Public report of apache/cassandra, published 16 November 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.11.4). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey →
Signed and filed in the standard's public register, 16 November 2026, 17:40 UTC · Survey ID cd_e057bad7d51f42759a466cea7e883b8d
apache/cassandra
Measured 16 November 2026, 17:38 UTC, at code version 30b73ca
Test reliability is not measured: The suite could not be re-run, but the repository declares tests of its own unreliable.
Supply-chain provenance & signing is not measured: Supply-chain provenance is not scored (this pipeline releases no artifact), but its build steps or GitHub Actions workflows have integrity defects, or nothing watches its dependency set for published advisories.
CAI scoreAdequate
CriticalWeakAdequateStrongExemplary
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A very large codebase: 670,612 lines of product code, tests not counted · Estimated rebuild effort: about 10.8 person-years · Weakest lens: Production Readiness, 38.4
Findings by how serious they are
211 critical5118 serious1148 minor
15 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look 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
Canine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
16 November 2026, 17:38 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that
implements it, and today the Canine Code Analyzer is the only one that does.
The score is deterministic, which means the same code always gets the same score. We work 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 ▸
58of 58 dimensions measured by tools.
6464of 6477 findings point to an exact file and line, so you can open each one in the code. The other 13 concern the repository as a whole, such as missing documentation.
58dimensions across 6 lenses, read from 670,612 lines of product code.
apache/cassandra falls short of our standard for production, in part because we found no automated security scanning of the code, its secrets or its dependencies. It scores 55.1 out of 100 and is rated Adequate, and 111 of its 211 critical findings are security problems in the build pipeline and in its code.
Production Readiness, at 38.4, is the weakest lens and counts most in the score. The best first step is making the two tests that check nothing check their results, worth about 9.1 points. Adding automated security scanning would lift Production Readiness itself, worth about 7.2 points. Raising Production Readiness to 70 would lift the score to about 67.2.
107 pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Two pipeline steps install packages that can change without warning, and ninety parts of the code are no longer understood by anyone working on it. Pinning each tool to an exact version, pinning what the pipeline installs and having someone learn the forgotten files would close these risks. The pipeline step that runs a download without checking it needs each download checked against a known checksum first. The place where the code runs text as code or as a command needs a direct call instead. The eight tests the project itself marks as unreliable need fixing or deleting.
The product code is 670,612 lines, about €1,600,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 Production Readiness rose from 38.4 to 70, the lowest score rated Strong, the score would rise from 55.1 to about 67.2.
Code composition: what the lines of code are
Product code 51%Tests 49%
Rebuild cost: about €1,600,000 · Estimate
Cost to rebuild
€520,000 to €2,600,000, for 8,705 to 27,615 hours of work, about 10.8 person-years for 6 to 21 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.8 at a score of 55. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Very large: 670,612 lines of product code
What it is not
Not a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.
How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Resolve the 2 No assertions (empty test) finding(s) in Test Quality — start with AccordExecutorBurnTest.java, HistoryValidatorTest.java.
Raises the score by about 9.1 points · Low effort · Test Quality
2
Add a SAST step to CI running what this repository's stack ships: spotbugs with find-sec-bugs — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
Raises the score by about 7.2 points · Medium effort · DR & Backup
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 €1,600,000 to build again, about 10.8 person-years of work. Its weakest lens is Production Readiness, at 38.4 (Weak). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Resolve the 2 No assertions (empty test) finding(s) in Test Quality. Of all the actions in this report, it raises the score most for the work it takes: about 9.1 points for low effort, because it clears the 2 Test Quality findings. 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.2 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 2% to 5% on every change. The history of the code shows how much it changes: about 120,412 lines over the last 90 days, which is about 488,338 lines a year. At that pace, the extra work comes to an estimated 24.8 to 162.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 our 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, never less than 2% to 5% and never more than 40% to 60% in all; 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: 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.
244 modules, with 2130 dependencies between them. 5 loops run through 154 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 204 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.
service.consensus.migration uses transport, so a change to transport can break service.consensus.migration, while a change to service.consensus.migration can't break transport.
Position
Below the diagonal: service.consensus.migration uses a module listed above it, which is the healthy direction.
3→4 service.consensus.migration uses tcmpart of a loop✕
Connections
11 pairs of types, where a type in service.consensus.migration uses a type in tcm.
service.consensus.migration uses tcm, so a change to tcm can break service.consensus.migration, while a change to service.consensus.migration can't break tcm.
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.
3→6 service.consensus.migration uses service.accord.txnpart of a loop✕
Connections
2 pairs of types, where a type in service.consensus.migration uses a type in service.accord.txn.
service.consensus.migration uses service.accord.txn, so a change to service.accord.txn can break service.consensus.migration, while a change to service.consensus.migration can't break service.accord.txn.
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.
3→9 service.consensus.migration uses service.accordpart of a loop✕
Connections
2 pairs of types, where a type in service.consensus.migration uses a type in service.accord.
service.consensus.migration uses service.accord, so a change to service.accord can break service.consensus.migration, while a change to service.consensus.migration can't break service.accord.
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.
3→10 service.consensus.migration uses servicepart of a loop✕
Connections
1 pair of types, where a type in service.consensus.migration uses a type in service.
service.consensus.migration uses service, so a change to service can break service.consensus.migration, while a change to service.consensus.migration can't break service.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
3→11 service.consensus.migration uses repairpart of a loop✕
Connections
2 pairs of types, where a type in service.consensus.migration uses a type in repair.
service.consensus.migration uses repair, so a change to repair can break service.consensus.migration, while a change to service.consensus.migration can't break repair.
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.
3→12 service.consensus.migration uses netpart of a loop✕
Connections
1 pair of types, where a type in service.consensus.migration uses a type in net.
service.consensus.migration uses net, so a change to net can break service.consensus.migration, while a change to service.consensus.migration can't break net.
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.
3→13 service.consensus.migration uses schemapart of a loop✕
Connections
10 pairs of types, where a type in service.consensus.migration uses a type in schema.
service.consensus.migration uses schema, so a change to schema can break service.consensus.migration, while a change to service.consensus.migration can't break schema.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
3→19 service.consensus.migration uses locatorpart of a loop✕
Connections
1 pair of types, where a type in service.consensus.migration uses a type in locator.
service.consensus.migration uses locator, so a change to locator can break service.consensus.migration, while a change to service.consensus.migration can't break locator.
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.
3→22 service.consensus.migration uses dhtpart of a loop✕
Connections
15 pairs of types, where a type in service.consensus.migration uses a type in dht.
service.consensus.migration uses dht, so a change to dht can break service.consensus.migration, while a change to service.consensus.migration can't break dht.
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.
3→23 service.consensus.migration uses utilspart of a loop✕
Connections
1 pair of types, where a type in service.consensus.migration uses a type in utils.
service.consensus.migration uses utils, so a change to utils can break service.consensus.migration, while a change to service.consensus.migration can't break utils.
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.
3→24 service.consensus.migration uses io.utilpart of a loop✕
Connections
2 pairs of types, where a type in service.consensus.migration uses a type in io.util.
service.consensus.migration uses io.util, so a change to io.util can break service.consensus.migration, while a change to service.consensus.migration can't break io.util.
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.
3→25 service.consensus.migration uses iopart of a loop✕
Connections
3 pairs of types, where a type in service.consensus.migration uses a type in io.
service.consensus.migration uses io, so a change to io can break service.consensus.migration, while a change to service.consensus.migration can't break io.
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.
3→36 service.consensus.migration uses dbpart of a loop✕
Connections
17 pairs of types, where a type in service.consensus.migration uses a type in db.
service.consensus.migration uses db, so a change to db can break service.consensus.migration, while a change to service.consensus.migration can't break db.
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.
tcm uses service.consensus.migration, so a change to service.consensus.migration can break tcm, while a change to tcm can't break service.consensus.migration.
Position
Below the diagonal: tcm uses a module listed above it, which is the healthy direction.
db.virtual uses service.consensus.migration, so a change to service.consensus.migration can break db.virtual, while a change to db.virtual can't break service.consensus.migration.
Position
Below the diagonal: db.virtual uses a module listed above it, which is the healthy direction.
36 pairs of types, where a type in db.virtual uses a type in db.filter. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
service.accord.txn uses service.accord, so a change to service.accord can break service.accord.txn, while a change to service.accord.txn can't break service.accord.
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.
6→10 service.accord.txn uses servicepart of a loop✕
Connections
2 pairs of types, where a type in service.accord.txn uses a type in service.
service.accord.txn uses exceptions, so a change to exceptions can break service.accord.txn, while a change to service.accord.txn can't break exceptions.
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.
service.accord.txn uses utils, so a change to utils can break service.accord.txn, while a change to service.accord.txn can't break utils.
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.
6→24 service.accord.txn uses io.utilpart of a loop✕
Connections
48 pairs of types, where a type in service.accord.txn uses a type in io.util. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
32 pairs of types, where a type in service.accord.txn uses a type in io. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
service.accord.txn uses db.partitions, so a change to db.partitions can break service.accord.txn, while a change to service.accord.txn can't break db.partitions.
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.
6→27 service.accord.txn uses db.rowspart of a loop✕
Connections
13 pairs of types, where a type in service.accord.txn uses a type in db.rows.
service.accord.txn uses db.marshal, so a change to db.marshal can break service.accord.txn, while a change to service.accord.txn can't break db.marshal.
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.
service.accord uses utils.concurrent, so a change to utils.concurrent can break service.accord, while a change to service.accord can't break utils.concurrent.
Position
Below the diagonal: service.accord uses a module listed above it, which is the healthy direction.
service.accord uses service.accord.txn, so a change to service.accord.txn can break service.accord, while a change to service.accord can't break service.accord.txn.
Position
Below the diagonal: service.accord uses a module listed above it, which is the healthy direction.
service uses service.consensus.migration, so a change to service.consensus.migration can break service, while a change to service can't break service.consensus.migration.
Position
Below the diagonal: service uses a module listed above it, which is the healthy direction.
repair uses service.consensus.migration, so a change to service.consensus.migration can break repair, while a change to repair can't break service.consensus.migration.
Position
Below the diagonal: repair uses a module listed above it, which is the healthy direction.
schema uses service.consensus.migration, so a change to service.consensus.migration can break schema, while a change to schema can't break service.consensus.migration.
Position
Below the diagonal: schema uses a module listed above it, which is the healthy direction.
io.sstable.format uses utils.concurrent, so a change to utils.concurrent can break io.sstable.format, while a change to io.sstable.format can't break utils.concurrent.
Position
Below the diagonal: io.sstable.format uses a module listed above it, which is the healthy direction.
io.sstable.format uses schema, so a change to schema can break io.sstable.format, while a change to io.sstable.format can't break schema.
Position
Below the diagonal: io.sstable.format uses a module listed above it, which is the healthy direction.
14→15 io.sstable.format uses io.sstablepart of a loop✕
Connections
74 pairs of types, where a type in io.sstable.format uses a type in io.sstable. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
io.sstable.format uses db.lifecycle, so a change to db.lifecycle can break io.sstable.format, while a change to io.sstable.format can't break db.lifecycle.
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.
14→17 io.sstable.format uses db.compactionpart of a loop✕
Connections
8 pairs of types, where a type in io.sstable.format uses a type in db.compaction.
io.sstable.format uses db.compaction, so a change to db.compaction can break io.sstable.format, while a change to io.sstable.format can't break db.compaction.
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.
io.sstable.format uses utils, so a change to utils can break io.sstable.format, while a change to io.sstable.format can't break utils.
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.
14→24 io.sstable.format uses io.utilpart of a loop✕
Connections
28 pairs of types, where a type in io.sstable.format uses a type in io.util. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
io.sstable.format uses db.partitions, so a change to db.partitions can break io.sstable.format, while a change to io.sstable.format can't break db.partitions.
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.
14→27 io.sstable.format uses db.rowspart of a loop✕
Connections
29 pairs of types, where a type in io.sstable.format uses a type in db.rows. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
31 pairs of types, where a type in io.sstable.format uses a type in db. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
37 pairs of types, where a type in io.sstable uses a type in io.sstable.format. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
43 pairs of types, where a type in io.sstable uses a type in io.util. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
41 pairs of types, where a type in io.sstable uses a type in db.rows. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
db.lifecycle uses utils.concurrent, so a change to utils.concurrent can break db.lifecycle, while a change to db.lifecycle can't break utils.concurrent.
Position
Below the diagonal: db.lifecycle uses a module listed above it, which is the healthy direction.
db.lifecycle uses io.sstable.format, so a change to io.sstable.format can break db.lifecycle, while a change to db.lifecycle can't break io.sstable.format.
Position
Below the diagonal: db.lifecycle uses a module listed above it, which is the healthy direction.
db.compaction uses utils.concurrent, so a change to utils.concurrent can break db.compaction, while a change to db.compaction can't break utils.concurrent.
Position
Below the diagonal: db.compaction uses a module listed above it, which is the healthy direction.
55 pairs of types, where a type in db.compaction uses a type in io.sstable.format. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
db.compaction uses io.sstable.format, so a change to io.sstable.format can break db.compaction, while a change to db.compaction can't break io.sstable.format.
Position
Below the diagonal: db.compaction uses a module listed above it, which is the healthy direction.
32 pairs of types, where a type in db.compaction uses a type in io.sstable. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
26 pairs of types, where a type in db.compaction uses a type in db.lifecycle. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
28 pairs of types, where a type in db.compaction uses a type in utils. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
32 pairs of types, where a type in db.compaction uses a type in db.rows. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
db.partitions uses utils.concurrent, so a change to utils.concurrent can break db.partitions, while a change to db.partitions can't break utils.concurrent.
Position
Below the diagonal: db.partitions uses a module listed above it, which is the healthy direction.
62 pairs of types, where a type in db.partitions uses a type in db.rows. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
35 pairs of types, where a type in db.marshal uses a type in transport. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
27 pairs of types, where a type in db.marshal uses a type in db.rows. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
cql3.statements uses service.accord.txn, so a change to service.accord.txn can break cql3.statements, while a change to cql3.statements can't break service.accord.txn.
Position
Below the diagonal: cql3.statements uses a module listed above it, which is the healthy direction.
cql3.statements uses service.paxos, so a change to service.paxos can break cql3.statements, while a change to cql3.statements can't break service.paxos.
Position
Below the diagonal: cql3.statements uses a module listed above it, which is the healthy direction.
59 pairs of types, where a type in cql3.statements uses a type in service. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
48 pairs of types, where a type in cql3.statements uses a type in schema. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
29 pairs of types, where a type in cql3.statements uses a type in db.partitions. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
cql3.statements uses db.partitions, so a change to db.partitions can break cql3.statements, while a change to cql3.statements can't break db.partitions.
Position
Below the diagonal: cql3.statements uses a module listed above it, which is the healthy direction.
134 pairs of types, where a type in cql3.statements uses a type in cql3. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
72 pairs of types, where a type in cql3.statements uses a type in db. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
db.memtable uses io.sstable.format, so a change to io.sstable.format can break db.memtable, while a change to db.memtable can't break io.sstable.format.
Position
Below the diagonal: db.memtable uses a module listed above it, which is the healthy direction.
db uses service.consensus.migration, so a change to service.consensus.migration can break db, while a change to db can't break service.consensus.migration.
Position
Below the diagonal: db uses a module listed above it, which is the healthy direction.
index.sai.utils uses db.partitions, so a change to db.partitions can break index.sai.utils, while a change to index.sai.utils can't break db.partitions.
Position
Below the diagonal: index.sai.utils uses a module listed above it, which is the healthy direction.
26 pairs of types, where a type in index.sai.utils uses a type in db.rows. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
32 pairs of types, where a type in index.sai.utils uses a type in db. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A05:2025 — Injection
115
High / Critical
A07:2025 — Authentication Failures
4
Medium
A03:2025 — Software Supply Chain Failures
2
Medium
Roadmap
Top priorities: Resolve the 2 No assertions (empty test) finding(s) in Test Quality — start with AccordExecutorBurnTest.java, HistoryValidatorTest.java; Resolve the 1453 No assertions finding(s) in Test Quality — start with WeightedQueueTest.java (32), ASTSingleTableModelTest.java (25), GuardrailColumnValueSizeTest.java (23); Add a SAST step to CI running what this repository's stack ships: spotbugs with find-sec-bugs — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 2 No assertions (empty test) finding(s) in Test Quality — start with AccordExecutorBurnTest.java, HistoryValidatorTest.java.
Add a SAST step to CI running what this repository's stack ships: spotbugs with find-sec-bugs — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
Declare the default where Java declares it: `@NullMarked` (org.jspecify.annotations) in each package's `package-info.java`, or once in `module-info.java`, and run NullAway (Error Prone) or the Checker Framework so the declaration is enforced. Then annotate the real exceptions `@Nullable` and resolve the suppressions rather than adding to them: a `@SuppressWarnings("NullAway")` or `castToNonNull(x)` on a value the checker could show to be null is a `NullPointerException` waiting for the path that makes it true — where the value genuinely cannot be null, say something the checker can see instead (a null check, `Objects.requireNonNull`, a non-null field initialised in the constructor).
Resolve the 1453 No assertions finding(s) in Test Quality — start with WeightedQueueTest.java (32), ASTSingleTableModelTest.java (25), GuardrailColumnValueSizeTest.java (23).
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.
Bring the 2 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with DatabaseDescriptor.applySimpleConfig (cyclomatic 157), StatsTableComparator.compare (cyclomatic 94).
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 — 211
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 — 5118
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 — 1148
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 15
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
This survey 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. All 58 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.9, the weighted average across measured dimensions.
Every figure here is one of two 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. 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.
What we checked — 58 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, 6464 of 6477 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 or a scanner, 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.
D5 Coupling — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
D8 Code Coverage — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: the Python half could not be measured — the pytest suite ran no test, so nothing was measured (its dependency install failed (pip exit 1: no error line printed), so its suite was not run against dependencies it does not declare). Coverage is excluded from the score rather than counted as a near-zero. This is OUR limitation, not a defect in the repo.
D10 Test Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we 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 12,128 test(s) behind this row are the ones the code-model census could read, and this repository also carries at least 14 test source file(s) (.py) that it cannot: it reads the test types the .java frontend declared, so a suite in any other language 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 — We 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 repository declares 8 of its own test(s) unreliable. The built-in reliability runner does not support this repository's ecosystem (.java, .py), so the suite was not re-run and no reliability score is given — these are the repository's own declarations, not our measurement.
D12 Dependency Hygiene — 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. This repository's 4 shipped Python distribution(s) across 1 manifest(s) WERE read; what went unanswered is the currency half, because it grades an EXACT pin against the newest release and every declaration here is a floor or a range — which installs the newest release it admits and so cannot be behind one. So pypi.org was never asked. This is a true statement about the repository, and the healthy one, NOT a gap on our side: no reader we could write would find a currency question here.
D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we 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. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we 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. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we 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. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated per language (docs/plans/deterministic-engine.md, P5; C# and each NeutralApiArms arm pass): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
D24 Comment Value — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
D26 Project Cohesion — not measured this run — We 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. Project size and spread are measured over build units (a .NET project, a Maven or Gradle module, an npm, Deno or JSR package, a Go module, a Cargo crate, a Python, Composer, Bundler, RubyGems, Mix, rebar3, sbt, SwiftPM or pub package, an OTP application, an Xcode project or XcodeGen spec, or a checkout that declares no build at all) whose source a code model reads. This repository's production source is in a language no model reads, or in units whose build tool D26 does not recognise. That is a gap in this analyzer's language reach — not a finding that the repository's projects are cohesive.
D31 IaC & Container Security — measured, with a gap in what it reached — We measured this, but not all of it. What we 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. Checkov ran but its report could not be read (checkov produced no output — not a clean result). Every misconfiguration only checkov reports — most of its Terraform, CloudFormation, Bicep and Ansible policies — is absent from this card, so its absence here is not evidence those resources are configured correctly.
AX1 Captive dependencies — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads Microsoft.Extensions.DependencyInjection registrations in C# and Spring beans in Java/Kotlin only, and this repository defines its own container in src/java/org/apache/cassandra/service/accord/interop/AccordInteropExecution.java, whose lifetimes are not modelled yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
AXB1 Runtime evidence locked — no reproducible boot — not measured this run — We 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. Subject: 1 markup document(s) — HTML, Razor, JSX, Vue, Svelte or server templates. The Runtime Evidence tier boots an app only via docker-compose, an Aspire AppHost, a Dockerfile, an npm dev script, a web service's own toolchain entry point (cargo, go, dotnet, Python, Spring Boot), or an Android app's own Gradle wrapper (run on an emulator); an Apple or Flutter app needs a host it lacks. None applied, so no live runtime a11y/egress/header evidence was collected. You can widen what we reach: add a docker-compose.yml (or an Aspire AppHost) that brings the app up with its dependencies. We then boot it in an isolated sandbox and gathers real runtime evidence — you change nothing in your pipeline (no CI step, no SDK).
C1 Data Protection — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
C2 Access Controls — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
C3 Audit Trail — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
C4 Data Retention — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These retention controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks retention controls.
C5 Data-Subject Rights — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These data-subject rights controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks data-subject rights controls.
ED5 Idempotency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check decides whether a handler's mutation is safe to re-run by recognising its persistence writes (a database save, a repository write, an event publish) and its guards. Those markers are .NET member names, so in this repository's language a write such as `repository.save(order)` is not recognised and a same-named call on an unrelated library type could be. The handlers were found; their idempotency was neither confirmed nor ruled out.
IC1 Incompleteness & stubs — measured, with a gap in what it reached — We measured this, but not all of it. What we 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. 66 further occurrence(s) are not listed individually; the score already reflects all 106.
M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
S1 Web-Security Posture — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
X10 Duplicated predicate — not measured this run — We 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. 56 further occurrence(s) are not listed individually; the score already reflects all 96.
X12 Unreachable branch — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X4 Structured logging — measured, with a gap in what it reached — We measured this, but not all of it. What we 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. 71 further occurrence(s) are not listed individually; the score already reflects all 111.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
We assess the repository exactly as committed, and only the repository. By design we do 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.
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.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
D13 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
D21 Naming Consistency: Naming consistency compares each name with the convention its structural peers follow in this repository: it cannot tell whether a consistently used name is a good one, and languages other than C# and TypeScript are not measured.
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 REDACTED, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
What it measures: How tangled the control flow is — methods with many branches are hard to test and change.
Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.
266 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was DatabaseDescriptor.applySimpleConfig at 157. A further 8 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 CommandEmptySizes.emptySize at 37 — they are counted neither in the figure above nor in this dimension's score. 5 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: src/java/org/apache/cassandra/service/accord/AccordObjectSizes.java (CommandEmptySizes.emptySize at 37), src/java/org/apache/cassandra/service/accord/journal/CommandChangeWriter.java (CommandChangeWriter.serialize at 19), src/java/org/apache/cassandra/service/accord/journal/CommandChanges.java (CommandChanges.deserialize at 19), src/java/org/apache/cassandra/db/ConsistencyLevel.java (ConsistencyLevel.blockFor at 18), src/java/org/apache/cassandra/utils/MurmurHash.java (MurmurHash.hash3_x64_128 at 17). 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 2 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with DatabaseDescriptor.applySimpleConfig (cyclomatic 157), StatsTableComparator.compare (cyclomatic 94). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 2 together lifts Cyclomatic Complexity from 5.5 to about 6.5/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How hard the code is for a person to follow, beyond raw branching.
Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.
+ 587 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 2 bodies over 120 down to 120 or less in Cognitive Complexity — start with DatabaseDescriptor.applySimpleConfig (cognitive 196), TableStatsHolder.initializeKeyspaces (cognitive 139). — 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 2 together lifts Cognitive Complexity from 5.3 to about 5.8/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes8.4 / 10Strong✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
Resolve the 168 TooManyMethods finding(s) in God Classes — start with TableMetadata.java (2), ClusterMetadata.java (2), TokenKey.java (2). — One of this dimension's main actionable groups (168 warning-level).
Resolve the 105 ClassTooLong finding(s) in God Classes — start with DatabaseDescriptor.java, StorageService.java, StorageProxy.java. — One of this dimension's main actionable groups (105 warning-level).
Resolve the 87 FileTooLong finding(s) in God Classes — start with DatabaseDescriptor.java, StorageService.java, BTree.java. — One of this dimension's main actionable groups (87 warning-level).
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How much of the production code is copy-pasted: the share of production lines inside a reported copy (every copy of a duplicated block or of an edited member, each line once), 10 at none and 0 at a quarter of the lines.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), scored on the share of production lines inside a reported copy (each line once; 10 at none, 0 at a quarter). Deterministic.
479 duplicated block group(s) detected. 4.7 % of the production lines (31,579 of 670,612) are in a reported copy. A further 900 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 32 of the 1379 are in trees this repository does not ship — vendored, example/demo, project-template, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.
Edited copy of a member (6 corresponding lines) · ×61src/java/org/apache/cassandra/service/accord/journal/SegmentRangeSearcher.java:100
Edited copy of a member (9 corresponding lines) · ×58src/java/org/apache/cassandra/service/accord/journal/RangeSearchManager.java:229
Edited copy of a member (8 corresponding lines) · ×53src/java/org/apache/cassandra/utils/MurmurHash.java:215
Edited copy of a member (10 corresponding lines) · ×48src/java/org/apache/cassandra/tcm/transformations/PrepareJoin.java:201
+ 205 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 61 Edited copy of a member (6 corresponding lines) finding(s) in Code Duplication — start with MessagingServiceMBeanImpl.java (6), ArraySerializers.java (4), PrepareReplace.java (2). — One of this dimension's main actionable groups (61 warning-level).
Resolve the 58 Edited copy of a member (9 corresponding lines) finding(s) in Code Duplication — start with RangeSearchManager.java, AccordJournal.java, BTreeRow.java. — One of this dimension's main actionable groups (58 warning-level).
Resolve the 56 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with BootstrapAndJoin.java (3), AccordMarkStale.java (3), PrepareJoin.java (2). — One of this dimension's main actionable groups (56 warning-level).
Detailed fixes: d4_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 33 Low cohesion finding(s) in Cohesion (LCOM4) — start with AccordCache.java (2), StorageService.java, AuditLogEntry.java. — One of this dimension's main actionable groups (33 warning-level).
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D10 · Test Quality8.2 / 10Adequategated by 2 critical 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.
122 skipped (122 with a documented reason), 1455 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 12128 tests. Measured on the .java suite only — at least 14 test source file(s) (.py) went unread, so its test quality is unmeasured and is not in these counts.
No assertions (empty test): test · ×2test/burn/org/apache/cassandra/service/accord/AccordExecutorBurnTest.java:87
No assertions: buildKeyManagerFactoryWithBadPassword · ×1453examples/ssl-factory/test/unit/org/apache/cassandra/security/KubernetesSecretsPEMSslContextFactoryTest.java:180
Resolve the 2 No assertions (empty test) finding(s) in Test Quality — start with AccordExecutorBurnTest.java, HistoryValidatorTest.java. — One of this dimension's main actionable groups (2 issue-level).
Resolve the 1453 No assertions finding(s) in Test Quality — start with WeightedQueueTest.java (32), ASTSingleTableModelTest.java (25), GuardrailColumnValueSizeTest.java (23). — One of this dimension's main actionable groups (1453 warning-level).
Detailed fixes: d10_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.
REDACTED scan ran and found no leaked secrets. 2 detection(s) were excluded as holding no minted credential in material that runs: a name, reference or comparison rather than a value, a readable phrase or pattern, a value that declares itself fake, or development, test, example, mock or demo material. 2 password hash(es) are listed to check and are not counted as leaked credentials.
REDACTED
✓ On the Gold path — maintain.
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 12 shipped Python distribution(s) use a banned license. Licences were resolved from PyPI over the distributions a consumer installs — this repository's 4 declared runtime requirement(s) closed transitively over each distribution's published `requires_dist` (8 reached that way). Requirements it states ONLY under an extra, a PEP 735 dependency group, a Poetry dev group or a dev-named requirements file are excluded: pip does not install any of them for a consumer. ★ This repository commits no dependency lockfile that this pass reads, so each licence is the one PyPI publishes for the distribution's CURRENT release rather than for a pinned version. 1 of them publish no licence on PyPI this pass can read; that is missing data, not a violation, and none of them is charged.
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.
Resolve the 8 Hotspot finding(s) in Churn × Complexity Hotspots — start with DatabaseDescriptor.java, AccordService.java, StorageService.java. — One of this dimension's main actionable groups (8 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.7 / 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.
62 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is pylib/cqlshlib/copyutil.py. Counted over 2354 of the 3413 production source files in this repository: 928 are under the ~2,400-byte size floor this dimension measures over, and the remaining 131 have no attributable history left to measure.
Off-boarding risk: anonymized user #1 · ×6
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.
946 deducted task-comment markers across 670612 LoC (0.1/KLoC) → score 9.7. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
Resolve the 929 TodoComment finding(s) in Explicit Debt — start with AccordDebugKeyspace.java (18), SafeTask.java (14), ASTGenerators.java (11). — One of this dimension's main actionable groups (929 warning-level).
Resolve the 9 HackComment finding(s) in Explicit Debt — start with DropAccordTableTest.java, ColumnFamilyStoreTest.java, DirectoriesTest.java. — One of this dimension's main actionable groups (9 warning-level).
Resolve the 7 FixmeComment finding(s) in Explicit Debt — start with RandomAccessReaderTest.java, CachingBenchTest.java, GcCompactionBenchTest.java. — One of this dimension's main actionable groups (7 warning-level).
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Seven vocabulary-free rules (N1-N7) mine each naming convention from the repository and flag a name that breaks a convention its structural peers in the same unit follow; production C# and TypeScript, each its own population. Deterministic, no model, no sample. Advisory.
8 naming inconsistencies among 797 declarations measured against a convention their peers follow.
`isIN` spells `IN` where 971 names in the project spell it `In` · ×2src/java/org/apache/cassandra/cql3/Operator.java:1119
`broadcastRPCAddr` spells `RPC` where 77 names in the project spell it `Rpc`src/java/org/apache/cassandra/config/DatabaseDescriptor.java:3667
`isRestrictedByEqualsOrIN` spells `IN` where 971 names in the project spell it `In`src/java/org/apache/cassandra/cql3/restrictions/Restrictions.java:37
`hasIN` spells `IN` where 971 names in the project spell it `In`src/java/org/apache/cassandra/cql3/restrictions/Restrictions.java:63
`clusteringKeyRestrictionsHasIN` spells `IN` where 971 names in the project spell it `In`src/java/org/apache/cassandra/cql3/restrictions/StatementRestrictions.java:650
+ 2 more group(s) — more in Appendix A; the complete list is findings.md.
✓ On the Gold path — maintain.
Detailed fixes: d21_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
40 % of calls cross a namespace and 15 % go through an interface, but 100 % of collaborators are co-located — so a call's collaborators sit together and tracing stays easy. Baseline: small — navigation cost is tolerated.
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.
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).
115 finding(s): 0 critical, 111 high, 4 medium, 0 low. 10 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 18 file(s) — `.build/build-artifacts.sh` (line 22, line 23, line 24), `.build/build-jars.sh` (line 35, line 43, line 44, …), `.build/check-code.sh` (line 30, line 38, line 39, …), `.build/ci/generate-ci-summary.sh` (line 35, line 36, line 37), `.build/ci/generate-test-report.sh` (line 31, line 32, line 33), … (+13 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.
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
+ 2 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 97 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (95), REDACTED (2). — One of this dimension's main actionable groups (97 issue-level).
Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
No action in Static Analysis (SAST) — all 10 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (10 issue-level, 0 of them charged here).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.
Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
Resolve the 2 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d30_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.
939 of 2485 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java. Counted over 2485 of the 3413 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Resolve the 849 Orphaned file finding(s) in Knowledge Freshness — start with View.java (3), Expression.java (2), Term.java (2). — One of this dimension's main actionable groups (849 recommendation-level).
Resolve the 90 Orphaned knowledge finding(s) in Knowledge Freshness — start with Duration.java (2), Operation.java (2), TypeCodec.java. — One of this dimension's main actionable groups (90 issue-level).
Resolve the 1 Further orphaned files (smaller) finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
Resolve the 6 Change coupling finding(s) in Change Coupling — start with AccordCommandStore.java (2), GuardrailsConfig.java, Config.java. — One of this dimension's main actionable groups (6 warning-level).
Detailed fixes: d35_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 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. Reported 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. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.
Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 0 platform declaration(s) and 4 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether the codebase has a recognisable, scale-appropriate structure (a named architectural style, or modular enough for its size) rather than being an ad-hoc ball of mud.
Method: Roslyn plus csproj analysis: architecture style detection (DDD, clean, vertical-slice, CQRS) and structure fitness for repo size. Deterministic.
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.
`GettableByIndexData` declares 32 abstract methods: `get`, `get`, `get`, `getBool`, `getByte`, `getBytes`, `getBytesUnsafe`, `getDate`, `getDecimal`, `getDouble`, `getFloat`, `getInet`, `getInt`, `getList`, `getList`, `getLong`, `getMap`, `getMap`, `getObject`, `getSet`, `getSet`, `getShort`, `getString`, `getTime`, `getTimestamp`, `getTupleValue`, `getUDTValue`, `getUUID`, `getVarint`, `getVector`, `getVector`, `isNull`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. Those 32 declarations carry 26 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 26 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. — src/java/org/apache/cassandra/cql3/functions/types/GettableByIndexData.java:38
`GettableByNameData` declares 32 abstract methods: `get`, `get`, `get`, `getBool`, `getByte`, `getBytes`, `getBytesUnsafe`, `getDate`, `getDecimal`, `getDouble`, `getFloat`, `getInet`, `getInt`, `getList`, `getList`, `getLong`, `getMap`, `getMap`, `getObject`, `getSet`, `getSet`, `getShort`, `getString`, `getTime`, `getTimestamp`, `getTupleValue`, `getUDTValue`, `getUUID`, `getVarint`, `getVector`, `getVector`, `isNull`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. Those 32 declarations carry 26 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 26 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. — src/java/org/apache/cassandra/cql3/functions/types/GettableByNameData.java:38
`SettableByIndexData<T>` declares 33 abstract methods: `set`, `set`, `set`, `setBool`, `setByte`, `setBytes`, `setBytesUnsafe`, `setDate`, `setDecimal`, `setDouble`, `setFloat`, `setInet`, `setInt`, `setList`, `setList`, `setList`, `setLong`, `setMap`, `setMap`, `setMap`, `setSet`, `setSet`, `setSet`, `setShort`, `setString`, `setTime`, `setTimestamp`, `setToNull`, `setTupleValue`, `setUDTValue`, `setUUID`, `setVarint`, `setVector`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. Those 33 declarations carry 25 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 25 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. — src/java/org/apache/cassandra/cql3/functions/types/SettableByIndexData.java:38
`SettableByNameData<T>` declares 33 abstract methods: `set`, `set`, `set`, `setBool`, `setByte`, `setBytes`, `setBytesUnsafe`, `setDate`, `setDecimal`, `setDouble`, `setFloat`, `setInet`, `setInt`, `setList`, `setList`, `setList`, `setLong`, `setMap`, `setMap`, `setMap`, `setSet`, `setSet`, `setSet`, `setShort`, `setString`, `setTime`, `setTimestamp`, `setToNull`, `setTupleValue`, `setUDTValue`, `setUUID`, `setVarint`, `setVector`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. Those 33 declarations carry 25 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 25 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. — src/java/org/apache/cassandra/cql3/functions/types/SettableByNameData.java:38
`IAccordService` declares 30 abstract methods: `agent`, `awaitDone`, `coordinate`, `coordinateAsync`, `currentEpoch`, `endpointMapper`, `ensureMinHlc`, `epochReady`, `epochReadyFor`, `executors`, `flushCaches`, `getCompactionInfo`, `isEnabled`, `journalConfiguration`, `localStartup`, `maxConflict`, `minEpoch`, `node`, `receive`, `requestHandler`, `responseHandler`, `scheduler`, `setCacheSize`, `setWorkingSetSize`, `shutdownAndWait`, `stop`, `sync`, `syncKeysForMigration`, `topology`, `topologyService`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. 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. — src/java/org/apache/cassandra/service/accord/IAccordService.java:81
`ActiveRepairServiceMBean` declares 22 abstract methods: `cleanupPending`, `failSession`, `getConcurrentMerkleTreeRequests`, `getIncrementalRepairDiskHeadroomRejectRatio`, `getPaxosRepairParallelism`, `getPendingStats`, `getRepairPendingCompactionRejectThreshold`, `getRepairSessionSpaceInMebibytes`, `getRepairSessionSpaceInMegabytes`, `getRepairSessionSpaceInMiB`, `getRepairStats`, `getSessions`, `getUseOffheapMerkleTrees`, `parentRepairSessionsCount`, `setConcurrentMerkleTreeRequests`, `setIncrementalRepairDiskHeadroomRejectRatio`, `setPaxosRepairParallelism`, `setRepairPendingCompactionRejectThreshold`, `setRepairSessionSpaceInMebibytes`, `setRepairSessionSpaceInMegabytes`, `setRepairSessionSpaceInMiB`, `setUseOffheapMerkleTrees`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. 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. — src/java/org/apache/cassandra/service/ActiveRepairServiceMBean.java:26
`AutoRepairServiceMBean` declares 26 abstract methods: `getAutoRepairConfiguration`, `getOnGoingRepairHostIds`, `isAutoRepairDisabled`, `setAllowParallelReplicaRepair`, `setAllowParallelReplicaRepairAcrossSchedules`, `setAutoRepairEnabled`, `setAutoRepairHistoryClearDeleteHostsBufferDuration`, `setAutoRepairMaxRetriesCount`, `setAutoRepairMinRepairTaskDuration`, `setAutoRepairRetryBackoff`, `setAutoRepairTableMaxRepairTime`, `setAutoRepairTokenRangeSplitterParameter`, `setForceRepairForHosts`, `setIgnoreDCs`, `setMVRepairEnabled`, `setMixedMajorVersionRepairEnabled`, `setParallelRepairCount`, `setParallelRepairPercentage`, `setPrimaryTokenRangeOnly`, `setRepairByKeyspace`, `setRepairMinInterval`, `setRepairPriorityForHosts`, `setRepairSSTableCountHigherThreshold`, `setRepairSessionTimeout`, `setRepairThreads`, `startScheduler`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. 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. — src/java/org/apache/cassandra/service/AutoRepairServiceMBean.java:26
`CacheServiceMBean` declares 19 abstract methods: `getCounterCacheKeysToSave`, `getCounterCacheSavePeriodInSeconds`, `getKeyCacheKeysToSave`, `getKeyCacheSavePeriodInSeconds`, `getRowCacheKeysToSave`, `getRowCacheSavePeriodInSeconds`, `invalidateCounterCache`, `invalidateKeyCache`, `invalidateRowCache`, `saveCaches`, `setCounterCacheCapacityInMB`, `setCounterCacheKeysToSave`, `setCounterCacheSavePeriodInSeconds`, `setKeyCacheCapacityInMB`, `setKeyCacheKeysToSave`, `setKeyCacheSavePeriodInSeconds`, `setRowCacheCapacityInMB`, `setRowCacheKeysToSave`, `setRowCacheSavePeriodInSeconds`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. 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. — src/java/org/apache/cassandra/service/CacheServiceMBean.java:22
`StorageProxyMBean` declares 100 abstract methods: `denylistKey`, `disableCheckForDuplicateRowsDuringCompaction`, `disableCheckForDuplicateRowsDuringReads`, `disableHintsForDC`, `disableRepairedDataTrackingForPartitionReads`, `disableRepairedDataTrackingForRangeReads`, `disableReportingUnconfirmedRepairedDataMismatches`, `disableSnapshotOnDuplicateRowDetection`, `disableSnapshotOnRepairedDataMismatch`, `enableCheckForDuplicateRowsDuringCompaction`, `enableCheckForDuplicateRowsDuringReads`, `enableHintsForDC`, `enableRepairedDataTrackingForPartitionReads`, `enableRepairedDataTrackingForRangeReads`, `enableReportingUnconfirmedRepairedDataMismatches`, `enableSnapshotOnDuplicateRowDetection`, `enableSnapshotOnRepairedDataMismatch`, `getAllowArtificialLatencyForAllConsistencyLevels`, `getArtificialLatencies`, `getArtificialLatencyEnabled`, `getArtificialLatencyVerbs`, `getCasContentionTimeout`, `getCheckForDuplicateRowsDuringCompaction`, `getCheckForDuplicateRowsDuringReads`, `getClientRequestSizeMetricsEnabled`, `getCounterWriteRpcTimeout`, `getDumpHeapOnUncaughtException`, `getHintedHandoffDisabledDCs`, `getHintedHandoffEnabled`, `getHintsInProgress`, `getIdealConsistencyLevel`, `getMaxHintWindow`, `getMaxHintsInProgress`, `getMaxHintsSizePerHostInMiB`, `getNativeTransportMaxConcurrentConnections`, `getNativeTransportMaxConcurrentConnectionsPerIp`, `getNumberOfTables`, `getOtcBacklogExpirationInterval`, `getPartitionDenylistLoadAttempts`, `getPartitionDenylistLoadSuccesses`, and 60 more. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. 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. — src/java/org/apache/cassandra/service/StorageProxyMBean.java:24
`StorageServiceMBean` declares 395 abstract methods: `abortBootstrap`, `abortDecommission`, `abortMove`, `abortRemoveNode`, `alterTopology`, `assassinateEndpoint`, `autoOptimiseFullRepairStreams`, `autoOptimiseIncRepairStreams`, `autoOptimisePreviewRepairStreams`, `bulkLoad`, `bulkLoadAsync`, `bypassConcurrentValidatorsLimit`, `cleanupSizeEstimates`, `clearConnectionHistory`, `clearOrphanedCompressionDictionaries`, `clearPaxosRepairs`, `clearSnapshot`, `clearSnapshot`, `decommission`, `deliverHints`, `describeRingJMX`, `describeRingWithPortJMX`, `disableAuditLog`, `disableAutoCompaction`, `disableNativeTransportOldProtocolVersions`, `drain`, `dropPreparedStatements`, `effectiveOwnership`, `effectiveOwnershipWithPort`, `enableAuditLog`, `enableAuditLog`, `enableAuditLog`, `enableAuditLog`, `enableAutoCompaction`, `enableFullQueryLogger`, `enableNativeTransportOldProtocolVersions`, `enforceConcurrentValidatorsLimit`, `evictHungRepairs`, `finishConsensusMigration`, `forceCompactionKeysIgnoringGcGrace`, and 355 more. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. Those 395 declarations carry 376 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 376 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. — src/java/org/apache/cassandra/service/StorageServiceMBean.java:42
`IRoleManager` declares 16 abstract methods: `alterRole`, `alterableOptions`, `canLogin`, `createRole`, `dropRole`, `getAllRoles`, `getCustomOptions`, `getRoles`, `grantRole`, `isExistingRole`, `isSuper`, `protectedResources`, `revokeRole`, `setup`, `supportedOptions`, `validateConfiguration`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. 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. — src/java/org/apache/cassandra/auth/IRoleManager.java:38
`CompactionManagerMBean` declares 29 abstract methods: `forceUserDefinedCleanup`, `forceUserDefinedCompaction`, `getAutomaticSSTableUpgradeEnabled`, `getCompactionHistory`, `getCompactionSummary`, `getCompactions`, `getCoreCompactorThreads`, `getCoreSecondaryIndexExecutorThreads`, `getCoreValidationThreads`, `getCoreViewBuildThreads`, `getDisableSTCSInL0`, `getMaxConcurrentAutoUpgradeTasks`, `getMaximumCompactorThreads`, `getMaximumSecondaryIndexExecutorThreads`, `getMaximumValidatorThreads`, `getMaximumViewBuildThreads`, `setAutomaticSSTableUpgradeEnabled`, `setCoreCompactorThreads`, `setCoreSecondaryIndexExecutorThreads`, `setCoreValidationThreads`, `setCoreViewBuildThreads`, `setDisableSTCSInL0`, `setMaxConcurrentAutoUpgradeTasks`, `setMaximumCompactorThreads`, `setMaximumSecondaryIndexExecutorThreads`, `setMaximumValidatorThreads`, `setMaximumViewBuildThreads`, `stopCompaction`, `stopCompactionById`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. 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. — src/java/org/apache/cassandra/db/compaction/CompactionManagerMBean.java:25
`GuardrailsConfig` declares 124 abstract methods: `getAllowFilteringEnabled`, `getAlterTableEnabled`, `getBulkLoadEnabled`, `getCollectionListSizeFailThreshold`, `getCollectionListSizeWarnThreshold`, `getCollectionMapSizeFailThreshold`, `getCollectionMapSizeWarnThreshold`, `getCollectionSetSizeFailThreshold`, `getCollectionSetSizeWarnThreshold`, `getCollectionSizeFailThreshold`, `getCollectionSizeWarnThreshold`, `getColumnAsciiValueSizeFailThreshold`, `getColumnAsciiValueSizeWarnThreshold`, `getColumnBlobValueSizeFailThreshold`, `getColumnBlobValueSizeWarnThreshold`, `getColumnTextAndVarcharValueSizeFailThreshold`, `getColumnTextAndVarcharValueSizeWarnThreshold`, `getColumnValueSizeFailThreshold`, `getColumnValueSizeWarnThreshold`, `getColumnsPerTableFailThreshold`, `getColumnsPerTableWarnThreshold`, `getCompactTablesEnabled`, `getDataDiskUsageKeyspaceWideProtectionEnabled`, `getDataDiskUsageMaxDiskSize`, `getDataDiskUsagePercentageFailThreshold`, `getDataDiskUsagePercentageWarnThreshold`, `getDropKeyspaceEnabled`, `getDropTruncateTableEnabled`, `getFieldsPerUDTFailThreshold`, `getFieldsPerUDTWarnThreshold`, `getGroupByEnabled`, `getInSelectCartesianProductFailThreshold`, `getInSelectCartesianProductWarnThreshold`, `getIntersectFilteringQueryEnabled`, `getIntersectFilteringQueryWarned`, `getItemsPerCollectionFailThreshold`, `getItemsPerCollectionWarnThreshold`, `getKeyspacePropertiesDisallowed`, `getKeyspacePropertiesIgnored`, `getKeyspacePropertiesWarned`, and 84 more. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. 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. — src/java/org/apache/cassandra/db/guardrails/GuardrailsConfig.java:48
`GuardrailsMBean` declares 197 abstract methods: `getAllowFilteringEnabled`, `getAlterTableEnabled`, `getBulkLoadEnabled`, `getCollectionListSizeFailThreshold`, `getCollectionListSizeWarnThreshold`, `getCollectionMapSizeFailThreshold`, `getCollectionMapSizeWarnThreshold`, `getCollectionSetSizeFailThreshold`, `getCollectionSetSizeWarnThreshold`, `getCollectionSizeFailThreshold`, `getCollectionSizeWarnThreshold`, `getColumnAsciiValueSizeFailThreshold`, `getColumnAsciiValueSizeWarnThreshold`, `getColumnBlobValueSizeFailThreshold`, `getColumnBlobValueSizeWarnThreshold`, `getColumnTextAndVarcharValueSizeFailThreshold`, `getColumnTextAndVarcharValueSizeWarnThreshold`, `getColumnValueSizeFailThreshold`, `getColumnValueSizeWarnThreshold`, `getColumnsPerTableFailThreshold`, `getColumnsPerTableWarnThreshold`, `getCompactTablesEnabled`, `getDataDiskUsageKeyspaceWideProtectionEnabled`, `getDataDiskUsageMaxDiskSize`, `getDataDiskUsagePercentageFailThreshold`, `getDataDiskUsagePercentageWarnThreshold`, `getDropKeyspaceEnabled`, `getDropTruncateTableEnabled`, `getFieldsPerUDTFailThreshold`, `getFieldsPerUDTWarnThreshold`, `getGroupByEnabled`, `getInSelectCartesianProductFailThreshold`, `getInSelectCartesianProductWarnThreshold`, `getIntersectFilteringQueryEnabled`, `getIntersectFilteringQueryWarned`, `getItemsPerCollectionFailThreshold`, `getItemsPerCollectionWarnThreshold`, `getKeyspacePropertiesDisallowed`, `getKeyspacePropertiesDisallowedCSV`, `getKeyspacePropertiesIgnored`, and 157 more. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. 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. — src/java/org/apache/cassandra/db/guardrails/GuardrailsMBean.java:37
`ValueAccessor<V>` declares 55 abstract methods: `allocate`, `compare`, `compareByteArrayTo`, `compareByteBufferTo`, `convert`, `copyByteArrayTo`, `copyByteBufferTo`, `copyTo`, `createArray`, `digest`, `empty`, `factory`, `getByte`, `getDouble`, `getFloat`, `getInt`, `getLong`, `getShort`, `getUnsignedShort`, `putByte`, `putFloat`, `putInt`, `putLong`, `putShort`, `read`, `size`, `slice`, `toArray`, `toArray`, `toBallot`, `toBuffer`, `toByte`, `toDouble`, `toFloat`, `toFloatArray`, `toHex`, `toInt`, `toLong`, `toShort`, `toString`, and 15 more. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. Those 55 declarations carry 43 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 43 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. — src/java/org/apache/cassandra/db/marshal/ValueAccessor.java:64
`Memtable` declares 28 abstract methods: `accepts`, `addMemoryUsageTo`, `createdAtNanos`, `discard`, `ensureFlushListener`, `getApproximateCommitLogLowerBound`, `getCommitLogLowerBound`, `getFinalCommitLogUpperBound`, `getFlushSet`, `getFlushTransaction`, `getLiveDataSize`, `getMemtableId`, `hasFlushListener`, `isClean`, `localRangesUpdated`, `markExtraOffHeapUsed`, `markExtraOnHeapUsed`, `mayContainDataBefore`, `metadata`, `metadataUpdated`, `notifyFlushed`, `operationCount`, `partitionCount`, `performSnapshot`, `put`, `setFlushTransaction`, `shouldSwitch`, `switchOut`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. 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. — src/java/org/apache/cassandra/db/memtable/Memtable.java:60
`Row` declares 43 abstract methods: `accumulate`, `accumulate`, `accumulate`, `accumulate`, `apply`, `apply`, `cells`, `cellsInLegacyOrder`, `clone`, `clustering`, `columnCount`, `columnData`, `columns`, `dataSize`, `deletion`, `filter`, `filter`, `getCell`, `getCell`, `getColumnData`, `getComplexColumnData`, `hasComplex`, `hasComplexDeletion`, `hasDeletion`, `hasLiveData`, `isEmpty`, `isStatic`, `liveDataSize`, `markCounterLocalToBeCleared`, `minLocalDeletionTime`, `primaryKeyLivenessInfo`, `purge`, `purgeDataOlderThan`, `searchIterator`, `toString`, `transformAndFilter`, `transformAndFilter`, `unsharedHeapSize`, `unsharedHeapSizeExcludingData`, `updateAllTimestamp`, and 3 more. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. Those 43 declarations carry 36 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 36 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. — src/java/org/apache/cassandra/db/rows/Row.java:69
`ColumnFamilyStoreMBean` declares 58 abstract methods: `beginLocalSampling`, `compactionDiskSpaceCheck`, `estimateKeys`, `finishLocalSampling`, `forceCompactionForTokenRange`, `forceCompactionForTokenRanges`, `forceMajorCompaction`, `forceMajorCompaction`, `getBuiltIndexes`, `getColumnFamilyName`, `getCompactionParameters`, `getCompactionParametersJson`, `getCompressionParameters`, `getCompressionParametersJson`, `getDataPaths`, `getDroppableTombstoneRatio`, `getLevelFanoutSize`, `getMaxSSTableDuration`, `getMaxSSTableSize`, `getMaximumCompactionThreshold`, `getMinimumCompactionThreshold`, `getNeverPurgeTombstones`, `getPerLevelAvgDensity`, `getPerLevelAvgDensityMaxDensityThresholdRatio`, `getPerLevelAvgSize`, `getPerLevelAvgTokenSpace`, `getPerLevelMaxDensityMaxDensityThresholdRatio`, `getPerLevelMaxDensityThreshold`, `getPerLevelSizeBytes`, `getSSTableCountPerLevel`, `getSSTableCountPerTWCSBucket`, `getSSTablesForKey`, `getSSTablesForKey`, `getSSTablesForKeyWithLevel`, `getTableName`, `getTopSizePartitions`, `getTopSizePartitionsLastUpdate`, `getTopTombstonePartitions`, `getTopTombstonePartitionsLastUpdate`, `getUnleveledSSTables`, and 18 more. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. Those 58 declarations carry 54 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 54 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. — src/java/org/apache/cassandra/db/ColumnFamilyStoreMBean.java:37
`Index` declares 17 abstract methods: `customExpressionValueType`, `dependsOn`, `getBackingTable`, `getBlockingFlushTask`, `getEstimatedResultRows`, `getIndexMetadata`, `getInitializationTask`, `getInvalidateTask`, `getMetadataReloadTask`, `getPostIndexQueryFilter`, `getTruncateTask`, `indexerFor`, `register`, `searcherFor`, `shouldBuildBlocking`, `supportsExpression`, `validate`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. 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. — src/java/org/apache/cassandra/index/Index.java:160
`SSTableFormat<R, W>` declares 16 abstract methods: `allComponents`, `batchComponents`, `delete`, `deleteOrphanedComponents`, `generatedOnLoadComponents`, `getFormatSpecificMetricsProviders`, `getKeyCacheValueSerializer`, `getLatestVersion`, `getReaderFactory`, `getScrubber`, `getVersion`, `getWriterFactory`, `mutableComponents`, `name`, `primaryComponents`, `uploadComponents`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. 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. — src/java/org/apache/cassandra/io/sstable/format/SSTableFormat.java:45
`ReplicaCollection<C>` declares 17 abstract methods under just 15 distinct name(s): `contains`, `count`, `endpoints`, `equals`, `filter`, `filter`, `filterLazily`, `filterLazily`, `get`, `hashCode`, `isEmpty`, `iterator`, `size`, `sorted`, `stream`, `subList`, `toString`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. That is an OVERLOAD SET, not 17 separate responsibilities: a caller binds to 15 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. — src/java/org/apache/cassandra/locator/ReplicaCollection.java:33
`JmxHistogramMBean` declares 16 abstract methods: `bucketsId`, `get50thPercentile`, `get75thPercentile`, `get95thPercentile`, `get98thPercentile`, `get999thPercentile`, `get99thPercentile`, `getCount`, `getMax`, `getMean`, `getMin`, `getRecentValues`, `getStdDev`, `rawBuckets`, `rawValues`, `values`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. 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. — src/java/org/apache/cassandra/metrics/CassandraMetricsRegistry.java:655
`JmxTimerMBean` declares 16 abstract methods: `bucketsId`, `get50thPercentile`, `get75thPercentile`, `get95thPercentile`, `get98thPercentile`, `get999thPercentile`, `get99thPercentile`, `getDurationUnit`, `getMax`, `getMean`, `getMin`, `getRecentValues`, `getStdDev`, `rawBuckets`, `rawValues`, `values`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. 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. — src/java/org/apache/cassandra/metrics/CassandraMetricsRegistry.java:950
`MessagingServiceMBean` declares 27 abstract methods: `getBackPressurePerHost`, `getDroppedMessages`, `getGossipMessageCompletedTasks`, `getGossipMessageCompletedTasksWithPort`, `getGossipMessageDroppedTasks`, `getGossipMessageDroppedTasksWithPort`, `getGossipMessagePendingTasks`, `getGossipMessagePendingTasksWithPort`, `getLargeMessageCompletedTasks`, `getLargeMessageCompletedTasksWithPort`, `getLargeMessageDroppedTasks`, `getLargeMessageDroppedTasksWithPort`, `getLargeMessagePendingTasks`, `getLargeMessagePendingTasksWithPort`, `getSmallMessageCompletedTasks`, `getSmallMessageCompletedTasksWithPort`, `getSmallMessageDroppedTasks`, `getSmallMessageDroppedTasksWithPort`, `getSmallMessagePendingTasks`, `getSmallMessagePendingTasksWithPort`, `getTimeoutsPerHost`, `getTimeoutsPerHostWithPort`, `getTotalTimeouts`, `getVersion`, `isBackPressureEnabled`, `reloadSslCertificates`, `setBackPressureEnabled`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. 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. — src/java/org/apache/cassandra/net/MessagingServiceMBean.java:29
`SharedContext` declares 18 abstract methods: `broadcastAddressAndPort`, `clock`, `compactionManager`, `executorFactory`, `failureDetector`, `gossiper`, `locator`, `mbean`, `messaging`, `nonPeriodicTasks`, `optionalTasks`, `paxosRepairState`, `random`, `repair`, `repairManager`, `scheduledTasks`, `streamExecutor`, `validationManager`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. 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. — src/java/org/apache/cassandra/repair/SharedContext.java:56
`SchemaProvider` declares 17 abstract methods: `distributedAndLocalKeyspaces`, `distributedKeyspaces`, `getIndexMetadata`, `getKeyspaceInstance`, `getKeyspaceMetadata`, `getKeyspaces`, `getNumberOfTables`, `getTableMetadata`, `getTableMetadata`, `getTablesAndViews`, `getUserKeyspaces`, `localKeyspaces`, `registerListener`, `saveSystemKeyspace`, `schemaChangeNotifier`, `submit`, `unregisterListener`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. Those 17 declarations carry 16 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 16 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. — src/java/org/apache/cassandra/schema/SchemaProvider.java:46
`CMSOperationsMBean` declares 36 abstract methods: `abortInitialization`, `cancelInProgressSequences`, `cancelReconfigureCms`, `describeCMS`, `dumpClusterMetadata`, `dumpClusterMetadata`, `dumpDirectory`, `dumpLog`, `getCmsAwaitTimeoutMillis`, `getCmsCommitMemberPreferencePolicy`, `getCmsCommitRetryInitialDelayMillis`, `getCmsCommitRetryMaxDelayMillis`, `getCmsCommitTimeoutMillis`, `getCmsReconfigurationWaitTimeoutMillis`, `getCommitsPaused`, `getLegacyStateListenerSyncLocalUpdates`, `initializeCMS`, `reconfigureCMS`, `reconfigureCMS`, `reconfigureCMS`, `reconfigureCMS`, `reconfigureCMSStatus`, `resumeDropAccordTable`, `resumeReconfigureCms`, `setCmsAwaitTimeoutMillis`, `setCmsCommitMemberPreferencePolicy`, `setCmsCommitRetryInitialDelayMillis`, `setCmsCommitRetryMaxDelayMillis`, `setCmsCommitTimeoutMillis`, `setCmsReconfigurationWaitTimeoutMillis`, `setCommitsPaused`, `setLegacyStateListenerSyncLocalUpdates`, `snapshotClusterMetadata`, `unregisterLeftNodes`, `unsafeLoadClusterMetadata`, `unsafeRevertClusterMetadata`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. Those 36 declarations carry 32 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 32 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. — src/java/org/apache/cassandra/tcm/CMSOperationsMBean.java:25
`Future<V>` declares 16 abstract methods under just 9 distinct name(s): `addCallback`, `addCallback`, `addCallback`, `addCallback`, `addCallback`, `addCallback`, `addListener`, `addListener`, `andThenAsync`, `andThenAsync`, `await`, `awaitThrowUncheckedOnInterrupt`, `awaitUninterruptibly`, `flatMap`, `map`, `notifyExecutor`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. That is an OVERLOAD SET, not 16 separate responsibilities: a caller binds to 9 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 16 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. — src/java/org/apache/cassandra/utils/concurrent/Future.java:47
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.
Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.
Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.
Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.
Other · Code Health — Unreviewed-generation residue in this repository's Java: methods whose whole body only throws a "not implemented" or bare unsupported-operation exception, or returns a default value (or nothing) under a TODO/FIXME marker, and placeholder text (lorem ipsum, changeme/replace_me…) left in strings of 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.
`isSatisfiedBy` is a shipped method whose whole body only throws `UnsupportedOperationException` saying it is not implemented — scaffolding that was never completed. Implement it or remove the dead surface. — src/java/org/apache/cassandra/cql3/Operator.java:948
`writeUTF` is a shipped method whose whole body only throws `UnsupportedOperationException` saying it is not implemented — scaffolding that was never completed. Implement it or remove the dead surface. — src/java/org/apache/cassandra/io/util/ChecksumedDataOutputPlus.java:106
`onFlushFailed` is a shipped method whose body is empty except for a TODO/FIXME — scaffolding that was never completed. Implement it or remove it. — src/java/org/apache/cassandra/journal/Journal.java:150
`invokeOnFailure` is a shipped method whose whole body returns a default value under a TODO/FIXME — a placeholder standing in for the implementation. Implement it or remove it. — src/java/org/apache/cassandra/net/RequestCallback.java:55
`resetLocalSchema` is a shipped method whose body is empty except for a TODO/FIXME — scaffolding that was never completed. Implement it or remove it. — src/java/org/apache/cassandra/service/StorageService.java:4715
`reloadLocalSchema` is a shipped method whose body is empty except for a TODO/FIXME — scaffolding that was never completed. Implement it or remove it. — src/java/org/apache/cassandra/service/StorageService.java:4721
`navigableKeySet` is a shipped method whose whole body only throws `UnsupportedOperationException` saying it is not implemented — scaffolding that was never completed. Implement it or remove the dead surface. — src/java/org/apache/cassandra/utils/btree/BTreeMap.java:164
`descendingKeySet` is a shipped method whose whole body only throws `UnsupportedOperationException` saying it is not implemented — scaffolding that was never completed. Implement it or remove the dead surface. — src/java/org/apache/cassandra/utils/btree/BTreeMap.java:170
`subMap` is a shipped method whose whole body only throws `UnsupportedOperationException` saying it is not implemented — scaffolding that was never completed. Implement it or remove the dead surface. (×2) — src/java/org/apache/cassandra/utils/btree/BTreeMap.java:176, src/java/org/apache/cassandra/utils/btree/BTreeMap.java:200
`headMap` is a shipped method whose whole body only throws `UnsupportedOperationException` saying it is not implemented — scaffolding that was never completed. Implement it or remove the dead surface. (×2) — src/java/org/apache/cassandra/utils/btree/BTreeMap.java:182, src/java/org/apache/cassandra/utils/btree/BTreeMap.java:206
`tailMap` is a shipped method whose whole body only throws `UnsupportedOperationException` saying it is not implemented — scaffolding that was never completed. Implement it or remove the dead surface. (×2) — src/java/org/apache/cassandra/utils/btree/BTreeMap.java:188, src/java/org/apache/cassandra/utils/btree/BTreeMap.java:212
What to do
Finish or delete the methods that still throw "not implemented" or return a placeholder under a TODO, and replace placeholder text before shipping.
Other · Code Health — Unfinished work detected by code SHAPE, not keywords, in this repository's Java: methods that only throw a "not implemented" exception, methods that take inputs and return a constant or do nothing, dead `if (false)` branches, and skeleton classes most of whose methods are holes.
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.
`writeUTF` throws an exception whose message says it isn't finished — a not-implemented stub wearing an ordinary exception. Implement it or remove it. — src/java/org/apache/cassandra/io/util/ChecksumedDataOutputPlus.java:106
`navigableKeySet` throws an exception whose message says it isn't finished — a not-implemented stub wearing an ordinary exception. Implement it or remove it. — src/java/org/apache/cassandra/utils/btree/BTreeMap.java:164
`descendingKeySet` throws an exception whose message says it isn't finished — a not-implemented stub wearing an ordinary exception. Implement it or remove it. — src/java/org/apache/cassandra/utils/btree/BTreeMap.java:170
`subMap` throws an exception whose message says it isn't finished — a not-implemented stub wearing an ordinary exception. Implement it or remove it. (×2) — src/java/org/apache/cassandra/utils/btree/BTreeMap.java:176, src/java/org/apache/cassandra/utils/btree/BTreeMap.java:200
`headMap` throws an exception whose message says it isn't finished — a not-implemented stub wearing an ordinary exception. Implement it or remove it. (×2) — src/java/org/apache/cassandra/utils/btree/BTreeMap.java:182, src/java/org/apache/cassandra/utils/btree/BTreeMap.java:206
`tailMap` throws an exception whose message says it isn't finished — a not-implemented stub wearing an ordinary exception. Implement it or remove it. (×2) — src/java/org/apache/cassandra/utils/btree/BTreeMap.java:188, src/java/org/apache/cassandra/utils/btree/BTreeMap.java:212
A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something. (×31) — test/burn/org/apache/cassandra/concurrent/LongSharedExecutorPoolTest.java:103, test/distributed/org/apache/cassandra/distributed/test/AbstractHintWindowTest.java:44, test/distributed/org/apache/cassandra/distributed/test/AbstractNodetoolStatusTest.java:50, …
What to do
Finish or delete the unfinished stubs (functions that throw "not implemented", or whose body is empty or a bare constant) — they are dead surface that looks live.
Clear the softer debt: re-enable or delete @Disabled/@Ignore tests, decide whether each empty method or UnsupportedOperationException is deliberate (and say so in a comment), and replace @SuppressWarnings("all") with targeted, justified suppressions.
Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
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 repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.
Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.
Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.
Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.
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's code 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 · Observability5.5 / 10Adequate✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
Only 1/2 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`.
What to do
Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
Add a health-check endpoint (Spring Boot Actuator's /actuator/health, or a /health route) so orchestrators and load balancers can probe liveness/readiness.
Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.
No static application security testing detected. For this repository's stack, add spotbugs with find-sec-bugs (or `semgrep --config=auto`, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 6 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner. — REDACTED:16
`pylib/requirements.txt` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`. — pylib/requirements.txt:23
What to do
Add a SAST step to CI running what this repository's stack ships: spotbugs with find-sec-bugs — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
Enable Dependabot/Renovate or a dependency-review gate.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.
Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.
Do you agree with this assessment?
P5 · DR & Backup0.0 / 10Critical✓ 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.
A persistence guard (data volume / purge-protection) was found, but no backup, geo-recovery or RTO/RPO controls were evidenced — a volume that survives a container recreate is not a tested restore from catastrophic loss.
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.
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.
The JDK pipes both `stdout` and `stderr` of this child — no `redirectErrorStream`, `redirectError`, `redirectOutput` or `inheritIO` is set — and `process.waitFor()` is written before stdout and stderr is read, so nothing drains it while the parent waits. The JDK's own `Process` documentation warns that failing to read a child's output promptly "may cause the process to block, or even deadlock": once the child writes more than the pipe holds (measured on OpenJDK 25 / Linux: 60,000 bytes finishes, 70,000 hangs forever), it blocks on the write, never exits, and the wait never returns. Nothing fails loudly. Read every piped stream before (or while) waiting — a thread or `CompletableFuture` per stream — merge them with `redirectErrorStream(true)` and read the one stream before `waitFor`, or discard what you do not want with `redirectOutput`/`redirectError(ProcessBuilder.Redirect.DISCARD)` (or a file). — src/java/org/apache/cassandra/utils/FBUtilities.java:1253
The JDK pipes both `stdout` and `stderr` of this child — no `redirectErrorStream`, `redirectError`, `redirectOutput` or `inheritIO` is set — and `p.waitFor()` is written before stdout and stderr is read, so nothing drains it while the parent waits. The JDK's own `Process` documentation warns that failing to read a child's output promptly "may cause the process to block, or even deadlock": once the child writes more than the pipe holds (measured on OpenJDK 25 / Linux: 60,000 bytes finishes, 70,000 hangs forever), it blocks on the write, never exits, and the wait never returns. Nothing fails loudly. Read every piped stream before (or while) waiting — a thread or `CompletableFuture` per stream — merge them with `redirectErrorStream(true)` and read the one stream before `waitFor`, or discard what you do not want with `redirectOutput`/`redirectError(ProcessBuilder.Redirect.DISCARD)` (or a file). — src/java/org/apache/cassandra/io/util/PathUtils.java:368
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 reader1.8 / 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.
`compressedLength` is read from the bytes being parsed at line 80 (`readInt`), then used to size a `new byte[]` at line 103 — and nowhere in its scope is `compressedLength` 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). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `compressedLength` against the bytes actually remaining and a maximum the format allows before allocating. — src/java/org/apache/cassandra/streaming/async/StreamCompressionSerializer.java:103
`len` is read from the bytes being parsed at line 193 (`readInt`), then used to size a `new byte[]` at line 194 — and nowhere in its scope is `len` 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). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `len` against the bytes actually remaining and a maximum the format allows before allocating. — src/java/org/apache/cassandra/index/sai/disk/v1/segment/SegmentMetadata.java:194
`paramsLength` is read from the bytes being parsed at line 455 (`readInt`), then used to size a `new byte[]` at line 459 — and nowhere in its scope is `paramsLength` 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). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `paramsLength` against the bytes actually remaining and a maximum the format allows before allocating. — src/java/org/apache/cassandra/hints/HintsDescriptor.java:459
`length` is read from the bytes being parsed at line 301 (`readInt`), then used to size a `new byte[]` at line 302 — and nowhere in its scope is `length` 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). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `length` against the bytes actually remaining and a maximum the format allows before allocating. — src/java/org/apache/cassandra/db/compression/CompressionDictionary.java:302
`numPKNames` is read from the bytes being parsed at line 616 (`readInt`), then used to size a `new short[]` at line 619 — and nowhere in its scope is `numPKNames` 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). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `numPKNames` against the bytes actually remaining and a maximum the format allows before allocating. — src/java/org/apache/cassandra/cql3/ResultSet.java:619
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.
Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.
Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.
Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether an argument guard throws the exception its own condition describes — a guard that rejects a value for being EMPTY and reports it as `NullPointerException` (Java, Kotlin, Scala), `ArgumentError.notNull` (Dart) or `ArgumentNullException` (F#'s `nullArg`) tells the caller a parameter was null when it provably was not.
Method: Roslyn syntax: `throw new ArgumentNullException(nameof(p))` statements (or a repository exception type deriving from it) controlled by an `if` — directly or through the `using`, `lock` or `try` that wraps the throw — 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)`); in the `else` branch, for a conjunct of the admitting condition that is FALSE of a non-null `p`. Range guards are read for bounds that leave nothing and for a `p > C.Count` bound whose index then reaches `C[p]`, `C.RemoveAt(p)` or a method of the same type that indexes with it. 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.
`debug` at line 908 is called with an argument built by `Arrays.toString(sortedSaveDirs)` (line 908), whose cost grows with the collection it walks. Java evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isDebugEnabled`/`isTraceEnabled` test, no debug flag, no lambda or `Supplier` the logger calls only when the level is on. — src/java/org/apache/cassandra/service/accord/AccordCommandStore.java:908
`debug` at line 389 is called with an argument built by `String.join("…", supportedProtocols)` (line 390), whose cost grows with the collection it walks. Java evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isDebugEnabled`/`isTraceEnabled` test, no debug flag, no lambda or `Supplier` the logger calls only when the level is on. — src/java/org/apache/cassandra/security/SSLFactory.java:389
`debug` at line 391 is called with an argument built by `String.join("…", enabledProtocols)` (line 392), whose cost grows with the collection it walks. Java evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isDebugEnabled`/`isTraceEnabled` test, no debug flag, no lambda or `Supplier` the logger calls only when the level is on. — src/java/org/apache/cassandra/security/SSLFactory.java:391
`debug` at line 394 is called with an argument built by `String.join("…", supportedCiphers)` (line 395), whose cost grows with the collection it walks. Java evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isDebugEnabled`/`isTraceEnabled` test, no debug flag, no lambda or `Supplier` the logger calls only when the level is on. — src/java/org/apache/cassandra/security/SSLFactory.java:394
`debug` at line 346 is called with an argument built by `stream()` (line 346), whose cost grows with the collection it walks. Java evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isDebugEnabled`/`isTraceEnabled` test, no debug flag, no lambda or `Supplier` the logger calls only when the level is on. — src/java/org/apache/cassandra/index/sai/disk/v1/vector/OnHeapGraph.java:346
`trace` at line 693 is called with an argument built by `Arrays.toString(estimated)` (line 694), whose cost grows with the collection it walks. Java evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because trace is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isDebugEnabled`/`isTraceEnabled` test, no debug flag, no lambda or `Supplier` the logger calls only when the level is on. — src/java/org/apache/cassandra/db/compaction/LeveledManifest.java:693
What to do
In Java, put the construction behind the logger's own check (`if (log.isDebugEnabled())` for SLF4J and Log4j, `if (logger.isLoggable(Level.FINE))` for java.util.logging), or hand the logger a lambda it calls only when the level is on (Log4j 2's `Supplier` overloads, SLF4J 2's `log.atDebug().addArgument(() -> …)`). A `{}` placeholder alone is not the fix: it defers the formatting, not the stream, join or serialisation in the argument.
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.
Do you agree with this assessment?
X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether an enhanced `for` leaves the collection it is walking alone — a body that adds to or removes from the very collection the loop is iterating invalidates the fail-fast iterator it is holding, so the next `next()` throws `ConcurrentModificationException` and the remaining elements are never seen. Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen.
Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.
Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.
Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.
Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.
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. (×10) — src/java/org/apache/cassandra/utils/FBUtilities.java:1494, src/java/org/apache/cassandra/utils/MonotonicClock.java:211, src/java/org/apache/cassandra/utils/MonotonicClock.java:353, …
`catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×9) — src/java/org/apache/cassandra/utils/Hex.java:163, src/java/org/apache/cassandra/utils/concurrent/Ref.java:749, src/java/org/apache/cassandra/transport/Client.java:195, …
`catch (Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×6) — src/java/org/apache/cassandra/service/snapshot/TableSnapshot.java:303, src/java/org/apache/cassandra/service/paxos/Paxos.java:1349, src/java/org/apache/cassandra/io/sstable/SSTable.java:256, …
`catch (RuntimeException)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — src/java/org/apache/cassandra/io/sstable/format/SortedTableScrubber.java:144
`except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — pylib/cqlshlib/cql3handling.py:930
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.
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.
`debug` at line 353 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.debug("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text. — src/java/org/apache/cassandra/utils/EstimatedHistogram.java:353
`error` at line 51 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.error("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text. — src/java/org/apache/cassandra/utils/JavaUtils.java:51
`error` at line 64 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.error("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text. — src/java/org/apache/cassandra/utils/ResourceWatcher.java:64
`info` at line 71 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text. — src/java/org/apache/cassandra/utils/StatusLogger.java:71
`info` at line 81 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text. — src/java/org/apache/cassandra/utils/StatusLogger.java:81
`info` at line 93 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text. — src/java/org/apache/cassandra/utils/StatusLogger.java:93
`info` at line 105 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text. — src/java/org/apache/cassandra/utils/StatusLogger.java:105
`info` at line 111 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text. — src/java/org/apache/cassandra/utils/StatusLogger.java:111
`info` at line 121 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text. — src/java/org/apache/cassandra/utils/StatusLogger.java:121
`error` at line 127 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.error("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text. (×2) — src/java/org/apache/cassandra/utils/SystemInfo.java:127, src/java/org/apache/cassandra/tracing/Tracing.java:127
`warn` at line 908 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text. — src/java/org/apache/cassandra/transport/SimpleClient.java:908
`info` at line 376 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text. — src/java/org/apache/cassandra/tcm/CMSOperations.java:376
`warn` at line 1001 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text. — src/java/org/apache/cassandra/tcm/ClusterMetadataService.java:1001
`error` at line 119 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.error("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text. — src/java/org/apache/cassandra/tcm/MetadataSnapshots.java:119
`warn` at line 123 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text. — src/java/org/apache/cassandra/tcm/PeerLogFetcher.java:123
`warn` at line 416 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text. — src/java/org/apache/cassandra/tcm/RemoteProcessor.java:416
`debug` at line 439 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.debug("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text. — src/java/org/apache/cassandra/tcm/Startup.java:439
`warn` at line 803 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text. — src/java/org/apache/cassandra/tcm/Startup.java:803
`info` at line 109 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text. — src/java/org/apache/cassandra/tcm/transformations/AccordMarkHardRemoved.java:109
`info` at line 101 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text. — src/java/org/apache/cassandra/tcm/transformations/AccordMarkStale.java:101
`info` at line 74 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text. — src/java/org/apache/cassandra/tcm/transformations/AccordUnmarkStale.java:74
`warn` at line 177 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text. — src/java/org/apache/cassandra/tcm/transformations/PrepareLeave.java:177
`info` at line 150 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text. — src/java/org/apache/cassandra/tcm/sequences/ProgressBarrier.java:150
`error` at line 145 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.error("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text. — src/java/org/apache/cassandra/tcm/compatibility/GossipHelper.java:145
`error` at line 155 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.error("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text. — src/java/org/apache/cassandra/tcm/compatibility/GossipHelper.java:155
`error` at line 172 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.error("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text. — src/java/org/apache/cassandra/tcm/compatibility/GossipHelper.java:172
`error` at line 357 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.error("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text. — src/java/org/apache/cassandra/service/AsyncProfilerService.java:357
`trace` at line 158 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.trace("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text. — src/java/org/apache/cassandra/service/DataResurrectionCheck.java:158
`trace` at line 307 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.trace("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text. — src/java/org/apache/cassandra/service/DataResurrectionCheck.java:307
`error` at line 312 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.error("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text. — src/java/org/apache/cassandra/service/DataResurrectionCheck.java:312
`error` at line 71 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.error("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text. — src/java/org/apache/cassandra/service/DefaultDiskErrorsHandler.java:71
`error` at line 89 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.error("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text. — src/java/org/apache/cassandra/service/DefaultDiskErrorsHandler.java:89
`error` at line 101 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.error("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text. — src/java/org/apache/cassandra/service/DefaultDiskErrorsHandler.java:101
`warn` at line 57 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text. — src/java/org/apache/cassandra/service/DiskErrorsHandlerService.java:57
`warn` at line 298 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text. — src/java/org/apache/cassandra/service/FileSystemOwnershipCheck.java:298
`warn` at line 316 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text. — src/java/org/apache/cassandra/service/FileSystemOwnershipCheck.java:316
`warn` at line 238 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text. — REDACTED:238
`warn` at line 685 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text. — REDACTED:685
`warn` at line 897 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text. — src/java/org/apache/cassandra/service/StorageService.java:897
Other · Code Health — Whether Java packages are null-marked and not undermined by heavy nullness suppression — a package under `@NullMarked` (or `@NonNullApi`, `@ParametersAreNonnullByDefault`, `@NonNullByDefault`, or a NullAway/Checker Framework configuration naming it) makes an unannotated reference exclude null, and `@SuppressWarnings("NullAway")`, `("nullness")`, `("null")` and `castToNonNull(…)` are what silence it.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
0/190 of this repository's Java package directories are under a non-null default: a `package-info.java` declaring `@NullMarked` (JSpecify) or `@NonNullApi`, `@ParametersAreNonnullByDefault`, `@NonNullByDefault`, `@DefaultQualifier(NonNull.class)`; a `module-info.java` declaring `@NullMarked`; every type in it `@NullMarked`; or a build that runs NullAway with the package in `AnnotatedPackages`, or the Checker Framework's `NullnessChecker`. Elsewhere every reference admits null and no checker warns on the dereference that throws a `NullPointerException`.
What to do
Declare the default where Java declares it: `@NullMarked` (org.jspecify.annotations) in each package's `package-info.java`, or once in `module-info.java`, and run NullAway (Error Prone) or the Checker Framework so the declaration is enforced. Then annotate the real exceptions `@Nullable` and resolve the suppressions rather than adding to them: a `@SuppressWarnings("NullAway")` or `castToNonNull(x)` on a value the checker could show to be null is a `NullPointerException` waiting for the path that makes it true — where the value genuinely cannot be null, say something the checker can see instead (a null check, `Objects.requireNonNull`, a non-null field initialised in the constructor).
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 — 4 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.
D11 Test Reliability — 8 observation(s) recorded · This repository declares 8 of its own test(s) unreliable. The built-in reliability runner does not support this repository's ecosystem (.java, .py), so the suite was not re-run and no reliability score is given — these are the repository's own declarations, not our measurement.
D36 Supply-chain Provenance & Signing — 3 observation(s) recorded · The CI pipeline publishes no artifact — no package publish, container push or release with files to download. Supply-chain provenance, signing and an SBOM describe a PUBLISHED artifact for the people who obtain it, so there is nothing to attest here; a deployment of the service itself publishes nothing for anyone else to verify. Add them to the release pipeline when this repo starts publishing artifacts (a package, a container image, or a release with downloadable files). Build integrity and workflow-token hygiene are reported below: they describe what the CI runs and the token it runs with, neither of which is affected by whether the pipeline ships an artifact.
X10 Duplicated predicate — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 6 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 3 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
C3 Audit Trail — Not assessed: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C4 Data Retention — Not assessed: these retention controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks retention controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C5 Data-Subject Rights — Not assessed: these data-subject rights controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks data-subject rights controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
Not included — 52 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 — The only markup in this repository is in its own developer tools (a root `tools/` or `scripts/` tree), which is not the product's UI — accessibility is not applicable to this repository.
AC2 Forms & labels — The only markup in this repository is in its own developer tools (a root `tools/` or `scripts/` tree), which is not the product's UI — accessibility is not applicable to this repository.
AC3 Page structure — The only markup in this repository is in its own developer tools (a root `tools/` or `scripts/` tree), which is not the product's UI — accessibility is not applicable to this repository.
AC4 Keyboard semantics — The only markup in this repository is in its own developer tools (a root `tools/` or `scripts/` tree), which is not the product's UI — accessibility is not applicable to this repository.
AC5 ARIA correctness — The only markup in this repository is in its own developer tools (a root `tools/` or `scripts/` tree), which is not the product's UI — accessibility is not applicable to this repository.
AC6 Visual & motion safety — The only markup in this repository is in its own developer tools (a root `tools/` or `scripts/` tree), which is not the product's UI — accessibility is not applicable to this repository.
AX1 Captive dependencies — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No class in this Java code is a Spring, JSR-330 or CDI singleton bean. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads.
AX4 Dependency direction — not applicable to a CQRS architecture (the inward-dependency rule is for layered/clean styles)
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AX8 Test isolation — no test/production split to check
AXB1 Runtime evidence locked — no reproducible boot — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
D12 Dependency Hygiene — Dependency currency not established — no declaration carries an exact pin to grade
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D20 ADR Quality — N/A — ADRs are expected on deployable products with a user-facing host, not consumed libraries; no ADR log is required here.
D22 Internal API Consistency — API consistency is measured on C#, TypeScript, Go only; the exposed Python surface was not measured.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — D24 reads C#, Visual Basic, TypeScript and JavaScript comments only — this repository's production source is .java, .py, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D25 ADR Conformance — no ADRs to check
D26 Project Cohesion — D26 measured no build unit over this repository's .java source. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D32 Data Compliance (PII/GDPR) — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D5 Coupling — D5 reads a .NET project-reference graph only — this repository's production source is .java, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
D8 Code Coverage — Coverage not measured — Python suite
DM1 Domain Modelling — applicable but not scored (2 of 3 signals for this style — below the bar we score at): 512 value object(s); 24 domain event(s); its domain events are published by services or handlers — no domain entity raises one
ED1 Event-Driven — applicable but not scored (2 of 3 signals for this style — below the bar we score at): 2 event handler(s); 49 CQRS handler(s)
ED5 Idempotency — Not assessed, and this one is on us: 49 command handler(s) or message consumer(s) were found here, but this check does not yet recognise persistence writes in this repository's language. Idempotency was neither confirmed nor ruled out — this is a limit of the analyzer, not a finding about your code.
ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the JVM, Python source, so there is no service whose uptime a failing dependency could take down
P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
P9 Domain vs controller coverage — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
PF3 Async & latency hygiene — Not applicable: this repository declares no async functions, so there is no asynchronous code for a blocking call to stall.
S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
X1 Async correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X12 Unreachable branch — X12 reached only 1% of this repository's production lines — java (658,429 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X2 Cancellation propagation — no C# was loaded; this repository's Java and Python were read, and no request in it can be cancelled by a caller — a Java request off Android takes no token: it is cancelled through the handle it returns (Future.cancel, Call.cancel, a Disposable), ambiently (io.grpc.Context) or by interrupting its thread, not through a parameter; a Python request takes no token: asyncio cancels the task and trio or anyio the scope that made it, from outside the call, and requests, httpx, aiohttp and gRPC take a timeout, not a cancellation
X21 Side-effecting pattern guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X24 Document value interpolated into markup unescaped — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
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.
Orphaned knowledge src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java: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 src/java/org/apache/cassandra/cql3/selection/Selectable.java: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 src/java/org/apache/cassandra/db/filter/DataLimits.java: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 src/java/org/apache/cassandra/utils/MerkleTree.java: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 src/java/org/apache/cassandra/repair/consistent/LocalSessions.java: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 src/java/org/apache/cassandra/service/consensus/migration/ConsensusRequestRouter.java: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 src/java/org/apache/cassandra/config/EncryptionOptions.java: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 src/java/org/apache/cassandra/cql3/restrictions/StatementRestrictions.java: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 src/java/org/apache/cassandra/db/filter/ColumnFilter.java: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 src/java/org/apache/cassandra/utils/IntervalTree.java: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 src/java/org/apache/cassandra/cql3/functions/types/CodecRegistry.java: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 src/java/org/apache/cassandra/repair/autorepair/RepairTokenRangeSplitter.java: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 src/java/org/apache/cassandra/io/sstable/format/big/RowIndexEntry.java: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 src/java/org/apache/cassandra/utils/LongTimSort.java: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 src/java/org/apache/cassandra/cql3/CQL3Type.java: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 src/java/org/apache/cassandra/tools/nodetool/stats/TableStatsHolder.java: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 src/java/org/apache/cassandra/cql3/functions/types/GettableByIndexData.java: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 src/java/org/apache/cassandra/cql3/functions/types/GettableByNameData.java: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 src/java/org/apache/cassandra/cql3/statements/DescribeStatement.java: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 src/java/org/apache/cassandra/cql3/functions/types/SettableByNameData.java: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 src/java/org/apache/cassandra/db/context/CounterContext.java: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 src/java/org/apache/cassandra/metrics/DecayingEstimatedHistogramReservoir.java: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 src/java/org/apache/cassandra/schema/TableParams.java: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 src/java/org/apache/cassandra/dht/Range.java: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 src/java/org/apache/cassandra/index/sai/disk/v1/bbtree/BlockBalancedTreeWriter.java: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.
D11 · Test Reliability· Test declared unreliable · ×8
Test declared unreliable: AccordWriteInteroperabilityTest test/distributed/org/apache/cassandra/distributed/test/accord/AccordWriteInteroperabilityTest.java:69— This test is disabled or skipped with a reason naming unreliability — the repository's own words: "flaky". A test that is skipped for flakiness is neither passing nor protecting the code it covers; either stabilise it or delete it, but do not leave it disabled indefinitely. (Found by reading the repository's own test source — the suite itself was not re-run, since the reliability runner does not support this ecosystem.)
Test declared unreliable: test/distributed/org/apache/cassandra/distributed/test/accord/MigrationFromAccordReadRaceTest.java test/distributed/org/apache/cassandra/distributed/test/accord/MigrationFromAccordReadRaceTest.java:23— This test is disabled or skipped with a reason naming unreliability — the repository's own words: "Flakey". A test that is skipped for flakiness is neither passing nor protecting the code it covers; either stabilise it or delete it, but do not leave it disabled indefinitely. (Found by reading the repository's own test source — the suite itself was not re-run, since the reliability runner does not support this ecosystem.)
Test declared unreliable: test/distributed/org/apache/cassandra/distributed/test/accord/MigrationFromAccordWriteRaceTest.java test/distributed/org/apache/cassandra/distributed/test/accord/MigrationFromAccordWriteRaceTest.java:23— This test is disabled or skipped with a reason naming unreliability — the repository's own words: "Flakey". A test that is skipped for flakiness is neither passing nor protecting the code it covers; either stabilise it or delete it, but do not leave it disabled indefinitely. (Found by reading the repository's own test source — the suite itself was not re-run, since the reliability runner does not support this ecosystem.)
Test declared unreliable: test/distributed/org/apache/cassandra/distributed/test/accord/MigrationToAccordReadRaceTest.java test/distributed/org/apache/cassandra/distributed/test/accord/MigrationToAccordReadRaceTest.java:23— This test is disabled or skipped with a reason naming unreliability — the repository's own words: "Flakey". A test that is skipped for flakiness is neither passing nor protecting the code it covers; either stabilise it or delete it, but do not leave it disabled indefinitely. (Found by reading the repository's own test source — the suite itself was not re-run, since the reliability runner does not support this ecosystem.)
Test declared unreliable: test/distributed/org/apache/cassandra/distributed/test/accord/MigrationToAccordWriteRaceTest.java test/distributed/org/apache/cassandra/distributed/test/accord/MigrationToAccordWriteRaceTest.java:23— This test is disabled or skipped with a reason naming unreliability — the repository's own words: "Flakey". A test that is skipped for flakiness is neither passing nor protecting the code it covers; either stabilise it or delete it, but do not leave it disabled indefinitely. (Found by reading the repository's own test source — the suite itself was not re-run, since the reliability runner does not support this ecosystem.)
Test declared unreliable: test test/distributed/org/apache/cassandra/distributed/test/accord/journal/StatefulJournalRestartTest.java:84— This test is disabled or skipped with a reason naming unreliability — the repository's own words: "Unstable, need to fix". A test that is skipped for flakiness is neither passing nor protecting the code it covers; either stabilise it or delete it, but do not leave it disabled indefinitely. (Found by reading the repository's own test source — the suite itself was not re-run, since the reliability runner does not support this ecosystem.)
Test declared unreliable: FullAccordInteropMultiNodeTableWalkTest test/distributed/org/apache/cassandra/distributed/test/cql3/FullAccordInteropMultiNodeTableWalkTest.java:28— This test is disabled or skipped with a reason naming unreliability — the repository's own words: "flakey". A test that is skipped for flakiness is neither passing nor protecting the code it covers; either stabilise it or delete it, but do not leave it disabled indefinitely. (Found by reading the repository's own test source — the suite itself was not re-run, since the reliability runner does not support this ecosystem.)
Test declared unreliable: MixedReadsAccordInteropMultiNodeTableWalkTest test/distributed/org/apache/cassandra/distributed/test/cql3/MixedReadsAccordInteropMultiNodeTableWalkTest.java:28— This test is disabled or skipped with a reason naming unreliability — the repository's own words: "flakey". A test that is skipped for flakiness is neither passing nor protecting the code it covers; either stabilise it or delete it, but do not leave it disabled indefinitely. (Found by reading the repository's own test source — the suite itself was not re-run, since the reliability runner does not support this ecosystem.)
D10 · Test Quality· No assertions (empty test) · ×2
No assertions (empty test): test test/burn/org/apache/cassandra/service/accord/AccordExecutorBurnTest.java:87— Test method has an empty body — it asserts nothing and exercises no code.
No assertions (empty test): anomalyWriteSkew test/simulator/test/org/apache/cassandra/simulator/paxos/HistoryValidatorTest.java:235— Test method has an empty body — it asserts nothing and exercises no code.
No assertions: buildKeyManagerFactoryWithBadPassword examples/ssl-factory/test/unit/org/apache/cassandra/security/KubernetesSecretsPEMSslContextFactoryTest.java:180— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, 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: buildKeyManagerFactoryWithInvalidPrivateKey examples/ssl-factory/test/unit/org/apache/cassandra/security/KubernetesSecretsPEMSslContextFactoryTest.java:167— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, 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: buildKeyManagerFactoryWithMultipleCertsInCertChain examples/ssl-factory/test/unit/org/apache/cassandra/security/KubernetesSecretsPEMSslContextFactoryTest.java:219— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, 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: buildTrustManagerFactoryWithInvalidTrustedCertificates examples/ssl-factory/test/unit/org/apache/cassandra/security/KubernetesSecretsPEMSslContextFactoryTest.java:142— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, 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: buildKeyManagerFactoryWithBadPassword examples/ssl-factory/test/unit/org/apache/cassandra/security/KubernetesSecretsSslContextFactoryTest.java:165— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, 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: buildKeyManagerFactoryWithInvalidKeystoreFile examples/ssl-factory/test/unit/org/apache/cassandra/security/KubernetesSecretsSslContextFactoryTest.java:151— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, 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: buildTrustManagerFactoryWithBadPassword examples/ssl-factory/test/unit/org/apache/cassandra/security/KubernetesSecretsSslContextFactoryTest.java:112— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, 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: buildTrustManagerFactoryWithEmptyPassword examples/ssl-factory/test/unit/org/apache/cassandra/security/KubernetesSecretsSslContextFactoryTest.java:125— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, 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: buildTrustManagerFactoryWithInvalidTruststoreFile examples/ssl-factory/test/unit/org/apache/cassandra/security/KubernetesSecretsSslContextFactoryTest.java:100— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, 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: getDecryptor_EmptyIv test/unit/org/apache/cassandra/security/CipherFactoryTest.java:153— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, 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: getDecryptor_NullIv test/unit/org/apache/cassandra/security/CipherFactoryTest.java:147— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, 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: buildKeyManagerFactoryWithBadPassword test/unit/org/apache/cassandra/security/DefaultSslContextFactoryTest.java:144— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, 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: buildKeyManagerFactoryWithInvalidKeystoreFile test/unit/org/apache/cassandra/security/DefaultSslContextFactoryTest.java:131— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, 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: buildOutboundKeyManagerFactoryWithBadPassword test/unit/org/apache/cassandra/security/DefaultSslContextFactoryTest.java:193— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, 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: buildOutboundKeyManagerFactoryWithInvalidKeystoreFile test/unit/org/apache/cassandra/security/DefaultSslContextFactoryTest.java:180— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, 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: buildTrustManagerFactoryWithBadPassword test/unit/org/apache/cassandra/security/DefaultSslContextFactoryTest.java:107— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, 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: buildTrustManagerFactoryWithInvalidTruststoreFile test/unit/org/apache/cassandra/security/DefaultSslContextFactoryTest.java:95— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, 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: testBadKeystorePasswordFile test/unit/org/apache/cassandra/security/FileBasedSslContextFactoryTest.java:148— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, 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: testMissingPasswordFile test/unit/org/apache/cassandra/security/FileBasedStoreContextTest.java:65— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, 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: buildKeyManagerFactoryWithBadPassword test/unit/org/apache/cassandra/security/PEMBasedSslContextFactoryTest.java:311— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, 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: buildKeyManagerFactoryWithConflictingPasswordConfigs test/unit/org/apache/cassandra/security/PEMBasedSslContextFactoryTest.java:347— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, 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: buildKeyManagerFactoryWithInvalidKeystoreFile test/unit/org/apache/cassandra/security/PEMBasedSslContextFactoryTest.java:299— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, 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: buildKeyManagerFactoryWithMatchingPasswordConfigs test/unit/org/apache/cassandra/security/PEMBasedSslContextFactoryTest.java:359— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, 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: buildTrustManagerFactoryWithInvalidTruststoreFile test/unit/org/apache/cassandra/security/PEMBasedSslContextFactoryTest.java:260— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, 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: testMultiplePrivateKeySources test/unit/org/apache/cassandra/security/PEMBasedSslContextFactoryTest.java:438— This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, 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.
TodoComment tools/stress/src/org/apache/cassandra/stress/StressAction.java:83— // TODO : move this to a new queue wrapper that gates progress based on a poisson (or configurable) distribution — 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 tools/stress/src/org/apache/cassandra/stress/StressAction.java:134— // TODO : permit varying more than just thread count — 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 tools/stress/src/org/apache/cassandra/stress/StressAction.java:135— // TODO : vary thread count based on percentage improvement of previous increment, not by fixed amounts — 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 tools/stress/src/org/apache/cassandra/stress/util/JmxCollector.java:79— // TODO: should expand to whole cluster — 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 tools/stress/src/org/apache/cassandra/stress/util/Uncertainty.java:27— // TODO: do not assume normal distribution of measurements. — 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 tools/stress/src/org/apache/cassandra/stress/operations/userdefined/SchemaStatement.java:47— //TODO: FIRSTROW, LASTROW — 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 tools/stress/src/org/apache/cassandra/stress/operations/predefined/CqlCounterAdder.java:54— // TODO : increment distribution subset of columns — 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 tools/stress/src/org/apache/cassandra/stress/generate/PartitionIterator.java:48— // TODO: we should batch the generation of clustering components so we can bound the time and size necessary to — 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 tools/stress/src/org/apache/cassandra/stress/generate/PartitionIterator.java:187— // TODO : support first/last row, and constraining reads to rows we know are populated — 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 tools/stress/src/org/apache/cassandra/stress/generate/values/Dates.java:36— // TODO: let the range of values generated advance as stress test progresses — 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 test/unit/org/apache/cassandra/Util.java:300— // TODO should probably rewrite tests that use this post CEP-21
TodoComment test/unit/org/apache/cassandra/utils/ASTGenerators.java:211— //TODO (correctness): "(smallint) ? - 16250" failed, but is this general or is it a small int thing? — 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 test/unit/org/apache/cassandra/utils/ASTGenerators.java:294— //TODO (coverage): rather than single level operators, allow nested (a + b + c + d) — 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 test/unit/org/apache/cassandra/utils/ASTGenerators.java:761— //TODO (coverage): add accord support — 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 test/unit/org/apache/cassandra/utils/ASTGenerators.java:1068— //TODO (flexability): since expression offers visit to replace things, could also keep the expression in tact but just replace Value with the Reference? — 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 test/unit/org/apache/cassandra/utils/ASTGenerators.java:1096— //TODO (coverage): nothing stops the following: c[0] = 42, c[1] = 72, just not impl in generator yet — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment test/unit/org/apache/cassandra/utils/ASTGenerators.java:1223— //TODO (coverage): this is something Accord should support, so should remove and make sure accord is updated — 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 test/unit/org/apache/cassandra/utils/ASTGenerators.java:1353— //TODO (coverage): this is something Accord should support, so should remove and make sure accord is updated — 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 test/distributed/org/apache/cassandra/fuzz/topology/AccordTopologyMixupTest.java:155— //TODO (coverage): this is something Accord should support, so should remove and make sure accord is updated — 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 test/unit/org/apache/cassandra/utils/ASTGenerators.java:1224— //TODO (coverage): CASSANDRA-20828 found an issue with multi cell list type timestamp handling, so make sure accord doesn't hit this
TodoComment test/unit/org/apache/cassandra/utils/ASTGenerators.java:1354— //TODO (coverage): CASSANDRA-20828 found an issue with multi cell list type timestamp handling, so make sure accord doesn't hit this
TodoComment test/simulator/test/org/apache/cassandra/simulator/test/SingleTableASTSimulation.java:247— //TODO (coverage): CASSANDRA-20828 found an issue with multi cell list type timestamp handling, so make sure accord doesn't hit this
TodoComment test/distributed/org/apache/cassandra/fuzz/topology/AccordTopologyMixupTest.java:156— //TODO (coverage): CASSANDRA-20828 found an issue with multi cell list type timestamp handling, so make sure accord doesn't hit this
TodoComment test/unit/org/apache/cassandra/utils/ASTGenerators.java:1256— //TODO support OR — 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 test/unit/org/apache/cassandra/utils/ASTGenerators.java:1317— //TODO (now): refactor so ASTGenerators no longer is quicktheories, its too annoying to go back and forth... — 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.
TooManyMethods: DatabaseDescriptor src/java/org/apache/cassandra/config/DatabaseDescriptor.java:186— TooManyMethods — 813 methods. The bar is 30 methods; this is 783 over it, 27.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: StorageService src/java/org/apache/cassandra/service/StorageService.java:291— TooManyMethods — 557 methods. The bar is 30 methods; this is 527 over it, 18.57× the bar. Most of these members implement service.StorageServiceMBean (376 of 513 members), so moving them onto a smaller type would remove them from that contract rather than reduce it. To reduce it, split the contract instead: give each cohesive group of operations its own smaller interface and its own implementing type. Where the contract has to stay whole, move the work behind these members into collaborator types, so what is left here is a forward per member rather than a responsibility per member.
TooManyMethods: NodeProbe src/java/org/apache/cassandra/tools/NodeProbe.java:158— TooManyMethods — 318 methods. The bar is 30 methods; this is 288 over it, 10.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ColumnFamilyStore src/java/org/apache/cassandra/db/ColumnFamilyStore.java:188— TooManyMethods — 231 methods. The bar is 30 methods; this is 201 over it, 7.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Guardrails src/java/org/apache/cassandra/db/guardrails/Guardrails.java:56— TooManyMethods — 217 methods. The bar is 30 methods; this is 187 over it, 7.23× the bar. Most of these members implement guardrails.GuardrailsMBean (197 of 209 members), so moving them onto a smaller type would remove them from that contract rather than reduce it. To reduce it, split the contract instead: give each cohesive group of operations its own smaller interface and its own implementing type. Where the contract has to stay whole, move the work behind these members into collaborator types, so what is left here is a forward per member rather than a responsibility per member.
TooManyMethods: GuardrailsOptions src/java/org/apache/cassandra/config/GuardrailsOptions.java:68— TooManyMethods — 201 methods. The bar is 30 methods; this is 171 over it, 6.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: StorageProxy src/java/org/apache/cassandra/service/StorageProxy.java:246— TooManyMethods — 173 methods. The bar is 30 methods; this is 143 over it, 5.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: SSTableReader src/java/org/apache/cassandra/io/sstable/format/SSTableReader.java:160— TooManyMethods — 142 methods. The bar is 30 methods; this is 112 over it, 4.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: BTree src/java/org/apache/cassandra/utils/btree/BTree.java:55— TooManyMethods — 121 methods. The bar is 30 methods; this is 91 over it, 4.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: Gossiper src/java/org/apache/cassandra/gms/Gossiper.java:141— TooManyMethods — 119 methods. The bar is 30 methods; this is 89 over it, 3.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: CompactionManager src/java/org/apache/cassandra/db/compaction/CompactionManager.java:154— TooManyMethods — 109 methods. The bar is 30 methods; this is 79 over it, 3.63× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: SystemKeyspace src/java/org/apache/cassandra/db/SystemKeyspace.java:162— TooManyMethods — 104 methods. The bar is 30 methods; this is 74 over it, 3.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: Task src/java/org/apache/cassandra/service/accord/execution/Task.java:81— TooManyMethods — 99 methods. The bar is 30 methods; this is 69 over it, 3.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: AccordCacheEntry src/java/org/apache/cassandra/service/accord/execution/AccordCacheEntry.java:70— TooManyMethods — 98 methods. The bar is 30 methods; this is 68 over it, 3.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Shell pylib/cqlshlib/cqlshmain.py:237— TooManyMethods — 95 methods. The bar is 30 methods; this is 65 over it, 3.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: File src/java/org/apache/cassandra/io/util/File.java:58— TooManyMethods — 94 methods. The bar is 30 methods; this is 64 over it, 3.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: FBUtilities src/java/org/apache/cassandra/utils/FBUtilities.java:114— TooManyMethods — 94 methods. The bar is 30 methods; this is 64 over it, 3.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: CursorCompactor src/java/org/apache/cassandra/db/compaction/CursorCompactor.java:125— TooManyMethods — 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: SafeTask src/java/org/apache/cassandra/service/accord/execution/SafeTask.java:148— TooManyMethods — 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: AbstractType src/java/org/apache/cassandra/db/marshal/AbstractType.java:66— TooManyMethods — 88 methods. 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: CompactionStrategyManager src/java/org/apache/cassandra/db/compaction/CompactionStrategyManager.java:111— TooManyMethods — 86 methods. The bar is 30 methods; this is 56 over it, 2.87× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: TableMetadata src/java/org/apache/cassandra/schema/TableMetadata.java:105— TooManyMethods — 83 methods. The bar is 30 methods; this is 53 over it, 2.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: ByteBufferUtil src/java/org/apache/cassandra/utils/ByteBufferUtil.java:104— TooManyMethods — 83 methods. The bar is 30 methods; this is 53 over it, 2.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: ModificationStatement src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java:149— TooManyMethods — 81 methods. The bar is 30 methods; this is 51 over it, 2.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: AccordService src/java/org/apache/cassandra/service/accord/AccordService.java:224— TooManyMethods — 81 methods. The bar is 30 methods; this is 51 over it, 2.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: DatabaseDescriptor src/java/org/apache/cassandra/config/DatabaseDescriptor.java:186— ClassTooLong — 2974 significant lines (blank, comment-only and punctuation-only lines excluded), 813 methods. The bar is 400 significant lines; this is 2574 over it, 7.44× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: StorageService src/java/org/apache/cassandra/service/StorageService.java:291— ClassTooLong — 2813 significant lines (blank, comment-only and punctuation-only lines excluded), 557 methods. The bar is 400 significant lines; this is 2413 over it, 7.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: StorageProxy src/java/org/apache/cassandra/service/StorageProxy.java:246— ClassTooLong — 1879 significant lines (blank, comment-only and punctuation-only lines excluded), 173 methods. The bar is 400 significant lines; this is 1479 over it, 4.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ColumnFamilyStore src/java/org/apache/cassandra/db/ColumnFamilyStore.java:188— ClassTooLong — 1695 significant lines (blank, comment-only and punctuation-only lines excluded), 231 methods. The bar is 400 significant lines; this is 1295 over it, 4.24× 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: AccordDebugKeyspace src/java/org/apache/cassandra/db/virtual/AccordDebugKeyspace.java:199— ClassTooLong — 1597 significant lines (blank, comment-only and punctuation-only lines excluded), 16 methods. The bar is 400 significant lines; this is 1197 over it, 3.99× 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: NodeProbe src/java/org/apache/cassandra/tools/NodeProbe.java:158— ClassTooLong — 1318 significant lines (blank, comment-only and punctuation-only lines excluded), 318 methods. The bar is 400 significant lines; this is 918 over it, 3.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: CompactionManager src/java/org/apache/cassandra/db/compaction/CompactionManager.java:154— ClassTooLong — 1310 significant lines (blank, comment-only and punctuation-only lines excluded), 109 methods. The bar is 400 significant lines; this is 910 over it, 3.28× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: SystemKeyspace src/java/org/apache/cassandra/db/SystemKeyspace.java:162— ClassTooLong — 1300 significant lines (blank, comment-only and punctuation-only lines excluded), 104 methods. The bar is 400 significant lines; this is 900 over it, 3.25× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: SafeTask src/java/org/apache/cassandra/service/accord/execution/SafeTask.java:148— ClassTooLong — 1203 significant lines (blank, comment-only and punctuation-only lines excluded), 89 methods. The bar is 400 significant lines; this is 803 over it, 3.01× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Gossiper src/java/org/apache/cassandra/gms/Gossiper.java:141— ClassTooLong — 1157 significant lines (blank, comment-only and punctuation-only lines excluded), 119 methods. The bar is 400 significant lines; this is 757 over it, 2.89× 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: Guardrails src/java/org/apache/cassandra/db/guardrails/Guardrails.java:56— ClassTooLong — 1156 significant lines (blank, comment-only and punctuation-only lines excluded), 217 methods. The bar is 400 significant lines; this is 756 over it, 2.89× 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: SelectStatement src/java/org/apache/cassandra/cql3/statements/SelectStatement.java:164— ClassTooLong — 1108 significant lines (blank, comment-only and punctuation-only lines excluded), 64 methods. The bar is 400 significant lines; this is 708 over it, 2.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.
ClassTooLong: TableMetadata src/java/org/apache/cassandra/schema/TableMetadata.java:105— ClassTooLong — 1084 significant lines (blank, comment-only and punctuation-only lines excluded), 83 methods. The bar is 400 significant lines; this is 684 over it, 2.71× 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: GuardrailsOptions src/java/org/apache/cassandra/config/GuardrailsOptions.java:68— ClassTooLong — 1078 significant lines (blank, comment-only and punctuation-only lines excluded), 201 methods. The bar is 400 significant lines; this is 678 over it, 2.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: CursorCompactor src/java/org/apache/cassandra/db/compaction/CursorCompactor.java:125— ClassTooLong — 1027 significant lines (blank, comment-only and punctuation-only lines excluded), 89 methods. The bar is 400 significant lines; this is 627 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.
ClassTooLong: ClusterMetadata src/java/org/apache/cassandra/tcm/ClusterMetadata.java:102— ClassTooLong — 863 significant lines (blank, comment-only and punctuation-only lines excluded), 44 methods. The bar is 400 significant lines; this is 463 over it, 2.16× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: SchemaKeyspace src/java/org/apache/cassandra/schema/SchemaKeyspace.java:125— ClassTooLong — 862 significant lines (blank, comment-only and punctuation-only lines excluded), 74 methods. The bar is 400 significant lines; this is 462 over it, 2.16× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: SSTableReader src/java/org/apache/cassandra/io/sstable/format/SSTableReader.java:160— ClassTooLong — 825 significant lines (blank, comment-only and punctuation-only lines excluded), 142 methods. The bar is 400 significant lines; this is 425 over it, 2.06× 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: AccordService src/java/org/apache/cassandra/service/accord/AccordService.java:224— ClassTooLong — 824 significant lines (blank, comment-only and punctuation-only lines excluded), 81 methods. The bar is 400 significant lines; this is 424 over it, 2.06× 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: AccordCache src/java/org/apache/cassandra/service/accord/execution/AccordCache.java:109— ClassTooLong — 798 significant lines (blank, comment-only and punctuation-only lines excluded), 34 methods. The bar is 400 significant lines; this is 398 over it, 2.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: CommandSerializers src/java/org/apache/cassandra/service/accord/serializers/CommandSerializers.java:73— ClassTooLong — 797 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 397 over it, 1.99× 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: SinglePartitionReadCommand src/java/org/apache/cassandra/db/SinglePartitionReadCommand.java:98— ClassTooLong — 786 significant lines (blank, comment-only and punctuation-only lines excluded), 52 methods. The bar is 400 significant lines; this is 386 over it, 1.97× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: AutoRepairUtils src/java/org/apache/cassandra/repair/autorepair/AutoRepairUtils.java:116— ClassTooLong — 786 significant lines (blank, comment-only and punctuation-only lines excluded), 47 methods. The bar is 400 significant lines; this is 386 over it, 1.97× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: DataLimits src/java/org/apache/cassandra/db/filter/DataLimits.java:67— ClassTooLong — 776 significant lines (blank, comment-only and punctuation-only lines excluded), 29 methods. The bar is 400 significant lines; this is 376 over it, 1.94× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: MerkleTree src/java/org/apache/cassandra/utils/MerkleTree.java:77— ClassTooLong — 766 significant lines (blank, comment-only and punctuation-only lines excluded), 46 methods. The bar is 400 significant lines; this is 366 over it, 1.92× 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.
FileTooLong: config/DatabaseDescriptor.java src/java/org/apache/cassandra/config/DatabaseDescriptor.java— FileTooLong — 3134 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: DatabaseDescriptor (186-6589). The bar is 500 significant lines; this is 2634 over it, 6.27× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: service/StorageService.java src/java/org/apache/cassandra/service/StorageService.java— FileTooLong — 3073 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: StorageService (291-5937). The bar is 500 significant lines; this is 2573 over it, 6.15× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: btree/BTree.java src/java/org/apache/cassandra/utils/btree/BTree.java— FileTooLong — 2269 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1769 over it, 4.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: service/StorageProxy.java src/java/org/apache/cassandra/service/StorageProxy.java— FileTooLong — 2099 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: StorageProxy (246-3893). The bar is 500 significant lines; this is 1599 over it, 4.20× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: db/ColumnFamilyStore.java src/java/org/apache/cassandra/db/ColumnFamilyStore.java— FileTooLong — 1858 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: ColumnFamilyStore (188-3589). The bar is 500 significant lines; this is 1358 over it, 3.72× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: cqlshlib/copyutil.py pylib/cqlshlib/copyutil.py— FileTooLong — 1822 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1322 over it, 3.64× 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: virtual/AccordDebugKeyspace.java src/java/org/apache/cassandra/db/virtual/AccordDebugKeyspace.java— FileTooLong — 1769 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: AccordDebugKeyspace (199-2606). The bar is 500 significant lines; this is 1269 over it, 3.54× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: tools/NodeProbe.java src/java/org/apache/cassandra/tools/NodeProbe.java— FileTooLong — 1490 significant lines (blank, comment-only and punctuation-only lines excluded), about 88% of them inside a single declaration: NodeProbe (158-2897). The bar is 500 significant lines; this is 990 over it, 2.98× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: db/SystemKeyspace.java src/java/org/apache/cassandra/db/SystemKeyspace.java— FileTooLong — 1437 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: SystemKeyspace (162-2265). The bar is 500 significant lines; this is 937 over it, 2.87× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: compaction/CompactionManager.java src/java/org/apache/cassandra/db/compaction/CompactionManager.java— FileTooLong — 1430 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: CompactionManager (154-2727). The bar is 500 significant lines; this is 930 over it, 2.86× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: types/TypeCodec.java src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java— FileTooLong — 1352 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 852 over it, 2.70× 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: execution/SafeTask.java src/java/org/apache/cassandra/service/accord/execution/SafeTask.java— FileTooLong — 1325 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: SafeTask (148-2302). The bar is 500 significant lines; this is 825 over it, 2.65× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: cqlshlib/cqlshmain.py pylib/cqlshlib/cqlshmain.py— FileTooLong — 1314 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 814 over it, 2.63× 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: run-ci.d/run_ci.py .build/run-ci.d/run_ci.py— FileTooLong — 1270 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 770 over it, 2.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: gms/Gossiper.java src/java/org/apache/cassandra/gms/Gossiper.java— FileTooLong — 1258 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: Gossiper (141-2449). The bar is 500 significant lines; this is 758 over it, 2.52× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: statements/SelectStatement.java src/java/org/apache/cassandra/cql3/statements/SelectStatement.java— FileTooLong — 1236 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: SelectStatement (164-2138). The bar is 500 significant lines; this is 736 over it, 2.47× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: guardrails/Guardrails.java src/java/org/apache/cassandra/db/guardrails/Guardrails.java— FileTooLong — 1183 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: Guardrails (56-2135). The bar is 500 significant lines; this is 683 over it, 2.37× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: schema/TableMetadata.java src/java/org/apache/cassandra/schema/TableMetadata.java— FileTooLong — 1163 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: TableMetadata (105-2236). The bar is 500 significant lines; this is 663 over it, 2.33× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: config/GuardrailsOptions.java src/java/org/apache/cassandra/config/GuardrailsOptions.java— FileTooLong — 1106 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: GuardrailsOptions (68-1817). The bar is 500 significant lines; this is 606 over it, 2.21× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: compaction/CursorCompactor.java src/java/org/apache/cassandra/db/compaction/CursorCompactor.java— FileTooLong — 1106 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: CursorCompactor (125-2388). The bar is 500 significant lines; this is 606 over it, 2.21× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: accord/AccordService.java src/java/org/apache/cassandra/service/accord/AccordService.java— FileTooLong — 1021 significant lines (blank, comment-only and punctuation-only lines excluded), about 81% of them inside a single declaration: AccordService (224-1646). The bar is 500 significant lines; this is 521 over it, 2.04× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: schema/SchemaKeyspace.java src/java/org/apache/cassandra/schema/SchemaKeyspace.java— FileTooLong — 956 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: SchemaKeyspace (125-1532). The bar is 500 significant lines; this is 456 over it, 1.91× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: tcm/ClusterMetadata.java src/java/org/apache/cassandra/tcm/ClusterMetadata.java— FileTooLong — 939 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: ClusterMetadata (102-1565). The bar is 500 significant lines; this is 439 over it, 1.88× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: format/SSTableReader.java src/java/org/apache/cassandra/io/sstable/format/SSTableReader.java— FileTooLong — 925 significant lines (blank, comment-only and punctuation-only lines excluded), about 89% of them inside a single declaration: SSTableReader (160-2165). The bar is 500 significant lines; this is 425 over it, 1.85× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: autorepair/AutoRepairUtils.java src/java/org/apache/cassandra/repair/autorepair/AutoRepairUtils.java— FileTooLong — 873 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: AutoRepairUtils (116-1569). The bar is 500 significant lines; this is 373 over it, 1.75× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
+ 62 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (6 corresponding lines) · ×61
Edited copy of a member (6 corresponding lines) src/java/org/apache/cassandra/service/accord/journal/SegmentRangeSearcher.java:100— src/java/org/apache/cassandra/service/accord/journal/SegmentRangeSearcher.java:100-105 | src/java/org/apache/cassandra/service/accord/journal/SegmentRangeSearcher.java:115-120 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src/java/org/apache/cassandra/net/MessagingServiceMBeanImpl.java:66— src/java/org/apache/cassandra/net/MessagingServiceMBeanImpl.java:66-71 | src/java/org/apache/cassandra/net/MessagingServiceMBeanImpl.java:75-80 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src/java/org/apache/cassandra/net/MessagingServiceMBeanImpl.java:93— src/java/org/apache/cassandra/net/MessagingServiceMBeanImpl.java:93-98 | src/java/org/apache/cassandra/net/MessagingServiceMBeanImpl.java:102-107 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src/java/org/apache/cassandra/net/MessagingServiceMBeanImpl.java:120— src/java/org/apache/cassandra/net/MessagingServiceMBeanImpl.java:120-125 | src/java/org/apache/cassandra/net/MessagingServiceMBeanImpl.java:129-134 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src/java/org/apache/cassandra/net/MessagingServiceMBeanImpl.java:147— src/java/org/apache/cassandra/net/MessagingServiceMBeanImpl.java:147-152 | src/java/org/apache/cassandra/net/MessagingServiceMBeanImpl.java:156-161 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src/java/org/apache/cassandra/net/MessagingServiceMBeanImpl.java:174— src/java/org/apache/cassandra/net/MessagingServiceMBeanImpl.java:174-179 | src/java/org/apache/cassandra/net/MessagingServiceMBeanImpl.java:183-188 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src/java/org/apache/cassandra/net/MessagingServiceMBeanImpl.java:201— src/java/org/apache/cassandra/net/MessagingServiceMBeanImpl.java:201-206 | src/java/org/apache/cassandra/net/MessagingServiceMBeanImpl.java:210-215 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src/java/org/apache/cassandra/repair/asymmetric/RangeMap.java:250— src/java/org/apache/cassandra/repair/asymmetric/RangeMap.java:250-256 | src/java/org/apache/cassandra/utils/MutableEntry.java:57-62 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src/java/org/apache/cassandra/service/StorageService.java:4341— src/java/org/apache/cassandra/service/StorageService.java:4341-4346 | src/java/org/apache/cassandra/service/StorageService.java:4349-4354 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src/java/org/apache/cassandra/tcm/sequences/ProgressBarrier.java:347— src/java/org/apache/cassandra/tcm/sequences/ProgressBarrier.java:347-352 | src/java/org/apache/cassandra/tcm/sequences/ProgressBarrier.java:438-443 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src/java/org/apache/cassandra/utils/concurrent/FutureCombiner.java:239— src/java/org/apache/cassandra/utils/concurrent/FutureCombiner.java:239-244 | src/java/org/apache/cassandra/utils/concurrent/FutureCombiner.java:259-268 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src/java/org/apache/cassandra/schema/SchemaKeyspace.java:1277— src/java/org/apache/cassandra/schema/SchemaKeyspace.java:1277-1282 | src/java/org/apache/cassandra/schema/SchemaKeyspace.java:1293-1298 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src/java/org/apache/cassandra/repair/autorepair/KeyspaceRepairPlan.java:83— src/java/org/apache/cassandra/repair/autorepair/KeyspaceRepairPlan.java:83-88 | src/java/org/apache/cassandra/repair/autorepair/RepairAssignment.java:70-76 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src/java/org/apache/cassandra/metrics/AccordReplicaMetrics.java:203— src/java/org/apache/cassandra/metrics/AccordReplicaMetrics.java:203-208 | src/java/org/apache/cassandra/metrics/AccordReplicaMetrics.java:226-234 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src/java/org/apache/cassandra/tools/JMXTool.java:659— src/java/org/apache/cassandra/tools/JMXTool.java:659-665 | src/java/org/apache/cassandra/tools/nodetool/GuardrailsConfigCommand.java:510-515 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src/java/org/apache/cassandra/service/accord/debug/DebugBlockedTxns.java:95— src/java/org/apache/cassandra/service/accord/debug/DebugBlockedTxns.java:95-101 | src/java/org/apache/cassandra/service/accord/debug/DebugTxnGraph.java:86-91 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src/java/org/apache/cassandra/net/Message.java:317— src/java/org/apache/cassandra/net/Message.java:317-322 | src/java/org/apache/cassandra/net/Message.java:330-335 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src/java/org/apache/cassandra/tcm/transformations/PrepareReplace.java:211— src/java/org/apache/cassandra/tcm/transformations/PrepareReplace.java:211-217 | src/java/org/apache/cassandra/tcm/transformations/ApplyPlacementDeltas.java:141-146 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src/java/org/apache/cassandra/cql3/selection/UserTypeSelector.java:112— src/java/org/apache/cassandra/cql3/selection/UserTypeSelector.java:112-118 | src/java/org/apache/cassandra/utils/MerkleTrees.java:381-386 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src/java/org/apache/cassandra/db/RangeTombstoneList.java:136— src/java/org/apache/cassandra/db/RangeTombstoneList.java:136-141 | src/java/org/apache/cassandra/db/virtual/AbstractLazyVirtualTable.java:802-807 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src/java/org/apache/cassandra/tcm/transformations/PrepareReplace.java:202— src/java/org/apache/cassandra/tcm/transformations/PrepareReplace.java:202-208 | src/java/org/apache/cassandra/tcm/transformations/ApplyPlacementDeltas.java:133-138 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src/java/org/apache/cassandra/journal/Segments.java:60— src/java/org/apache/cassandra/journal/Segments.java:60-65 | src/java/org/apache/cassandra/journal/Segments.java:68-73 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src/java/org/apache/cassandra/db/partitions/PartitionUpdate.java:258— src/java/org/apache/cassandra/db/partitions/PartitionUpdate.java:258-263 | src/java/org/apache/cassandra/db/partitions/PartitionUpdate.java:277-282 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src/java/org/apache/cassandra/service/writes/thresholds/WarnCounter.java:41— src/java/org/apache/cassandra/service/writes/thresholds/WarnCounter.java:41-47 | src/java/org/apache/cassandra/tcm/ownership/PlacementDeltas.java:111-116 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) pylib/cqlshlib/copyutil.py:2518— pylib/cqlshlib/copyutil.py:2518-2532 | pylib/cqlshlib/copyutil.py:2535-2540 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
+ 36 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (9 corresponding lines) · ×58
Edited copy of a member (9 corresponding lines) src/java/org/apache/cassandra/service/accord/journal/RangeSearchManager.java:229— src/java/org/apache/cassandra/service/accord/journal/RangeSearchManager.java:229-237 | src/java/org/apache/cassandra/service/accord/journal/RangeSearchManager.java:240-248 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src/java/org/apache/cassandra/service/accord/journal/AccordJournal.java:399— src/java/org/apache/cassandra/service/accord/journal/AccordJournal.java:399-408 | src/java/org/apache/cassandra/service/accord/journal/AccordJournal.java:411-419 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src/java/org/apache/cassandra/db/rows/BTreeRow.java:463— src/java/org/apache/cassandra/db/rows/BTreeRow.java:463-472 | src/java/org/apache/cassandra/db/rows/BTreeRow.java:476-484 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src/java/org/apache/cassandra/service/accord/serializers/Version.java:102— src/java/org/apache/cassandra/service/accord/serializers/Version.java:102-110 | src/java/org/apache/cassandra/tcm/serialization/Version.java:165-173 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src/java/org/apache/cassandra/index/internal/composites/ClusteringColumnIndex.java:73— src/java/org/apache/cassandra/index/internal/composites/ClusteringColumnIndex.java:73-81 | src/java/org/apache/cassandra/index/internal/composites/CollectionValueIndex.java:67-81 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src/java/org/apache/cassandra/db/partitions/PartitionUpdate.java:783— src/java/org/apache/cassandra/db/partitions/PartitionUpdate.java:783-791 | src/java/org/apache/cassandra/db/partitions/PartitionUpdate.java:893-902 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src/java/org/apache/cassandra/cql3/Operator.java:341— src/java/org/apache/cassandra/cql3/Operator.java:341-349 | src/java/org/apache/cassandra/cql3/Operator.java:353-361 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src/java/org/apache/cassandra/tools/NodeProbe.java:2384— src/java/org/apache/cassandra/tools/NodeProbe.java:2384-2392 | src/java/org/apache/cassandra/tools/NodeProbe.java:2395-2403 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src/java/org/apache/cassandra/io/tries/TrieNode.java:398— src/java/org/apache/cassandra/io/tries/TrieNode.java:398-406 | src/java/org/apache/cassandra/io/tries/TrieNode.java:468-477 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src/java/org/apache/cassandra/db/Clustering.java:71— src/java/org/apache/cassandra/db/Clustering.java:71-79 | src/java/org/apache/cassandra/db/Clustering.java:82-90 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src/java/org/apache/cassandra/index/accord/IndexDescriptor.java:121— src/java/org/apache/cassandra/index/accord/IndexDescriptor.java:121-129 | src/java/org/apache/cassandra/index/sai/disk/format/IndexDescriptor.java:95-112 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src/java/org/apache/cassandra/tcm/ownership/PlacementDeltas.java:246— src/java/org/apache/cassandra/tcm/ownership/PlacementDeltas.java:246-254 | src/java/org/apache/cassandra/tcm/ownership/PlacementDeltas.java:271-280 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src/java/org/apache/cassandra/gms/GossipDigestAck.java:65— src/java/org/apache/cassandra/gms/GossipDigestAck.java:65-74 | src/java/org/apache/cassandra/gms/GossipDigestAck2.java:51-59 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) REDACTED:174— REDACTED:174-184 | src/java/org/apache/cassandra/utils/UUIDGen.java:57-65 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src/java/org/apache/cassandra/tcm/transformations/cms/PreInitialize.java:128— src/java/org/apache/cassandra/tcm/transformations/cms/PreInitialize.java:128-136 | src/java/org/apache/cassandra/tcm/transformations/cms/PreInitialize.java:150-159 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src/java/org/apache/cassandra/db/SystemKeyspace.java:2195— src/java/org/apache/cassandra/db/SystemKeyspace.java:2195-2203 | src/java/org/apache/cassandra/db/SystemKeyspace.java:2206-2215 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src/java/org/apache/cassandra/repair/consistent/admin/CleanupSummary.java:133— src/java/org/apache/cassandra/repair/consistent/admin/CleanupSummary.java:133-141 | src/java/org/apache/cassandra/repair/consistent/admin/PendingStats.java:96-105 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src/java/org/apache/cassandra/utils/bytecomparable/ByteSourceInverse.java:63— src/java/org/apache/cassandra/utils/bytecomparable/ByteSourceInverse.java:63-74 | src/java/org/apache/cassandra/utils/bytecomparable/ByteSourceInverse.java:133-141 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src/java/org/apache/cassandra/cql3/functions/types/CodecRegistry.java:722— src/java/org/apache/cassandra/cql3/functions/types/CodecRegistry.java:722-733 | src/java/org/apache/cassandra/cql3/functions/types/CodecRegistry.java:736-744 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src/java/org/apache/cassandra/cql3/functions/CastFcts.java:392— src/java/org/apache/cassandra/cql3/functions/CastFcts.java:392-400 | src/java/org/apache/cassandra/cql3/functions/ToJsonFct.java:59-68 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src/java/org/apache/cassandra/db/compaction/LeveledCompactionStrategy.java:199— src/java/org/apache/cassandra/db/compaction/LeveledCompactionStrategy.java:199-210 | src/java/org/apache/cassandra/db/compaction/TimeWindowCompactionStrategy.java:388-396 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src/java/org/apache/cassandra/service/reads/thresholds/CoordinatorWarnings.java:126— src/java/org/apache/cassandra/service/reads/thresholds/CoordinatorWarnings.java:126-134 | src/java/org/apache/cassandra/service/reads/thresholds/CoordinatorWarnings.java:137-145 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src/java/org/apache/cassandra/tcm/transformations/PrepareJoin.java:214— src/java/org/apache/cassandra/tcm/transformations/PrepareJoin.java:214-222 | src/java/org/apache/cassandra/tcm/transformations/PrepareMove.java:156-164 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src/java/org/apache/cassandra/locator/Ec2LocationProvider.java:101— src/java/org/apache/cassandra/locator/Ec2LocationProvider.java:101-109 | src/java/org/apache/cassandra/locator/SnitchAdapter.java:47-55 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src/java/org/apache/cassandra/index/sai/memory/ShardedMemtableIndex.java:162— src/java/org/apache/cassandra/index/sai/memory/ShardedMemtableIndex.java:162-170 | src/java/org/apache/cassandra/index/sai/memory/UnshardedMemtableIndex.java:98-106 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (5 lines × 2) src/java/org/apache/cassandra/cql3/Operator.java:342— src/java/org/apache/cassandra/cql3/Operator.java:342-346 | src/java/org/apache/cassandra/cql3/Operator.java:354-358 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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 first that the copies are not typed on the same thing: the declarations holding them bind `leftOperand` to `ByteBuffer` in one and `ComplexColumnData` 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 (5 lines × 2) src/java/org/apache/cassandra/cql3/constraints/FunctionColumnConstraint.java:172— src/java/org/apache/cassandra/cql3/constraints/FunctionColumnConstraint.java:172-176 | src/java/org/apache/cassandra/cql3/constraints/UnaryFunctionColumnConstraint.java:159-163 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 first that the copies are not typed on the same thing: the declarations holding them bind `columnConstraint` to `FunctionColumnConstraint` in one and `UnaryFunctionColumnConstraint` 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 after the matched lines, `src/java/org/apache/cassandra/cql3/constraints/FunctionColumnConstraint.java:179` calls `writeTo`, `writeUTF` and `src/java/org/apache/cassandra/cql3/constraints/UnaryFunctionColumnConstraint.java:165` 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 × 2) src/java/org/apache/cassandra/cql3/statements/schema/AlterTableStatement.java:628— src/java/org/apache/cassandra/cql3/statements/schema/AlterTableStatement.java:628-632 | src/java/org/apache/cassandra/cql3/statements/schema/CreateTableStatement.java:204-211 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) src/java/org/apache/cassandra/db/ClusteringComparator.java:145— src/java/org/apache/cassandra/db/ClusteringComparator.java:145-149 | src/java/org/apache/cassandra/db/ClusteringComparator.java:286-290 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/db/ClusteringComparator.java:145` 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 `c1` to `ClusteringPrefix<V1>` in one and `Clustering<V1>` 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 (5 lines × 2) src/java/org/apache/cassandra/db/ColumnFamilyStore.java:2196— src/java/org/apache/cassandra/db/ColumnFamilyStore.java:2196-2200 | src/java/org/apache/cassandra/db/ColumnFamilyStore.java:2250-2254 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/db/ColumnFamilyStore.java:2196` 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 × 2) src/java/org/apache/cassandra/db/Digest.java:176— src/java/org/apache/cassandra/db/Digest.java:176-180 | src/java/org/apache/cassandra/db/Digest.java:190-194 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/db/Digest.java: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. 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 first that the copies are not typed on the same thing: the declarations holding them bind `val` to `int` in one and `long` 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 (5 lines × 2) src/java/org/apache/cassandra/db/SystemKeyspace.java:1109— src/java/org/apache/cassandra/db/SystemKeyspace.java:1109-1113 | src/java/org/apache/cassandra/db/SystemKeyspace.java:1148-1152 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/db/SystemKeyspace.java:1109` 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 × 2) src/java/org/apache/cassandra/db/virtual/InternodeInboundTable.java:93— src/java/org/apache/cassandra/db/virtual/InternodeInboundTable.java:93-97 | src/java/org/apache/cassandra/db/virtual/InternodeOutboundTable.java:93-97 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) src/java/org/apache/cassandra/gms/GossipDigestAck.java:97— src/java/org/apache/cassandra/gms/GossipDigestAck.java:97-101 | src/java/org/apache/cassandra/gms/GossipDigestAck2.java:78-82 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/gms/GossipDigestAck.java:97` 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 (5 lines × 2) src/java/org/apache/cassandra/io/compress/DeflateCompressor.java:100— src/java/org/apache/cassandra/io/compress/DeflateCompressor.java:100-104 | src/java/org/apache/cassandra/io/compress/DeflateCompressor.java:157-161 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/io/compress/DeflateCompressor.java:100` 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 (5 lines × 2) src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java:279— src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java:279-283 | tools/stress/src/org/apache/cassandra/io/sstable/StressCQLSSTableWriter.java:258-262 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) src/java/org/apache/cassandra/io/sstable/UnfilteredDescriptor.java:210— src/java/org/apache/cassandra/io/sstable/UnfilteredDescriptor.java:210-214 | src/java/org/apache/cassandra/io/sstable/UnfilteredDescriptor.java:225-229 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/io/sstable/UnfilteredDescriptor.java:210` 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 × 2) src/java/org/apache/cassandra/io/tries/TrieNode.java:399— src/java/org/apache/cassandra/io/tries/TrieNode.java:399-403 | src/java/org/apache/cassandra/io/tries/TrieNode.java:469-473 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) src/java/org/apache/cassandra/repair/autorepair/AutoRepairUtils.java:526— src/java/org/apache/cassandra/repair/autorepair/AutoRepairUtils.java:526-530 | src/java/org/apache/cassandra/repair/autorepair/AutoRepairUtils.java:1164-1168 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/repair/autorepair/AutoRepairUtils.java:526` 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 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) src/java/org/apache/cassandra/service/StorageService.java:4212— src/java/org/apache/cassandra/service/StorageService.java:4212-4216 | src/java/org/apache/cassandra/service/StorageService.java:4232-4236 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/service/StorageService.java:4212` 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 × 2) src/java/org/apache/cassandra/service/paxos/PaxosPrepare.java:1102— src/java/org/apache/cassandra/service/paxos/PaxosPrepare.java:1102-1107 | src/java/org/apache/cassandra/service/paxos/PaxosPrepareRefresh.java:177-181 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/service/paxos/PaxosPrepare.java:1102` 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 × 2) src/java/org/apache/cassandra/tcm/sequences/BootstrapAndJoin.java:539— src/java/org/apache/cassandra/tcm/sequences/BootstrapAndJoin.java:539-543 | src/java/org/apache/cassandra/tcm/sequences/Move.java:646-650 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 before the matched lines, `src/java/org/apache/cassandra/tcm/sequences/BootstrapAndJoin.java:538` calls `writeBoolean` and `src/java/org/apache/cassandra/tcm/sequences/Move.java:645` 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 (5 lines × 2) src/java/org/apache/cassandra/tcm/sequences/BootstrapAndJoin.java:554— src/java/org/apache/cassandra/tcm/sequences/BootstrapAndJoin.java:554-558 | src/java/org/apache/cassandra/tcm/sequences/Move.java:664-668 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 before the matched lines, `src/java/org/apache/cassandra/tcm/sequences/BootstrapAndJoin.java:553` calls `readBoolean` and `src/java/org/apache/cassandra/tcm/sequences/Move.java:663` 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 × 2) src/java/org/apache/cassandra/tcm/transformations/PrepareJoin.java:191— src/java/org/apache/cassandra/tcm/transformations/PrepareJoin.java:191-195 | src/java/org/apache/cassandra/tcm/transformations/PrepareMove.java:135-139 — before extracting anything, compare `src/java/org/apache/cassandra/tcm/transformations/PrepareJoin.java` and `src/java/org/apache/cassandra/tcm/transformations/PrepareMove.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/java/org/apache/cassandra/tcm/transformations/PrepareJoin.java:197` calls `writeBoolean` and `src/java/org/apache/cassandra/tcm/transformations/PrepareMove.java:141` 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 × 2) src/java/org/apache/cassandra/tcm/transformations/PrepareJoin.java:215— src/java/org/apache/cassandra/tcm/transformations/PrepareJoin.java:215-219 | src/java/org/apache/cassandra/tcm/transformations/PrepareMove.java:157-161 — before extracting anything, compare `src/java/org/apache/cassandra/tcm/transformations/PrepareJoin.java` and `src/java/org/apache/cassandra/tcm/transformations/PrepareMove.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) src/java/org/apache/cassandra/transport/messages/BatchMessage.java:248— src/java/org/apache/cassandra/transport/messages/BatchMessage.java:248-253 | src/java/org/apache/cassandra/transport/messages/QueryMessage.java:147-151 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 `src/java/org/apache/cassandra/transport/messages/BatchMessage.java:248` 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) src/java/org/apache/cassandra/utils/LongTimSort.java:604— src/java/org/apache/cassandra/utils/LongTimSort.java:604-608 | src/java/org/apache/cassandra/utils/LongTimSort.java:712-716 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) src/java/org/apache/cassandra/cql3/statements/schema/AlterViewStatement.java:117— src/java/org/apache/cassandra/cql3/statements/schema/AlterViewStatement.java:117-121 | src/java/org/apache/cassandra/cql3/statements/schema/DropViewStatement.java:82-86 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) src/java/org/apache/cassandra/db/ArrayClusteringBoundOrBoundary.java:26— src/java/org/apache/cassandra/db/ArrayClusteringBoundOrBoundary.java:26-30 | src/java/org/apache/cassandra/db/BufferClusteringBoundOrBoundary.java:28-32 — before extracting anything, compare `src/java/org/apache/cassandra/db/ArrayClusteringBoundOrBoundary.java` and `src/java/org/apache/cassandra/db/BufferClusteringBoundOrBoundary.java` as WHOLE FILES: 84% 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `values` to `byte[][]` in one and `ByteBuffer[]` 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 (5 lines × 2) src/java/org/apache/cassandra/db/commitlog/CommitLogArchiver.java:337— src/java/org/apache/cassandra/db/commitlog/CommitLogArchiver.java:337-341 | src/java/org/apache/cassandra/utils/binlog/ExternalArchiver.java:180-184 — 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.
+ 31 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (8 corresponding lines) · ×53
Edited copy of a member (8 corresponding lines) src/java/org/apache/cassandra/utils/MurmurHash.java:215— src/java/org/apache/cassandra/utils/MurmurHash.java:215-222 | src/java/org/apache/cassandra/utils/MurmurHash.java:225-232 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) src/java/org/apache/cassandra/service/accord/txn/TxnRead.java:121— src/java/org/apache/cassandra/service/accord/txn/TxnRead.java:121-131 | src/java/org/apache/cassandra/service/accord/txn/TxnRead.java:134-141 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) src/java/org/apache/cassandra/db/lifecycle/View.java:311— src/java/org/apache/cassandra/db/lifecycle/View.java:311-318 | src/java/org/apache/cassandra/db/lifecycle/View.java:328-335 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) src/java/org/apache/cassandra/tools/nodetool/SetCacheCapacity.java:50— src/java/org/apache/cassandra/tools/nodetool/SetCacheCapacity.java:50-57 | src/java/org/apache/cassandra/tools/nodetool/SetCacheKeysToSave.java:50-57 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) src/java/org/apache/cassandra/dht/ByteOrderedPartitioner.java:228— src/java/org/apache/cassandra/dht/ByteOrderedPartitioner.java:228-238 | src/java/org/apache/cassandra/dht/OrderPreservingPartitioner.java:86-93 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) src/java/org/apache/cassandra/dht/Token.java:215— src/java/org/apache/cassandra/dht/Token.java:215-222 | src/java/org/apache/cassandra/dht/Token.java:233-240 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) src/java/org/apache/cassandra/cql3/statements/TransactionStatement.java:218— src/java/org/apache/cassandra/cql3/statements/TransactionStatement.java:218-225 | src/java/org/apache/cassandra/cql3/statements/TransactionStatement.java:228-235 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) src/java/org/apache/cassandra/dht/Token.java:195— src/java/org/apache/cassandra/dht/Token.java:195-202 | src/java/org/apache/cassandra/dht/Token.java:205-212 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) src/java/org/apache/cassandra/io/sstable/format/big/BigTableReader.java:141— src/java/org/apache/cassandra/io/sstable/format/big/BigTableReader.java:141-148 | src/java/org/apache/cassandra/io/sstable/format/bti/BtiTableReader.java:446-460 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) src/java/org/apache/cassandra/transport/SimpleClient.java:628— src/java/org/apache/cassandra/transport/SimpleClient.java:628-635 | src/java/org/apache/cassandra/transport/SimpleClient.java:638-645 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) src/java/org/apache/cassandra/db/marshal/IntegerType.java:571— src/java/org/apache/cassandra/db/marshal/IntegerType.java:571-578 | src/java/org/apache/cassandra/db/marshal/IntegerType.java:582-589 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) src/java/org/apache/cassandra/utils/btree/BTreeRemoval.java:296— src/java/org/apache/cassandra/utils/btree/BTreeRemoval.java:296-303 | src/java/org/apache/cassandra/utils/btree/BTreeRemoval.java:315-324 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) src/java/org/apache/cassandra/tcm/transformations/PrepareJoin.java:190— src/java/org/apache/cassandra/tcm/transformations/PrepareJoin.java:190-198 | src/java/org/apache/cassandra/tcm/transformations/PrepareMove.java:134-141 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) src/java/org/apache/cassandra/locator/ReplicaLayout.java:371— src/java/org/apache/cassandra/locator/ReplicaLayout.java:371-379 | src/java/org/apache/cassandra/locator/ReplicaLayout.java:386-393 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) pylib/cqlshlib/cql3handling.py:1371— pylib/cqlshlib/cql3handling.py:1371-1378 | pylib/cqlshlib/cql3handling.py:1383-1390 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) src/java/org/apache/cassandra/cql3/functions/types/AbstractAddressableByIndexData.java:62— src/java/org/apache/cassandra/cql3/functions/types/AbstractAddressableByIndexData.java:62-69 | src/java/org/apache/cassandra/cql3/functions/types/AbstractData.java:88-95 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) src/java/org/apache/cassandra/cql3/functions/types/AbstractAddressableByIndexData.java:73— src/java/org/apache/cassandra/cql3/functions/types/AbstractAddressableByIndexData.java:73-80 | src/java/org/apache/cassandra/cql3/functions/types/AbstractData.java:109-116 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) src/java/org/apache/cassandra/cql3/functions/types/AbstractAddressableByIndexData.java:84— src/java/org/apache/cassandra/cql3/functions/types/AbstractAddressableByIndexData.java:84-91 | src/java/org/apache/cassandra/cql3/functions/types/AbstractData.java:130-137 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) src/java/org/apache/cassandra/cql3/functions/types/AbstractAddressableByIndexData.java:95— src/java/org/apache/cassandra/cql3/functions/types/AbstractAddressableByIndexData.java:95-102 | src/java/org/apache/cassandra/cql3/functions/types/AbstractData.java:151-158 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) src/java/org/apache/cassandra/cql3/functions/types/AbstractAddressableByIndexData.java:140— src/java/org/apache/cassandra/cql3/functions/types/AbstractAddressableByIndexData.java:140-147 | src/java/org/apache/cassandra/cql3/functions/types/AbstractData.java:246-253 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) src/java/org/apache/cassandra/cql3/functions/types/AbstractAddressableByIndexData.java:151— src/java/org/apache/cassandra/cql3/functions/types/AbstractAddressableByIndexData.java:151-158 | src/java/org/apache/cassandra/cql3/functions/types/AbstractData.java:267-274 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) src/java/org/apache/cassandra/tcm/ownership/EndpointDelta.java:80— src/java/org/apache/cassandra/tcm/ownership/EndpointDelta.java:80-87 | src/java/org/apache/cassandra/tcm/ownership/NodeIdDelta.java:85-92 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) src/java/org/apache/cassandra/cql3/constraints/FunctionColumnConstraint.java:171— src/java/org/apache/cassandra/cql3/constraints/FunctionColumnConstraint.java:171-181 | src/java/org/apache/cassandra/cql3/constraints/UnaryFunctionColumnConstraint.java:158-165 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) src/java/org/apache/cassandra/db/ClusteringPrefix.java:469— src/java/org/apache/cassandra/db/ClusteringPrefix.java:469-481 | src/java/org/apache/cassandra/db/ClusteringPrefix.java:506-513 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) src/java/org/apache/cassandra/tcm/transformations/PrepareJoin.java:357— src/java/org/apache/cassandra/tcm/transformations/PrepareJoin.java:357-364 | src/java/org/apache/cassandra/tcm/transformations/PrepareMove.java:292-299 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
+ 28 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (10 corresponding lines) · ×48
Edited copy of a member (10 corresponding lines) src/java/org/apache/cassandra/tcm/transformations/PrepareJoin.java:201— src/java/org/apache/cassandra/tcm/transformations/PrepareJoin.java:201-211 | src/java/org/apache/cassandra/tcm/transformations/PrepareMove.java:144-153 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src/java/org/apache/cassandra/index/sasi/analyzer/NonTokenizingAnalyzer.java:129— src/java/org/apache/cassandra/index/sasi/analyzer/NonTokenizingAnalyzer.java:129-138 | src/java/org/apache/cassandra/index/sasi/analyzer/StandardAnalyzer.java:142-153 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src/java/org/apache/cassandra/service/accord/journal/SegmentRangeSearcher.java:236— src/java/org/apache/cassandra/service/accord/journal/SegmentRangeSearcher.java:236-245 | src/java/org/apache/cassandra/service/accord/journal/SegmentRangeSearcher.java:250-259 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src/java/org/apache/cassandra/db/virtual/ClusterMetadataDirectoryTable.java:93— src/java/org/apache/cassandra/db/virtual/ClusterMetadataDirectoryTable.java:93-103 | src/java/org/apache/cassandra/db/virtual/ClusterMetadataLogTable.java:65-74 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src/java/org/apache/cassandra/tcm/ownership/TokenMap.java:210— src/java/org/apache/cassandra/tcm/ownership/TokenMap.java:210-219 | src/java/org/apache/cassandra/tcm/ownership/TokenMap.java:234-244 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src/java/org/apache/cassandra/tcm/sequences/LockedRanges.java:421— src/java/org/apache/cassandra/tcm/sequences/LockedRanges.java:421-430 | src/java/org/apache/cassandra/tcm/sequences/LockedRanges.java:448-458 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src/java/org/apache/cassandra/service/accord/AccordObjectSizes.java:119— src/java/org/apache/cassandra/service/accord/AccordObjectSizes.java:119-129 | src/java/org/apache/cassandra/service/accord/AccordObjectSizes.java:152-161 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src/java/org/apache/cassandra/metrics/LogLinearDecayingHistograms.java:158— src/java/org/apache/cassandra/metrics/LogLinearDecayingHistograms.java:158-175 | src/java/org/apache/cassandra/metrics/LogLinearHistogram.java:319-328 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src/java/org/apache/cassandra/net/MessagingServiceMBeanImpl.java:232— src/java/org/apache/cassandra/net/MessagingServiceMBeanImpl.java:232-241 | src/java/org/apache/cassandra/net/MessagingServiceMBeanImpl.java:246-255 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src/java/org/apache/cassandra/cql3/statements/schema/CreateAggregateStatement.java:283— src/java/org/apache/cassandra/cql3/statements/schema/CreateAggregateStatement.java:283-292 | src/java/org/apache/cassandra/cql3/statements/schema/CreateFunctionStatement.java:196-205 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src/java/org/apache/cassandra/cache/KeyCacheKey.java:66— src/java/org/apache/cassandra/cache/KeyCacheKey.java:66-76 | src/java/org/apache/cassandra/cache/RowCacheKey.java:68-77 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src/java/org/apache/cassandra/cql3/statements/PropertyDefinitions.java:94— src/java/org/apache/cassandra/cql3/statements/PropertyDefinitions.java:94-103 | src/java/org/apache/cassandra/cql3/statements/PropertyDefinitions.java:107-116 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src/java/org/apache/cassandra/service/accord/debug/DebugBlockedTxns.java:166— src/java/org/apache/cassandra/service/accord/debug/DebugBlockedTxns.java:166-175 | src/java/org/apache/cassandra/service/accord/debug/DebugTxnGraph.java:211-220 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src/java/org/apache/cassandra/cql3/terms/Terms.java:566— src/java/org/apache/cassandra/cql3/terms/Terms.java:566-575 | src/java/org/apache/cassandra/cql3/terms/Terms.java:579-588 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src/java/org/apache/cassandra/io/AsymmetricParameterisedVersionedSerializer.java:35— src/java/org/apache/cassandra/io/AsymmetricParameterisedVersionedSerializer.java:35-44 | src/java/org/apache/cassandra/io/AsymmetricUnversionedSerializer.java:39-48 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src/java/org/apache/cassandra/utils/btree/BTree.java:174— src/java/org/apache/cassandra/utils/btree/BTree.java:174-184 | src/java/org/apache/cassandra/utils/btree/BTree.java:192-201 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src/java/org/apache/cassandra/db/rows/BTreeRow.java:499— src/java/org/apache/cassandra/db/rows/BTreeRow.java:499-511 | src/java/org/apache/cassandra/db/rows/BTreeRow.java:514-523 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src/java/org/apache/cassandra/utils/Interval.java:81— src/java/org/apache/cassandra/utils/Interval.java:81-90 | src/java/org/apache/cassandra/utils/Interval.java:102-111 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src/java/org/apache/cassandra/cql3/statements/schema/CommentOnUserTypeStatement.java:71— src/java/org/apache/cassandra/cql3/statements/schema/CommentOnUserTypeStatement.java:71-80 | src/java/org/apache/cassandra/cql3/statements/schema/SecurityLabelOnUserTypeFieldStatement.java:99-112 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src/java/org/apache/cassandra/db/rows/AbstractCell.java:130— src/java/org/apache/cassandra/db/rows/AbstractCell.java:130-139 | src/java/org/apache/cassandra/db/rows/NativeCell.java:51-63 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src/java/org/apache/cassandra/locator/TopologyFileLocationProvider.java:80— src/java/org/apache/cassandra/locator/TopologyFileLocationProvider.java:80-93 | src/java/org/apache/cassandra/tcm/membership/Location.java:71-80 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src/java/org/apache/cassandra/utils/btree/BTree.java:2057— src/java/org/apache/cassandra/utils/btree/BTree.java:2057-2066 | src/java/org/apache/cassandra/utils/btree/BTree.java:2070-2079 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src/java/org/apache/cassandra/audit/AuditLogManager.java:452— src/java/org/apache/cassandra/audit/AuditLogManager.java:452-461 | src/java/org/apache/cassandra/audit/AuditLogManager.java:465-474 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src/java/org/apache/cassandra/db/RangeTombstoneList.java:297— src/java/org/apache/cassandra/db/RangeTombstoneList.java:297-306 | src/java/org/apache/cassandra/db/RangeTombstoneList.java:519-528 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src/java/org/apache/cassandra/cql3/functions/AbstractFunction.java:189— src/java/org/apache/cassandra/cql3/functions/AbstractFunction.java:189-198 | src/java/org/apache/cassandra/db/rows/CellPath.java:81-94 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (6 lines × 2) src/java/org/apache/cassandra/cql3/Duration.java:190— src/java/org/apache/cassandra/cql3/Duration.java:190-197 | src/java/org/apache/cassandra/cql3/functions/types/Duration.java:175-180 — before extracting anything, compare `src/java/org/apache/cassandra/cql3/Duration.java` and `src/java/org/apache/cassandra/cql3/functions/types/Duration.java` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 112 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 `src/java/org/apache/cassandra/cql3/Duration.java:190` 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 (6 lines × 2) src/java/org/apache/cassandra/cql3/Operation.java:351— src/java/org/apache/cassandra/cql3/Operation.java:351-356 | src/java/org/apache/cassandra/cql3/Operation.java:412-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 `src/java/org/apache/cassandra/cql3/Operation.java:351` 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) src/java/org/apache/cassandra/cql3/functions/AggregateFcts.java:75— src/java/org/apache/cassandra/cql3/functions/AggregateFcts.java:75-80 | src/java/org/apache/cassandra/cql3/functions/AggregateFcts.java:86-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 `src/java/org/apache/cassandra/cql3/functions/AggregateFcts.java:75` 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) src/java/org/apache/cassandra/cql3/functions/CollectionFcts.java:74— src/java/org/apache/cassandra/cql3/functions/CollectionFcts.java:74-79 | src/java/org/apache/cassandra/cql3/functions/CollectionFcts.java:83-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/cql3/functions/CollectionFcts.java:74` 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) src/java/org/apache/cassandra/cql3/functions/CollectionFcts.java:92— src/java/org/apache/cassandra/cql3/functions/CollectionFcts.java:92-97 | src/java/org/apache/cassandra/cql3/functions/CollectionFcts.java:101-106 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/cql3/functions/CollectionFcts.java:92` 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) src/java/org/apache/cassandra/cql3/functions/types/AbstractGettableByIndexData.java:169— src/java/org/apache/cassandra/cql3/functions/types/AbstractGettableByIndexData.java:169-174 | src/java/org/apache/cassandra/cql3/functions/types/AbstractGettableByIndexData.java:202-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. 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) src/java/org/apache/cassandra/db/marshal/VectorType.java:616— src/java/org/apache/cassandra/db/marshal/VectorType.java:616-621 | src/java/org/apache/cassandra/db/marshal/VectorType.java:664-669 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/db/marshal/VectorType.java:616` 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) src/java/org/apache/cassandra/db/streaming/CassandraCompressedStreamReader.java:120— src/java/org/apache/cassandra/db/streaming/CassandraCompressedStreamReader.java:120-125 | src/java/org/apache/cassandra/db/streaming/CassandraStreamReader.java:153-158 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 `src/java/org/apache/cassandra/db/streaming/CassandraCompressedStreamReader.java:120` 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 (6 lines × 2) src/java/org/apache/cassandra/index/sai/disk/v1/segment/VectorIndexSegmentSearcher.java:157— src/java/org/apache/cassandra/index/sai/disk/v1/segment/VectorIndexSegmentSearcher.java:157-162 | src/java/org/apache/cassandra/index/sai/disk/v1/segment/VectorIndexSegmentSearcher.java:346-351 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java:208— src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java:208-213 | tools/stress/src/org/apache/cassandra/io/sstable/StressCQLSSTableWriter.java:187-192 — 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 `src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java:208` 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) src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java:243— src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java:243-248 | tools/stress/src/org/apache/cassandra/io/sstable/StressCQLSSTableWriter.java:222-227 — 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 `src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java:243` 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) src/java/org/apache/cassandra/service/accord/serializers/IVersionedWithKeysSerializer.java:213— src/java/org/apache/cassandra/service/accord/serializers/IVersionedWithKeysSerializer.java:213-218 | src/java/org/apache/cassandra/service/accord/serializers/IVersionedWithKeysSerializer.java:223-228 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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 `serialize` to `AbstractKeys<K>` in one and `AbstractRanges` 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) src/java/org/apache/cassandra/service/pager/AbstractQueryPager.java:125— src/java/org/apache/cassandra/service/pager/AbstractQueryPager.java:125-130 | src/java/org/apache/cassandra/service/pager/AbstractQueryPager.java:139-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. 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) src/java/org/apache/cassandra/utils/btree/BTree.java:1281— src/java/org/apache/cassandra/utils/btree/BTree.java:1281-1286 | src/java/org/apache/cassandra/utils/btree/BTree.java:1330-1335 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/utils/btree/BTree.java:1281` 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) src/java/org/apache/cassandra/cql3/functions/FunctionResolver.java:105— src/java/org/apache/cassandra/cql3/functions/FunctionResolver.java:105-110 | src/java/org/apache/cassandra/cql3/functions/FunctionResolver.java:119-124 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/cql3/functions/FunctionResolver.java:105` 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 × 2) src/java/org/apache/cassandra/cql3/statements/schema/DropAggregateStatement.java:105— src/java/org/apache/cassandra/cql3/statements/schema/DropAggregateStatement.java:105-110 | src/java/org/apache/cassandra/cql3/statements/schema/DropFunctionStatement.java:107-112 — before extracting anything, compare `src/java/org/apache/cassandra/cql3/statements/schema/DropAggregateStatement.java` and `src/java/org/apache/cassandra/cql3/statements/schema/DropFunctionStatement.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 2) src/java/org/apache/cassandra/db/ReadCommand.java:1552— src/java/org/apache/cassandra/db/ReadCommand.java:1552-1557 | src/java/org/apache/cassandra/db/ReadCommand.java:1563-1568 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/db/ReadCommand.java:1552` 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 × 2) src/java/org/apache/cassandra/index/sai/plan/Operation.java:127— src/java/org/apache/cassandra/index/sai/plan/Operation.java:127-132 | src/java/org/apache/cassandra/index/sasi/plan/Operation.java:279-284 — 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 `src/java/org/apache/cassandra/index/sai/plan/Operation.java:127` 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 (6 lines × 2) src/java/org/apache/cassandra/cql3/Duration.java:342— src/java/org/apache/cassandra/cql3/Duration.java:342-350 | src/java/org/apache/cassandra/cql3/functions/types/Duration.java:340-345 — before extracting anything, compare `src/java/org/apache/cassandra/cql3/Duration.java` and `src/java/org/apache/cassandra/cql3/functions/types/Duration.java` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 112 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.
Duplicated block (6 lines × 2) src/java/org/apache/cassandra/cql3/Duration.java:405— src/java/org/apache/cassandra/cql3/Duration.java:405-411 | src/java/org/apache/cassandra/cql3/functions/types/Duration.java:295-300 — before extracting anything, compare `src/java/org/apache/cassandra/cql3/Duration.java` and `src/java/org/apache/cassandra/cql3/functions/types/Duration.java` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 112 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.
Duplicated block (6 lines × 2) src/java/org/apache/cassandra/cql3/functions/types/CodecUtils.java:178— src/java/org/apache/cassandra/cql3/functions/types/CodecUtils.java:178-183 | src/java/org/apache/cassandra/utils/ByteBufferUtil.java:872-877 — 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) src/java/org/apache/cassandra/cql3/statements/schema/DropAggregateStatement.java:160— src/java/org/apache/cassandra/cql3/statements/schema/DropAggregateStatement.java:160-165 | src/java/org/apache/cassandra/cql3/statements/schema/DropFunctionStatement.java:178-183 — before extracting anything, compare `src/java/org/apache/cassandra/cql3/statements/schema/DropAggregateStatement.java` and `src/java/org/apache/cassandra/cql3/statements/schema/DropFunctionStatement.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 2) src/java/org/apache/cassandra/db/memtable/ShardedSkipListMemtable.java:190— src/java/org/apache/cassandra/db/memtable/ShardedSkipListMemtable.java:190-195 | src/java/org/apache/cassandra/db/memtable/TrieMemtable.java:265-270 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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) src/java/org/apache/cassandra/db/memtable/ShardedSkipListMemtable.java:199— src/java/org/apache/cassandra/db/memtable/ShardedSkipListMemtable.java:199-204 | src/java/org/apache/cassandra/db/memtable/TrieMemtable.java:274-279 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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) src/java/org/apache/cassandra/index/sai/plan/Expression.java:593— src/java/org/apache/cassandra/index/sai/plan/Expression.java:593-598 | src/java/org/apache/cassandra/index/sasi/plan/Expression.java:418-423 — 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.
+ 22 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (7 corresponding lines) · ×44
Edited copy of a member (7 corresponding lines) src/java/org/apache/cassandra/dht/Range.java:272— src/java/org/apache/cassandra/dht/Range.java:272-278 | src/java/org/apache/cassandra/dht/Range.java:281-289 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) formalise/accord/execution/tla/matrix.py:355— formalise/accord/execution/tla/matrix.py:355-363 | formalise/accord/execution/tla/notify.py:272-278 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) src/java/org/apache/cassandra/db/marshal/DecimalType.java:437— src/java/org/apache/cassandra/db/marshal/DecimalType.java:437-443 | src/java/org/apache/cassandra/db/marshal/DecimalType.java:452-458 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) src/java/org/apache/cassandra/gms/GossipDigestAck.java:94— src/java/org/apache/cassandra/gms/GossipDigestAck.java:94-101 | src/java/org/apache/cassandra/gms/GossipDigestAck2.java:76-82 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) src/java/org/apache/cassandra/index/accord/RangeMemoryIndex.java:206— src/java/org/apache/cassandra/index/accord/RangeMemoryIndex.java:206-212 | src/java/org/apache/cassandra/index/accord/RangeMemoryIndex.java:217-223 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) src/java/org/apache/cassandra/dht/AccordBytesSplitter.java:87— src/java/org/apache/cassandra/dht/AccordBytesSplitter.java:87-93 | src/java/org/apache/cassandra/dht/OrderPreservingPartitioner.java:348-355 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) src/java/org/apache/cassandra/service/accord/serializers/PreacceptSerializers.java:80— src/java/org/apache/cassandra/service/accord/serializers/PreacceptSerializers.java:80-86 | src/java/org/apache/cassandra/service/accord/serializers/RecoverySerializers.java:95-101 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) src/java/org/apache/cassandra/io/sstable/SSTableIdFactory.java:39— src/java/org/apache/cassandra/io/sstable/SSTableIdFactory.java:39-45 | src/java/org/apache/cassandra/io/sstable/SSTableIdFactory.java:58-64 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) src/java/org/apache/cassandra/db/rows/AbstractRow.java:95— src/java/org/apache/cassandra/db/rows/AbstractRow.java:95-104 | src/java/org/apache/cassandra/db/rows/BTreeRow.java:448-454 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) src/java/org/apache/cassandra/service/accord/api/TokenKey.java:108— src/java/org/apache/cassandra/service/accord/api/TokenKey.java:108-114 | src/java/org/apache/cassandra/service/accord/api/TokenKey.java:119-126 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) src/java/org/apache/cassandra/streaming/StreamPlan.java:113— src/java/org/apache/cassandra/streaming/StreamPlan.java:113-121 | src/java/org/apache/cassandra/streaming/StreamSession.java:439-445 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) src/java/org/apache/cassandra/io/util/MmappedRegionsCache.java:50— src/java/org/apache/cassandra/io/util/MmappedRegionsCache.java:50-56 | src/java/org/apache/cassandra/io/util/MmappedRegionsCache.java:67-73 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) src/java/org/apache/cassandra/service/accord/serializers/CommandSerializers.java:716— src/java/org/apache/cassandra/service/accord/serializers/CommandSerializers.java:716-722 | src/java/org/apache/cassandra/service/accord/serializers/CommandSerializers.java:795-802 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) src/java/org/apache/cassandra/tcm/ownership/EndpointDelta.java:148— src/java/org/apache/cassandra/tcm/ownership/EndpointDelta.java:148-154 | src/java/org/apache/cassandra/tcm/ownership/NodeIdDelta.java:144-150 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) src/java/org/apache/cassandra/dht/RandomPartitioner.java:452— src/java/org/apache/cassandra/dht/RandomPartitioner.java:452-458 | src/java/org/apache/cassandra/dht/RandomPartitioner.java:462-468 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) src/java/org/apache/cassandra/cql3/functions/types/CodecRegistry.java:274— src/java/org/apache/cassandra/cql3/functions/types/CodecRegistry.java:274-280 | src/java/org/apache/cassandra/security/SSLFactory.java:446-453 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) src/java/org/apache/cassandra/db/ColumnFamilyStore.java:1094— src/java/org/apache/cassandra/db/ColumnFamilyStore.java:1094-1103 | src/java/org/apache/cassandra/metrics/TableMetrics.java:980-986 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) src/java/org/apache/cassandra/index/internal/composites/CollectionKeyIndexBase.java:58— src/java/org/apache/cassandra/index/internal/composites/CollectionKeyIndexBase.java:58-68 | src/java/org/apache/cassandra/index/internal/composites/PartitionKeyIndex.java:74-80 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) src/java/org/apache/cassandra/service/StorageService.java:4373— src/java/org/apache/cassandra/service/StorageService.java:4373-4381 | src/java/org/apache/cassandra/service/StorageService.java:4385-4391 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) src/java/org/apache/cassandra/db/compaction/CompactionManager.java:2373— src/java/org/apache/cassandra/db/compaction/CompactionManager.java:2373-2379 | src/java/org/apache/cassandra/db/compaction/CompactionManager.java:2383-2389 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) tools/stress/src/org/apache/cassandra/io/sstable/StressCQLSSTableWriter.java:135— tools/stress/src/org/apache/cassandra/io/sstable/StressCQLSSTableWriter.java:135-142 | src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java:157-163 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) src/java/org/apache/cassandra/db/marshal/ListType.java:68— src/java/org/apache/cassandra/db/marshal/ListType.java:68-74 | src/java/org/apache/cassandra/db/marshal/SetType.java:67-73 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) src/java/org/apache/cassandra/schema/SchemaKeyspace.java:332— src/java/org/apache/cassandra/schema/SchemaKeyspace.java:332-339 | src/java/org/apache/cassandra/db/SystemKeyspace.java:597-603 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) src/java/org/apache/cassandra/cql3/statements/BatchStatement.java:690— src/java/org/apache/cassandra/cql3/statements/BatchStatement.java:690-697 | src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java:910-916 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) src/java/org/apache/cassandra/cql3/statements/schema/CommentOnKeyspaceStatement.java:66— src/java/org/apache/cassandra/cql3/statements/schema/CommentOnKeyspaceStatement.java:66-72 | src/java/org/apache/cassandra/cql3/statements/schema/SecurityLabelOnKeyspaceStatement.java:92-102 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
+ 19 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (11 corresponding lines) · ×43
Edited copy of a member (11 corresponding lines) src/java/org/apache/cassandra/tcm/ownership/TokenMap.java:136— src/java/org/apache/cassandra/tcm/ownership/TokenMap.java:136-148 | src/java/org/apache/cassandra/tcm/ownership/UniformRangePlacement.java:321-331 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) src/java/org/apache/cassandra/tcm/transformations/PrepareJoin.java:343— src/java/org/apache/cassandra/tcm/transformations/PrepareJoin.java:343-353 | src/java/org/apache/cassandra/tcm/transformations/PrepareMove.java:278-289 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) src/java/org/apache/cassandra/tcm/sequences/BootstrapAndReplace.java:454— src/java/org/apache/cassandra/tcm/sequences/BootstrapAndReplace.java:454-464 | src/java/org/apache/cassandra/tcm/sequences/BootstrapAndReplace.java:467-477 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) src/java/org/apache/cassandra/index/accord/RangeMemoryIndex.java:94— src/java/org/apache/cassandra/index/accord/RangeMemoryIndex.java:94-104 | src/java/org/apache/cassandra/index/accord/RangeMemoryIndex.java:109-119 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) src/java/org/apache/cassandra/tcm/ownership/DataPlacements.java:253— src/java/org/apache/cassandra/tcm/ownership/DataPlacements.java:253-266 | src/java/org/apache/cassandra/tcm/ownership/DataPlacements.java:282-292 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) src/java/org/apache/cassandra/cql3/Operation.java:295— src/java/org/apache/cassandra/cql3/Operation.java:295-307 | src/java/org/apache/cassandra/cql3/Operation.java:561-571 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) src/java/org/apache/cassandra/io/compress/DeflateCompressor.java:96— src/java/org/apache/cassandra/io/compress/DeflateCompressor.java:96-106 | src/java/org/apache/cassandra/io/compress/DeflateCompressor.java:153-163 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) src/java/org/apache/cassandra/cql3/statements/schema/DropAggregateStatement.java:136— src/java/org/apache/cassandra/cql3/statements/schema/DropAggregateStatement.java:136-146 | src/java/org/apache/cassandra/cql3/statements/schema/DropFunctionStatement.java:154-164 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java:242— src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java:242-252 | tools/stress/src/org/apache/cassandra/io/sstable/StressCQLSSTableWriter.java:221-231 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) src/java/org/apache/cassandra/db/compaction/ShardManagerDiskAware.java:217— src/java/org/apache/cassandra/db/compaction/ShardManagerDiskAware.java:217-227 | src/java/org/apache/cassandra/db/compaction/ShardManagerNoDisks.java:204-217 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) src/java/org/apache/cassandra/tcm/transformations/AlterTopology.java:159— src/java/org/apache/cassandra/tcm/transformations/AlterTopology.java:159-169 | src/java/org/apache/cassandra/tcm/transformations/AlterTopology.java:181-191 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) src/java/org/apache/cassandra/service/accord/serializers/CommandStoreSerializers.java:880— src/java/org/apache/cassandra/service/accord/serializers/CommandStoreSerializers.java:880-890 | src/java/org/apache/cassandra/utils/EstimatedHistogram.java:433-444 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) src/java/org/apache/cassandra/cql3/selection/MapSelector.java:298— src/java/org/apache/cassandra/cql3/selection/MapSelector.java:298-308 | src/java/org/apache/cassandra/cql3/selection/MapSelector.java:312-322 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) src/java/org/apache/cassandra/tcm/transformations/Unregister.java:107— src/java/org/apache/cassandra/tcm/transformations/Unregister.java:107-117 | src/java/org/apache/cassandra/tcm/transformations/Unregister.java:133-145 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) src/java/org/apache/cassandra/db/SystemKeyspace.java:1686— src/java/org/apache/cassandra/db/SystemKeyspace.java:1686-1708 | src/java/org/apache/cassandra/db/SystemKeyspace.java:1714-1724 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) src/java/org/apache/cassandra/utils/GuidGenerator.java:52— src/java/org/apache/cassandra/utils/GuidGenerator.java:52-64 | src/java/org/apache/cassandra/utils/GuidGenerator.java:67-77 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) src/java/org/apache/cassandra/index/sai/disk/v1/SkinnyPrimaryKeyMap.java:156— src/java/org/apache/cassandra/index/sai/disk/v1/SkinnyPrimaryKeyMap.java:156-166 | src/java/org/apache/cassandra/index/sai/disk/v1/WidePrimaryKeyMap.java:148-160 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) src/java/org/apache/cassandra/tools/nodetool/EnableAuditLog.java:75— src/java/org/apache/cassandra/tools/nodetool/EnableAuditLog.java:75-86 | src/java/org/apache/cassandra/tools/nodetool/EnableFullQueryLog.java:54-64 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) src/java/org/apache/cassandra/transport/CBUtil.java:257— src/java/org/apache/cassandra/transport/CBUtil.java:257-267 | src/java/org/apache/cassandra/transport/CBUtil.java:385-395 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) src/java/org/apache/cassandra/db/marshal/MapType.java:307— src/java/org/apache/cassandra/db/marshal/MapType.java:307-317 | src/java/org/apache/cassandra/db/marshal/MapType.java:320-330 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) src/java/org/apache/cassandra/cql3/constraints/LengthConstraint.java:52— src/java/org/apache/cassandra/cql3/constraints/LengthConstraint.java:52-62 | src/java/org/apache/cassandra/cql3/constraints/OctetLengthConstraint.java:46-56 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) src/java/org/apache/cassandra/repair/messages/SyncResponse.java:85— src/java/org/apache/cassandra/repair/messages/SyncResponse.java:85-95 | src/java/org/apache/cassandra/repair/messages/SyncResponse.java:115-127 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) src/java/org/apache/cassandra/auth/FunctionResource.java:338— src/java/org/apache/cassandra/auth/FunctionResource.java:338-351 | src/java/org/apache/cassandra/transport/Event.java:433-443 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) src/java/org/apache/cassandra/cql3/terms/Tuples.java:106— src/java/org/apache/cassandra/cql3/terms/Tuples.java:106-116 | src/java/org/apache/cassandra/cql3/terms/Tuples.java:159-169 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) src/java/org/apache/cassandra/db/DecoratedKey.java:250— src/java/org/apache/cassandra/db/DecoratedKey.java:250-260 | src/java/org/apache/cassandra/db/DecoratedKey.java:265-275 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (7 lines × 2) src/java/org/apache/cassandra/auth/DataResource.java:143— src/java/org/apache/cassandra/auth/DataResource.java:143-149 | src/java/org/apache/cassandra/auth/JMXResource.java:76-82 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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 (7 lines × 2) src/java/org/apache/cassandra/cql3/Operation.java:342— src/java/org/apache/cassandra/cql3/Operation.java:342-348 | src/java/org/apache/cassandra/cql3/Operation.java:403-409 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/cql3/Operation.java:342` 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 (7 lines × 2) src/java/org/apache/cassandra/cql3/functions/types/AbstractAddressableByIndexData.java:63— src/java/org/apache/cassandra/cql3/functions/types/AbstractAddressableByIndexData.java:63-69 | src/java/org/apache/cassandra/cql3/functions/types/AbstractData.java:89-95 — before extracting anything, compare `src/java/org/apache/cassandra/cql3/functions/types/AbstractAddressableByIndexData.java` and `src/java/org/apache/cassandra/cql3/functions/types/AbstractData.java` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 77 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (7 lines × 2) src/java/org/apache/cassandra/cql3/functions/types/AbstractAddressableByIndexData.java:74— src/java/org/apache/cassandra/cql3/functions/types/AbstractAddressableByIndexData.java:74-80 | src/java/org/apache/cassandra/cql3/functions/types/AbstractData.java:110-116 — before extracting anything, compare `src/java/org/apache/cassandra/cql3/functions/types/AbstractAddressableByIndexData.java` and `src/java/org/apache/cassandra/cql3/functions/types/AbstractData.java` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 77 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (7 lines × 2) src/java/org/apache/cassandra/cql3/functions/types/AbstractAddressableByIndexData.java:85— src/java/org/apache/cassandra/cql3/functions/types/AbstractAddressableByIndexData.java:85-91 | src/java/org/apache/cassandra/cql3/functions/types/AbstractData.java:131-137 — before extracting anything, compare `src/java/org/apache/cassandra/cql3/functions/types/AbstractAddressableByIndexData.java` and `src/java/org/apache/cassandra/cql3/functions/types/AbstractData.java` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 77 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (7 lines × 2) src/java/org/apache/cassandra/cql3/functions/types/AbstractAddressableByIndexData.java:96— src/java/org/apache/cassandra/cql3/functions/types/AbstractAddressableByIndexData.java:96-102 | src/java/org/apache/cassandra/cql3/functions/types/AbstractData.java:152-158 — before extracting anything, compare `src/java/org/apache/cassandra/cql3/functions/types/AbstractAddressableByIndexData.java` and `src/java/org/apache/cassandra/cql3/functions/types/AbstractData.java` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 77 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (7 lines × 2) src/java/org/apache/cassandra/cql3/functions/types/AbstractAddressableByIndexData.java:141— src/java/org/apache/cassandra/cql3/functions/types/AbstractAddressableByIndexData.java:141-147 | src/java/org/apache/cassandra/cql3/functions/types/AbstractData.java:247-253 — before extracting anything, compare `src/java/org/apache/cassandra/cql3/functions/types/AbstractAddressableByIndexData.java` and `src/java/org/apache/cassandra/cql3/functions/types/AbstractData.java` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 77 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (7 lines × 2) src/java/org/apache/cassandra/cql3/functions/types/AbstractAddressableByIndexData.java:152— src/java/org/apache/cassandra/cql3/functions/types/AbstractAddressableByIndexData.java:152-158 | src/java/org/apache/cassandra/cql3/functions/types/AbstractData.java:268-274 — before extracting anything, compare `src/java/org/apache/cassandra/cql3/functions/types/AbstractAddressableByIndexData.java` and `src/java/org/apache/cassandra/cql3/functions/types/AbstractData.java` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 77 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (7 lines × 2) src/java/org/apache/cassandra/cql3/selection/ListSelector.java:100— src/java/org/apache/cassandra/cql3/selection/ListSelector.java:100-106 | src/java/org/apache/cassandra/cql3/selection/TupleSelector.java:101-107 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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) src/java/org/apache/cassandra/db/ReadCommand.java:1497— src/java/org/apache/cassandra/db/ReadCommand.java:1497-1503 | src/java/org/apache/cassandra/db/partitions/PartitionUpdate.java:804-810 — 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 `src/java/org/apache/cassandra/db/ReadCommand.java:1497` 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) src/java/org/apache/cassandra/db/ReadCommandVerbHandler.java:203— src/java/org/apache/cassandra/db/ReadCommandVerbHandler.java:203-209 | src/java/org/apache/cassandra/db/ReadCommandVerbHandler.java:232-238 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/db/ReadCommandVerbHandler.java: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.
Duplicated block (7 lines × 2) src/java/org/apache/cassandra/db/SystemKeyspace.java:1743— src/java/org/apache/cassandra/db/SystemKeyspace.java:1743-1749 | src/java/org/apache/cassandra/db/SystemKeyspace.java:1769-1776 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/db/SystemKeyspace.java:1743` 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) src/java/org/apache/cassandra/db/compaction/PendingRepairManager.java:182— src/java/org/apache/cassandra/db/compaction/PendingRepairManager.java:182-188 | src/java/org/apache/cassandra/db/compaction/PendingRepairManager.java:192-198 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/db/compaction/PendingRepairManager.java: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 (7 lines × 2) src/java/org/apache/cassandra/db/virtual/SettingsTable.java:65— src/java/org/apache/cassandra/db/virtual/SettingsTable.java:65-71 | src/java/org/apache/cassandra/db/virtual/SystemPropertiesTable.java:37-43 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7 lines × 2) src/java/org/apache/cassandra/index/SecondaryIndexManager.java:603— src/java/org/apache/cassandra/index/SecondaryIndexManager.java:603-609 | src/java/org/apache/cassandra/index/SecondaryIndexManager.java:674-680 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/index/SecondaryIndexManager.java:603` 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 (7 lines × 2) src/java/org/apache/cassandra/index/SecondaryIndexManager.java:611— src/java/org/apache/cassandra/index/SecondaryIndexManager.java:611-617 | src/java/org/apache/cassandra/index/SecondaryIndexManager.java:685-691 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/index/SecondaryIndexManager.java:611` 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 (7 lines × 2) src/java/org/apache/cassandra/index/sai/virtual/SSTableIndexesSystemView.java:62— src/java/org/apache/cassandra/index/sai/virtual/SSTableIndexesSystemView.java:62-68 | src/java/org/apache/cassandra/index/sai/virtual/SegmentsSystemView.java:62-68 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/index/sai/virtual/SSTableIndexesSystemView.java: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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/java/org/apache/cassandra/index/sai/virtual/SegmentsSystemView.java:69` calls `addClusteringColumn` and `src/java/org/apache/cassandra/index/sai/virtual/SSTableIndexesSystemView.java:69` 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) src/java/org/apache/cassandra/io/util/PathUtils.java:872— src/java/org/apache/cassandra/io/util/PathUtils.java:872-878 | src/java/org/apache/cassandra/io/util/PathUtils.java:901-907 — both copies are in the same file, so extract the 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 `ioe` to `IOException` in one and `E` 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 (7 lines × 2) src/java/org/apache/cassandra/tcm/transformations/cms/PrepareCMSReconfiguration.java:420— src/java/org/apache/cassandra/tcm/transformations/cms/PrepareCMSReconfiguration.java:420-426 | src/java/org/apache/cassandra/tcm/transformations/cms/PrepareCMSReconfiguration.java:428-434 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) src/java/org/apache/cassandra/tools/NodeProbe.java:2386— src/java/org/apache/cassandra/tools/NodeProbe.java:2386-2392 | src/java/org/apache/cassandra/tools/NodeProbe.java:2397-2403 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/tools/NodeProbe.java:2386` 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 `metric` to `CassandraMetricsRegistry.JmxHistogramMBean` in one and `CassandraMetricsRegistry.JmxTimerMBean` 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 (7 lines × 2) src/java/org/apache/cassandra/tools/SSTableExpiredBlockers.java:161— src/java/org/apache/cassandra/tools/SSTableExpiredBlockers.java:161-167 | src/java/org/apache/cassandra/tools/SSTableOfflineRelevel.java:114-120 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/tools/SSTableExpiredBlockers.java:161` 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) src/java/org/apache/cassandra/tools/StandaloneUpgrader.java:87— src/java/org/apache/cassandra/tools/StandaloneUpgrader.java:87-93 | src/java/org/apache/cassandra/tools/StandaloneVerifier.java:104-110 — before extracting anything, compare `src/java/org/apache/cassandra/tools/StandaloneUpgrader.java` and `src/java/org/apache/cassandra/tools/StandaloneVerifier.java` as WHOLE FILES: this scan already matched 4 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 `src/java/org/apache/cassandra/tools/StandaloneUpgrader.java:87` 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) src/java/org/apache/cassandra/cql3/functions/types/CodecRegistry.java:754— src/java/org/apache/cassandra/cql3/functions/types/CodecRegistry.java:754-760 | src/java/org/apache/cassandra/cql3/functions/types/CodecRegistry.java:767-773 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) src/java/org/apache/cassandra/index/accord/SSTableIndex.java:89— src/java/org/apache/cassandra/index/accord/SSTableIndex.java:89-95 | src/java/org/apache/cassandra/index/accord/SSTableIndex.java:122-128 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/index/accord/SSTableIndex.java:89` 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) src/java/org/apache/cassandra/io/tries/TrieNode.java:773— src/java/org/apache/cassandra/io/tries/TrieNode.java:773-779 | src/java/org/apache/cassandra/io/tries/TrieNode.java:831-837 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
+ 17 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (12 corresponding lines) · ×39
Edited copy of a member (12 corresponding lines) src/java/org/apache/cassandra/io/util/ChecksumedDataInputPlus.java:86— src/java/org/apache/cassandra/io/util/ChecksumedDataInputPlus.java:86-98 | src/java/org/apache/cassandra/io/util/ChecksumedDataOutputPlus.java:92-103 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src/java/org/apache/cassandra/index/accord/IndexMetrics.java:74— src/java/org/apache/cassandra/index/accord/IndexMetrics.java:74-85 | src/java/org/apache/cassandra/index/sai/metrics/AbstractMetrics.java:79-90 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src/java/org/apache/cassandra/db/virtual/AccordDebugKeyspace.java:2261— src/java/org/apache/cassandra/db/virtual/AccordDebugKeyspace.java:2261-2272 | src/java/org/apache/cassandra/db/virtual/AccordDebugKeyspace.java:2298-2310 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src/java/org/apache/cassandra/db/virtual/InternodeInboundTable.java:91— src/java/org/apache/cassandra/db/virtual/InternodeInboundTable.java:91-102 | src/java/org/apache/cassandra/db/virtual/InternodeOutboundTable.java:91-102 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src/java/org/apache/cassandra/repair/state/CoordinatorState.java:140— src/java/org/apache/cassandra/repair/state/CoordinatorState.java:140-151 | src/java/org/apache/cassandra/repair/state/SessionState.java:78-89 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src/java/org/apache/cassandra/db/marshal/UserType.java:533— src/java/org/apache/cassandra/db/marshal/UserType.java:533-544 | src/java/org/apache/cassandra/db/marshal/UserType.java:547-558 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src/java/org/apache/cassandra/locator/EndpointsByReplica.java:79— src/java/org/apache/cassandra/locator/EndpointsByReplica.java:79-90 | src/java/org/apache/cassandra/locator/EndpointsByReplica.java:113-125 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src/java/org/apache/cassandra/schema/CompressionParams.java:526— src/java/org/apache/cassandra/schema/CompressionParams.java:526-537 | src/java/org/apache/cassandra/schema/CompressionParams.java:567-579 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src/java/org/apache/cassandra/tcm/sequences/InProgressSequences.java:148— src/java/org/apache/cassandra/tcm/sequences/InProgressSequences.java:148-159 | src/java/org/apache/cassandra/tcm/sequences/InProgressSequences.java:162-175 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src/java/org/apache/cassandra/service/accord/txn/TxnReferenceOperations.java:92— src/java/org/apache/cassandra/service/accord/txn/TxnReferenceOperations.java:92-103 | src/java/org/apache/cassandra/service/accord/txn/TxnReferenceOperations.java:122-133 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src/java/org/apache/cassandra/service/accord/topology/AccordNodeInfoCoordinator.java:115— src/java/org/apache/cassandra/service/accord/topology/AccordNodeInfoCoordinator.java:115-130 | src/java/org/apache/cassandra/service/accord/topology/AccordNodeInfoCoordinator.java:133-144 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src/java/org/apache/cassandra/gms/EndpointState.java:368— src/java/org/apache/cassandra/gms/EndpointState.java:368-382 | src/java/org/apache/cassandra/gms/EndpointState.java:401-412 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java:207— src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java:207-218 | tools/stress/src/org/apache/cassandra/io/sstable/StressCQLSSTableWriter.java:186-197 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src/java/org/apache/cassandra/gms/GossipDigestAck.java:78— src/java/org/apache/cassandra/gms/GossipDigestAck.java:78-90 | src/java/org/apache/cassandra/gms/GossipDigestAck2.java:62-73 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src/java/org/apache/cassandra/tcm/ownership/MovementMap.java:143— src/java/org/apache/cassandra/tcm/ownership/MovementMap.java:143-154 | src/java/org/apache/cassandra/tcm/ownership/PlacementDeltas.java:257-268 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src/java/org/apache/cassandra/transport/Server.java:543— src/java/org/apache/cassandra/transport/Server.java:543-554 | src/java/org/apache/cassandra/transport/Server.java:557-568 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src/java/org/apache/cassandra/cql3/constraints/ConstraintResolver.java:86— src/java/org/apache/cassandra/cql3/constraints/ConstraintResolver.java:86-97 | src/java/org/apache/cassandra/cql3/constraints/ConstraintResolver.java:110-121 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:1324— src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:1324-1335 | src/java/org/apache/cassandra/serializers/DecimalSerializer.java:43-56 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src/java/org/apache/cassandra/hints/CompressedChecksummedDataInput.java:90— src/java/org/apache/cassandra/hints/CompressedChecksummedDataInput.java:90-101 | src/java/org/apache/cassandra/hints/EncryptedChecksummedDataInput.java:102-113 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src/java/org/apache/cassandra/cql3/constraints/ConstraintResolver.java:124— src/java/org/apache/cassandra/cql3/constraints/ConstraintResolver.java:124-135 | src/java/org/apache/cassandra/cql3/constraints/ConstraintResolver.java:138-149 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src/java/org/apache/cassandra/db/marshal/MapType.java:473— src/java/org/apache/cassandra/db/marshal/MapType.java:473-484 | src/java/org/apache/cassandra/db/marshal/UserType.java:625-638 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src/java/org/apache/cassandra/io/sstable/SSTable.java:340— src/java/org/apache/cassandra/io/sstable/SSTable.java:340-351 | src/java/org/apache/cassandra/io/sstable/SSTable.java:359-370 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src/java/org/apache/cassandra/db/filter/DataLimits.java:736— src/java/org/apache/cassandra/db/filter/DataLimits.java:736-747 | src/java/org/apache/cassandra/db/filter/DataLimits.java:1005-1018 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src/java/org/apache/cassandra/db/guardrails/Guardrails.java:1993— src/java/org/apache/cassandra/db/guardrails/Guardrails.java:1993-2004 | src/java/org/apache/cassandra/db/guardrails/Guardrails.java:2008-2019 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src/java/org/apache/cassandra/schema/SchemaKeyspace.java:1004— src/java/org/apache/cassandra/schema/SchemaKeyspace.java:1004-1015 | src/java/org/apache/cassandra/schema/SchemaKeyspace.java:1497-1508 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (8 lines × 2) src/java/org/apache/cassandra/concurrent/ScheduledThreadPoolExecutorPlus.java:217— src/java/org/apache/cassandra/concurrent/ScheduledThreadPoolExecutorPlus.java:217-224 | src/java/org/apache/cassandra/concurrent/ThreadPoolExecutorBase.java:134-141 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 (8 lines × 2) src/java/org/apache/cassandra/cql3/CQL3Type.java:288— src/java/org/apache/cassandra/cql3/CQL3Type.java:288-295 | src/java/org/apache/cassandra/cql3/CQL3Type.java:305-312 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/cql3/CQL3Type.java:288` 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) src/java/org/apache/cassandra/cql3/ResultSet.java:510— src/java/org/apache/cassandra/cql3/ResultSet.java:510-517 | src/java/org/apache/cassandra/cql3/ResultSet.java:702-709 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/cql3/ResultSet.java:510` 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) src/java/org/apache/cassandra/cql3/constraints/LengthConstraint.java:55— src/java/org/apache/cassandra/cql3/constraints/LengthConstraint.java:55-62 | src/java/org/apache/cassandra/cql3/constraints/OctetLengthConstraint.java:49-56 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/cql3/constraints/LengthConstraint.java:55` 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) src/java/org/apache/cassandra/cql3/terms/Lists.java:177— src/java/org/apache/cassandra/cql3/terms/Lists.java:177-184 | src/java/org/apache/cassandra/cql3/terms/Sets.java:169-176 — before extracting anything, compare `src/java/org/apache/cassandra/cql3/terms/Lists.java` and `src/java/org/apache/cassandra/cql3/terms/Sets.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `src/java/org/apache/cassandra/cql3/terms/Lists.java:177` 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 × 2) src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java:107— src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java:107-114 | src/java/org/apache/cassandra/db/compaction/TimeWindowCompactionStrategy.java:165-172 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (8 lines × 2) src/java/org/apache/cassandra/db/marshal/TimestampUtf8Type.java:61— src/java/org/apache/cassandra/db/marshal/TimestampUtf8Type.java:61-68 | src/java/org/apache/cassandra/db/marshal/TxnIdUtf8Type.java:61-68 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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) src/java/org/apache/cassandra/db/rows/NativeCell.java:54— src/java/org/apache/cassandra/db/rows/NativeCell.java:54-61 | src/java/org/apache/cassandra/db/rows/NativeCell.java:132-139 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) src/java/org/apache/cassandra/db/tries/InMemoryReadTrie.java:705— src/java/org/apache/cassandra/db/tries/InMemoryReadTrie.java:705-712 | src/java/org/apache/cassandra/db/tries/InMemoryReadTrie.java:716-723 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/db/tries/InMemoryReadTrie.java:705` 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) src/java/org/apache/cassandra/db/view/TableViews.java:252— src/java/org/apache/cassandra/db/view/TableViews.java:252-259 | src/java/org/apache/cassandra/db/view/TableViews.java:265-272 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) src/java/org/apache/cassandra/dht/ByteOrderedPartitioner.java:450— src/java/org/apache/cassandra/dht/ByteOrderedPartitioner.java:450-457 | src/java/org/apache/cassandra/dht/OrderPreservingPartitioner.java:308-315 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 `src/java/org/apache/cassandra/dht/ByteOrderedPartitioner.java:450` 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 × 2) src/java/org/apache/cassandra/gms/GossipDigestAck.java:67— src/java/org/apache/cassandra/gms/GossipDigestAck.java:67-74 | src/java/org/apache/cassandra/gms/GossipDigestAck2.java:52-59 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/gms/GossipDigestAck.java:67` 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) src/java/org/apache/cassandra/index/internal/CassandraIndexFunctions.java:169— src/java/org/apache/cassandra/index/internal/CassandraIndexFunctions.java:169-176 | src/java/org/apache/cassandra/index/internal/CassandraIndexFunctions.java:219-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 `src/java/org/apache/cassandra/index/internal/CassandraIndexFunctions.java:169` 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) src/java/org/apache/cassandra/net/FrameEncoderCrc.java:77— src/java/org/apache/cassandra/net/FrameEncoderCrc.java:77-84 | src/java/org/apache/cassandra/net/FrameEncoderLZ4.java:93-100 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) src/java/org/apache/cassandra/repair/RepairMessageVerbHandler.java:174— src/java/org/apache/cassandra/repair/RepairMessageVerbHandler.java:174-181 | src/java/org/apache/cassandra/repair/RepairMessageVerbHandler.java:224-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. 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) src/java/org/apache/cassandra/repair/consistent/CoordinatorSessions.java:73— src/java/org/apache/cassandra/repair/consistent/CoordinatorSessions.java:73-80 | src/java/org/apache/cassandra/repair/consistent/LocalSessions.java:719-726 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) src/java/org/apache/cassandra/repair/messages/RepairOption.java:243— src/java/org/apache/cassandra/repair/messages/RepairOption.java:243-250 | src/java/org/apache/cassandra/repair/messages/RepairOption.java:256-263 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/repair/messages/RepairOption.java:243` 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) src/java/org/apache/cassandra/schema/ReplicationParams.java:273— src/java/org/apache/cassandra/schema/ReplicationParams.java:273-280 | src/java/org/apache/cassandra/schema/ReplicationParams.java:309-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. 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) src/java/org/apache/cassandra/serializers/AbstractMapSerializer.java:119— src/java/org/apache/cassandra/serializers/AbstractMapSerializer.java:119-126 | src/java/org/apache/cassandra/serializers/MapSerializer.java:162-169 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 `src/java/org/apache/cassandra/serializers/AbstractMapSerializer.java:119` 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) src/java/org/apache/cassandra/serializers/CollectionSerializer.java:288— src/java/org/apache/cassandra/serializers/CollectionSerializer.java:288-295 | src/java/org/apache/cassandra/serializers/SetSerializer.java:160-167 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 `src/java/org/apache/cassandra/serializers/CollectionSerializer.java:288` 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) src/java/org/apache/cassandra/service/accord/serializers/FetchSerializers.java:92— src/java/org/apache/cassandra/service/accord/serializers/FetchSerializers.java:92-99 | src/java/org/apache/cassandra/service/accord/serializers/ReadDataSerializer.java:321-328 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 (8 lines × 2) src/java/org/apache/cassandra/tools/AuditLogViewer.java:251— src/java/org/apache/cassandra/tools/AuditLogViewer.java:251-258 | src/java/org/apache/cassandra/tools/StandaloneSSTableUtil.java:237-244 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `options` to `Options` in one and `CmdLineOptions` 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 (8 lines × 2) src/java/org/apache/cassandra/tools/StandaloneUpgrader.java:99— src/java/org/apache/cassandra/tools/StandaloneUpgrader.java:99-106 | src/java/org/apache/cassandra/tools/StandaloneVerifier.java:111-118 — before extracting anything, compare `src/java/org/apache/cassandra/tools/StandaloneUpgrader.java` and `src/java/org/apache/cassandra/tools/StandaloneVerifier.java` as WHOLE FILES: this scan already matched 4 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 `src/java/org/apache/cassandra/tools/StandaloneUpgrader.java:99` 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) src/java/org/apache/cassandra/tools/nodetool/RepairAdmin.java:219— src/java/org/apache/cassandra/tools/nodetool/RepairAdmin.java:219-226 | src/java/org/apache/cassandra/tools/nodetool/RepairAdmin.java:285-292 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/tools/nodetool/RepairAdmin.java:219` 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, `src/java/org/apache/cassandra/tools/nodetool/RepairAdmin.java:228` calls `add` and `src/java/org/apache/cassandra/tools/nodetool/RepairAdmin.java:293` 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) src/java/org/apache/cassandra/service/accord/serializers/Version.java:103— src/java/org/apache/cassandra/service/accord/serializers/Version.java:103-110 | src/java/org/apache/cassandra/tcm/serialization/Version.java:166-173 — 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.
+ 11 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (14 corresponding lines) · ×35
Edited copy of a member (14 corresponding lines) src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java:349— src/java/org/apache/cassandra/metrics/KeyspaceMetrics.java:349-363 | src/java/org/apache/cassandra/metrics/TableMetrics.java:1014-1027 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) src/java/org/apache/cassandra/tcm/membership/Directory.java:941— src/java/org/apache/cassandra/tcm/membership/Directory.java:941-954 | src/java/org/apache/cassandra/tcm/ownership/DataPlacements.java:313-329 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) src/java/org/apache/cassandra/db/compaction/CompactionStrategyHolder.java:171— src/java/org/apache/cassandra/db/compaction/CompactionStrategyHolder.java:171-184 | src/java/org/apache/cassandra/db/compaction/PendingRepairHolder.java:214-227 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) src/java/org/apache/cassandra/tcm/sequences/BootstrapAndJoin.java:536— src/java/org/apache/cassandra/tcm/sequences/BootstrapAndJoin.java:536-549 | src/java/org/apache/cassandra/tcm/sequences/Move.java:644-660 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) src/java/org/apache/cassandra/db/lifecycle/View.java:305— src/java/org/apache/cassandra/db/lifecycle/View.java:305-320 | src/java/org/apache/cassandra/db/lifecycle/View.java:324-337 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) src/java/org/apache/cassandra/auth/CassandraRoleManager.java:410— src/java/org/apache/cassandra/auth/CassandraRoleManager.java:410-427 | src/java/org/apache/cassandra/auth/CassandraRoleManager.java:431-444 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) src/java/org/apache/cassandra/transport/CBUtil.java:645— src/java/org/apache/cassandra/transport/CBUtil.java:645-658 | src/java/org/apache/cassandra/transport/CBUtil.java:661-674 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) src/java/org/apache/cassandra/dht/Range.java:606— src/java/org/apache/cassandra/dht/Range.java:606-623 | src/java/org/apache/cassandra/dht/Range.java:680-693 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) src/java/org/apache/cassandra/tcm/ownership/NodeIdDelta.java:192— src/java/org/apache/cassandra/tcm/ownership/NodeIdDelta.java:192-205 | src/java/org/apache/cassandra/tcm/ownership/NodeIdDelta.java:226-240 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) src/java/org/apache/cassandra/cql3/UntypedResultSet.java:182— src/java/org/apache/cassandra/cql3/UntypedResultSet.java:182-196 | src/java/org/apache/cassandra/cql3/UntypedResultSet.java:248-261 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) src/java/org/apache/cassandra/service/accord/txn/TxnDataRangeValue.java:171— src/java/org/apache/cassandra/service/accord/txn/TxnDataRangeValue.java:171-185 | src/java/org/apache/cassandra/service/accord/txn/TxnDataRangeValue.java:208-221 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) src/java/org/apache/cassandra/db/rows/RowIterators.java:38— src/java/org/apache/cassandra/db/rows/RowIterators.java:38-51 | src/java/org/apache/cassandra/db/rows/UnfilteredRowIterators.java:192-216 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) src/java/org/apache/cassandra/cql3/functions/JavaBasedUDFunction.java:627— src/java/org/apache/cassandra/cql3/functions/JavaBasedUDFunction.java:627-640 | src/java/org/apache/cassandra/cql3/functions/JavaBasedUDFunction.java:686-704 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) src/java/org/apache/cassandra/db/marshal/DoubleType.java:98— src/java/org/apache/cassandra/db/marshal/DoubleType.java:98-111 | src/java/org/apache/cassandra/db/marshal/FloatType.java:99-112 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) src/java/org/apache/cassandra/tcm/transformations/AccordChangeDownStatus.java:60— src/java/org/apache/cassandra/tcm/transformations/AccordChangeDownStatus.java:60-73 | src/java/org/apache/cassandra/tcm/transformations/AccordChangeNodeInfo.java:64-77 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) src/java/org/apache/cassandra/cql3/statements/TransactionStatement.java:504— src/java/org/apache/cassandra/cql3/statements/TransactionStatement.java:504-517 | src/java/org/apache/cassandra/cql3/statements/TransactionStatement.java:540-556 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) src/java/org/apache/cassandra/db/filter/RowFilter.java:620— src/java/org/apache/cassandra/db/filter/RowFilter.java:620-633 | src/java/org/apache/cassandra/db/filter/RowFilter.java:961-974 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) src/java/org/apache/cassandra/journal/Journal.java:541— src/java/org/apache/cassandra/journal/Journal.java:541-554 | src/java/org/apache/cassandra/journal/Journal.java:571-584 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java:911— src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java:911-924 | tools/stress/src/org/apache/cassandra/io/sstable/StressCQLSSTableWriter.java:693-707 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) src/java/org/apache/cassandra/cql3/selection/MapSelector.java:94— src/java/org/apache/cassandra/cql3/selection/MapSelector.java:94-108 | src/java/org/apache/cassandra/cql3/selection/UserTypeSelector.java:96-109 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) src/java/org/apache/cassandra/index/sasi/disk/DynamicTokenTreeBuilder.java:84— src/java/org/apache/cassandra/index/sasi/disk/DynamicTokenTreeBuilder.java:84-97 | src/java/org/apache/cassandra/index/sasi/disk/StaticTokenTreeBuilder.java:86-99 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) src/java/org/apache/cassandra/net/ForwardingInfo.java:67— src/java/org/apache/cassandra/net/ForwardingInfo.java:67-80 | src/java/org/apache/cassandra/net/ForwardingInfo.java:83-98 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) src/java/org/apache/cassandra/db/virtual/ExceptionsTable.java:112— src/java/org/apache/cassandra/db/virtual/ExceptionsTable.java:112-125 | src/java/org/apache/cassandra/db/virtual/ExceptionsTable.java:129-145 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) src/java/org/apache/cassandra/index/sai/plan/QueryController.java:187— src/java/org/apache/cassandra/index/sai/plan/QueryController.java:187-200 | src/java/org/apache/cassandra/index/sai/plan/QueryController.java:228-241 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) src/java/org/apache/cassandra/service/accord/txn/TxnReference.java:216— src/java/org/apache/cassandra/service/accord/txn/TxnReference.java:216-229 | src/java/org/apache/cassandra/service/accord/txn/TxnReference.java:242-256 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
+ 10 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (16 corresponding lines) · ×33
Edited copy of a member (16 corresponding lines) src/java/org/apache/cassandra/cql3/functions/UDAggregate.java:400— src/java/org/apache/cassandra/cql3/functions/UDAggregate.java:400-415 | src/java/org/apache/cassandra/cql3/functions/UDAggregate.java:441-458 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) src/java/org/apache/cassandra/cql3/functions/UDFunction.java:749— src/java/org/apache/cassandra/cql3/functions/UDFunction.java:749-764 | src/java/org/apache/cassandra/cql3/functions/UDFunction.java:789-805 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) src/java/org/apache/cassandra/index/accord/SSTableIndex.java:88— src/java/org/apache/cassandra/index/accord/SSTableIndex.java:88-103 | src/java/org/apache/cassandra/index/accord/SSTableIndex.java:121-139 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) src/java/org/apache/cassandra/schema/UserFunctions.java:381— src/java/org/apache/cassandra/schema/UserFunctions.java:381-396 | src/java/org/apache/cassandra/schema/UserFunctions.java:415-432 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) src/java/org/apache/cassandra/service/accord/journal/TopologyRecord.java:234— src/java/org/apache/cassandra/service/accord/journal/TopologyRecord.java:234-249 | src/java/org/apache/cassandra/service/accord/journal/TopologyRecord.java:285-302 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) src/java/org/apache/cassandra/tcm/sequences/LockedRanges.java:223— src/java/org/apache/cassandra/tcm/sequences/LockedRanges.java:223-238 | src/java/org/apache/cassandra/tcm/sequences/LockedRanges.java:261-277 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) src/java/org/apache/cassandra/tcm/sequences/BootstrapAndJoin.java:568— src/java/org/apache/cassandra/tcm/sequences/BootstrapAndJoin.java:568-583 | src/java/org/apache/cassandra/tcm/sequences/Move.java:685-703 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) src/java/org/apache/cassandra/tcm/sequences/BootstrapAndJoin.java:430— src/java/org/apache/cassandra/tcm/sequences/BootstrapAndJoin.java:430-447 | src/java/org/apache/cassandra/tcm/sequences/BootstrapAndReplace.java:357-372 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) src/java/org/apache/cassandra/cql3/statements/ListRolesStatement.java:131— src/java/org/apache/cassandra/cql3/statements/ListRolesStatement.java:131-146 | src/java/org/apache/cassandra/cql3/statements/ListUsersStatement.java:53-69 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) src/java/org/apache/cassandra/locator/RangesByEndpoint.java:117— src/java/org/apache/cassandra/locator/RangesByEndpoint.java:117-132 | src/java/org/apache/cassandra/tcm/ownership/NodeIdDelta.java:208-223 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) src/java/org/apache/cassandra/cql3/functions/FormatFcts.java:289— src/java/org/apache/cassandra/cql3/functions/FormatFcts.java:289-304 | src/java/org/apache/cassandra/cql3/functions/FormatFcts.java:430-445 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) src/java/org/apache/cassandra/index/accord/RouteJournalIndex.java:482— src/java/org/apache/cassandra/index/accord/RouteJournalIndex.java:482-497 | src/java/org/apache/cassandra/index/accord/RouteJournalIndex.java:527-542 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) pylib/cqlshlib/cql3handling.py:499— pylib/cqlshlib/cql3handling.py:499-514 | pylib/cqlshlib/cql3handling.py:528-544 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) src/java/org/apache/cassandra/io/util/CompressedFrameDataOutputPlus.java:107— src/java/org/apache/cassandra/io/util/CompressedFrameDataOutputPlus.java:107-122 | src/java/org/apache/cassandra/io/util/CompressedFrameDataOutputPlus.java:125-140 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) src/java/org/apache/cassandra/service/pager/PagingState.java:218— src/java/org/apache/cassandra/service/pager/PagingState.java:218-233 | src/java/org/apache/cassandra/service/pager/PagingState.java:302-321 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:3130— src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:3130-3145 | src/java/org/apache/cassandra/serializers/DurationSerializer.java:35-59 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) src/java/org/apache/cassandra/db/lifecycle/LogReplica.java:60— src/java/org/apache/cassandra/db/lifecycle/LogReplica.java:60-75 | src/java/org/apache/cassandra/db/lifecycle/LogReplica.java:78-93 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) src/java/org/apache/cassandra/streaming/SessionSummary.java:85— src/java/org/apache/cassandra/streaming/SessionSummary.java:85-100 | src/java/org/apache/cassandra/streaming/SessionSummary.java:125-141 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) src/java/org/apache/cassandra/utils/streamhist/TombstoneHistogram.java:95— src/java/org/apache/cassandra/utils/streamhist/TombstoneHistogram.java:95-110 | src/java/org/apache/cassandra/utils/streamhist/TombstoneHistogram.java:161-176 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) src/java/org/apache/cassandra/db/marshal/VectorType.java:539— src/java/org/apache/cassandra/db/marshal/VectorType.java:539-557 | src/java/org/apache/cassandra/db/marshal/VectorType.java:679-694 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) src/java/org/apache/cassandra/io/tries/IncrementalDeepTrieWriterPageAware.java:138— src/java/org/apache/cassandra/io/tries/IncrementalDeepTrieWriterPageAware.java:138-158 | src/java/org/apache/cassandra/io/tries/IncrementalTrieWriterPageAware.java:249-264 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) src/java/org/apache/cassandra/utils/btree/BTree.java:704— src/java/org/apache/cassandra/utils/btree/BTree.java:704-719 | src/java/org/apache/cassandra/utils/btree/BTree.java:760-779 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) src/java/org/apache/cassandra/db/partitions/PartitionIterators.java:61— src/java/org/apache/cassandra/db/partitions/PartitionIterators.java:61-77 | src/java/org/apache/cassandra/db/partitions/UnfilteredPartitionIterators.java:111-126 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) src/java/org/apache/cassandra/schema/SchemaTransformation.java:155— src/java/org/apache/cassandra/schema/SchemaTransformation.java:155-170 | src/java/org/apache/cassandra/schema/SchemaTransformation.java:197-212 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) src/java/org/apache/cassandra/db/transform/DuplicateRowChecker.java:116— src/java/org/apache/cassandra/db/transform/DuplicateRowChecker.java:116-132 | src/java/org/apache/cassandra/db/transform/DuplicateRowChecker.java:135-150 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
+ 8 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (13 corresponding lines) · ×33
Edited copy of a member (13 corresponding lines) src/java/org/apache/cassandra/utils/btree/BTreeRemoval.java:154— src/java/org/apache/cassandra/utils/btree/BTreeRemoval.java:154-168 | src/java/org/apache/cassandra/utils/btree/BTreeRemoval.java:171-183 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) src/java/org/apache/cassandra/repair/RepairJob.java:275— src/java/org/apache/cassandra/repair/RepairJob.java:275-287 | src/java/org/apache/cassandra/repair/RepairJob.java:294-308 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) src/java/org/apache/cassandra/index/accord/SSTableIndex.java:106— src/java/org/apache/cassandra/index/accord/SSTableIndex.java:106-118 | src/java/org/apache/cassandra/index/accord/SSTableIndex.java:142-154 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) src/java/org/apache/cassandra/service/accord/serializers/TopologySerializers.java:149— src/java/org/apache/cassandra/service/accord/serializers/TopologySerializers.java:149-161 | src/java/org/apache/cassandra/service/accord/serializers/TopologySerializers.java:164-177 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) src/java/org/apache/cassandra/cql3/statements/schema/CreateAggregateStatement.java:250— src/java/org/apache/cassandra/cql3/statements/schema/CreateAggregateStatement.java:250-262 | src/java/org/apache/cassandra/cql3/statements/schema/CreateFunctionStatement.java:170-182 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) src/java/org/apache/cassandra/db/compaction/CompactionStrategyManager.java:890— src/java/org/apache/cassandra/db/compaction/CompactionStrategyManager.java:890-902 | src/java/org/apache/cassandra/db/compaction/CompactionStrategyManager.java:905-917 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) src/java/org/apache/cassandra/cql3/statements/schema/CommentOnColumnStatement.java:76— src/java/org/apache/cassandra/cql3/statements/schema/CommentOnColumnStatement.java:76-88 | src/java/org/apache/cassandra/cql3/statements/schema/SecurityLabelOnColumnStatement.java:100-115 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) src/java/org/apache/cassandra/db/marshal/TimestampUtf8Type.java:60— src/java/org/apache/cassandra/db/marshal/TimestampUtf8Type.java:60-72 | src/java/org/apache/cassandra/db/marshal/TxnIdUtf8Type.java:60-72 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) src/java/org/apache/cassandra/index/internal/CassandraIndexFunctions.java:168— src/java/org/apache/cassandra/index/internal/CassandraIndexFunctions.java:168-180 | src/java/org/apache/cassandra/index/internal/CassandraIndexFunctions.java:218-230 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) src/java/org/apache/cassandra/cql3/Duration.java:200— src/java/org/apache/cassandra/cql3/Duration.java:200-212 | src/java/org/apache/cassandra/cql3/functions/types/Duration.java:183-197 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) src/java/org/apache/cassandra/schema/SchemaKeyspace.java:1044— src/java/org/apache/cassandra/schema/SchemaKeyspace.java:1044-1056 | tools/sstableloader/src/org/apache/cassandra/utils/NativeSSTableLoaderClient.java:166-178 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) src/java/org/apache/cassandra/dht/ByteOrderedPartitioner.java:267— src/java/org/apache/cassandra/dht/ByteOrderedPartitioner.java:267-282 | src/java/org/apache/cassandra/dht/OrderPreservingPartitioner.java:125-137 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) src/java/org/apache/cassandra/config/YamlConfigurationLoader.java:172— src/java/org/apache/cassandra/config/YamlConfigurationLoader.java:172-184 | src/java/org/apache/cassandra/config/YamlConfigurationLoader.java:337-352 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) src/java/org/apache/cassandra/cql3/terms/Lists.java:187— src/java/org/apache/cassandra/cql3/terms/Lists.java:187-199 | src/java/org/apache/cassandra/cql3/terms/Sets.java:179-198 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) src/java/org/apache/cassandra/repair/LocalSyncTask.java:83— src/java/org/apache/cassandra/repair/LocalSyncTask.java:83-105 | src/java/org/apache/cassandra/repair/StreamingRepairTask.java:94-106 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) src/java/org/apache/cassandra/transport/messages/ResultMessage.java:235— src/java/org/apache/cassandra/transport/messages/ResultMessage.java:235-247 | src/java/org/apache/cassandra/transport/messages/ResultMessage.java:250-263 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) src/java/org/apache/cassandra/auth/CIDRPermissionsManager.java:88— src/java/org/apache/cassandra/auth/CIDRPermissionsManager.java:88-100 | src/java/org/apache/cassandra/auth/CassandraNetworkAuthorizer.java:77-89 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) src/java/org/apache/cassandra/tcm/ownership/EndpointDelta.java:65— src/java/org/apache/cassandra/tcm/ownership/EndpointDelta.java:65-77 | src/java/org/apache/cassandra/tcm/ownership/NodeIdDelta.java:70-82 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) src/java/org/apache/cassandra/tools/nodetool/Status.java:376— src/java/org/apache/cassandra/tools/nodetool/Status.java:376-388 | src/java/org/apache/cassandra/tools/nodetool/Status.java:438-450 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) src/java/org/apache/cassandra/io/util/PathUtils.java:871— src/java/org/apache/cassandra/io/util/PathUtils.java:871-883 | src/java/org/apache/cassandra/io/util/PathUtils.java:900-912 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) src/java/org/apache/cassandra/service/accord/serializers/KeySerializers.java:409— src/java/org/apache/cassandra/service/accord/serializers/KeySerializers.java:409-421 | src/java/org/apache/cassandra/service/accord/serializers/KeySerializers.java:453-465 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) src/java/org/apache/cassandra/utils/EstimatedHistogram.java:415— src/java/org/apache/cassandra/utils/EstimatedHistogram.java:415-430 | src/java/org/apache/cassandra/utils/EstimatedHistogram.java:447-459 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) src/java/org/apache/cassandra/fql/FullQueryLogger.java:93— src/java/org/apache/cassandra/fql/FullQueryLogger.java:93-105 | src/java/org/apache/cassandra/fql/FullQueryLogger.java:108-120 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) src/java/org/apache/cassandra/service/accord/topology/AccordNodeInfos.java:518— src/java/org/apache/cassandra/service/accord/topology/AccordNodeInfos.java:518-530 | src/java/org/apache/cassandra/service/accord/topology/AccordNodeInfos.java:537-549 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) src/java/org/apache/cassandra/auth/CassandraAuthorizer.java:117— src/java/org/apache/cassandra/auth/CassandraAuthorizer.java:117-130 | src/java/org/apache/cassandra/auth/CassandraAuthorizer.java:134-146 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Low cohesion: StorageService (LCOM4 59) src/java/org/apache/cassandra/service/StorageService.java:291— StorageService's methods fall into 59 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 59 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: Builder (LCOM4 9) src/java/org/apache/cassandra/audit/AuditLogEntry.java:178— Builder's methods fall into 9 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 9 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: CMSOperations (LCOM4 9) src/java/org/apache/cassandra/tcm/CMSOperations.java:58— CMSOperations's methods fall into 9 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 9 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: Builder (LCOM4 8) src/java/org/apache/cassandra/io/sstable/format/SSTableReader.java:2032— Builder's methods fall into 8 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 8 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: LogSpec (LCOM4 8) src/java/org/apache/cassandra/tcm/log/LocalLog.java:115— LogSpec's methods fall into 8 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 8 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: AccordAgent (LCOM4 7) src/java/org/apache/cassandra/service/accord/api/AccordAgent.java:115— AccordAgent'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: AccordExecutor (LCOM4 7) src/java/org/apache/cassandra/service/accord/execution/AccordExecutor.java:103— AccordExecutor'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: ThreadPoolExecutorBuilder (LCOM4 7) src/java/org/apache/cassandra/concurrent/ThreadPoolExecutorBuilder.java:43— ThreadPoolExecutorBuilder'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: RandomPartitioner (LCOM4 7) src/java/org/apache/cassandra/dht/RandomPartitioner.java:60— RandomPartitioner'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: Builder (LCOM4 7) src/java/org/apache/cassandra/io/sstable/format/SSTableWriter.java:447— Builder'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: Builder (LCOM4 7) src/java/org/apache/cassandra/schema/TableMetadata.java:976— Builder'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: CompactionManager (LCOM4 6) src/java/org/apache/cassandra/db/compaction/CompactionManager.java:154— CompactionManager's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: VariableWidthTimestampSerializer (LCOM4 5) src/java/org/apache/cassandra/service/accord/serializers/CommandSerializers.java:480— VariableWidthTimestampSerializer's methods fall into 5 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 5 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: PaxosUncommittedIndex (LCOM4 5) src/java/org/apache/cassandra/service/paxos/uncommitted/PaxosUncommittedIndex.java:85— PaxosUncommittedIndex's methods fall into 5 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 5 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: OrderPreservingPartitioner (LCOM4 5) src/java/org/apache/cassandra/dht/OrderPreservingPartitioner.java:57— OrderPreservingPartitioner's methods fall into 5 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 5 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: FailureDetector (LCOM4 5) src/java/org/apache/cassandra/gms/FailureDetector.java:75— FailureDetector's methods fall into 5 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 5 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: DistributedSchema (LCOM4 5) src/java/org/apache/cassandra/schema/DistributedSchema.java:60— DistributedSchema's methods fall into 5 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 5 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: Builder (LCOM4 5) src/java/org/apache/cassandra/transport/Server.java:228— Builder's methods fall into 5 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 5 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: UDFByteCodeVerifier (LCOM4 4) src/java/org/apache/cassandra/cql3/functions/UDFByteCodeVerifier.java:47— UDFByteCodeVerifier'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: RestrictionSet (LCOM4 4) src/java/org/apache/cassandra/cql3/restrictions/RestrictionSet.java:50— RestrictionSet'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: AccordCache (LCOM4 4) src/java/org/apache/cassandra/service/accord/execution/AccordCache.java:109— AccordCache'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: Type (LCOM4 4) src/java/org/apache/cassandra/service/accord/execution/AccordCache.java:469— Type'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: AccordCommandStores (LCOM4 4) src/java/org/apache/cassandra/service/accord/AccordCommandStores.java:74— AccordCommandStores'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: Builder (LCOM4 4) src/java/org/apache/cassandra/service/snapshot/SnapshotOptions.java:115— Builder'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: AbstractCompactionTask (LCOM4 4) src/java/org/apache/cassandra/db/compaction/AbstractCompactionTask.java:32— AbstractCompactionTask'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.
Duplicated block (11 lines × 2) src/java/org/apache/cassandra/audit/AuditLogFilter.java:73— src/java/org/apache/cassandra/audit/AuditLogFilter.java:73-83 | src/java/org/apache/cassandra/audit/AuditLogFilter.java:92-102 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/audit/AuditLogFilter.java:73` 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) src/java/org/apache/cassandra/auth/MutualTlsAuthenticator.java:97— src/java/org/apache/cassandra/auth/MutualTlsAuthenticator.java:97-107 | src/java/org/apache/cassandra/auth/MutualTlsInternodeAuthenticator.java:99-109 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) src/java/org/apache/cassandra/config/DatabaseDescriptor.java:2217— src/java/org/apache/cassandra/config/DatabaseDescriptor.java:2217-2227 | src/java/org/apache/cassandra/config/DatabaseDescriptor.java:2231-2241 — both copies are in the same file, so extract the 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 (11 lines × 2) src/java/org/apache/cassandra/cql3/UntypedResultSet.java:177— src/java/org/apache/cassandra/cql3/UntypedResultSet.java:177-187 | src/java/org/apache/cassandra/cql3/UntypedResultSet.java:243-253 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/cql3/UntypedResultSet.java:177` 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 × 2) src/java/org/apache/cassandra/cql3/functions/UDFunction.java:686— src/java/org/apache/cassandra/cql3/functions/UDFunction.java:686-696 | src/java/org/apache/cassandra/db/marshal/UserType.java:473-483 — 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 `src/java/org/apache/cassandra/cql3/functions/UDFunction.java:686` 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 (11 lines × 2) src/java/org/apache/cassandra/cql3/statements/schema/DropAggregateStatement.java:113— src/java/org/apache/cassandra/cql3/statements/schema/DropAggregateStatement.java:113-123 | src/java/org/apache/cassandra/cql3/statements/schema/DropFunctionStatement.java:115-125 — before extracting anything, compare `src/java/org/apache/cassandra/cql3/statements/schema/DropAggregateStatement.java` and `src/java/org/apache/cassandra/cql3/statements/schema/DropFunctionStatement.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) src/java/org/apache/cassandra/db/compaction/CompactionStrategyManager.java:892— src/java/org/apache/cassandra/db/compaction/CompactionStrategyManager.java:892-902 | src/java/org/apache/cassandra/db/compaction/CompactionStrategyManager.java:907-917 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/db/compaction/CompactionStrategyManager.java:892` 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 first that the copies are not typed on the same thing: the declarations holding them bind `a` to `int[]` in one and `long[]` 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) src/java/org/apache/cassandra/db/compaction/ShardManagerDiskAware.java:130— src/java/org/apache/cassandra/db/compaction/ShardManagerDiskAware.java:130-140 | src/java/org/apache/cassandra/db/compaction/ShardManagerNoDisks.java:142-152 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 (11 lines × 2) src/java/org/apache/cassandra/db/tries/Trie.java:569— src/java/org/apache/cassandra/db/tries/Trie.java:569-579 | src/java/org/apache/cassandra/db/tries/Trie.java:595-605 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/db/tries/Trie.java:569` 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 × 2) src/java/org/apache/cassandra/db/virtual/AccordDebugKeyspace.java:731— src/java/org/apache/cassandra/db/virtual/AccordDebugKeyspace.java:731-741 | src/java/org/apache/cassandra/db/virtual/AccordDebugKeyspace.java:787-797 — both copies are in the same file, so extract the 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 (11 lines × 2) src/java/org/apache/cassandra/index/sai/plan/QueryController.java:394— src/java/org/apache/cassandra/index/sai/plan/QueryController.java:394-404 | src/java/org/apache/cassandra/index/sai/plan/QueryController.java:426-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/index/sai/plan/QueryController.java:394` 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) src/java/org/apache/cassandra/index/sai/virtual/SSTableIndexesSystemView.java:87— src/java/org/apache/cassandra/index/sai/virtual/SSTableIndexesSystemView.java:87-97 | src/java/org/apache/cassandra/index/sai/virtual/SegmentsSystemView.java:103-113 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 `src/java/org/apache/cassandra/index/sai/virtual/SSTableIndexesSystemView.java:87` 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) src/java/org/apache/cassandra/io/compress/DeflateCompressor.java:125— src/java/org/apache/cassandra/io/compress/DeflateCompressor.java:125-135 | src/java/org/apache/cassandra/io/compress/DeflateCompressor.java:170-180 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/io/compress/DeflateCompressor.java:125` 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) src/java/org/apache/cassandra/metrics/DecayingEstimatedHistogramReservoir.java:421— src/java/org/apache/cassandra/metrics/DecayingEstimatedHistogramReservoir.java:421-431 | src/java/org/apache/cassandra/metrics/DecayingEstimatedHistogramReservoir.java:757-767 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/metrics/DecayingEstimatedHistogramReservoir.java:421` 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) src/java/org/apache/cassandra/service/accord/serializers/KeySerializers.java:721— src/java/org/apache/cassandra/service/accord/serializers/KeySerializers.java:721-731 | src/java/org/apache/cassandra/service/accord/serializers/KeySerializers.java:765-775 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/service/accord/serializers/KeySerializers.java:721` 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 × 2) src/java/org/apache/cassandra/tools/StandaloneVerifier.java:106— src/java/org/apache/cassandra/tools/StandaloneVerifier.java:106-116 | tools/stress/src/org/apache/cassandra/stress/CompactionStress.java:142-152 — 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 `src/java/org/apache/cassandra/tools/StandaloneVerifier.java:106` 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 × 2) src/java/org/apache/cassandra/tools/nodetool/DescribeCluster.java:96— src/java/org/apache/cassandra/tools/nodetool/DescribeCluster.java:96-106 | src/java/org/apache/cassandra/tools/nodetool/Ring.java:91-101 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/tools/nodetool/DescribeCluster.java: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.
Duplicated block (11 lines × 2) src/java/org/apache/cassandra/tools/nodetool/TableHistograms.java:130— src/java/org/apache/cassandra/tools/nodetool/TableHistograms.java:130-140 | src/java/org/apache/cassandra/tools/nodetool/TableHistograms.java:142-152 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) src/java/org/apache/cassandra/utils/LongTimSort.java:678— src/java/org/apache/cassandra/utils/LongTimSort.java:678-688 | src/java/org/apache/cassandra/utils/LongTimSort.java:788-798 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/utils/LongTimSort.java:678` 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 (11 lines × 2) src/java/org/apache/cassandra/service/paxos/cleanup/PaxosCleanupComplete.java:133— src/java/org/apache/cassandra/service/paxos/cleanup/PaxosCleanupComplete.java:133-143 | src/java/org/apache/cassandra/service/paxos/cleanup/PaxosStartPrepareCleanup.java:162-172 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 `src/java/org/apache/cassandra/service/paxos/cleanup/PaxosCleanupComplete.java:133` 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) src/java/org/apache/cassandra/cql3/selection/Selectable.java:1471— src/java/org/apache/cassandra/cql3/selection/Selectable.java:1471-1481 | src/java/org/apache/cassandra/cql3/selection/Selectable.java:1558-1568 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) src/java/org/apache/cassandra/io/tries/IncrementalDeepTrieWriterPageAware.java:235— src/java/org/apache/cassandra/io/tries/IncrementalDeepTrieWriterPageAware.java:235-245 | src/java/org/apache/cassandra/io/tries/IncrementalTrieWriterPageAware.java:274-284 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 `src/java/org/apache/cassandra/io/tries/IncrementalDeepTrieWriterPageAware.java:235` 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) src/java/org/apache/cassandra/db/commitlog/CommitLog.java:590— src/java/org/apache/cassandra/db/commitlog/CommitLog.java:590-600 | src/java/org/apache/cassandra/service/DefaultDiskErrorsHandler.java:207-217 — 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 (11 lines × 2) src/java/org/apache/cassandra/db/commitlog/DirectIOSegment.java:150— src/java/org/apache/cassandra/db/commitlog/DirectIOSegment.java:150-160 | src/java/org/apache/cassandra/db/commitlog/FileDirectSegment.java:60-70 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) src/java/org/apache/cassandra/db/marshal/ByteArrayObjectFactory.java:110— src/java/org/apache/cassandra/db/marshal/ByteArrayObjectFactory.java:110-120 | src/java/org/apache/cassandra/db/marshal/ByteBufferObjectFactory.java:82-92 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) src/java/org/apache/cassandra/audit/AuditLogManager.java:264— src/java/org/apache/cassandra/audit/AuditLogManager.java:264-272 | src/java/org/apache/cassandra/audit/AuditLogManager.java:284-292 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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) src/java/org/apache/cassandra/cql3/ResultSet.java:474— src/java/org/apache/cassandra/cql3/ResultSet.java:474-482 | src/java/org/apache/cassandra/cql3/ResultSet.java:677-685 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/cql3/ResultSet.java:474` 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 × 2) src/java/org/apache/cassandra/cql3/statements/TransactionStatement.java:507— src/java/org/apache/cassandra/cql3/statements/TransactionStatement.java:507-515 | src/java/org/apache/cassandra/cql3/statements/TransactionStatement.java:543-551 — both copies are in the same file, so extract the 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) src/java/org/apache/cassandra/cql3/statements/schema/DropAggregateStatement.java:85— src/java/org/apache/cassandra/cql3/statements/schema/DropAggregateStatement.java:85-93 | src/java/org/apache/cassandra/cql3/statements/schema/DropFunctionStatement.java:87-95 — before extracting anything, compare `src/java/org/apache/cassandra/cql3/statements/schema/DropAggregateStatement.java` and `src/java/org/apache/cassandra/cql3/statements/schema/DropFunctionStatement.java` as WHOLE FILES: this scan already matched 5 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.
Duplicated block (9 lines × 2) src/java/org/apache/cassandra/cql3/terms/Constants.java:527— src/java/org/apache/cassandra/cql3/terms/Constants.java:527-535 | src/java/org/apache/cassandra/cql3/terms/Constants.java:584-592 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/cql3/terms/Constants.java:527` 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 (9 lines × 2) src/java/org/apache/cassandra/db/compaction/LeveledManifest.java:367— src/java/org/apache/cassandra/db/compaction/LeveledManifest.java:367-375 | src/java/org/apache/cassandra/db/compaction/LeveledManifest.java:508-516 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) src/java/org/apache/cassandra/db/marshal/CollectionType.java:199— src/java/org/apache/cassandra/db/marshal/CollectionType.java:199-207 | src/java/org/apache/cassandra/db/marshal/CollectionType.java:227-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. 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) src/java/org/apache/cassandra/db/marshal/ListType.java:313— src/java/org/apache/cassandra/db/marshal/ListType.java:313-321 | src/java/org/apache/cassandra/db/marshal/MapType.java:455-463 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 (9 lines × 2) src/java/org/apache/cassandra/db/virtual/InternodeInboundTable.java:63— src/java/org/apache/cassandra/db/virtual/InternodeInboundTable.java:63-71 | src/java/org/apache/cassandra/db/virtual/InternodeOutboundTable.java:64-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 `src/java/org/apache/cassandra/db/virtual/InternodeInboundTable.java:63` 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) src/java/org/apache/cassandra/fql/FullQueryLogger.java:94— src/java/org/apache/cassandra/fql/FullQueryLogger.java:94-102 | src/java/org/apache/cassandra/fql/FullQueryLogger.java:109-117 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java:347— src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java:347-355 | tools/stress/src/org/apache/cassandra/io/sstable/StressCQLSSTableWriter.java:312-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. 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) src/java/org/apache/cassandra/io/sstable/format/big/BigTableScrubber.java:167— src/java/org/apache/cassandra/io/sstable/format/big/BigTableScrubber.java:167-175 | src/java/org/apache/cassandra/io/sstable/format/bti/BtiTableScrubber.java:185-193 — before extracting anything, compare `src/java/org/apache/cassandra/io/sstable/format/big/BigTableScrubber.java` and `src/java/org/apache/cassandra/io/sstable/format/bti/BtiTableScrubber.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 `src/java/org/apache/cassandra/io/sstable/format/big/BigTableScrubber.java:167` 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) src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java:164— src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java:164-172 | src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java:206-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 `src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java: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 (9 lines × 2) src/java/org/apache/cassandra/net/FrameDecoderCrc.java:136— src/java/org/apache/cassandra/net/FrameDecoderCrc.java:136-144 | src/java/org/apache/cassandra/net/FrameDecoderLZ4.java:127-135 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/java/org/apache/cassandra/net/FrameDecoderLZ4.java:125` calls `uncompressedLength` and `src/java/org/apache/cassandra/net/FrameDecoderCrc.java:134` 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 (9 lines × 2) src/java/org/apache/cassandra/tcm/membership/Directory.java:372— src/java/org/apache/cassandra/tcm/membership/Directory.java:372-380 | src/java/org/apache/cassandra/tcm/membership/Directory.java:389-397 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/tcm/membership/Directory.java:372` 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) src/java/org/apache/cassandra/utils/IntervalTree.java:634— src/java/org/apache/cassandra/utils/IntervalTree.java:634-642 | src/java/org/apache/cassandra/utils/IntervalTree.java:654-662 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) src/java/org/apache/cassandra/utils/LongTimSort.java:505— src/java/org/apache/cassandra/utils/LongTimSort.java:505-513 | src/java/org/apache/cassandra/utils/LongTimSort.java:570-578 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/utils/LongTimSort.java:505` 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) src/java/org/apache/cassandra/db/NativeClustering.java:159— src/java/org/apache/cassandra/db/NativeClustering.java:159-167 | src/java/org/apache/cassandra/db/NativeClustering.java:212-220 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) src/java/org/apache/cassandra/db/marshal/Int32Type.java:63— src/java/org/apache/cassandra/db/marshal/Int32Type.java:63-71 | src/java/org/apache/cassandra/db/marshal/LongType.java:65-73 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from 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 (9 lines × 2) src/java/org/apache/cassandra/schema/ReplicationParams.java:294— src/java/org/apache/cassandra/schema/ReplicationParams.java:294-302 | src/java/org/apache/cassandra/schema/ReplicationParams.java:330-338 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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) src/java/org/apache/cassandra/utils/IntervalTree.java:588— src/java/org/apache/cassandra/utils/IntervalTree.java:588-596 | src/java/org/apache/cassandra/utils/IntervalTree.java:598-606 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) src/java/org/apache/cassandra/transport/messages/ExecuteMessage.java:217— src/java/org/apache/cassandra/transport/messages/ExecuteMessage.java:217-225 | src/java/org/apache/cassandra/transport/messages/QueryMessage.java:140-148 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 before the matched lines, `src/java/org/apache/cassandra/transport/messages/QueryMessage.java:139` calls `put` and `src/java/org/apache/cassandra/transport/messages/ExecuteMessage.java:216` 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) src/java/org/apache/cassandra/cql3/BatchQueryOptions.java:106— src/java/org/apache/cassandra/cql3/BatchQueryOptions.java:106-114 | src/java/org/apache/cassandra/cql3/QueryOptions.java:420-428 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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) src/java/org/apache/cassandra/db/marshal/ListType.java:148— src/java/org/apache/cassandra/db/marshal/ListType.java:148-156 | src/java/org/apache/cassandra/db/marshal/SetType.java:148-156 — before extracting anything, compare `src/java/org/apache/cassandra/db/marshal/ListType.java` and `src/java/org/apache/cassandra/db/marshal/SetType.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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) src/java/org/apache/cassandra/dht/Range.java:458— src/java/org/apache/cassandra/dht/Range.java:458-466 | src/java/org/apache/cassandra/repair/asymmetric/RangeDenormalizer.java:116-124 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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) src/java/org/apache/cassandra/config/YamlConfigurationLoader.java:339— src/java/org/apache/cassandra/config/YamlConfigurationLoader.java:339-348 | src/java/org/apache/cassandra/config/YamlConfigurationLoader.java:367-376 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/java/org/apache/cassandra/config/YamlConfigurationLoader.java:349` calls `maybeAddEnvironmentVariables`, `maybeAddSystemProperties` and `src/java/org/apache/cassandra/config/YamlConfigurationLoader.java:377` 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 (10 lines × 2) src/java/org/apache/cassandra/cql3/constraints/FunctionColumnConstraint.java:186— src/java/org/apache/cassandra/cql3/constraints/FunctionColumnConstraint.java:186-195 | src/java/org/apache/cassandra/cql3/constraints/UnaryFunctionColumnConstraint.java:170-179 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 `src/java/org/apache/cassandra/cql3/constraints/FunctionColumnConstraint.java:186` 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 × 2) src/java/org/apache/cassandra/cql3/functions/FormatFcts.java:290— src/java/org/apache/cassandra/cql3/functions/FormatFcts.java:290-299 | src/java/org/apache/cassandra/cql3/functions/FormatFcts.java:431-440 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/cql3/functions/FormatFcts.java:290` 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) src/java/org/apache/cassandra/cql3/functions/types/ParseUtils.java:400— src/java/org/apache/cassandra/cql3/functions/types/ParseUtils.java:400-409 | src/java/org/apache/cassandra/serializers/TimeSerializer.java:151-160 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/cql3/functions/types/ParseUtils.java:400` 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 × 2) src/java/org/apache/cassandra/cql3/selection/MapSelector.java:102— src/java/org/apache/cassandra/cql3/selection/MapSelector.java:102-111 | src/java/org/apache/cassandra/cql3/selection/UserTypeSelector.java:103-112 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 `src/java/org/apache/cassandra/cql3/selection/MapSelector.java:102` 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) src/java/org/apache/cassandra/db/Columns.java:649— src/java/org/apache/cassandra/db/Columns.java:649-658 | src/java/org/apache/cassandra/db/Columns.java:723-732 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/db/Columns.java:649` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) src/java/org/apache/cassandra/db/WriteThresholds.java:81— src/java/org/apache/cassandra/db/WriteThresholds.java:81-90 | src/java/org/apache/cassandra/db/WriteThresholds.java:95-104 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/db/WriteThresholds.java:81` 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 (10 lines × 2) src/java/org/apache/cassandra/db/virtual/AccordDebugKeyspace.java:1162— src/java/org/apache/cassandra/db/virtual/AccordDebugKeyspace.java:1162-1171 | src/java/org/apache/cassandra/db/virtual/AccordDebugKeyspace.java:1369-1378 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/db/virtual/AccordDebugKeyspace.java:1162` 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) src/java/org/apache/cassandra/index/sai/disk/format/IndexDescriptor.java:272— src/java/org/apache/cassandra/index/sai/disk/format/IndexDescriptor.java:272-281 | src/java/org/apache/cassandra/index/sai/disk/format/IndexDescriptor.java:294-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 `src/java/org/apache/cassandra/index/sai/disk/format/IndexDescriptor.java: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.
Duplicated block (10 lines × 2) src/java/org/apache/cassandra/repair/RepairMessageVerbHandler.java:205— src/java/org/apache/cassandra/repair/RepairMessageVerbHandler.java:205-214 | src/java/org/apache/cassandra/repair/RepairMessageVerbHandler.java:288-297 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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) src/java/org/apache/cassandra/repair/autorepair/AutoRepairUtils.java:561— src/java/org/apache/cassandra/repair/autorepair/AutoRepairUtils.java:561-570 | src/java/org/apache/cassandra/repair/autorepair/AutoRepairUtils.java:578-587 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/repair/autorepair/AutoRepairUtils.java:561` 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 `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) src/java/org/apache/cassandra/schema/SystemDistributedKeyspace.java:470— src/java/org/apache/cassandra/schema/SystemDistributedKeyspace.java:470-483 | src/java/org/apache/cassandra/schema/SystemDistributedKeyspace.java:545-554 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/schema/SystemDistributedKeyspace.java:470` 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) src/java/org/apache/cassandra/service/paxos/PaxosPrepare.java:1107— src/java/org/apache/cassandra/service/paxos/PaxosPrepare.java:1107-1116 | src/java/org/apache/cassandra/service/paxos/PaxosPropose.java:420-430 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 `src/java/org/apache/cassandra/service/paxos/PaxosPrepare.java:1107` 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 (10 lines × 2) src/java/org/apache/cassandra/tools/SSTableLevelResetter.java:79— src/java/org/apache/cassandra/tools/SSTableLevelResetter.java:79-88 | src/java/org/apache/cassandra/tools/SSTableOfflineRelevel.java:103-112 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10 lines × 2) src/java/org/apache/cassandra/tools/nodetool/ConsensusMigrationAdmin.java:166— src/java/org/apache/cassandra/tools/nodetool/ConsensusMigrationAdmin.java:166-175 | src/java/org/apache/cassandra/tools/nodetool/ConsensusMigrationAdmin.java:183-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/tools/nodetool/ConsensusMigrationAdmin.java:166` 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, `src/java/org/apache/cassandra/tools/nodetool/ConsensusMigrationAdmin.java:165` calls `add`, `FinishMigrationRepairCommand` and `src/java/org/apache/cassandra/tools/nodetool/ConsensusMigrationAdmin.java:182` 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 (10 lines × 2) src/java/org/apache/cassandra/tools/nodetool/NetStats.java:136— src/java/org/apache/cassandra/tools/nodetool/NetStats.java:136-145 | src/java/org/apache/cassandra/tools/nodetool/NetStats.java:160-169 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) src/java/org/apache/cassandra/utils/MurmurHash.java:104— src/java/org/apache/cassandra/utils/MurmurHash.java:104-113 | src/java/org/apache/cassandra/utils/MurmurHash.java:160-169 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/utils/MurmurHash.java:104` 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 × 2) src/java/org/apache/cassandra/utils/btree/BTree.java:405— src/java/org/apache/cassandra/utils/btree/BTree.java:405-414 | src/java/org/apache/cassandra/utils/btree/IntervalBTree.java:583-592 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 `src/java/org/apache/cassandra/utils/btree/BTree.java:405` 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, `src/java/org/apache/cassandra/utils/btree/BTree.java:416` calls `flip` and `src/java/org/apache/cassandra/utils/btree/IntervalBTree.java:593` 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 (10 lines × 2) src/java/org/apache/cassandra/utils/btree/BTree.java:1304— src/java/org/apache/cassandra/utils/btree/BTree.java:1304-1313 | src/java/org/apache/cassandra/utils/btree/BTree.java:1353-1362 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/utils/btree/BTree.java:1304` 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 × 2) src/java/org/apache/cassandra/utils/memory/BufferPool.java:1505— src/java/org/apache/cassandra/utils/memory/BufferPool.java:1505-1514 | src/java/org/apache/cassandra/utils/memory/BufferPool.java:1533-1542 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/utils/memory/BufferPool.java:1505` 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 × 2) src/java/org/apache/cassandra/utils/vint/VIntCoding.java:247— src/java/org/apache/cassandra/utils/vint/VIntCoding.java:247-256 | src/java/org/apache/cassandra/utils/vint/VIntCoding.java:296-305 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/utils/vint/VIntCoding.java:247` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) src/java/org/apache/cassandra/journal/JournalReadError.java:28— src/java/org/apache/cassandra/journal/JournalReadError.java:28-37 | src/java/org/apache/cassandra/journal/JournalWriteError.java:28-37 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10 lines × 2) src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java:299— src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java:299-308 | src/java/org/apache/cassandra/cql3/statements/SelectStatement.java:260-269 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 (10 lines × 2) src/java/org/apache/cassandra/db/marshal/CollectionType.java:128— src/java/org/apache/cassandra/db/marshal/CollectionType.java:128-137 | src/java/org/apache/cassandra/db/marshal/VectorType.java:273-282 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10 lines × 2) src/java/org/apache/cassandra/index/accord/RouteMemtableIndexManager.java:91— src/java/org/apache/cassandra/index/accord/RouteMemtableIndexManager.java:91-100 | src/java/org/apache/cassandra/index/sai/memory/MemtableIndexManager.java:132-141 — 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.
+ 5 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (15 corresponding lines) · ×25
Edited copy of a member (15 corresponding lines) src/java/org/apache/cassandra/locator/ReplicaPlans.java:928— src/java/org/apache/cassandra/locator/ReplicaPlans.java:928-942 | src/java/org/apache/cassandra/locator/ReplicaPlans.java:969-990 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) src/java/org/apache/cassandra/service/StorageProxy.java:2272— src/java/org/apache/cassandra/service/StorageProxy.java:2272-2286 | src/java/org/apache/cassandra/service/StorageProxy.java:2289-2304 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) src/java/org/apache/cassandra/service/paxos/uncommitted/PaxosRows.java:93— src/java/org/apache/cassandra/service/paxos/uncommitted/PaxosRows.java:93-107 | src/java/org/apache/cassandra/service/paxos/uncommitted/PaxosRows.java:110-124 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) src/java/org/apache/cassandra/service/accord/topology/AccordNodeInfos.java:555— src/java/org/apache/cassandra/service/accord/topology/AccordNodeInfos.java:555-569 | src/java/org/apache/cassandra/service/accord/topology/AccordNodeInfos.java:691-705 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) src/java/org/apache/cassandra/db/virtual/SSTableTasksTable.java:47— src/java/org/apache/cassandra/db/virtual/SSTableTasksTable.java:47-64 | src/java/org/apache/cassandra/db/virtual/VirtualSchemaKeyspace.java:113-127 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) src/java/org/apache/cassandra/db/virtual/CachesTable.java:43— src/java/org/apache/cassandra/db/virtual/CachesTable.java:43-58 | src/java/org/apache/cassandra/db/virtual/SnapshotsTable.java:45-59 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:2429— src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:2429-2443 | src/java/org/apache/cassandra/serializers/MapSerializer.java:190-206 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) src/java/org/apache/cassandra/db/ColumnFamilyStore.java:2248— src/java/org/apache/cassandra/db/ColumnFamilyStore.java:2248-2262 | src/java/org/apache/cassandra/db/ColumnFamilyStore.java:2265-2279 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) src/java/org/apache/cassandra/repair/consistent/admin/CleanupSummary.java:116— src/java/org/apache/cassandra/repair/consistent/admin/CleanupSummary.java:116-130 | src/java/org/apache/cassandra/repair/consistent/admin/PendingStat.java:81-99 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) src/java/org/apache/cassandra/index/sai/disk/format/IndexDescriptor.java:267— src/java/org/apache/cassandra/index/sai/disk/format/IndexDescriptor.java:267-281 | src/java/org/apache/cassandra/index/sai/disk/format/IndexDescriptor.java:289-303 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) src/java/org/apache/cassandra/journal/InMemoryIndex.java:142— src/java/org/apache/cassandra/journal/InMemoryIndex.java:142-156 | src/java/org/apache/cassandra/journal/Metadata.java:107-121 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) src/java/org/apache/cassandra/transport/CBUtil.java:485— src/java/org/apache/cassandra/transport/CBUtil.java:485-499 | src/java/org/apache/cassandra/transport/CBUtil.java:598-612 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) src/java/org/apache/cassandra/gms/EndpointState.java:298— src/java/org/apache/cassandra/gms/EndpointState.java:298-312 | src/java/org/apache/cassandra/gms/Gossiper.java:1383-1403 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) src/java/org/apache/cassandra/cql3/selection/Selectable.java:653— src/java/org/apache/cassandra/cql3/selection/Selectable.java:653-667 | src/java/org/apache/cassandra/cql3/selection/Selectable.java:1119-1133 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) src/java/org/apache/cassandra/index/sasi/memory/TrieMemIndex.java:182— src/java/org/apache/cassandra/index/sasi/memory/TrieMemIndex.java:182-196 | src/java/org/apache/cassandra/index/sasi/memory/TrieMemIndex.java:220-238 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) src/java/org/apache/cassandra/utils/FBUtilities.java:686— src/java/org/apache/cassandra/utils/FBUtilities.java:686-700 | src/java/org/apache/cassandra/utils/FBUtilities.java:703-720 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) src/java/org/apache/cassandra/cql3/QueryProcessor.java:971— src/java/org/apache/cassandra/cql3/QueryProcessor.java:971-985 | tools/stress/src/org/apache/cassandra/io/sstable/StressCQLSSTableWriter.java:711-725 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) src/java/org/apache/cassandra/auth/MutualTlsAuthenticator.java:260— src/java/org/apache/cassandra/auth/MutualTlsAuthenticator.java:260-274 | src/java/org/apache/cassandra/auth/PasswordAuthenticator.java:365-380 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) src/java/org/apache/cassandra/index/sai/disk/format/IndexDescriptor.java:226— src/java/org/apache/cassandra/index/sai/disk/format/IndexDescriptor.java:226-242 | src/java/org/apache/cassandra/index/sai/disk/format/IndexDescriptor.java:250-264 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) src/java/org/apache/cassandra/auth/NetworkPermissionsCache.java:27— src/java/org/apache/cassandra/auth/NetworkPermissionsCache.java:27-42 | src/java/org/apache/cassandra/auth/RolesCache.java:35-49 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) src/java/org/apache/cassandra/db/compaction/CursorCompactor.java:182— src/java/org/apache/cassandra/db/compaction/CursorCompactor.java:182-201 | src/java/org/apache/cassandra/db/compaction/CursorCompactor.java:204-218 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) src/java/org/apache/cassandra/db/PartitionRangeReadCommand.java:328— src/java/org/apache/cassandra/db/PartitionRangeReadCommand.java:328-342 | src/java/org/apache/cassandra/db/SinglePartitionReadCommand.java:460-475 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) src/java/org/apache/cassandra/db/commitlog/CommitLogDescriptor.java:220— src/java/org/apache/cassandra/db/commitlog/CommitLogDescriptor.java:220-234 | src/java/org/apache/cassandra/hints/HintsDescriptor.java:253-267 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) src/java/org/apache/cassandra/db/PartitionRangeReadCommand.java:164— src/java/org/apache/cassandra/db/PartitionRangeReadCommand.java:164-178 | src/java/org/apache/cassandra/db/SinglePartitionReadCommand.java:243-258 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) src/java/org/apache/cassandra/db/PartitionRangeReadCommand.java:141— src/java/org/apache/cassandra/db/PartitionRangeReadCommand.java:141-155 | src/java/org/apache/cassandra/db/SinglePartitionReadCommand.java:204-219 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (18 corresponding lines) · ×23
Edited copy of a member (18 corresponding lines) pylib/cqlshlib/formatting.py:548— pylib/cqlshlib/formatting.py:548-565 | pylib/cqlshlib/formatting.py:576-599 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) src/java/org/apache/cassandra/service/StorageService.java:4206— src/java/org/apache/cassandra/service/StorageService.java:4206-4223 | src/java/org/apache/cassandra/service/StorageService.java:4226-4243 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) src/java/org/apache/cassandra/cql3/selection/Selectable.java:1469— src/java/org/apache/cassandra/cql3/selection/Selectable.java:1469-1486 | src/java/org/apache/cassandra/cql3/selection/Selectable.java:1555-1577 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) src/java/org/apache/cassandra/locator/ReplicaPlans.java:542— src/java/org/apache/cassandra/locator/ReplicaPlans.java:542-560 | src/java/org/apache/cassandra/locator/ReplicaPlans.java:594-611 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) src/java/org/apache/cassandra/service/accord/serializers/CheckStatusSerializers.java:62— src/java/org/apache/cassandra/service/accord/serializers/CheckStatusSerializers.java:62-81 | src/java/org/apache/cassandra/service/accord/serializers/CheckStatusSerializers.java:105-122 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) src/java/org/apache/cassandra/db/marshal/Int32Type.java:107— src/java/org/apache/cassandra/db/marshal/Int32Type.java:107-124 | src/java/org/apache/cassandra/db/marshal/LongType.java:119-136 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) src/java/org/apache/cassandra/service/accord/serializers/CommandStoreSerializers.java:116— src/java/org/apache/cassandra/service/accord/serializers/CommandStoreSerializers.java:116-133 | src/java/org/apache/cassandra/service/accord/serializers/CommandStoreSerializers.java:159-178 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) src/java/org/apache/cassandra/dht/ByteOrderedPartitioner.java:166— src/java/org/apache/cassandra/dht/ByteOrderedPartitioner.java:166-183 | src/java/org/apache/cassandra/dht/ByteOrderedPartitioner.java:187-210 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) src/java/org/apache/cassandra/utils/btree/BTree.java:2136— src/java/org/apache/cassandra/utils/btree/BTree.java:2136-2153 | src/java/org/apache/cassandra/utils/btree/BTree.java:2166-2190 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) src/java/org/apache/cassandra/db/tries/Trie.java:568— src/java/org/apache/cassandra/db/tries/Trie.java:568-585 | src/java/org/apache/cassandra/db/tries/Trie.java:594-611 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) src/java/org/apache/cassandra/transport/Envelope.java:536— src/java/org/apache/cassandra/transport/Envelope.java:536-553 | src/java/org/apache/cassandra/transport/Envelope.java:564-582 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) src/java/org/apache/cassandra/tools/BootstrapMonitor.java:78— src/java/org/apache/cassandra/tools/BootstrapMonitor.java:78-95 | src/java/org/apache/cassandra/tools/RepairRunner.java:189-207 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) src/java/org/apache/cassandra/metrics/DecayingEstimatedHistogramReservoir.java:575— src/java/org/apache/cassandra/metrics/DecayingEstimatedHistogramReservoir.java:575-594 | src/java/org/apache/cassandra/utils/EstimatedHistogram.java:259-276 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) src/java/org/apache/cassandra/index/sai/memory/TrieMemoryIndex.java:172— src/java/org/apache/cassandra/index/sai/memory/TrieMemoryIndex.java:172-189 | src/java/org/apache/cassandra/index/sai/memory/UnshardedMemtableIndex.java:123-141 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) src/java/org/apache/cassandra/tools/nodetool/Status.java:493— src/java/org/apache/cassandra/tools/nodetool/Status.java:493-510 | src/java/org/apache/cassandra/tools/nodetool/Status.java:513-530 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) src/java/org/apache/cassandra/schema/PartitionDenylist.java:254— src/java/org/apache/cassandra/schema/PartitionDenylist.java:254-271 | src/java/org/apache/cassandra/schema/PartitionDenylist.java:277-294 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) src/java/org/apache/cassandra/net/InternodeConnectionUtils.java:46— src/java/org/apache/cassandra/net/InternodeConnectionUtils.java:46-63 | src/java/org/apache/cassandra/transport/ServerConnection.java:143-163 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) src/java/org/apache/cassandra/db/monitoring/MonitoringTask.java:170— src/java/org/apache/cassandra/db/monitoring/MonitoringTask.java:170-187 | src/java/org/apache/cassandra/db/monitoring/MonitoringTask.java:191-223 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) src/java/org/apache/cassandra/cql3/functions/types/DataTypeClassNameParser.java:375— src/java/org/apache/cassandra/cql3/functions/types/DataTypeClassNameParser.java:375-392 | src/java/org/apache/cassandra/db/marshal/TypeParser.java:572-591 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) src/java/org/apache/cassandra/db/compaction/CompactionStrategyHolder.java:234— src/java/org/apache/cassandra/db/compaction/CompactionStrategyHolder.java:234-259 | src/java/org/apache/cassandra/db/compaction/PendingRepairHolder.java:254-271 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) src/java/org/apache/cassandra/db/Keyspace.java:357— src/java/org/apache/cassandra/db/Keyspace.java:357-374 | src/java/org/apache/cassandra/db/Keyspace.java:385-406 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) src/java/org/apache/cassandra/locator/AbstractReplicaCollection.java:196— src/java/org/apache/cassandra/locator/AbstractReplicaCollection.java:196-214 | src/java/org/apache/cassandra/locator/AbstractReplicaCollection.java:219-236 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) tools/stress/src/org/apache/cassandra/stress/operations/predefined/CqlOperation.java:457— tools/stress/src/org/apache/cassandra/stress/operations/predefined/CqlOperation.java:457-474 | tools/stress/src/org/apache/cassandra/stress/operations/predefined/CqlOperation.java:478-496 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (19 corresponding lines) · ×21
Edited copy of a member (19 corresponding lines) src/java/org/apache/cassandra/service/accord/serializers/DepsSerializers.java:90— src/java/org/apache/cassandra/service/accord/serializers/DepsSerializers.java:90-108 | src/java/org/apache/cassandra/service/accord/serializers/DepsSerializers.java:241-260 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) src/java/org/apache/cassandra/db/NativeClustering.java:158— src/java/org/apache/cassandra/db/NativeClustering.java:158-176 | src/java/org/apache/cassandra/db/NativeClustering.java:211-229 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) src/java/org/apache/cassandra/schema/DistributedMetadataLogKeyspace.java:189— src/java/org/apache/cassandra/schema/DistributedMetadataLogKeyspace.java:189-207 | src/java/org/apache/cassandra/schema/DistributedMetadataLogKeyspace.java:210-228 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) src/java/org/apache/cassandra/io/util/CompressedChunkReader.java:141— src/java/org/apache/cassandra/io/util/CompressedChunkReader.java:141-168 | src/java/org/apache/cassandra/io/util/CompressedChunkReader.java:184-202 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) src/java/org/apache/cassandra/fql/FullQueryLoggerOptionsCompositeData.java:78— src/java/org/apache/cassandra/fql/FullQueryLoggerOptionsCompositeData.java:78-96 | src/java/org/apache/cassandra/streaming/management/ProgressInfoCompositeData.java:80-100 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) src/java/org/apache/cassandra/service/accord/serializers/CommandSerializers.java:128— src/java/org/apache/cassandra/service/accord/serializers/CommandSerializers.java:128-147 | src/java/org/apache/cassandra/service/accord/serializers/CommandSerializers.java:163-181 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) src/java/org/apache/cassandra/index/sai/plan/QueryController.java:385— src/java/org/apache/cassandra/index/sai/plan/QueryController.java:385-404 | src/java/org/apache/cassandra/index/sai/plan/QueryController.java:418-436 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) src/java/org/apache/cassandra/db/streaming/CompressionInfo.java:196— src/java/org/apache/cassandra/db/streaming/CompressionInfo.java:196-218 | src/java/org/apache/cassandra/db/streaming/CompressionInfo.java:238-256 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:2145— src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:2145-2163 | src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:2497-2518 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) src/java/org/apache/cassandra/metrics/DecayingEstimatedHistogramReservoir.java:504— src/java/org/apache/cassandra/metrics/DecayingEstimatedHistogramReservoir.java:504-527 | src/java/org/apache/cassandra/utils/EstimatedHistogram.java:225-243 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) src/java/org/apache/cassandra/cql3/statements/schema/DropIndexStatement.java:59— src/java/org/apache/cassandra/cql3/statements/schema/DropIndexStatement.java:59-77 | src/java/org/apache/cassandra/cql3/statements/schema/DropTriggerStatement.java:58-80 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) src/java/org/apache/cassandra/db/aggregation/AggregationSpecification.java:239— src/java/org/apache/cassandra/db/aggregation/AggregationSpecification.java:239-259 | src/java/org/apache/cassandra/db/aggregation/AggregationSpecification.java:284-302 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) src/java/org/apache/cassandra/index/sasi/memory/SkipListMemIndex.java:46— src/java/org/apache/cassandra/index/sasi/memory/SkipListMemIndex.java:46-64 | src/java/org/apache/cassandra/index/sasi/memory/TrieMemIndex.java:116-137 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) src/java/org/apache/cassandra/locator/InetAddressAndPort.java:446— src/java/org/apache/cassandra/locator/InetAddressAndPort.java:446-468 | src/java/org/apache/cassandra/locator/InetAddressAndPort.java:530-548 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) src/java/org/apache/cassandra/utils/InsertionOrderedNavigableSet.java:199— src/java/org/apache/cassandra/utils/InsertionOrderedNavigableSet.java:199-217 | src/java/org/apache/cassandra/utils/InsertionOrderedNavigableSet.java:221-239 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) src/java/org/apache/cassandra/db/filter/ClusteringIndexNamesFilter.java:117— src/java/org/apache/cassandra/db/filter/ClusteringIndexNamesFilter.java:117-135 | src/java/org/apache/cassandra/db/filter/ClusteringIndexSliceFilter.java:99-119 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) src/java/org/apache/cassandra/index/sai/disk/format/IndexDescriptor.java:372— src/java/org/apache/cassandra/index/sai/disk/format/IndexDescriptor.java:372-390 | src/java/org/apache/cassandra/index/sai/disk/format/IndexDescriptor.java:394-412 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) src/java/org/apache/cassandra/utils/FBUtilities.java:723— src/java/org/apache/cassandra/utils/FBUtilities.java:723-741 | src/java/org/apache/cassandra/utils/FBUtilities.java:744-762 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) src/java/org/apache/cassandra/cql3/functions/FunctionParameter.java:240— src/java/org/apache/cassandra/cql3/functions/FunctionParameter.java:240-258 | src/java/org/apache/cassandra/cql3/functions/FunctionParameter.java:334-352 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) src/java/org/apache/cassandra/cache/SerializingCache.java:168— src/java/org/apache/cassandra/cache/SerializingCache.java:168-186 | src/java/org/apache/cassandra/cache/SerializingCache.java:189-209 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) src/java/org/apache/cassandra/db/compaction/CompactionStrategyManager.java:625— src/java/org/apache/cassandra/db/compaction/CompactionStrategyManager.java:625-643 | src/java/org/apache/cassandra/db/compaction/CompactionStrategyManager.java:651-672 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (17 corresponding lines) · ×20
Edited copy of a member (17 corresponding lines) src/java/org/apache/cassandra/service/accord/serializers/KeySerializers.java:360— src/java/org/apache/cassandra/service/accord/serializers/KeySerializers.java:360-376 | src/java/org/apache/cassandra/service/accord/serializers/KeySerializers.java:379-395 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) src/java/org/apache/cassandra/io/tries/IncrementalDeepTrieWriterPageAware.java:224— src/java/org/apache/cassandra/io/tries/IncrementalDeepTrieWriterPageAware.java:224-245 | src/java/org/apache/cassandra/io/tries/IncrementalTrieWriterPageAware.java:268-284 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) src/java/org/apache/cassandra/repair/consistent/admin/PendingStats.java:77— src/java/org/apache/cassandra/repair/consistent/admin/PendingStats.java:77-93 | src/java/org/apache/cassandra/repair/consistent/admin/RepairStats.java:156-176 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) src/java/org/apache/cassandra/db/marshal/TupleType.java:406— src/java/org/apache/cassandra/db/marshal/TupleType.java:406-422 | src/java/org/apache/cassandra/db/marshal/UserType.java:685-702 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) src/java/org/apache/cassandra/security/FileBasedSslContextFactory.java:188— src/java/org/apache/cassandra/security/FileBasedSslContextFactory.java:188-204 | src/java/org/apache/cassandra/security/FileBasedSslContextFactory.java:207-228 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) src/java/org/apache/cassandra/utils/FBUtilities.java:1045— src/java/org/apache/cassandra/utils/FBUtilities.java:1045-1061 | src/java/org/apache/cassandra/utils/FBUtilities.java:1072-1089 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) src/java/org/apache/cassandra/db/monitoring/MonitoringTask.java:529— src/java/org/apache/cassandra/db/monitoring/MonitoringTask.java:529-545 | src/java/org/apache/cassandra/db/monitoring/MonitoringTask.java:567-583 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) src/java/org/apache/cassandra/db/marshal/CollectionType.java:343— src/java/org/apache/cassandra/db/marshal/CollectionType.java:343-359 | src/java/org/apache/cassandra/db/marshal/MapType.java:266-285 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) src/java/org/apache/cassandra/db/Slices.java:412— src/java/org/apache/cassandra/db/Slices.java:412-428 | src/java/org/apache/cassandra/db/Slices.java:431-447 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) src/java/org/apache/cassandra/cql3/constraints/AbstractFunctionSatisfiabilityChecker.java:177— src/java/org/apache/cassandra/cql3/constraints/AbstractFunctionSatisfiabilityChecker.java:177-193 | src/java/org/apache/cassandra/cql3/constraints/AbstractFunctionSatisfiabilityChecker.java:208-230 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) src/java/org/apache/cassandra/net/InboundConnectionInitiator.java:237— src/java/org/apache/cassandra/net/InboundConnectionInitiator.java:237-253 | src/java/org/apache/cassandra/net/OutboundConnectionInitiator.java:287-305 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) src/java/org/apache/cassandra/metrics/CassandraMetricsRegistry.java:1364— src/java/org/apache/cassandra/metrics/CassandraMetricsRegistry.java:1364-1380 | src/java/org/apache/cassandra/metrics/DefaultNameFactory.java:53-69 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) src/java/org/apache/cassandra/io/tries/ReverseValueIterator.java:88— src/java/org/apache/cassandra/io/tries/ReverseValueIterator.java:88-104 | src/java/org/apache/cassandra/io/tries/ValueIterator.java:104-121 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) src/java/org/apache/cassandra/cql3/functions/CollectionFcts.java:123— src/java/org/apache/cassandra/cql3/functions/CollectionFcts.java:123-139 | src/java/org/apache/cassandra/cql3/functions/CollectionFcts.java:151-167 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) src/java/org/apache/cassandra/db/marshal/AbstractType.java:580— src/java/org/apache/cassandra/db/marshal/AbstractType.java:580-596 | src/java/org/apache/cassandra/db/marshal/AbstractType.java:599-615 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) src/java/org/apache/cassandra/tcm/ownership/Delta.java:68— src/java/org/apache/cassandra/tcm/ownership/Delta.java:68-91 | src/java/org/apache/cassandra/tcm/ownership/Delta.java:111-127 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) src/java/org/apache/cassandra/io/tries/Walker.java:228— src/java/org/apache/cassandra/io/tries/Walker.java:228-244 | src/java/org/apache/cassandra/io/tries/Walker.java:254-271 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) src/java/org/apache/cassandra/security/ThreadAwareSecurityManager.java:116— src/java/org/apache/cassandra/security/ThreadAwareSecurityManager.java:116-138 | src/java/org/apache/cassandra/security/ThreadAwareSecurityManager.java:146-162 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) src/java/org/apache/cassandra/utils/concurrent/NonBlockingRateLimiter.java:113— src/java/org/apache/cassandra/utils/concurrent/NonBlockingRateLimiter.java:113-129 | src/java/org/apache/cassandra/utils/concurrent/NonBlockingRateLimiter.java:137-157 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) src/java/org/apache/cassandra/db/lifecycle/Helpers.java:122— src/java/org/apache/cassandra/db/lifecycle/Helpers.java:122-138 | src/java/org/apache/cassandra/db/lifecycle/Helpers.java:158-174 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (4 corresponding lines) · ×20
Edited copy of a member (4 corresponding lines) src/java/org/apache/cassandra/schema/Indexes.java:158— src/java/org/apache/cassandra/schema/Indexes.java:158-161 | src/java/org/apache/cassandra/schema/Triggers.java:106-111 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) src/java/org/apache/cassandra/db/PartitionRangeReadCommand.java:622— src/java/org/apache/cassandra/db/PartitionRangeReadCommand.java:622-625 | src/java/org/apache/cassandra/db/SinglePartitionReadCommand.java:1511-1514 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) src/java/org/apache/cassandra/cql3/statements/GrantPermissionsStatement.java:90— src/java/org/apache/cassandra/cql3/statements/GrantPermissionsStatement.java:90-93 | src/java/org/apache/cassandra/cql3/statements/RevokePermissionsStatement.java:78-81 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) src/java/org/apache/cassandra/index/sai/disk/v1/keystore/KeyLookup.java:360— src/java/org/apache/cassandra/index/sai/disk/v1/keystore/KeyLookup.java:360-363 | src/java/org/apache/cassandra/index/sai/disk/v1/keystore/KeyStoreWriter.java:208-211 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) src/java/org/apache/cassandra/io/sstable/format/big/BigFormat.java:295— src/java/org/apache/cassandra/io/sstable/format/big/BigFormat.java:295-298 | src/java/org/apache/cassandra/io/sstable/format/bti/BtiFormat.java:190-193 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) src/java/org/apache/cassandra/cql3/statements/schema/DropAggregateStatement.java:186— src/java/org/apache/cassandra/cql3/statements/schema/DropAggregateStatement.java:186-189 | src/java/org/apache/cassandra/cql3/statements/schema/DropFunctionStatement.java:204-207 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) src/java/org/apache/cassandra/utils/AbstractBiMultiValMap.java:85— src/java/org/apache/cassandra/utils/AbstractBiMultiValMap.java:85-88 | src/java/org/apache/cassandra/utils/ConcurrentBiMap.java:106-109 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) src/java/org/apache/cassandra/cql3/selection/Selectable.java:334— src/java/org/apache/cassandra/cql3/selection/Selectable.java:334-337 | src/java/org/apache/cassandra/cql3/selection/WritetimeOrTTLSelector.java:72-75 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) src/java/org/apache/cassandra/io/sstable/format/big/BigTableReader.java:527— src/java/org/apache/cassandra/io/sstable/format/big/BigTableReader.java:527-530 | src/java/org/apache/cassandra/io/sstable/format/bti/BtiTableReader.java:566-569 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) src/java/org/apache/cassandra/cql3/functions/types/AbstractAddressableByIndexData.java:293— src/java/org/apache/cassandra/cql3/functions/types/AbstractAddressableByIndexData.java:293-296 | src/java/org/apache/cassandra/cql3/functions/types/AbstractData.java:630-633 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) src/java/org/apache/cassandra/repair/RepairJobDesc.java:88— src/java/org/apache/cassandra/repair/RepairJobDesc.java:88-91 | src/java/org/apache/cassandra/service/paxos/PaxosRepairHistory.java:75-78 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) src/java/org/apache/cassandra/service/accord/txn/TxnCondition.java:751— src/java/org/apache/cassandra/service/accord/txn/TxnCondition.java:751-754 | src/java/org/apache/cassandra/service/accord/txn/TxnReferenceValue.java:224-227 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) src/java/org/apache/cassandra/service/accord/txn/TxnDataValue.java:82— src/java/org/apache/cassandra/service/accord/txn/TxnDataValue.java:82-85 | src/java/org/apache/cassandra/tcm/Transformation.java:351-354 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) src/java/org/apache/cassandra/cql3/functions/types/CodecUtils.java:267— src/java/org/apache/cassandra/cql3/functions/types/CodecUtils.java:267-270 | src/java/org/apache/cassandra/utils/ByteBufferUtil.java:856-859 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) src/java/org/apache/cassandra/db/filter/DataLimits.java:403— src/java/org/apache/cassandra/db/filter/DataLimits.java:403-406 | src/java/org/apache/cassandra/utils/memory/EnsureOnHeap.java:54-58 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) src/java/org/apache/cassandra/db/rows/ArrayCell.java:60— src/java/org/apache/cassandra/db/rows/ArrayCell.java:60-63 | src/java/org/apache/cassandra/db/rows/BufferCell.java:71-74 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) src/java/org/apache/cassandra/index/sai/analyzer/filter/BasicFilters.java:54— src/java/org/apache/cassandra/index/sai/analyzer/filter/BasicFilters.java:54-57 | src/java/org/apache/cassandra/index/sasi/analyzer/AbstractAnalyzer.java:72-76 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) src/java/org/apache/cassandra/service/paxos/v1/AbstractPaxosVerbHandler.java:64— src/java/org/apache/cassandra/service/paxos/v1/AbstractPaxosVerbHandler.java:64-67 | src/java/org/apache/cassandra/service/paxos/v1/PrepareVerbHandler.java:37-40 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) tools/stress/src/org/apache/cassandra/stress/generate/values/Bytes.java:35— tools/stress/src/org/apache/cassandra/stress/generate/values/Bytes.java:35-38 | tools/stress/src/org/apache/cassandra/stress/generate/values/HexBytes.java:33-36 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) tools/stress/src/org/apache/cassandra/stress/generate/values/HexStrings.java:30— tools/stress/src/org/apache/cassandra/stress/generate/values/HexStrings.java:30-33 | tools/stress/src/org/apache/cassandra/stress/generate/values/Strings.java:32-35 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (21 corresponding lines) · ×19
Edited copy of a member (21 corresponding lines) src/java/org/apache/cassandra/service/reads/ReplicaFilteringProtection.java:167— src/java/org/apache/cassandra/service/reads/ReplicaFilteringProtection.java:167-190 | src/java/org/apache/cassandra/service/reads/ShortReadPartitionsProtection.java:184-204 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) src/java/org/apache/cassandra/cql3/Duration.java:354— src/java/org/apache/cassandra/cql3/Duration.java:354-375 | src/java/org/apache/cassandra/cql3/functions/types/Duration.java:349-369 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) src/java/org/apache/cassandra/io/tries/TrieNode.java:772— src/java/org/apache/cassandra/io/tries/TrieNode.java:772-792 | src/java/org/apache/cassandra/io/tries/TrieNode.java:830-855 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) src/java/org/apache/cassandra/tools/nodetool/NetStats.java:131— src/java/org/apache/cassandra/tools/nodetool/NetStats.java:131-151 | src/java/org/apache/cassandra/tools/nodetool/NetStats.java:155-175 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) src/java/org/apache/cassandra/db/DeletionTime.java:251— src/java/org/apache/cassandra/db/DeletionTime.java:251-271 | src/java/org/apache/cassandra/db/DeletionTime.java:274-294 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) src/java/org/apache/cassandra/db/marshal/CompositeType.java:390— src/java/org/apache/cassandra/db/marshal/CompositeType.java:390-410 | src/java/org/apache/cassandra/db/marshal/CompositeType.java:414-434 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) src/java/org/apache/cassandra/tcm/sequences/BootstrapAndReplace.java:321— src/java/org/apache/cassandra/tcm/sequences/BootstrapAndReplace.java:321-341 | src/java/org/apache/cassandra/tcm/sequences/UnbootstrapAndLeave.java:255-275 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) src/java/org/apache/cassandra/cql3/terms/Marker.java:76— src/java/org/apache/cassandra/cql3/terms/Marker.java:76-96 | src/java/org/apache/cassandra/cql3/terms/Marker.java:101-123 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:2604— src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:2604-2626 | src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:2908-2928 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) src/java/org/apache/cassandra/io/sstable/indexsummary/IndexSummary.java:131— src/java/org/apache/cassandra/io/sstable/indexsummary/IndexSummary.java:131-155 | src/java/org/apache/cassandra/journal/OnDiskIndex.java:346-366 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) src/java/org/apache/cassandra/db/Keyspace.java:769— src/java/org/apache/cassandra/db/Keyspace.java:769-789 | src/java/org/apache/cassandra/schema/TableMetadataRef.java:153-173 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) src/java/org/apache/cassandra/cql3/statements/AlterRoleStatement.java:72— src/java/org/apache/cassandra/cql3/statements/AlterRoleStatement.java:72-95 | src/java/org/apache/cassandra/cql3/statements/CreateRoleStatement.java:78-98 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) src/java/org/apache/cassandra/auth/jmx/AuthorizationProxy.java:374— src/java/org/apache/cassandra/auth/jmx/AuthorizationProxy.java:374-405 | src/java/org/apache/cassandra/auth/jmx/AuthorizationProxy.java:419-439 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) src/java/org/apache/cassandra/db/ReadResponse.java:735— src/java/org/apache/cassandra/db/ReadResponse.java:735-757 | src/java/org/apache/cassandra/db/ReadResponse.java:778-798 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) src/java/org/apache/cassandra/cql3/functions/CollectionFcts.java:178— src/java/org/apache/cassandra/cql3/functions/CollectionFcts.java:178-198 | src/java/org/apache/cassandra/cql3/functions/LengthFcts.java:57-78 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) src/java/org/apache/cassandra/cql3/functions/types/CodecUtils.java:96— src/java/org/apache/cassandra/cql3/functions/types/CodecUtils.java:96-117 | src/java/org/apache/cassandra/cql3/functions/types/CodecUtils.java:244-264 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) src/java/org/apache/cassandra/io/sstable/format/SortedTableScrubber.java:359— src/java/org/apache/cassandra/io/sstable/format/SortedTableScrubber.java:359-380 | src/java/org/apache/cassandra/io/sstable/format/SortedTableVerifier.java:495-515 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) src/java/org/apache/cassandra/net/InboundConnectionInitiator.java:558— src/java/org/apache/cassandra/net/InboundConnectionInitiator.java:558-578 | src/java/org/apache/cassandra/transport/PipelineConfigurator.java:213-234 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) src/java/org/apache/cassandra/utils/concurrent/WeightedQueue.java:74— src/java/org/apache/cassandra/utils/concurrent/WeightedQueue.java:74-94 | src/java/org/apache/cassandra/utils/concurrent/WeightedQueue.java:138-159 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (12 lines × 2) src/java/org/apache/cassandra/cql3/functions/FunctionArguments.java:56— src/java/org/apache/cassandra/cql3/functions/FunctionArguments.java:56-67 | src/java/org/apache/cassandra/cql3/functions/FunctionArguments.java:104-115 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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 `argTypes` to `List<UDFDataType>` in one and `List<AbstractType<?>>` 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) src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:2651— src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:2651-2662 | src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:2950-2961 — both copies are in the same file, so extract the 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 (12 lines × 2) src/java/org/apache/cassandra/db/marshal/TupleType.java:552— src/java/org/apache/cassandra/db/marshal/TupleType.java:552-563 | src/java/org/apache/cassandra/db/marshal/TupleType.java:573-584 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/db/marshal/TupleType.java:552` 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) src/java/org/apache/cassandra/dht/ByteOrderedPartitioner.java:427— src/java/org/apache/cassandra/dht/ByteOrderedPartitioner.java:427-438 | src/java/org/apache/cassandra/dht/OrderPreservingPartitioner.java:285-296 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 `src/java/org/apache/cassandra/dht/ByteOrderedPartitioner.java:427` 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) src/java/org/apache/cassandra/dht/tokenallocator/NoReplicationTokenAllocator.java:62— src/java/org/apache/cassandra/dht/tokenallocator/NoReplicationTokenAllocator.java:62-73 | src/java/org/apache/cassandra/dht/tokenallocator/ReplicationAwareTokenAllocator.java:169-180 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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, `src/java/org/apache/cassandra/dht/tokenallocator/NoReplicationTokenAllocator.java:74` calls `clear` and `src/java/org/apache/cassandra/dht/tokenallocator/ReplicationAwareTokenAllocator.java:181` 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) src/java/org/apache/cassandra/index/accord/RangeMemoryIndex.java:135— src/java/org/apache/cassandra/index/accord/RangeMemoryIndex.java:135-146 | src/java/org/apache/cassandra/service/accord/journal/SegmentRangeSearcher.java:275-286 — 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 `src/java/org/apache/cassandra/index/accord/RangeMemoryIndex.java:135` 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 first that the copies are not typed on the same thing: the declarations holding them bind `range` to `Range` in one and `IndexedRange` 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) src/java/org/apache/cassandra/io/compress/CompressionMetadata.java:423— src/java/org/apache/cassandra/io/compress/CompressionMetadata.java:423-434 | src/java/org/apache/cassandra/io/compress/CompressionMetadata.java:457-468 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/io/compress/CompressionMetadata.java:423` 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) src/java/org/apache/cassandra/io/compress/ZstdCompressorBase.java:181— src/java/org/apache/cassandra/io/compress/ZstdCompressorBase.java:181-192 | src/java/org/apache/cassandra/io/compress/ZstdCompressorBase.java:226-237 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/io/compress/ZstdCompressorBase.java:181` 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) src/java/org/apache/cassandra/repair/RepairJob.java:607— src/java/org/apache/cassandra/repair/RepairJob.java:607-618 | src/java/org/apache/cassandra/repair/RepairJob.java:660-671 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/repair/RepairJob.java:607` 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) src/java/org/apache/cassandra/service/consensus/TransactionalMode.java:194— src/java/org/apache/cassandra/service/consensus/TransactionalMode.java:194-205 | src/java/org/apache/cassandra/service/consensus/TransactionalMode.java:243-254 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/service/consensus/TransactionalMode.java:194` 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 (12 lines × 2) src/java/org/apache/cassandra/service/consensus/migration/ConsensusRequestRouter.java:397— src/java/org/apache/cassandra/service/consensus/migration/ConsensusRequestRouter.java:397-408 | src/java/org/apache/cassandra/service/consensus/migration/ConsensusRequestRouter.java:438-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/service/consensus/migration/ConsensusRequestRouter.java:397` 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) src/java/org/apache/cassandra/service/paxos/PaxosRequestCallback.java:62— src/java/org/apache/cassandra/service/paxos/PaxosRequestCallback.java:62-73 | src/java/org/apache/cassandra/service/paxos/PaxosRequestCallback.java:89-100 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/service/paxos/PaxosRequestCallback.java:62` 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) src/java/org/apache/cassandra/tcm/ClusterMetadataService.java:306— src/java/org/apache/cassandra/tcm/ClusterMetadataService.java:306-317 | src/java/org/apache/cassandra/tcm/ClusterMetadataService.java:348-359 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/tcm/ClusterMetadataService.java:306` 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 (12 lines × 2) src/java/org/apache/cassandra/utils/FastByteOperations.java:256— src/java/org/apache/cassandra/utils/FastByteOperations.java:256-267 | src/java/org/apache/cassandra/utils/FastByteOperations.java:287-298 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) src/java/org/apache/cassandra/utils/MergeIterator.java:298— src/java/org/apache/cassandra/utils/MergeIterator.java:298-309 | src/java/org/apache/cassandra/utils/MergeIterator.java:395-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.
Duplicated block (12 lines × 2) src/java/org/apache/cassandra/service/accord/serializers/CommandSerializers.java:537— src/java/org/apache/cassandra/service/accord/serializers/CommandSerializers.java:537-548 | src/java/org/apache/cassandra/service/accord/serializers/CommandSerializers.java:670-681 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) src/java/org/apache/cassandra/cql3/constraints/LengthConstraint.java:86— src/java/org/apache/cassandra/cql3/constraints/LengthConstraint.java:86-97 | src/java/org/apache/cassandra/cql3/constraints/OctetLengthConstraint.java:72-83 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (12 lines × 2) src/java/org/apache/cassandra/dht/Bounds.java:113— src/java/org/apache/cassandra/dht/Bounds.java:113-124 | src/java/org/apache/cassandra/dht/Range.java:536-547 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 (12 lines × 2) src/java/org/apache/cassandra/service/accord/execution/Task.java:1136— src/java/org/apache/cassandra/service/accord/execution/Task.java:1136-1147 | src/java/org/apache/cassandra/utils/concurrent/IntrusiveStack.java:195-206 — 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.
MethodTooLong: DatabaseDescriptor.applySimpleConfig src/java/org/apache/cassandra/config/DatabaseDescriptor.java:617— MethodTooLong — applySimpleConfig runs 393 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 293 over it, 3.93× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: TableMetrics.<init> src/java/org/apache/cassandra/metrics/TableMetrics.java:452— MethodTooLong — <init> runs 313 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 213 over it, 3.13× 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: RepairMessageVerbHandler.doVerb src/java/org/apache/cassandra/repair/RepairMessageVerbHandler.java:97— MethodTooLong — doVerb 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: TableStatsHolder.initializeKeyspaces src/java/org/apache/cassandra/tools/nodetool/stats/TableStatsHolder.java:212— MethodTooLong — initializeKeyspaces runs 179 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 79 over it, 1.79× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: StatsTableComparator.compare src/java/org/apache/cassandra/tools/nodetool/stats/StatsTableComparator.java:123— MethodTooLong — compare runs 171 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 71 over it, 1.71× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CreateViewStatement.apply src/java/org/apache/cassandra/cql3/statements/schema/CreateViewStatement.java:140— MethodTooLong — apply 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.
MethodTooLong: Controller.validateOptions src/java/org/apache/cassandra/db/compaction/unified/Controller.java:512— MethodTooLong — validateOptions runs 127 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 27 over it, 1.27× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CompactionTask.runMayThrow src/java/org/apache/cassandra/db/compaction/CompactionTask.java:181— MethodTooLong — runMayThrow runs 119 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 19 over it, 1.19× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: StatsMetadataSerializer.deserialize src/java/org/apache/cassandra/io/sstable/metadata/StatsMetadata.java:523— MethodTooLong — deserialize runs 108 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 8 over it, 1.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: StatementRestrictions.<init> src/java/org/apache/cassandra/cql3/restrictions/StatementRestrictions.java:190— MethodTooLong — <init> runs 107 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 7 over it, 1.07× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: JavaBasedUDFunction.<init> src/java/org/apache/cassandra/cql3/functions/JavaBasedUDFunction.java:211— MethodTooLong — <init> runs 106 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 6 over it, 1.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: SSTableMetadataViewer.printScannedOverview src/java/org/apache/cassandra/tools/SSTableMetadataViewer.java:173— MethodTooLong — printScannedOverview runs 106 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 6 over it, 1.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: SSTableImporter.importNewSSTables src/java/org/apache/cassandra/db/SSTableImporter.java:78— MethodTooLong — importNewSSTables runs 102 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 2 over it, 1.02× 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: CassandraDaemon.setup src/java/org/apache/cassandra/service/CassandraDaemon.java:244— MethodTooLong — setup runs 102 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 2 over it, 1.02× 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: Move.executeNext src/java/org/apache/cassandra/tcm/sequences/Move.java:261— MethodTooLong — executeNext runs 102 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 2 over it, 1.02× 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: Info.execute src/java/org/apache/cassandra/tools/nodetool/Info.java:44— MethodTooLong — execute runs 102 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 2 over it, 1.02× 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: IndexSummaryRedistribution.adjustSamplingLevels src/java/org/apache/cassandra/io/sstable/indexsummary/IndexSummaryRedistribution.java:162— MethodTooLong — adjustSamplingLevels runs 101 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1 over it, 1.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: StorageService.drain src/java/org/apache/cassandra/service/StorageService.java:3883— MethodTooLong — drain runs 101 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1 over it, 1.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.
D4 · Code Duplication· Edited copy of a member (20 corresponding lines) · ×18
Edited copy of a member (20 corresponding lines) src/java/org/apache/cassandra/utils/ArrayUtils.java:26— src/java/org/apache/cassandra/utils/ArrayUtils.java:26-45 | src/java/org/apache/cassandra/utils/ArrayUtils.java:48-67 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) src/java/org/apache/cassandra/db/SystemKeyspace.java:1730— src/java/org/apache/cassandra/db/SystemKeyspace.java:1730-1749 | src/java/org/apache/cassandra/db/SystemKeyspace.java:1755-1776 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) src/java/org/apache/cassandra/service/accord/topology/WatermarkCollector.java:216— src/java/org/apache/cassandra/service/accord/topology/WatermarkCollector.java:216-235 | src/java/org/apache/cassandra/service/accord/topology/WatermarkCollector.java:262-283 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) src/java/org/apache/cassandra/index/sai/virtual/SSTableIndexesSystemView.java:61— src/java/org/apache/cassandra/index/sai/virtual/SSTableIndexesSystemView.java:61-80 | src/java/org/apache/cassandra/index/sai/virtual/SegmentsSystemView.java:61-84 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) src/java/org/apache/cassandra/cql3/terms/UserTypes.java:61— src/java/org/apache/cassandra/cql3/terms/UserTypes.java:61-80 | src/java/org/apache/cassandra/cql3/terms/UserTypes.java:177-198 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) src/java/org/apache/cassandra/cql3/terms/Lists.java:165— src/java/org/apache/cassandra/cql3/terms/Lists.java:165-184 | src/java/org/apache/cassandra/cql3/terms/Sets.java:151-176 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) src/java/org/apache/cassandra/utils/btree/BTree.java:1376— src/java/org/apache/cassandra/utils/btree/BTree.java:1376-1395 | src/java/org/apache/cassandra/utils/btree/BTree.java:1400-1419 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) src/java/org/apache/cassandra/index/SecondaryIndexManager.java:1735— src/java/org/apache/cassandra/index/SecondaryIndexManager.java:1735-1754 | src/java/org/apache/cassandra/index/SecondaryIndexManager.java:1805-1828 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) src/java/org/apache/cassandra/cql3/constraints/FunctionColumnConstraint.java:185— src/java/org/apache/cassandra/cql3/constraints/FunctionColumnConstraint.java:185-205 | src/java/org/apache/cassandra/cql3/constraints/UnaryFunctionColumnConstraint.java:169-188 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) src/java/org/apache/cassandra/db/marshal/DynamicCompositeType.java:179— src/java/org/apache/cassandra/db/marshal/DynamicCompositeType.java:179-198 | src/java/org/apache/cassandra/db/marshal/DynamicCompositeType.java:246-266 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) src/java/org/apache/cassandra/auth/CIDRPermissionsManager.java:119— src/java/org/apache/cassandra/auth/CIDRPermissionsManager.java:119-138 | src/java/org/apache/cassandra/auth/CassandraNetworkAuthorizer.java:92-112 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) src/java/org/apache/cassandra/service/StorageProxy.java:2250— src/java/org/apache/cassandra/service/StorageProxy.java:2250-2269 | src/java/org/apache/cassandra/service/consensus/migration/ConsensusMigrationMutationHelper.java:111-133 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) src/java/org/apache/cassandra/hints/HintsReader.java:212— src/java/org/apache/cassandra/hints/HintsReader.java:212-231 | src/java/org/apache/cassandra/hints/HintsReader.java:318-337 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) src/java/org/apache/cassandra/service/accord/execution/SafeTask.java:1821— src/java/org/apache/cassandra/service/accord/execution/SafeTask.java:1821-1841 | src/java/org/apache/cassandra/service/accord/execution/Task.java:672-691 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) src/java/org/apache/cassandra/utils/ObjectSizes.java:161— src/java/org/apache/cassandra/utils/ObjectSizes.java:161-180 | src/java/org/apache/cassandra/utils/ObjectSizes.java:196-216 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) src/java/org/apache/cassandra/index/sai/plan/Operation.java:295— src/java/org/apache/cassandra/index/sai/plan/Operation.java:295-314 | src/java/org/apache/cassandra/index/sasi/plan/Operation.java:348-374 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) tools/fqltool/src/org/apache/cassandra/fqltool/ResultComparator.java:95— tools/fqltool/src/org/apache/cassandra/fqltool/ResultComparator.java:95-114 | tools/fqltool/src/org/apache/cassandra/fqltool/ResultComparator.java:117-136 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) tools/fqltool/src/org/apache/cassandra/fqltool/FQLQuery.java:156— tools/fqltool/src/org/apache/cassandra/fqltool/FQLQuery.java:156-180 | tools/fqltool/src/org/apache/cassandra/fqltool/FQLQuery.java:223-242 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Swallowed exception (caught, then discarded) src/java/org/apache/cassandra/utils/Hex.java:163— `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) src/java/org/apache/cassandra/utils/concurrent/Ref.java:749— `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) src/java/org/apache/cassandra/transport/Client.java:195— `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) src/java/org/apache/cassandra/service/snapshot/TableSnapshot.java:303— `catch (Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) src/java/org/apache/cassandra/service/paxos/Paxos.java:1349— `catch (Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) src/java/org/apache/cassandra/schema/SystemDistributedKeyspace.java:657— `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) src/java/org/apache/cassandra/io/util/FileUtils.java:766— `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) src/java/org/apache/cassandra/io/sstable/SSTable.java:256— `catch (Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) src/java/org/apache/cassandra/io/sstable/SSTable.java:278— `catch (Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) src/java/org/apache/cassandra/io/sstable/SSTable.java:300— `catch (Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) src/java/org/apache/cassandra/io/sstable/format/SortedTableScrubber.java:144— `catch (RuntimeException)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) src/java/org/apache/cassandra/index/sasi/utils/TypeUtil.java:84— `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) src/java/org/apache/cassandra/db/commitlog/CommitLogReader.java:194— `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) src/java/org/apache/cassandra/cql3/functions/types/utils/Bytes.java:68— `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) src/java/org/apache/cassandra/config/GuardrailsOptions.java:1796— `catch (Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) src/java/org/apache/cassandra/config/YamlConfigurationLoader.java:284— `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) pylib/cqlshlib/cql3handling.py:930— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
D4 · Code Duplication· Edited copy of a member (5 corresponding lines) · ×15
Edited copy of a member (5 corresponding lines) src/java/org/apache/cassandra/cql3/functions/types/ParseUtils.java:197— src/java/org/apache/cassandra/cql3/functions/types/ParseUtils.java:197-206 | src/java/org/apache/cassandra/db/marshal/TypeParser.java:597-601 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) src/java/org/apache/cassandra/net/RequestCallbacks.java:97— src/java/org/apache/cassandra/net/RequestCallbacks.java:97-102 | src/java/org/apache/cassandra/net/RequestCallbacks.java:105-109 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) src/java/org/apache/cassandra/service/accord/journal/RangeSearchManager.java:214— src/java/org/apache/cassandra/service/accord/journal/RangeSearchManager.java:214-218 | src/java/org/apache/cassandra/service/accord/journal/RangeSearchManager.java:222-226 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) src/java/org/apache/cassandra/db/PartitionRangeReadCommand.java:653— src/java/org/apache/cassandra/db/PartitionRangeReadCommand.java:653-657 | src/java/org/apache/cassandra/db/SinglePartitionReadCommand.java:1573-1577 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) src/java/org/apache/cassandra/db/marshal/AbstractType.java:126— src/java/org/apache/cassandra/db/marshal/AbstractType.java:126-131 | src/java/org/apache/cassandra/db/marshal/LexicalUUIDType.java:63-67 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) src/java/org/apache/cassandra/service/accord/api/AccordTopologySorter.java:137— src/java/org/apache/cassandra/service/accord/api/AccordTopologySorter.java:137-141 | src/java/org/apache/cassandra/service/accord/debug/DebugTxnGraph.java:354-358 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) src/java/org/apache/cassandra/service/accord/debug/AccordTracing.java:590— src/java/org/apache/cassandra/service/accord/debug/AccordTracing.java:590-594 | src/java/org/apache/cassandra/service/accord/debug/DebugTxnGraph.java:143-147 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) src/java/org/apache/cassandra/service/accord/topology/FetchTopologies.java:98— src/java/org/apache/cassandra/service/accord/topology/FetchTopologies.java:98-102 | src/java/org/apache/cassandra/service/accord/txn/TxnReference.java:276-280 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) src/java/org/apache/cassandra/service/accord/serializers/AwaitSerializers.java:124— src/java/org/apache/cassandra/service/accord/serializers/AwaitSerializers.java:124-129 | src/java/org/apache/cassandra/service/accord/serializers/TxnRequestSerializer.java:34-38 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) src/java/org/apache/cassandra/db/guardrails/Guardrails.java:2084— src/java/org/apache/cassandra/db/guardrails/Guardrails.java:2084-2088 | src/java/org/apache/cassandra/db/virtual/LocalRepairTables.java:447-451 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) src/java/org/apache/cassandra/db/guardrails/Guardrails.java:2091— src/java/org/apache/cassandra/db/guardrails/Guardrails.java:2091-2095 | src/java/org/apache/cassandra/db/virtual/LocalRepairTables.java:440-444 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) src/java/org/apache/cassandra/service/accord/serializers/TableMetadatas.java:68— src/java/org/apache/cassandra/service/accord/serializers/TableMetadatas.java:68-72 | src/java/org/apache/cassandra/service/accord/serializers/TableMetadatasAndKeys.java:98-102 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) src/java/org/apache/cassandra/cql3/functions/FunctionArguments.java:88— src/java/org/apache/cassandra/cql3/functions/FunctionArguments.java:88-93 | src/java/org/apache/cassandra/cql3/functions/TokenFct.java:45-49 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) src/java/org/apache/cassandra/db/rows/RowIterators.java:89— src/java/org/apache/cassandra/db/rows/RowIterators.java:89-93 | src/java/org/apache/cassandra/db/rows/UnfilteredRowIterators.java:372-376 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) src/java/org/apache/cassandra/cql3/statements/CQL3CasRequest.java:320— src/java/org/apache/cassandra/cql3/statements/CQL3CasRequest.java:320-324 | src/java/org/apache/cassandra/locator/ReplicaPlan.java:138-142 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Unfinished stub — throws a "not implemented" exception src/java/org/apache/cassandra/cql3/Operator.java:948— `isSatisfiedBy` is a shipped method whose whole body only throws `UnsupportedOperationException` saying it is not implemented — scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws a "not implemented" exception src/java/org/apache/cassandra/io/util/ChecksumedDataOutputPlus.java:106— `writeUTF` is a shipped method whose whole body only throws `UnsupportedOperationException` saying it is not implemented — scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — empty body under a TODO marker src/java/org/apache/cassandra/journal/Journal.java:150— `onFlushFailed` is a shipped method whose body is empty except for a TODO/FIXME — scaffolding that was never completed. Implement it or remove it.
Unfinished stub — returns a placeholder under a TODO marker src/java/org/apache/cassandra/net/RequestCallback.java:55— `invokeOnFailure` is a shipped method whose whole body returns a default value under a TODO/FIXME — a placeholder standing in for the implementation. Implement it or remove it.
Unfinished stub — empty body under a TODO marker src/java/org/apache/cassandra/service/StorageService.java:4715— `resetLocalSchema` is a shipped method whose body is empty except for a TODO/FIXME — scaffolding that was never completed. Implement it or remove it.
Unfinished stub — empty body under a TODO marker src/java/org/apache/cassandra/service/StorageService.java:4721— `reloadLocalSchema` is a shipped method whose body is empty except for a TODO/FIXME — scaffolding that was never completed. Implement it or remove it.
Unfinished stub — throws a "not implemented" exception src/java/org/apache/cassandra/utils/btree/BTreeMap.java:164— `navigableKeySet` is a shipped method whose whole body only throws `UnsupportedOperationException` saying it is not implemented — scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws a "not implemented" exception src/java/org/apache/cassandra/utils/btree/BTreeMap.java:170— `descendingKeySet` is a shipped method whose whole body only throws `UnsupportedOperationException` saying it is not implemented — scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws a "not implemented" exception src/java/org/apache/cassandra/utils/btree/BTreeMap.java:176— `subMap` is a shipped method whose whole body only throws `UnsupportedOperationException` saying it is not implemented — scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws a "not implemented" exception src/java/org/apache/cassandra/utils/btree/BTreeMap.java:182— `headMap` is a shipped method whose whole body only throws `UnsupportedOperationException` saying it is not implemented — scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws a "not implemented" exception src/java/org/apache/cassandra/utils/btree/BTreeMap.java:188— `tailMap` is a shipped method whose whole body only throws `UnsupportedOperationException` saying it is not implemented — scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws a "not implemented" exception src/java/org/apache/cassandra/utils/btree/BTreeMap.java:200— `subMap` is a shipped method whose whole body only throws `UnsupportedOperationException` saying it is not implemented — scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws a "not implemented" exception src/java/org/apache/cassandra/utils/btree/BTreeMap.java:206— `headMap` is a shipped method whose whole body only throws `UnsupportedOperationException` saying it is not implemented — scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws a "not implemented" exception src/java/org/apache/cassandra/utils/btree/BTreeMap.java:212— `tailMap` is a shipped method whose whole body only throws `UnsupportedOperationException` saying it is not implemented — scaffolding that was never completed. Implement it or remove the dead surface.
D4 · Code Duplication· Edited copy of a member (22 corresponding lines) · ×12
Edited copy of a member (22 corresponding lines) src/java/org/apache/cassandra/tcm/ownership/ReplicaGroups.java:491— src/java/org/apache/cassandra/tcm/ownership/ReplicaGroups.java:491-512 | src/java/org/apache/cassandra/tcm/ownership/ReplicaGroups.java:551-573 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) src/java/org/apache/cassandra/schema/Types.java:532— src/java/org/apache/cassandra/schema/Types.java:532-553 | src/java/org/apache/cassandra/schema/Types.java:586-608 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) src/java/org/apache/cassandra/io/sstable/format/SortedTableScrubber.java:530— src/java/org/apache/cassandra/io/sstable/format/SortedTableScrubber.java:530-556 | src/java/org/apache/cassandra/io/sstable/format/SortedTableScrubber.java:671-692 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) src/java/org/apache/cassandra/cql3/terms/Lists.java:353— src/java/org/apache/cassandra/cql3/terms/Lists.java:353-381 | src/java/org/apache/cassandra/cql3/terms/Lists.java:547-568 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) src/java/org/apache/cassandra/auth/CIDRPermissionsManager.java:177— src/java/org/apache/cassandra/auth/CIDRPermissionsManager.java:177-209 | src/java/org/apache/cassandra/auth/CassandraNetworkAuthorizer.java:172-193 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) src/java/org/apache/cassandra/cql3/statements/GrantPermissionsStatement.java:65— src/java/org/apache/cassandra/cql3/statements/GrantPermissionsStatement.java:65-86 | src/java/org/apache/cassandra/cql3/statements/RevokePermissionsStatement.java:47-68 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) src/java/org/apache/cassandra/cql3/UntypedResultSet.java:176— src/java/org/apache/cassandra/cql3/UntypedResultSet.java:176-198 | src/java/org/apache/cassandra/cql3/UntypedResultSet.java:242-263 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) src/java/org/apache/cassandra/cql3/Duration.java:225— src/java/org/apache/cassandra/cql3/Duration.java:225-246 | src/java/org/apache/cassandra/cql3/functions/types/Duration.java:210-232 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) src/java/org/apache/cassandra/utils/CollectionSerializers.java:652— src/java/org/apache/cassandra/utils/CollectionSerializers.java:652-673 | src/java/org/apache/cassandra/utils/CollectionSerializers.java:676-697 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) src/java/org/apache/cassandra/utils/CollectionSerializers.java:604— src/java/org/apache/cassandra/utils/CollectionSerializers.java:604-625 | src/java/org/apache/cassandra/utils/CollectionSerializers.java:628-649 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) src/java/org/apache/cassandra/cql3/statements/TruncateStatement.java:73— src/java/org/apache/cassandra/cql3/statements/TruncateStatement.java:73-94 | src/java/org/apache/cassandra/cql3/statements/TruncateStatement.java:97-119 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) src/java/org/apache/cassandra/utils/NativeLibrary.java:277— src/java/org/apache/cassandra/utils/NativeLibrary.java:277-299 | src/java/org/apache/cassandra/utils/NativeLibrary.java:302-323 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 6+ corresponding lines) · ×12
Edited copies of one member (3 members, 6+ corresponding lines) src/java/org/apache/cassandra/utils/memory/BigEndianMemoryUtil.java:94— src/java/org/apache/cassandra/utils/memory/BigEndianMemoryUtil.java:94-99 | src/java/org/apache/cassandra/utils/memory/LittleEndianMemoryUtil.java:94-99 | src/java/org/apache/cassandra/utils/memory/NativeEndianMemoryUtil.java:131-142 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 6+ corresponding lines) src/java/org/apache/cassandra/cql3/conditions/ColumnCondition.java:328— src/java/org/apache/cassandra/cql3/conditions/ColumnCondition.java:328-333 | src/java/org/apache/cassandra/cql3/conditions/ColumnCondition.java:441-446 | src/java/org/apache/cassandra/cql3/conditions/ColumnCondition.java:488-493 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 6+ corresponding lines) src/java/org/apache/cassandra/service/StorageService.java:2089— src/java/org/apache/cassandra/service/StorageService.java:2089-2094 | src/java/org/apache/cassandra/service/StorageService.java:2107-2112 | src/java/org/apache/cassandra/service/StorageService.java:2452-2461 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 6+ corresponding lines) src/java/org/apache/cassandra/tcm/ownership/TokenMap.java:200— src/java/org/apache/cassandra/tcm/ownership/TokenMap.java:200-205 | tools/stress/src/org/apache/cassandra/stress/settings/OptionAnyProbabilities.java:66-73 | tools/stress/src/org/apache/cassandra/stress/settings/OptionMulti.java:192-199 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 6+ corresponding lines) src/java/org/apache/cassandra/service/consensus/migration/ConsensusTableMigration.java:308— src/java/org/apache/cassandra/service/consensus/migration/ConsensusTableMigration.java:308-313 | src/java/org/apache/cassandra/service/consensus/migration/ConsensusTableMigration.java:320-325 | src/java/org/apache/cassandra/service/consensus/migration/ConsensusTableMigration.java:333-338 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 6+ corresponding lines) src/java/org/apache/cassandra/db/filter/DataLimits.java:835— src/java/org/apache/cassandra/db/filter/DataLimits.java:835-841 | src/java/org/apache/cassandra/db/filter/DataLimits.java:1418-1424 | src/java/org/apache/cassandra/service/pager/SinglePartitionPager.java:125-130 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 6+ corresponding lines) src/java/org/apache/cassandra/tcm/migration/CMSInitializationRequest.java:133— src/java/org/apache/cassandra/tcm/migration/CMSInitializationRequest.java:133-138 | src/java/org/apache/cassandra/tcm/transformations/cms/BaseMembershipTransformation.java:83-88 | src/java/org/apache/cassandra/tcm/transformations/cms/RemoveFromCMS.java:120-125 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 6+ corresponding lines) src/java/org/apache/cassandra/utils/memory/BigEndianMemoryUtil.java:56— src/java/org/apache/cassandra/utils/memory/BigEndianMemoryUtil.java:56-61 | src/java/org/apache/cassandra/utils/memory/LittleEndianMemoryUtil.java:56-61 | src/java/org/apache/cassandra/utils/memory/NativeEndianMemoryUtil.java:60-65 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 6+ corresponding lines) src/java/org/apache/cassandra/utils/memory/BigEndianMemoryUtil.java:64— src/java/org/apache/cassandra/utils/memory/BigEndianMemoryUtil.java:64-69 | src/java/org/apache/cassandra/utils/memory/LittleEndianMemoryUtil.java:64-69 | src/java/org/apache/cassandra/utils/memory/NativeEndianMemoryUtil.java:68-73 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 6+ corresponding lines) src/java/org/apache/cassandra/utils/memory/BigEndianMemoryUtil.java:72— src/java/org/apache/cassandra/utils/memory/BigEndianMemoryUtil.java:72-77 | src/java/org/apache/cassandra/utils/memory/LittleEndianMemoryUtil.java:72-77 | src/java/org/apache/cassandra/utils/memory/NativeEndianMemoryUtil.java:76-81 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 6+ corresponding lines) src/java/org/apache/cassandra/tools/nodetool/AsyncProfileCommandGroup.java:68— src/java/org/apache/cassandra/tools/nodetool/AsyncProfileCommandGroup.java:68-73 | src/java/org/apache/cassandra/tools/nodetool/CMSAdmin.java:67-72 | src/java/org/apache/cassandra/tools/nodetool/RepairAdmin.java:62-67 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 6+ corresponding lines) src/java/org/apache/cassandra/config/DatabaseDescriptor.java:6197— src/java/org/apache/cassandra/config/DatabaseDescriptor.java:6197-6202 | src/java/org/apache/cassandra/streaming/StreamCoordinator.java:250-256 | src/java/org/apache/cassandra/streaming/messages/StreamMessage.java:87-93 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (24 corresponding lines) · ×11
Edited copy of a member (24 corresponding lines) src/java/org/apache/cassandra/cql3/Duration.java:169— src/java/org/apache/cassandra/cql3/Duration.java:169-197 | src/java/org/apache/cassandra/cql3/functions/types/Duration.java:157-180 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) src/java/org/apache/cassandra/cql3/functions/types/AbstractAddressableByIndexData.java:306— src/java/org/apache/cassandra/cql3/functions/types/AbstractAddressableByIndexData.java:306-329 | src/java/org/apache/cassandra/cql3/functions/types/AbstractData.java:663-686 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) src/java/org/apache/cassandra/service/accord/journal/AccordJournal.java:479— src/java/org/apache/cassandra/service/accord/journal/AccordJournal.java:479-502 | src/java/org/apache/cassandra/service/accord/journal/AccordJournal.java:510-542 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) src/java/org/apache/cassandra/utils/memory/BufferPool.java:1494— src/java/org/apache/cassandra/utils/memory/BufferPool.java:1494-1517 | src/java/org/apache/cassandra/utils/memory/BufferPool.java:1520-1546 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) src/java/org/apache/cassandra/cql3/restrictions/ClusteringColumnRestrictions.java:107— src/java/org/apache/cassandra/cql3/restrictions/ClusteringColumnRestrictions.java:107-130 | src/java/org/apache/cassandra/cql3/restrictions/PartitionKeyRestrictions.java:197-226 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) src/java/org/apache/cassandra/utils/vint/VIntCoding.java:147— src/java/org/apache/cassandra/utils/vint/VIntCoding.java:147-172 | src/java/org/apache/cassandra/utils/vint/VIntCoding.java:175-198 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) src/java/org/apache/cassandra/cql3/statements/DescribeStatement.java:369— src/java/org/apache/cassandra/cql3/statements/DescribeStatement.java:369-392 | src/java/org/apache/cassandra/cql3/statements/DescribeStatement.java:398-425 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) src/java/org/apache/cassandra/io/tries/Walker.java:284— src/java/org/apache/cassandra/io/tries/Walker.java:284-307 | src/java/org/apache/cassandra/io/tries/Walker.java:321-352 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) src/java/org/apache/cassandra/db/partitions/PartitionIterators.java:35— src/java/org/apache/cassandra/db/partitions/PartitionIterators.java:35-58 | src/java/org/apache/cassandra/db/partitions/UnfilteredPartitionIterators.java:85-108 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) src/java/org/apache/cassandra/concurrent/ExecutionFailure.java:130— src/java/org/apache/cassandra/concurrent/ExecutionFailure.java:130-154 | src/java/org/apache/cassandra/concurrent/ExecutionFailure.java:217-240 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) pylib/cqlshlib/cqlshmain.py:1664— pylib/cqlshlib/cqlshmain.py:1664-1689 | pylib/cqlshlib/cqlshmain.py:1692-1715 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (3 corresponding lines) · ×11
Edited copy of a member (3 corresponding lines) src/java/org/apache/cassandra/index/sai/iterators/KeyRangeIterator.java:53— src/java/org/apache/cassandra/index/sai/iterators/KeyRangeIterator.java:53-58 | src/java/org/apache/cassandra/index/sasi/utils/RangeIterator.java:41-43 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) src/java/org/apache/cassandra/db/SystemKeyspace.java:606— src/java/org/apache/cassandra/db/SystemKeyspace.java:606-608 | src/java/org/apache/cassandra/service/accord/AccordKeyspace.java:522-524 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) src/java/org/apache/cassandra/auth/AuthKeyspace.java:162— src/java/org/apache/cassandra/auth/AuthKeyspace.java:162-168 | src/java/org/apache/cassandra/tracing/TraceKeyspace.java:110-112 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) src/java/org/apache/cassandra/db/PartitionRangeReadCommand.java:641— src/java/org/apache/cassandra/db/PartitionRangeReadCommand.java:641-643 | src/java/org/apache/cassandra/db/SinglePartitionReadCommand.java:1560-1563 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) src/java/org/apache/cassandra/io/sstable/format/big/BigTableReader.java:560— src/java/org/apache/cassandra/io/sstable/format/big/BigTableReader.java:560-562 | src/java/org/apache/cassandra/io/sstable/format/bti/BtiTableReader.java:465-467 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) src/java/org/apache/cassandra/config/EncryptionOptions.java:725— src/java/org/apache/cassandra/config/EncryptionOptions.java:725-729 | src/java/org/apache/cassandra/service/accord/interop/AccordInteropApply.java:98-100 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) src/java/org/apache/cassandra/auth/AuthCache.java:130— src/java/org/apache/cassandra/auth/AuthCache.java:130-144 | src/java/org/apache/cassandra/tcm/membership/Directory.java:111-113 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) src/java/org/apache/cassandra/cql3/restrictions/StatementRestrictions.java:182— src/java/org/apache/cassandra/cql3/restrictions/StatementRestrictions.java:182-184 | src/java/org/apache/cassandra/tcm/membership/Directory.java:127-130 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) src/java/org/apache/cassandra/cql3/terms/Lists.java:73— src/java/org/apache/cassandra/cql3/terms/Lists.java:73-75 | src/java/org/apache/cassandra/cql3/terms/Maps.java:62-64 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) src/java/org/apache/cassandra/db/marshal/ByteBufferAccessor.java:273— src/java/org/apache/cassandra/db/marshal/ByteBufferAccessor.java:273-275 | src/java/org/apache/cassandra/service/paxos/Ballot.java:109-113 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) tools/stress/src/org/apache/cassandra/stress/settings/SettingsCommand.java:236— tools/stress/src/org/apache/cassandra/stress/settings/SettingsCommand.java:236-238 | tools/stress/src/org/apache/cassandra/stress/settings/SettingsCommandPreDefined.java:155-157 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (14 lines × 2) src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:2712— src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:2712-2725 | src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:2985-2998 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:2712` 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 (14 lines × 2) src/java/org/apache/cassandra/cql3/selection/Selectable.java:1159— src/java/org/apache/cassandra/cql3/selection/Selectable.java:1159-1172 | src/java/org/apache/cassandra/cql3/selection/Selectable.java:1231-1244 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/cql3/selection/Selectable.java:1159` 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) src/java/org/apache/cassandra/db/marshal/DateType.java:84— src/java/org/apache/cassandra/db/marshal/DateType.java:84-97 | src/java/org/apache/cassandra/db/marshal/TimestampType.java:110-123 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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 (14 lines × 2) src/java/org/apache/cassandra/db/memtable/ShardedSkipListMemtable.java:398— src/java/org/apache/cassandra/db/memtable/ShardedSkipListMemtable.java:398-411 | src/java/org/apache/cassandra/db/memtable/SkipListMemtable.java:135-148 — before extracting anything, compare `src/java/org/apache/cassandra/db/memtable/ShardedSkipListMemtable.java` and `src/java/org/apache/cassandra/db/memtable/SkipListMemtable.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/db/memtable/ShardedSkipListMemtable.java:398` 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) src/java/org/apache/cassandra/io/compress/ZstdDictionaryCompressor.java:185— src/java/org/apache/cassandra/io/compress/ZstdDictionaryCompressor.java:185-198 | src/java/org/apache/cassandra/io/compress/ZstdDictionaryCompressor.java:229-242 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/io/compress/ZstdDictionaryCompressor.java:185` 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) src/java/org/apache/cassandra/service/accord/serializers/IVersionedWithKeysSerializer.java:181— src/java/org/apache/cassandra/service/accord/serializers/IVersionedWithKeysSerializer.java:181-194 | src/java/org/apache/cassandra/service/accord/serializers/IVersionedWithKeysSerializer.java:237-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 `src/java/org/apache/cassandra/service/accord/serializers/IVersionedWithKeysSerializer.java:181` 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) src/java/org/apache/cassandra/service/writes/thresholds/CoordinatorWriteWarnings.java:124— src/java/org/apache/cassandra/service/writes/thresholds/CoordinatorWriteWarnings.java:124-137 | src/java/org/apache/cassandra/service/writes/thresholds/CoordinatorWriteWarnings.java:146-159 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/service/writes/thresholds/CoordinatorWriteWarnings.java:124` 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) src/java/org/apache/cassandra/tools/StandaloneJournalUtil.java:255— src/java/org/apache/cassandra/tools/StandaloneJournalUtil.java:255-268 | src/java/org/apache/cassandra/tools/StandaloneJournalUtil.java:377-390 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) src/java/org/apache/cassandra/service/accord/debug/CoordinationKinds.java:50— src/java/org/apache/cassandra/service/accord/debug/CoordinationKinds.java:50-63 | src/java/org/apache/cassandra/service/accord/debug/TxnKindsAndDomains.java:71-84 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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) src/java/org/apache/cassandra/cql3/selection/ListSelector.java:70— src/java/org/apache/cassandra/cql3/selection/ListSelector.java:70-83 | src/java/org/apache/cassandra/cql3/selection/SetSelector.java:72-85 — before extracting anything, compare `src/java/org/apache/cassandra/cql3/selection/ListSelector.java` and `src/java/org/apache/cassandra/cql3/selection/SetSelector.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (14 lines × 2) tools/stress/src/org/apache/cassandra/io/sstable/StressCQLSSTableWriter.java:629— tools/stress/src/org/apache/cassandra/io/sstable/StressCQLSSTableWriter.java:629-642 | tools/stress/src/org/apache/cassandra/io/sstable/StressCQLSSTableWriter.java:661-674 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×10
Members sharing a duplicated core (4 members, 50+ identical tokens) src/java/org/apache/cassandra/cql3/CQL3Type.java:285— src/java/org/apache/cassandra/cql3/CQL3Type.java:285-301 | src/java/org/apache/cassandra/cql3/CQL3Type.java:304-314 | src/java/org/apache/cassandra/db/marshal/CollectionType.java:399-413 | src/java/org/apache/cassandra/db/marshal/MapType.java:360-385 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) src/java/org/apache/cassandra/cql3/functions/types/AbstractAddressableByIndexData.java:106— src/java/org/apache/cassandra/cql3/functions/types/AbstractAddressableByIndexData.java:106-113 | src/java/org/apache/cassandra/cql3/functions/types/AbstractAddressableByIndexData.java:129-136 | src/java/org/apache/cassandra/cql3/functions/types/AbstractData.java:172-179 | src/java/org/apache/cassandra/cql3/functions/types/AbstractData.java:225-232 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) src/java/org/apache/cassandra/cql3/functions/types/DataTypeClassNameParser.java:266— src/java/org/apache/cassandra/cql3/functions/types/DataTypeClassNameParser.java:266-296 | src/java/org/apache/cassandra/db/marshal/TypeParser.java:268-299 | src/java/org/apache/cassandra/db/marshal/TypeParser.java:302-347 | src/java/org/apache/cassandra/db/marshal/TypeParser.java:350-392 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) src/java/org/apache/cassandra/db/marshal/ListType.java:236— src/java/org/apache/cassandra/db/marshal/ListType.java:236-254 | src/java/org/apache/cassandra/db/marshal/SetType.java:227-245 | src/java/org/apache/cassandra/db/marshal/TupleType.java:490-521 | src/java/org/apache/cassandra/db/marshal/VectorType.java:314-334 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) src/java/org/apache/cassandra/net/Verb.java:546— src/java/org/apache/cassandra/net/Verb.java:546-555 | src/java/org/apache/cassandra/net/Verb.java:559-568 | src/java/org/apache/cassandra/net/Verb.java:572-581 | src/java/org/apache/cassandra/transport/Message.java:155-164 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) src/java/org/apache/cassandra/serializers/AbstractMapSerializer.java:118— src/java/org/apache/cassandra/serializers/AbstractMapSerializer.java:118-147 | src/java/org/apache/cassandra/serializers/CollectionSerializer.java:287-305 | src/java/org/apache/cassandra/serializers/MapSerializer.java:161-186 | src/java/org/apache/cassandra/serializers/SetSerializer.java:159-183 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) src/java/org/apache/cassandra/service/accord/serializers/CommandSerializers.java:527— src/java/org/apache/cassandra/service/accord/serializers/CommandSerializers.java:527-554 | src/java/org/apache/cassandra/service/accord/serializers/CommandSerializers.java:609-621 | src/java/org/apache/cassandra/service/accord/serializers/CommandSerializers.java:625-656 | src/java/org/apache/cassandra/service/accord/serializers/CommandSerializers.java:659-690 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) src/java/org/apache/cassandra/utils/CollectionSerializers.java:164— src/java/org/apache/cassandra/utils/CollectionSerializers.java:164-171 | src/java/org/apache/cassandra/utils/CollectionSerializers.java:174-181 | src/java/org/apache/cassandra/utils/CollectionSerializers.java:184-191 | src/java/org/apache/cassandra/utils/CollectionSerializers.java:194-201 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) src/java/org/apache/cassandra/utils/CollectionSerializers.java:477— src/java/org/apache/cassandra/utils/CollectionSerializers.java:477-483 | src/java/org/apache/cassandra/utils/CollectionSerializers.java:486-492 | src/java/org/apache/cassandra/utils/CollectionSerializers.java:495-501 | src/java/org/apache/cassandra/utils/CollectionSerializers.java:504-510 — 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) tools/stress/src/org/apache/cassandra/stress/settings/OptionDistribution.java:251— tools/stress/src/org/apache/cassandra/stress/settings/OptionDistribution.java:251-270 | tools/stress/src/org/apache/cassandra/stress/settings/OptionDistribution.java:277-297 | tools/stress/src/org/apache/cassandra/stress/settings/OptionDistribution.java:304-325 | tools/stress/src/org/apache/cassandra/stress/settings/OptionDistribution.java:333-348 — 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.
D4 · Code Duplication· Edited copy of a member (25 corresponding lines) · ×10
Edited copy of a member (25 corresponding lines) src/java/org/apache/cassandra/index/accord/CheckpointIntervalArrayIndex.java:546— src/java/org/apache/cassandra/index/accord/CheckpointIntervalArrayIndex.java:546-570 | src/java/org/apache/cassandra/index/accord/CheckpointIntervalArrayIndex.java:573-597 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) src/java/org/apache/cassandra/db/virtual/InternodeInboundTable.java:62— src/java/org/apache/cassandra/db/virtual/InternodeInboundTable.java:62-87 | src/java/org/apache/cassandra/db/virtual/InternodeOutboundTable.java:63-87 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) src/java/org/apache/cassandra/db/streaming/CassandraStreamHeader.java:161— src/java/org/apache/cassandra/db/streaming/CassandraStreamHeader.java:161-185 | src/java/org/apache/cassandra/db/streaming/CassandraStreamHeader.java:246-273 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:2573— src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:2573-2600 | src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:2880-2904 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) src/java/org/apache/cassandra/io/compress/CompressionMetadata.java:420— src/java/org/apache/cassandra/io/compress/CompressionMetadata.java:420-446 | src/java/org/apache/cassandra/io/compress/CompressionMetadata.java:453-477 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) src/java/org/apache/cassandra/service/accord/journal/TopologyRecord.java:311— src/java/org/apache/cassandra/service/accord/journal/TopologyRecord.java:311-335 | src/java/org/apache/cassandra/service/accord/journal/TopologyRecord.java:366-390 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java:189— src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java:189-213 | src/java/org/apache/cassandra/db/compaction/TimeWindowCompactionStrategy.java:89-113 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) src/java/org/apache/cassandra/utils/NativeLibrary.java:326— src/java/org/apache/cassandra/utils/NativeLibrary.java:326-350 | src/java/org/apache/cassandra/utils/NativeLibrary.java:353-377 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) src/java/org/apache/cassandra/utils/concurrent/AsyncFuture.java:174— src/java/org/apache/cassandra/utils/concurrent/AsyncFuture.java:174-198 | src/java/org/apache/cassandra/utils/concurrent/AsyncFuture.java:202-233 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) src/java/org/apache/cassandra/db/Slices.java:471— src/java/org/apache/cassandra/db/Slices.java:471-495 | src/java/org/apache/cassandra/db/Slices.java:514-538 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Swallowed exception (empty catch) src/java/org/apache/cassandra/utils/FBUtilities.java:1494— 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) src/java/org/apache/cassandra/utils/MonotonicClock.java:211— 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) src/java/org/apache/cassandra/utils/MonotonicClock.java:353— 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) src/java/org/apache/cassandra/service/accord/execution/AbstractLockLoop.java:240— 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) src/java/org/apache/cassandra/service/accord/execution/AbstractLockLoop.java:313— 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) src/java/org/apache/cassandra/service/accord/execution/AccordExecutorSignalLoop.java:385— 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) src/java/org/apache/cassandra/service/accord/execution/AccordExecutorSignalLoop.java:420— 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) src/java/org/apache/cassandra/service/accord/execution/AccordExecutorSignalLoop.java:520— 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) src/java/org/apache/cassandra/service/accord/execution/Task.java:623— 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) src/java/org/apache/cassandra/service/accord/execution/Task.java:632— 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.
HackComment test/unit/org/apache/cassandra/tcm/sequences/DropAccordTableTest.java:93— // hack this table into the schema... — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment test/unit/org/apache/cassandra/db/ColumnFamilyStoreTest.java:608— // // hack for reset generation — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment test/unit/org/apache/cassandra/db/DirectoriesTest.java:175— // hack to create a temp dir — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment test/microbench/org/apache/cassandra/test/microbench/btree/AtomicBTreePartitionUpdateBench.java:151— // hacky way to pass in the number of threads we're executing concurrently in JMH — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment test/distributed/org/apache/cassandra/distributed/test/thresholds/RowIndexSizeWarningTest.java:48— // hack to force multiple index entries — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment src/java/org/apache/cassandra/service/accord/execution/Task.java:119— // hack to allow us to create loops in our enum transition declarations — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment src/java/org/apache/cassandra/locator/Ec2LocationProvider.java:77— // hack for CASSANDRA-4026 — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment src/java/org/apache/cassandra/io/util/DataOutputBuffer.java:143— //Hack for test, make it possible to override checking the buffer capacity — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment src/java/org/apache/cassandra/io/tries/IncrementalTrieWriterSimple.java:80— // Hacky but works: temporarily write node's position. Will be overwritten when we finalize node. — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
D4 · Code Duplication· Edited copy of a member (23 corresponding lines) · ×9
Edited copy of a member (23 corresponding lines) src/java/org/apache/cassandra/tcm/sequences/InProgressSequences.java:237— src/java/org/apache/cassandra/tcm/sequences/InProgressSequences.java:237-259 | src/java/org/apache/cassandra/tcm/sequences/InProgressSequences.java:287-309 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) src/java/org/apache/cassandra/service/accord/serializers/LatestDepsSerializers.java:119— src/java/org/apache/cassandra/service/accord/serializers/LatestDepsSerializers.java:119-141 | src/java/org/apache/cassandra/service/accord/serializers/LatestDepsSerializers.java:168-192 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) src/java/org/apache/cassandra/db/virtual/CIDRFilteringMetricsTable.java:204— src/java/org/apache/cassandra/db/virtual/CIDRFilteringMetricsTable.java:204-226 | src/java/org/apache/cassandra/db/virtual/CIDRFilteringMetricsTable.java:229-255 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) src/java/org/apache/cassandra/cql3/selection/Selectable.java:1155— src/java/org/apache/cassandra/cql3/selection/Selectable.java:1155-1180 | src/java/org/apache/cassandra/cql3/selection/Selectable.java:1228-1250 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) src/java/org/apache/cassandra/cql3/functions/types/ParseUtils.java:313— src/java/org/apache/cassandra/cql3/functions/types/ParseUtils.java:313-338 | src/java/org/apache/cassandra/cql3/functions/types/ParseUtils.java:351-373 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) src/java/org/apache/cassandra/index/accord/CheckpointIntervalArrayIndex.java:207— src/java/org/apache/cassandra/index/accord/CheckpointIntervalArrayIndex.java:207-230 | src/java/org/apache/cassandra/index/accord/CheckpointIntervalArrayIndex.java:439-461 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) src/java/org/apache/cassandra/io/sstable/format/bti/PartitionIndex.java:368— src/java/org/apache/cassandra/io/sstable/format/bti/PartitionIndex.java:368-393 | src/java/org/apache/cassandra/io/sstable/format/bti/PartitionIndex.java:397-419 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) src/java/org/apache/cassandra/db/compression/CompressionDictionaryDetailsTabularData.java:124— src/java/org/apache/cassandra/db/compression/CompressionDictionaryDetailsTabularData.java:124-146 | src/java/org/apache/cassandra/db/compression/CompressionDictionaryDetailsTabularData.java:190-212 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) tools/stress/src/org/apache/cassandra/stress/operations/predefined/CqlOperation.java:397— tools/stress/src/org/apache/cassandra/stress/operations/predefined/CqlOperation.java:397-419 | tools/stress/src/org/apache/cassandra/stress/operations/predefined/CqlOperation.java:423-448 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (28 corresponding lines) · ×9
Edited copy of a member (28 corresponding lines) src/java/org/apache/cassandra/utils/MerkleTree.java:1326— src/java/org/apache/cassandra/utils/MerkleTree.java:1326-1353 | src/java/org/apache/cassandra/utils/MerkleTree.java:1424-1454 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) src/java/org/apache/cassandra/service/accord/serializers/KeySerializers.java:715— src/java/org/apache/cassandra/service/accord/serializers/KeySerializers.java:715-750 | src/java/org/apache/cassandra/service/accord/serializers/KeySerializers.java:759-786 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) src/java/org/apache/cassandra/utils/btree/BTree.java:726— src/java/org/apache/cassandra/utils/btree/BTree.java:726-753 | src/java/org/apache/cassandra/utils/btree/BTree.java:815-847 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) src/java/org/apache/cassandra/service/accord/serializers/IVersionedWithKeysSerializer.java:178— src/java/org/apache/cassandra/service/accord/serializers/IVersionedWithKeysSerializer.java:178-206 | src/java/org/apache/cassandra/service/accord/serializers/IVersionedWithKeysSerializer.java:234-261 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) src/java/org/apache/cassandra/db/rows/RowIterators.java:76— src/java/org/apache/cassandra/db/rows/RowIterators.java:76-103 | src/java/org/apache/cassandra/db/rows/UnfilteredRowIterators.java:358-393 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) src/java/org/apache/cassandra/io/sstable/format/SortedTableScrubber.java:559— src/java/org/apache/cassandra/io/sstable/format/SortedTableScrubber.java:559-588 | src/java/org/apache/cassandra/io/sstable/format/SortedTableScrubber.java:641-668 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:1735— src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:1735-1762 | src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:1895-1925 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) src/java/org/apache/cassandra/cql3/functions/AggregateFcts.java:867— src/java/org/apache/cassandra/cql3/functions/AggregateFcts.java:867-894 | src/java/org/apache/cassandra/cql3/functions/AggregateFcts.java:916-943 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) src/java/org/apache/cassandra/cql3/statements/DescribeStatement.java:607— src/java/org/apache/cassandra/cql3/statements/DescribeStatement.java:607-634 | src/java/org/apache/cassandra/cql3/statements/DescribeStatement.java:637-664 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Unfinished stub — throws a "not implemented" exception src/java/org/apache/cassandra/io/util/ChecksumedDataOutputPlus.java:106— `writeUTF` throws an exception whose message says it isn't finished — a not-implemented stub wearing an ordinary exception. Implement it or remove it.
Unfinished stub — throws a "not implemented" exception src/java/org/apache/cassandra/utils/btree/BTreeMap.java:164— `navigableKeySet` throws an exception whose message says it isn't finished — a not-implemented stub wearing an ordinary exception. Implement it or remove it.
Unfinished stub — throws a "not implemented" exception src/java/org/apache/cassandra/utils/btree/BTreeMap.java:170— `descendingKeySet` throws an exception whose message says it isn't finished — a not-implemented stub wearing an ordinary exception. Implement it or remove it.
Unfinished stub — throws a "not implemented" exception src/java/org/apache/cassandra/utils/btree/BTreeMap.java:176— `subMap` throws an exception whose message says it isn't finished — a not-implemented stub wearing an ordinary exception. Implement it or remove it.
Unfinished stub — throws a "not implemented" exception src/java/org/apache/cassandra/utils/btree/BTreeMap.java:182— `headMap` throws an exception whose message says it isn't finished — a not-implemented stub wearing an ordinary exception. Implement it or remove it.
Unfinished stub — throws a "not implemented" exception src/java/org/apache/cassandra/utils/btree/BTreeMap.java:188— `tailMap` throws an exception whose message says it isn't finished — a not-implemented stub wearing an ordinary exception. Implement it or remove it.
Unfinished stub — throws a "not implemented" exception src/java/org/apache/cassandra/utils/btree/BTreeMap.java:200— `subMap` throws an exception whose message says it isn't finished — a not-implemented stub wearing an ordinary exception. Implement it or remove it.
Unfinished stub — throws a "not implemented" exception src/java/org/apache/cassandra/utils/btree/BTreeMap.java:206— `headMap` throws an exception whose message says it isn't finished — a not-implemented stub wearing an ordinary exception. Implement it or remove it.
Unfinished stub — throws a "not implemented" exception src/java/org/apache/cassandra/utils/btree/BTreeMap.java:212— `tailMap` throws an exception whose message says it isn't finished — a not-implemented stub wearing an ordinary exception. Implement it or remove it.
Hotspot: src/java/org/apache/cassandra/config/DatabaseDescriptor.java src/java/org/apache/cassandra/config/DatabaseDescriptor.java:617— src/java/org/apache/cassandra/config/DatabaseDescriptor.java changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 157 in DatabaseDescriptor.applySimpleConfig at line 617. 1 of those changes was a fix/bug commit, and the other 5 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-08-17..2026-11-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-17 06:21:07 -06:00' --until='2026-11-15 06:21:07 -06:00' --full-history --no-merges -- src/java/org/apache/cassandra/config/DatabaseDescriptor.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/java/org/apache/cassandra/service/accord/AccordService.java src/java/org/apache/cassandra/service/accord/AccordService.java:570— src/java/org/apache/cassandra/service/accord/AccordService.java changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in AccordService.localStartup at line 570. 2 of those changes were fix/bug commits, and the other 2 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-08-17..2026-11-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-17 06:21:07 -06:00' --until='2026-11-15 06:21:07 -06:00' --full-history --no-merges -- src/java/org/apache/cassandra/service/accord/AccordService.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/java/org/apache/cassandra/service/StorageService.java src/java/org/apache/cassandra/service/StorageService.java:3883— src/java/org/apache/cassandra/service/StorageService.java changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in StorageService.drain at line 3883. 1 of those changes was a fix/bug commit, and the other 2 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-08-17..2026-11-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-17 06:21:07 -06:00' --until='2026-11-15 06:21:07 -06:00' --full-history --no-merges -- src/java/org/apache/cassandra/service/StorageService.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/java/org/apache/cassandra/tcm/AbstractLocalProcessor.java src/java/org/apache/cassandra/tcm/AbstractLocalProcessor.java:61— src/java/org/apache/cassandra/tcm/AbstractLocalProcessor.java changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in AbstractLocalProcessor.commit at line 61. 1 of those changes was a fix/bug commit, and the other 2 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-08-17..2026-11-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-17 06:21:07 -06:00' --until='2026-11-15 06:21:07 -06:00' --full-history --no-merges -- src/java/org/apache/cassandra/tcm/AbstractLocalProcessor.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/java/org/apache/cassandra/repair/autorepair/AutoRepair.java src/java/org/apache/cassandra/repair/autorepair/AutoRepair.java:163— src/java/org/apache/cassandra/repair/autorepair/AutoRepair.java changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in AutoRepair.repair at line 163. 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-08-17..2026-11-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-17 06:21:07 -06:00' --until='2026-11-15 06:21:07 -06:00' --full-history --no-merges -- src/java/org/apache/cassandra/repair/autorepair/AutoRepair.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/java/org/apache/cassandra/service/accord/AccordResult.java src/java/org/apache/cassandra/service/accord/AccordResult.java:126— src/java/org/apache/cassandra/service/accord/AccordResult.java changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in AccordResult.tryFailure at line 126. 2 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-08-17..2026-11-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-17 06:21:07 -06:00' --until='2026-11-15 06:21:07 -06:00' --full-history --no-merges -- src/java/org/apache/cassandra/service/accord/AccordResult.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/java/org/apache/cassandra/service/accord/execution/SafeTask.java src/java/org/apache/cassandra/service/accord/execution/SafeTask.java:865— src/java/org/apache/cassandra/service/accord/execution/SafeTask.java changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in SafeTask.setupExclusive at line 865. 1 of those changes was a fix/bug commit, and the other 1 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-08-17..2026-11-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-17 06:21:07 -06:00' --until='2026-11-15 06:21:07 -06:00' --full-history --no-merges -- src/java/org/apache/cassandra/service/accord/execution/SafeTask.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/java/org/apache/cassandra/service/accord/RangeIndex.java src/java/org/apache/cassandra/service/accord/RangeIndex.java:97— src/java/org/apache/cassandra/service/accord/RangeIndex.java changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in Loader.ifRelevant at line 97. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-17..2026-11-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-17 06:21:07 -06:00' --until='2026-11-15 06:21:07 -06:00' --full-history --no-merges -- src/java/org/apache/cassandra/service/accord/RangeIndex.java`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Duplicated block (17 lines × 2) src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java:190— src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java:190-206 | src/java/org/apache/cassandra/db/compaction/TimeWindowCompactionStrategy.java:90-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 `src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java:190` 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) src/java/org/apache/cassandra/db/guardrails/ValueGenerator.java:154— src/java/org/apache/cassandra/db/guardrails/ValueGenerator.java:154-170 | src/java/org/apache/cassandra/db/guardrails/ValueValidator.java:138-154 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 `src/java/org/apache/cassandra/db/guardrails/ValueGenerator.java:154` 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 (17 lines × 2) src/java/org/apache/cassandra/db/lifecycle/Tracker.java:196— src/java/org/apache/cassandra/db/lifecycle/Tracker.java:196-212 | src/java/org/apache/cassandra/db/lifecycle/Tracker.java:214-230 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) src/java/org/apache/cassandra/db/marshal/ListType.java:238— src/java/org/apache/cassandra/db/marshal/ListType.java:238-254 | src/java/org/apache/cassandra/db/marshal/SetType.java:229-245 — before extracting anything, compare `src/java/org/apache/cassandra/db/marshal/ListType.java` and `src/java/org/apache/cassandra/db/marshal/SetType.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/db/marshal/ListType.java:238` 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 (17 lines × 2) src/java/org/apache/cassandra/index/sai/plan/Operation.java:169— src/java/org/apache/cassandra/index/sai/plan/Operation.java:169-185 | src/java/org/apache/cassandra/index/sai/plan/Operation.java:243-259 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/index/sai/plan/Operation.java:169` 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) src/java/org/apache/cassandra/io/compress/ZstdCompressorBase.java:128— src/java/org/apache/cassandra/io/compress/ZstdCompressorBase.java:128-144 | src/java/org/apache/cassandra/io/compress/ZstdDictionaryCompressor.java:134-150 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/io/compress/ZstdCompressorBase.java:128` 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, `src/java/org/apache/cassandra/io/compress/ZstdDictionaryCompressor.java:133` calls `acquireDecompressCtx` and `src/java/org/apache/cassandra/io/compress/ZstdCompressorBase.java:127` 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) src/java/org/apache/cassandra/tools/StandaloneSplitter.java:203— src/java/org/apache/cassandra/tools/StandaloneSplitter.java:203-219 | tools/sstableloader/src/org/apache/cassandra/tools/LoaderOptions.java:424-440 — 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 `src/java/org/apache/cassandra/tools/StandaloneSplitter.java:203` 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) src/java/org/apache/cassandra/db/marshal/DecimalType.java:282— src/java/org/apache/cassandra/db/marshal/DecimalType.java:282-298 | src/java/org/apache/cassandra/db/marshal/IntegerType.java:454-471 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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.
FixmeComment test/unit/org/apache/cassandra/io/util/RandomAccessReaderTest.java:136— // FIXME: This is the same as above. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment test/microbench/org/apache/cassandra/test/microbench/CachingBenchTest.java:58— // FIXME – rewrite to jmh bench classes — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment test/microbench/org/apache/cassandra/test/microbench/GcCompactionBenchTest.java:55— // FIXME – rewrite to jmh bench classes — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment src/java/org/apache/cassandra/serializers/DurationSerializer.java:85— // FIXME: value input buffer — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment src/java/org/apache/cassandra/io/util/ChannelProxy.java:173— // FIXME: consider wrapping in a while loop — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment src/java/org/apache/cassandra/io/sstable/format/big/SSTableReversedIterator.java:124— // FIXME: so far we only keep stats on cells, so to get a rough estimate on the number of rows, — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment src/java/org/apache/cassandra/db/marshal/AbstractType.java:208— // FIXME — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
D4 · Code Duplication· Edited copy of a member (26 corresponding lines) · ×7
Edited copy of a member (26 corresponding lines) src/java/org/apache/cassandra/db/SystemKeyspace.java:1540— src/java/org/apache/cassandra/db/SystemKeyspace.java:1540-1568 | src/java/org/apache/cassandra/db/SystemKeyspace.java:1571-1601 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) formalise/accord/execution/tla/matrix.py:323— formalise/accord/execution/tla/matrix.py:323-348 | formalise/accord/execution/tla/notify.py:238-265 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) src/java/org/apache/cassandra/cql3/functions/types/CodecRegistry.java:665— src/java/org/apache/cassandra/cql3/functions/types/CodecRegistry.java:665-690 | src/java/org/apache/cassandra/cql3/functions/types/CodecRegistry.java:694-719 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) src/java/org/apache/cassandra/schema/SystemDistributedKeyspace.java:459— src/java/org/apache/cassandra/schema/SystemDistributedKeyspace.java:459-489 | src/java/org/apache/cassandra/schema/SystemDistributedKeyspace.java:533-558 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) src/java/org/apache/cassandra/index/sai/utils/IndexTermType.java:418— src/java/org/apache/cassandra/index/sai/utils/IndexTermType.java:418-443 | src/java/org/apache/cassandra/index/sasi/conf/ColumnIndex.java:234-259 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) src/java/org/apache/cassandra/io/sstable/AbstractSSTableIterator.java:531— src/java/org/apache/cassandra/io/sstable/AbstractSSTableIterator.java:531-556 | src/java/org/apache/cassandra/io/sstable/format/big/SSTableIterator.java:157-184 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) src/java/org/apache/cassandra/service/GCInspector.java:205— src/java/org/apache/cassandra/service/GCInspector.java:205-233 | src/java/org/apache/cassandra/service/GCInspector.java:242-267 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (35 corresponding lines) · ×7
Edited copy of a member (35 corresponding lines) src/java/org/apache/cassandra/cql3/ResultSet.java:443— src/java/org/apache/cassandra/cql3/ResultSet.java:443-483 | src/java/org/apache/cassandra/cql3/ResultSet.java:486-520 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (35 corresponding lines) src/java/org/apache/cassandra/index/sai/disk/v1/SSTableIndexWriter.java:82— src/java/org/apache/cassandra/index/sai/disk/v1/SSTableIndexWriter.java:82-116 | src/java/org/apache/cassandra/index/sai/memory/MemtableIndexManager.java:75-113 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (35 corresponding lines) src/java/org/apache/cassandra/index/sai/disk/v1/bbtree/BlockBalancedTreeWalker.java:63— src/java/org/apache/cassandra/index/sai/disk/v1/bbtree/BlockBalancedTreeWalker.java:63-107 | src/java/org/apache/cassandra/index/sai/disk/v1/bbtree/BlockBalancedTreeWalker.java:111-145 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (35 corresponding lines) src/java/org/apache/cassandra/tcm/ClusterMetadataService.java:289— src/java/org/apache/cassandra/tcm/ClusterMetadataService.java:289-323 | src/java/org/apache/cassandra/tcm/ClusterMetadataService.java:326-365 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (35 corresponding lines) src/java/org/apache/cassandra/io/compress/ZstdCompressorBase.java:173— src/java/org/apache/cassandra/io/compress/ZstdCompressorBase.java:173-207 | src/java/org/apache/cassandra/io/compress/ZstdCompressorBase.java:218-252 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (35 corresponding lines) src/java/org/apache/cassandra/service/StorageProxy.java:797— src/java/org/apache/cassandra/service/StorageProxy.java:797-831 | src/java/org/apache/cassandra/service/StorageProxy.java:840-874 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (35 corresponding lines) src/java/org/apache/cassandra/index/sai/analyzer/NonTokenizingAnalyzer.java:65— src/java/org/apache/cassandra/index/sai/analyzer/NonTokenizingAnalyzer.java:65-108 | src/java/org/apache/cassandra/index/sasi/analyzer/NonTokenizingAnalyzer.java:85-119 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 11+ corresponding lines) · ×7
Edited copies of one member (3 members, 11+ corresponding lines) pylib/cqlshlib/saferscanner.py:58— pylib/cqlshlib/saferscanner.py:58-68 | pylib/cqlshlib/saferscanner.py:74-84 | pylib/cqlshlib/saferscanner.py:90-100 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) src/java/org/apache/cassandra/metrics/CassandraMetricsRegistry.java:306— src/java/org/apache/cassandra/metrics/CassandraMetricsRegistry.java:306-316 | src/java/org/apache/cassandra/metrics/CassandraMetricsRegistry.java:319-329 | src/java/org/apache/cassandra/metrics/CassandraMetricsRegistry.java:337-347 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) src/java/org/apache/cassandra/service/StorageProxy.java:3750— src/java/org/apache/cassandra/service/StorageProxy.java:3750-3760 | src/java/org/apache/cassandra/service/StorageProxy.java:3771-3781 | src/java/org/apache/cassandra/service/StorageProxy.java:3787-3797 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) src/java/org/apache/cassandra/service/pager/AbstractQueryPager.java:124— src/java/org/apache/cassandra/service/pager/AbstractQueryPager.java:124-134 | src/java/org/apache/cassandra/service/pager/AbstractQueryPager.java:138-148 | src/java/org/apache/cassandra/service/pager/AbstractQueryPager.java:151-161 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) src/java/org/apache/cassandra/auth/CassandraRoleManager.java:496— src/java/org/apache/cassandra/auth/CassandraRoleManager.java:496-506 | src/java/org/apache/cassandra/auth/Roles.java:117-131 | src/java/org/apache/cassandra/auth/Roles.java:140-154 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) src/java/org/apache/cassandra/db/ReadResponse.java:567— src/java/org/apache/cassandra/db/ReadResponse.java:567-578 | src/java/org/apache/cassandra/index/sai/plan/StorageAttachedIndexSearcher.java:585-595 | src/java/org/apache/cassandra/index/sasi/plan/SASIIndexSearcher.java:159-169 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) src/java/org/apache/cassandra/io/sstable/format/SortedTableVerifier.java:405— src/java/org/apache/cassandra/io/sstable/format/SortedTableVerifier.java:405-415 | src/java/org/apache/cassandra/io/sstable/format/big/BigTableScrubber.java:281-292 | src/java/org/apache/cassandra/io/sstable/format/bti/BtiTableScrubber.java:303-314 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 9+ corresponding lines) · ×7
Edited copies of one member (3 members, 9+ corresponding lines) src/java/org/apache/cassandra/db/virtual/AbstractLazyVirtualTable.java:823— src/java/org/apache/cassandra/db/virtual/AbstractLazyVirtualTable.java:823-834 | src/java/org/apache/cassandra/db/virtual/CollectionVirtualTableAdapter.java:511-519 | src/java/org/apache/cassandra/db/virtual/SimpleDataSet.java:109-117 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) src/java/org/apache/cassandra/service/paxos/PaxosCommitAndPrepare.java:128— src/java/org/apache/cassandra/service/paxos/PaxosCommitAndPrepare.java:128-136 | src/java/org/apache/cassandra/service/paxos/PaxosPrepareRefresh.java:176-190 | src/java/org/apache/cassandra/service/paxos/PaxosPropose.java:414-430 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) src/java/org/apache/cassandra/db/SystemKeyspace.java:936— src/java/org/apache/cassandra/db/SystemKeyspace.java:936-947 | src/java/org/apache/cassandra/db/SystemKeyspace.java:950-960 | src/java/org/apache/cassandra/db/SystemKeyspace.java:979-987 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) src/java/org/apache/cassandra/db/RangeTombstoneList.java:719— src/java/org/apache/cassandra/db/RangeTombstoneList.java:719-727 | src/java/org/apache/cassandra/db/RangeTombstoneList.java:730-738 | src/java/org/apache/cassandra/db/RangeTombstoneList.java:741-749 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) src/java/org/apache/cassandra/tools/AuditLogViewer.java:250— src/java/org/apache/cassandra/tools/AuditLogViewer.java:250-258 | src/java/org/apache/cassandra/tools/StandaloneSSTableUtil.java:236-244 | src/java/org/apache/cassandra/tools/StandaloneScrubber.java:342-350 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) src/java/org/apache/cassandra/schema/IndexMetadata.java:377— src/java/org/apache/cassandra/schema/IndexMetadata.java:377-386 | src/java/org/apache/cassandra/schema/ReplicationParams.java:272-280 | src/java/org/apache/cassandra/schema/ReplicationParams.java:308-316 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) src/java/org/apache/cassandra/tools/nodetool/CompactionHistory.java:44— src/java/org/apache/cassandra/tools/nodetool/CompactionHistory.java:44-52 | src/java/org/apache/cassandra/tools/nodetool/DataPaths.java:45-54 | src/java/org/apache/cassandra/tools/nodetool/TpStats.java:44-53 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 8+ corresponding lines) · ×7
Edited copies of one member (3 members, 8+ corresponding lines) src/java/org/apache/cassandra/repair/autorepair/AutoRepairState.java:324— src/java/org/apache/cassandra/repair/autorepair/AutoRepairState.java:324-331 | src/java/org/apache/cassandra/repair/autorepair/AutoRepairState.java:343-351 | src/java/org/apache/cassandra/repair/autorepair/AutoRepairState.java:388-396 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) src/java/org/apache/cassandra/schema/IndexMetadata.java:389— src/java/org/apache/cassandra/schema/IndexMetadata.java:389-398 | src/java/org/apache/cassandra/schema/ReplicationParams.java:283-290 | src/java/org/apache/cassandra/schema/ReplicationParams.java:319-326 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) src/java/org/apache/cassandra/service/paxos/cleanup/PaxosCleanupComplete.java:146— src/java/org/apache/cassandra/service/paxos/cleanup/PaxosCleanupComplete.java:146-153 | src/java/org/apache/cassandra/service/paxos/cleanup/PaxosCleanupRequest.java:148-155 | src/java/org/apache/cassandra/service/paxos/cleanup/PaxosStartPrepareCleanup.java:175-183 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) src/java/org/apache/cassandra/cql3/QueryProcessor.java:421— src/java/org/apache/cassandra/cql3/QueryProcessor.java:421-430 | src/java/org/apache/cassandra/cql3/QueryProcessor.java:600-607 | src/java/org/apache/cassandra/cql3/QueryProcessor.java:615-624 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) src/java/org/apache/cassandra/dht/Bounds.java:54— src/java/org/apache/cassandra/dht/Bounds.java:54-63 | src/java/org/apache/cassandra/dht/ExcludingBounds.java:43-50 | src/java/org/apache/cassandra/dht/Range.java:325-334 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) src/java/org/apache/cassandra/db/virtual/LocalRepairTables.java:126— src/java/org/apache/cassandra/db/virtual/LocalRepairTables.java:126-133 | src/java/org/apache/cassandra/db/virtual/LocalRepairTables.java:284-291 | src/java/org/apache/cassandra/db/virtual/LocalRepairTables.java:345-352 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) src/java/org/apache/cassandra/cql3/selection/MapSelector.java:187— src/java/org/apache/cassandra/cql3/selection/MapSelector.java:187-194 | src/java/org/apache/cassandra/cql3/selection/MapSelector.java:197-204 | src/java/org/apache/cassandra/cql3/selection/MapSelector.java:236-244 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (20 lines × 2) src/java/org/apache/cassandra/concurrent/ExecutionFailure.java:133— src/java/org/apache/cassandra/concurrent/ExecutionFailure.java:133-152 | src/java/org/apache/cassandra/concurrent/ExecutionFailure.java:163-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. 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 × 2) src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:2387— src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:2387-2406 | src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:2687-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.
Duplicated block (20 lines × 2) src/java/org/apache/cassandra/db/SystemKeyspace.java:1495— src/java/org/apache/cassandra/db/SystemKeyspace.java:1495-1514 | src/java/org/apache/cassandra/db/SystemKeyspace.java:1518-1537 — both copies are in the same file, so extract the 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) src/java/org/apache/cassandra/db/memtable/ShardedSkipListMemtable.java:418— src/java/org/apache/cassandra/db/memtable/ShardedSkipListMemtable.java:418-437 | src/java/org/apache/cassandra/db/memtable/SkipListMemtable.java:183-202 — before extracting anything, compare `src/java/org/apache/cassandra/db/memtable/ShardedSkipListMemtable.java` and `src/java/org/apache/cassandra/db/memtable/SkipListMemtable.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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) src/java/org/apache/cassandra/tools/nodetool/Sjk.java:172— src/java/org/apache/cassandra/tools/nodetool/Sjk.java:172-191 | src/java/org/apache/cassandra/tools/nodetool/Sjk.java:215-234 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/tools/nodetool/Sjk.java:172` 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 (20 lines × 2) src/java/org/apache/cassandra/utils/MurmurHash.java:309— src/java/org/apache/cassandra/utils/MurmurHash.java:309-328 | src/java/org/apache/cassandra/utils/MurmurHash.java:385-404 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/utils/MurmurHash.java:309` 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 (20 lines × 2) src/java/org/apache/cassandra/cql3/functions/types/AbstractAddressableByIndexData.java:310— src/java/org/apache/cassandra/cql3/functions/types/AbstractAddressableByIndexData.java:310-329 | src/java/org/apache/cassandra/cql3/functions/types/AbstractData.java:667-686 — before extracting anything, compare `src/java/org/apache/cassandra/cql3/functions/types/AbstractAddressableByIndexData.java` and `src/java/org/apache/cassandra/cql3/functions/types/AbstractData.java` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 77 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `src/java/org/apache/cassandra/cql3/functions/types/AbstractAddressableByIndexData.java:310` 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 × 3) src/java/org/apache/cassandra/db/marshal/ListType.java:204— src/java/org/apache/cassandra/db/marshal/ListType.java:204-209 | src/java/org/apache/cassandra/db/marshal/SetType.java:197-202 | src/java/org/apache/cassandra/db/marshal/UserType.java:649-654 — before extracting anything, compare `src/java/org/apache/cassandra/db/marshal/ListType.java` and `src/java/org/apache/cassandra/db/marshal/SetType.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) src/java/org/apache/cassandra/index/internal/composites/CollectionKeyIndexBase.java:59— src/java/org/apache/cassandra/index/internal/composites/CollectionKeyIndexBase.java:59-68 | src/java/org/apache/cassandra/index/internal/composites/PartitionKeyIndex.java:75-80 | src/java/org/apache/cassandra/index/internal/composites/RegularColumnIndex.java:73-83 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from 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.
Duplicated block (6 lines × 3) src/java/org/apache/cassandra/locator/ReplicaPlans.java:355— src/java/org/apache/cassandra/locator/ReplicaPlans.java:355-360 | src/java/org/apache/cassandra/locator/ReplicaPlans.java:550-555 | src/java/org/apache/cassandra/locator/ReplicaPlans.java:600-606 — 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 `src/java/org/apache/cassandra/locator/ReplicaPlans.java:355` 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 (6 lines × 3) src/java/org/apache/cassandra/cql3/selection/ListSelector.java:184— src/java/org/apache/cassandra/cql3/selection/ListSelector.java:184-189 | src/java/org/apache/cassandra/cql3/selection/SetSelector.java:187-192 | src/java/org/apache/cassandra/cql3/selection/TupleSelector.java:186-192 — before extracting anything, compare `src/java/org/apache/cassandra/cql3/selection/ListSelector.java` and `src/java/org/apache/cassandra/cql3/selection/SetSelector.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) src/java/org/apache/cassandra/index/accord/CheckpointIntervalArrayIndex.java:768— src/java/org/apache/cassandra/index/accord/CheckpointIntervalArrayIndex.java:768-773 | src/java/org/apache/cassandra/index/accord/RangeMemoryIndex.java:277-282 | src/java/org/apache/cassandra/service/accord/journal/IndexedRange.java:39-44 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. 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 `other` to `Range` in one and `IndexedRange` 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 × 3) src/java/org/apache/cassandra/index/sai/iterators/KeyRangeIterator.java:228— src/java/org/apache/cassandra/index/sai/iterators/KeyRangeIterator.java:228-233 | src/java/org/apache/cassandra/index/sasi/utils/RangeIterator.java:307-312 | src/java/org/apache/cassandra/index/sasi/utils/RangeIterator.java:316-321 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `a` to `PrimaryKey` 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 (6 lines × 3) src/java/org/apache/cassandra/dht/Bounds.java:89— src/java/org/apache/cassandra/dht/Bounds.java:89-94 | src/java/org/apache/cassandra/dht/IncludingExcludingBounds.java:69-74 | src/java/org/apache/cassandra/dht/Range.java:556-561 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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. 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.
Change coupling: GuardrailsConfig.java ↔ GuardrailsMBean.java src/java/org/apache/cassandra/db/guardrails/GuardrailsConfig.java:1— `src/java/org/apache/cassandra/db/guardrails/GuardrailsConfig.java` and `src/java/org/apache/cassandra/db/guardrails/GuardrailsMBean.java` change together 97% of the time (38 of the 39 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — 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 the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 38 shared commits counted here, the most recent 3 are `bdfa3173` Implement Zstd compression level guardrail; `f771e964` Add guardrail to enforce minimum CMS size; `650fd418` Add blob type support to SAI — run `git show` on any of them.
Change coupling: Config.java ↔ GuardrailsMBean.java src/java/org/apache/cassandra/config/Config.java:1— `src/java/org/apache/cassandra/config/Config.java` and `src/java/org/apache/cassandra/db/guardrails/GuardrailsMBean.java` change together 92% of the time (37 of the 40 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 37 shared commits counted here, the most recent 3 are `bdfa3173` Implement Zstd compression level guardrail; `f771e964` Add guardrail to enforce minimum CMS size; `650fd418` Add blob type support to SAI — run `git show` on any of them.
Change coupling: AccordCommandStore.java ↔ AccordObjectSizes.java src/java/org/apache/cassandra/service/accord/AccordCommandStore.java:1— `src/java/org/apache/cassandra/service/accord/AccordCommandStore.java` and `src/java/org/apache/cassandra/service/accord/AccordObjectSizes.java` change together 73% of the time (11 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — 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 the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `e14816e2` Journal reads must select segments before sstables to avoid compactio…; `50868464` Fix: - Only use persisted RedundantBefore for compaction - RouteInd…; `af7dfcc3` Refactor RedundantStatus to encode vector of states that can be merge… — run `git show` on any of them.
Change coupling: NodeProbe.java ↔ NodeTool.java src/java/org/apache/cassandra/tools/NodeProbe.java:1— `src/java/org/apache/cassandra/tools/NodeProbe.java` and `src/java/org/apache/cassandra/tools/NodeTool.java` change together 68% of the time (28 of the 41 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — 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 the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 28 shared commits counted here, the most recent 3 are `5c94bc88` Add nodetool get/setguardrailsconfig commands; `2b01b5fa` Command to Exclude Replicas from Durability Status Coordination; `ebbdd8bb` Make it possible to abort all kinds of multi step operations — run `git show` on any of them.
Change coupling: AccordCommandStore.java ↔ AccordAgent.java src/java/org/apache/cassandra/service/accord/AccordCommandStore.java:1— `src/java/org/apache/cassandra/service/accord/AccordCommandStore.java` and `src/java/org/apache/cassandra/service/accord/api/AccordAgent.java` change together 56% of the time (9 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `b4f6c7c6` Topology compaction omits image records if minEpoch is ahead of last …; `7b12404a` Avoid cache modification reentrancy when cancelling loads Also fix: …; `46bda174` Bootstrap must first wait for a quorum to apply the sync point to ens… — run `git show` on any of them.
Change coupling: AccordKeyspace.java ↔ AccordObjectSizes.java src/java/org/apache/cassandra/service/accord/AccordKeyspace.java:1— `src/java/org/apache/cassandra/service/accord/AccordKeyspace.java` and `src/java/org/apache/cassandra/service/accord/AccordObjectSizes.java` change together 53% of the time (8 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — 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 the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `50868464` Fix: - Only use persisted RedundantBefore for compaction - RouteInd…; `52242f23` Remove TimestampsForKey; `325e48ac` Switch to streaming serialization of SavedCommand — run `git show` on any of them.
D4 · Code Duplication· Edited copy of a member (27 corresponding lines) · ×6
Edited copy of a member (27 corresponding lines) src/java/org/apache/cassandra/service/accord/serializers/CommandSerializers.java:557— src/java/org/apache/cassandra/service/accord/serializers/CommandSerializers.java:557-606 | src/java/org/apache/cassandra/service/accord/serializers/CommandSerializers.java:883-923 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) src/java/org/apache/cassandra/io/compress/DeflateCompressor.java:123— src/java/org/apache/cassandra/io/compress/DeflateCompressor.java:123-149 | src/java/org/apache/cassandra/io/compress/DeflateCompressor.java:166-198 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) src/java/org/apache/cassandra/cql3/statements/schema/CopyTableStatement.java:235— src/java/org/apache/cassandra/cql3/statements/schema/CopyTableStatement.java:235-261 | src/java/org/apache/cassandra/cql3/statements/schema/CreateTableStatement.java:203-236 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) src/java/org/apache/cassandra/io/util/RebufferingInputStream.java:76— src/java/org/apache/cassandra/io/util/RebufferingInputStream.java:76-104 | src/java/org/apache/cassandra/io/util/RebufferingInputStream.java:110-136 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) src/java/org/apache/cassandra/utils/vint/VIntCoding.java:237— src/java/org/apache/cassandra/utils/vint/VIntCoding.java:237-263 | src/java/org/apache/cassandra/utils/vint/VIntCoding.java:286-312 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java:263— src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java:263-291 | src/java/org/apache/cassandra/journal/ActiveSegment.java:345-371 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (29 corresponding lines) · ×6
Edited copy of a member (29 corresponding lines) src/java/org/apache/cassandra/service/accord/debug/DebugBlockedTxns.java:131— src/java/org/apache/cassandra/service/accord/debug/DebugBlockedTxns.java:131-163 | src/java/org/apache/cassandra/service/accord/debug/DebugTxnGraph.java:180-208 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (29 corresponding lines) src/java/org/apache/cassandra/service/paxos/uncommitted/PaxosUncommittedTracker.java:158— src/java/org/apache/cassandra/service/paxos/uncommitted/PaxosUncommittedTracker.java:158-186 | src/java/org/apache/cassandra/service/paxos/uncommitted/PaxosUncommittedTracker.java:247-276 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (29 corresponding lines) src/java/org/apache/cassandra/service/paxos/PaxosCommit.java:132— src/java/org/apache/cassandra/service/paxos/PaxosCommit.java:132-160 | src/java/org/apache/cassandra/service/paxos/PaxosPropose.java:179-210 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (29 corresponding lines) src/java/org/apache/cassandra/index/sai/analyzer/NonTokenizingOptions.java:115— src/java/org/apache/cassandra/index/sai/analyzer/NonTokenizingOptions.java:115-145 | src/java/org/apache/cassandra/index/sasi/analyzer/NonTokenizingOptions.java:105-133 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (29 corresponding lines) src/java/org/apache/cassandra/cql3/functions/UDFunction.java:375— src/java/org/apache/cassandra/cql3/functions/UDFunction.java:375-404 | src/java/org/apache/cassandra/cql3/functions/UDFunction.java:407-435 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (29 corresponding lines) src/java/org/apache/cassandra/db/PartitionRangeReadCommand.java:105— src/java/org/apache/cassandra/db/PartitionRangeReadCommand.java:105-133 | src/java/org/apache/cassandra/db/SinglePartitionReadCommand.java:145-180 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (15 lines × 2) src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:2586— src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:2586-2600 | src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:2890-2904 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:2586` 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) src/java/org/apache/cassandra/db/marshal/CompositeType.java:391— src/java/org/apache/cassandra/db/marshal/CompositeType.java:391-405 | src/java/org/apache/cassandra/db/marshal/CompositeType.java:415-429 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/db/marshal/CompositeType.java:391` 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) src/java/org/apache/cassandra/schema/TableMetadata.java:1811— src/java/org/apache/cassandra/schema/TableMetadata.java:1811-1825 | src/java/org/apache/cassandra/schema/TableMetadata.java:2110-2124 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/schema/TableMetadata.java:1811` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) src/java/org/apache/cassandra/utils/LongTimSort.java:621— src/java/org/apache/cassandra/utils/LongTimSort.java:621-635 | src/java/org/apache/cassandra/utils/LongTimSort.java:731-745 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/utils/LongTimSort.java:621` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) src/java/org/apache/cassandra/utils/MurmurHash.java:120— src/java/org/apache/cassandra/utils/MurmurHash.java:120-134 | src/java/org/apache/cassandra/utils/MurmurHash.java:176-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/utils/MurmurHash.java:120` 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 (15 lines × 2) src/java/org/apache/cassandra/service/accord/serializers/CommandSerializers.java:339— src/java/org/apache/cassandra/service/accord/serializers/CommandSerializers.java:339-353 | src/java/org/apache/cassandra/service/accord/serializers/CommandSerializers.java:442-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.
Duplicated block (13 lines × 2) src/java/org/apache/cassandra/cql3/statements/SingleTableSinglePartitionUpdatesCollector.java:93— src/java/org/apache/cassandra/cql3/statements/SingleTableSinglePartitionUpdatesCollector.java:93-105 | src/java/org/apache/cassandra/cql3/statements/SingleTableUpdatesCollector.java:118-130 — before extracting anything, compare `src/java/org/apache/cassandra/cql3/statements/SingleTableSinglePartitionUpdatesCollector.java` and `src/java/org/apache/cassandra/cql3/statements/SingleTableUpdatesCollector.java` as WHOLE FILES: 83% 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. 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) src/java/org/apache/cassandra/cql3/terms/Terms.java:596— src/java/org/apache/cassandra/cql3/terms/Terms.java:596-608 | src/java/org/apache/cassandra/cql3/terms/Terms.java:746-758 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/cql3/terms/Terms.java:596` 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 (13 lines × 2) src/java/org/apache/cassandra/db/rows/UnfilteredSerializer.java:480— src/java/org/apache/cassandra/db/rows/UnfilteredSerializer.java:480-492 | src/java/org/apache/cassandra/db/rows/UnfilteredSerializer.java:507-519 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/db/rows/UnfilteredSerializer.java:480` 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 `in` to `DataInputPlus` in one and `FileDataInput` 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) src/java/org/apache/cassandra/utils/btree/BTree.java:1290— src/java/org/apache/cassandra/utils/btree/BTree.java:1290-1302 | src/java/org/apache/cassandra/utils/btree/BTree.java:1339-1351 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/utils/btree/BTree.java:1290` 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 (13 lines × 2) src/java/org/apache/cassandra/utils/btree/BTree.java:2141— src/java/org/apache/cassandra/utils/btree/BTree.java:2141-2153 | src/java/org/apache/cassandra/utils/btree/BTree.java:2178-2190 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/utils/btree/BTree.java:2141` 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 (13 lines × 2) src/java/org/apache/cassandra/db/commitlog/DirectIOSegment.java:84— src/java/org/apache/cassandra/db/commitlog/DirectIOSegment.java:84-96 | src/java/org/apache/cassandra/db/commitlog/MemoryMappedSegment.java:75-87 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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.
D4 · Code Duplication· Edited copy of a member (30 corresponding lines) · ×5
Edited copy of a member (30 corresponding lines) src/java/org/apache/cassandra/utils/IntervalTree.java:81— src/java/org/apache/cassandra/utils/IntervalTree.java:81-110 | src/java/org/apache/cassandra/utils/IntervalTree.java:118-147 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) src/java/org/apache/cassandra/db/memtable/ShardedSkipListMemtable.java:381— src/java/org/apache/cassandra/db/memtable/ShardedSkipListMemtable.java:381-411 | src/java/org/apache/cassandra/db/memtable/SkipListMemtable.java:119-148 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) src/java/org/apache/cassandra/db/Columns.java:635— src/java/org/apache/cassandra/db/Columns.java:635-664 | src/java/org/apache/cassandra/db/Columns.java:709-739 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) src/java/org/apache/cassandra/cql3/functions/AggregateFcts.java:778— src/java/org/apache/cassandra/cql3/functions/AggregateFcts.java:778-807 | src/java/org/apache/cassandra/cql3/functions/AggregateFcts.java:817-846 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) src/java/org/apache/cassandra/service/paxos/uncommitted/PaxosRows.java:255— src/java/org/apache/cassandra/service/paxos/uncommitted/PaxosRows.java:255-284 | src/java/org/apache/cassandra/service/paxos/uncommitted/PaxosStateTracker.java:195-227 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (32 corresponding lines) · ×5
Edited copy of a member (32 corresponding lines) src/java/org/apache/cassandra/dht/Murmur3Partitioner.java:445— src/java/org/apache/cassandra/dht/Murmur3Partitioner.java:445-477 | src/java/org/apache/cassandra/dht/RandomPartitioner.java:379-410 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (32 corresponding lines) src/java/org/apache/cassandra/service/accord/serializers/TopologySerializers.java:237— src/java/org/apache/cassandra/service/accord/serializers/TopologySerializers.java:237-268 | src/java/org/apache/cassandra/service/accord/serializers/TopologySerializers.java:272-303 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (32 corresponding lines) src/java/org/apache/cassandra/config/YamlConfigurationLoader.java:187— src/java/org/apache/cassandra/config/YamlConfigurationLoader.java:187-219 | src/java/org/apache/cassandra/config/YamlConfigurationLoader.java:222-253 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (32 corresponding lines) src/java/org/apache/cassandra/service/accord/txn/TxnNamedRead.java:292— src/java/org/apache/cassandra/service/accord/txn/TxnNamedRead.java:292-323 | src/java/org/apache/cassandra/service/accord/txn/TxnNamedRead.java:367-403 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (32 corresponding lines) src/java/org/apache/cassandra/locator/ReplicaPlan.java:165— src/java/org/apache/cassandra/locator/ReplicaPlan.java:165-196 | src/java/org/apache/cassandra/locator/ReplicaPlan.java:367-404 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 15+ corresponding lines) · ×5
Edited copies of one member (3 members, 15+ corresponding lines) src/java/org/apache/cassandra/db/memtable/ShardedSkipListMemtable.java:226— src/java/org/apache/cassandra/db/memtable/ShardedSkipListMemtable.java:226-240 | src/java/org/apache/cassandra/db/memtable/SkipListMemtable.java:160-176 | src/java/org/apache/cassandra/db/memtable/TrieMemtable.java:301-323 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 15+ corresponding lines) src/java/org/apache/cassandra/index/sai/view/IndexViewManager.java:120— src/java/org/apache/cassandra/index/sai/view/IndexViewManager.java:120-134 | src/java/org/apache/cassandra/index/sasi/conf/DataTracker.java:101-117 | src/java/org/apache/cassandra/index/sasi/conf/DataTracker.java:120-137 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 15+ corresponding lines) src/java/org/apache/cassandra/db/marshal/VectorType.java:405— src/java/org/apache/cassandra/db/marshal/VectorType.java:405-419 | src/java/org/apache/cassandra/serializers/ListSerializer.java:205-219 | src/java/org/apache/cassandra/serializers/SetSerializer.java:130-148 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 15+ corresponding lines) src/java/org/apache/cassandra/utils/concurrent/AbstractFuture.java:342— src/java/org/apache/cassandra/utils/concurrent/AbstractFuture.java:342-356 | src/java/org/apache/cassandra/utils/concurrent/AbstractFuture.java:364-378 | src/java/org/apache/cassandra/utils/concurrent/AbstractFuture.java:397-411 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 15+ corresponding lines) tools/stress/src/org/apache/cassandra/stress/settings/SettingsGraph.java:96— tools/stress/src/org/apache/cassandra/stress/settings/SettingsGraph.java:96-110 | tools/stress/src/org/apache/cassandra/stress/settings/SettingsPort.java:66-80 | tools/stress/src/org/apache/cassandra/stress/settings/SettingsTokenRange.java:57-71 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 7+ corresponding lines) · ×5
Edited copies of one member (3 members, 7+ corresponding lines) src/java/org/apache/cassandra/cql3/selection/ListSelector.java:99— src/java/org/apache/cassandra/cql3/selection/ListSelector.java:99-106 | src/java/org/apache/cassandra/cql3/selection/TupleSelector.java:100-107 | src/java/org/apache/cassandra/cql3/selection/VectorSelector.java:133-139 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) src/java/org/apache/cassandra/service/accord/interop/AccordInteropRead.java:94— src/java/org/apache/cassandra/service/accord/interop/AccordInteropRead.java:94-100 | src/java/org/apache/cassandra/service/accord/interop/AccordInteropReadRepair.java:77-83 | src/java/org/apache/cassandra/service/accord/serializers/CommitSerializers.java:105-111 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) src/java/org/apache/cassandra/service/paxos/cleanup/PaxosCleanupComplete.java:121— src/java/org/apache/cassandra/service/paxos/cleanup/PaxosCleanupComplete.java:121-127 | src/java/org/apache/cassandra/service/paxos/cleanup/PaxosCleanupRequest.java:124-130 | src/java/org/apache/cassandra/service/paxos/cleanup/PaxosStartPrepareCleanup.java:145-153 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) src/java/org/apache/cassandra/schema/Indexes.java:239— src/java/org/apache/cassandra/schema/Indexes.java:239-245 | src/java/org/apache/cassandra/schema/Tables.java:312-321 | src/java/org/apache/cassandra/schema/Views.java:282-291 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) src/java/org/apache/cassandra/repair/messages/FinalizePromise.java:39— src/java/org/apache/cassandra/repair/messages/FinalizePromise.java:39-46 | src/java/org/apache/cassandra/repair/messages/PrepareConsistentResponse.java:39-46 | src/java/org/apache/cassandra/repair/messages/StatusResponse.java:36-42 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 5+ corresponding lines) · ×5
Edited copies of one member (3 members, 5+ corresponding lines) src/java/org/apache/cassandra/cql3/terms/Lists.java:149— src/java/org/apache/cassandra/cql3/terms/Lists.java:149-153 | src/java/org/apache/cassandra/cql3/terms/Sets.java:135-139 | src/java/org/apache/cassandra/cql3/terms/Vectors.java:88-92 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 5+ corresponding lines) src/java/org/apache/cassandra/db/virtual/walker/CounterMetricRowWalker.java:41— src/java/org/apache/cassandra/db/virtual/walker/CounterMetricRowWalker.java:41-45 | src/java/org/apache/cassandra/db/virtual/walker/GaugeMetricRowWalker.java:41-45 | src/java/org/apache/cassandra/db/virtual/walker/MetricRowWalker.java:42-47 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 5+ corresponding lines) src/java/org/apache/cassandra/db/virtual/walker/CounterMetricRowWalker.java:33— src/java/org/apache/cassandra/db/virtual/walker/CounterMetricRowWalker.java:33-37 | src/java/org/apache/cassandra/db/virtual/walker/GaugeMetricRowWalker.java:33-37 | src/java/org/apache/cassandra/db/virtual/walker/MetricRowWalker.java:33-38 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 5+ corresponding lines) src/java/org/apache/cassandra/cql3/terms/Lists.java:392— src/java/org/apache/cassandra/cql3/terms/Lists.java:392-396 | src/java/org/apache/cassandra/cql3/terms/Maps.java:316-321 | src/java/org/apache/cassandra/cql3/terms/Sets.java:251-256 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 5+ corresponding lines) src/java/org/apache/cassandra/net/Message.java:1200— src/java/org/apache/cassandra/net/Message.java:1200-1208 | src/java/org/apache/cassandra/service/accord/serializers/KeySerializers.java:644-648 | src/java/org/apache/cassandra/utils/ArraySerializers.java:81-85 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (10 lines × 3) src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:1326— src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:1326-1335 | src/java/org/apache/cassandra/serializers/DecimalSerializer.java:47-56 | src/java/org/apache/cassandra/utils/ByteBufferUtil.java:614-623 — 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 `src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:1326` 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 × 3) src/java/org/apache/cassandra/db/rows/Cell.java:307— src/java/org/apache/cassandra/db/rows/Cell.java:307-316 | src/java/org/apache/cassandra/db/rows/Cell.java:319-328 | src/java/org/apache/cassandra/db/rows/Cell.java:331-340 — 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. 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 × 3) src/java/org/apache/cassandra/utils/CollectionSerializers.java:287— src/java/org/apache/cassandra/utils/CollectionSerializers.java:287-296 | src/java/org/apache/cassandra/utils/CollectionSerializers.java:313-322 | src/java/org/apache/cassandra/utils/CollectionSerializers.java:326-335 — 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. 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 `keySerializer` to `IVersionedSerializer<K>` in one and `AsymmetricVersionedSerializer<?, K, Version>` 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 × 3) src/java/org/apache/cassandra/service/paxos/cleanup/PaxosCleanupComplete.java:93— src/java/org/apache/cassandra/service/paxos/cleanup/PaxosCleanupComplete.java:93-102 | src/java/org/apache/cassandra/service/paxos/cleanup/PaxosFinishPrepareCleanup.java:62-71 | src/java/org/apache/cassandra/service/paxos/cleanup/PaxosUpdateLowBallot.java:78-87 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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. 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 × 3) src/java/org/apache/cassandra/db/compaction/CompactionManager.java:2613— src/java/org/apache/cassandra/db/compaction/CompactionManager.java:2613-2622 | src/java/org/apache/cassandra/service/ActiveRepairService.java:351-360 | src/java/org/apache/cassandra/service/StorageService.java:3370-3379 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (9–10 lines × 2) src/java/org/apache/cassandra/cql3/Duration.java:233— src/java/org/apache/cassandra/cql3/Duration.java:233-242 | src/java/org/apache/cassandra/cql3/functions/types/Duration.java:219-227 — before extracting anything, compare `src/java/org/apache/cassandra/cql3/Duration.java` and `src/java/org/apache/cassandra/cql3/functions/types/Duration.java` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 112 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (9–10 lines × 2) src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:2219— src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:2219-2228 | src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:2415-2423 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:2219` 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 (9–10 lines × 2) src/java/org/apache/cassandra/db/SinglePartitionReadCommand.java:1099— src/java/org/apache/cassandra/db/SinglePartitionReadCommand.java:1099-1108 | src/java/org/apache/cassandra/db/SinglePartitionReadCommand.java:1117-1125 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/db/SinglePartitionReadCommand.java:1099` 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–10 lines × 2) src/java/org/apache/cassandra/db/marshal/TupleType.java:407— src/java/org/apache/cassandra/db/marshal/TupleType.java:407-415 | src/java/org/apache/cassandra/db/marshal/UserType.java:686-695 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 `src/java/org/apache/cassandra/db/marshal/TupleType.java:407` 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–10 lines × 2) src/java/org/apache/cassandra/locator/ReplicaPlans.java:549— src/java/org/apache/cassandra/locator/ReplicaPlans.java:549-557 | src/java/org/apache/cassandra/locator/ReplicaPlans.java:599-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/locator/ReplicaPlans.java:549` 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 × 4) src/java/org/apache/cassandra/cql3/functions/types/AbstractAddressableByIndexData.java:107— src/java/org/apache/cassandra/cql3/functions/types/AbstractAddressableByIndexData.java:107-113 | src/java/org/apache/cassandra/cql3/functions/types/AbstractAddressableByIndexData.java:130-136 | src/java/org/apache/cassandra/cql3/functions/types/AbstractData.java:173-179 | src/java/org/apache/cassandra/cql3/functions/types/AbstractData.java:226-232 — before extracting anything, compare `src/java/org/apache/cassandra/cql3/functions/types/AbstractAddressableByIndexData.java` and `src/java/org/apache/cassandra/cql3/functions/types/AbstractData.java` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 77 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (7 lines × 4) src/java/org/apache/cassandra/net/Verb.java:549— src/java/org/apache/cassandra/net/Verb.java:549-555 | src/java/org/apache/cassandra/net/Verb.java:562-568 | src/java/org/apache/cassandra/net/Verb.java:575-581 | src/java/org/apache/cassandra/transport/Message.java:158-164 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/net/Verb.java:549` 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 (7 lines × 4) src/java/org/apache/cassandra/service/accord/serializers/CommandSerializers.java:537— src/java/org/apache/cassandra/service/accord/serializers/CommandSerializers.java:537-543 | src/java/org/apache/cassandra/service/accord/serializers/CommandSerializers.java:610-616 | src/java/org/apache/cassandra/service/accord/serializers/CommandSerializers.java:628-634 | src/java/org/apache/cassandra/service/accord/serializers/CommandSerializers.java:670-676 — 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 (7 lines × 4) src/java/org/apache/cassandra/utils/CollectionSerializers.java:165— src/java/org/apache/cassandra/utils/CollectionSerializers.java:165-171 | src/java/org/apache/cassandra/utils/CollectionSerializers.java:175-181 | src/java/org/apache/cassandra/utils/CollectionSerializers.java:185-191 | src/java/org/apache/cassandra/utils/CollectionSerializers.java:195-201 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. 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 `valueSerializer` to `IVersionedSerializer<V>` in one and `IPartitionerDependentSerializer<V>` 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 (7 lines × 4) tools/stress/src/org/apache/cassandra/stress/settings/OptionDistribution.java:252— tools/stress/src/org/apache/cassandra/stress/settings/OptionDistribution.java:252-258 | tools/stress/src/org/apache/cassandra/stress/settings/OptionDistribution.java:278-284 | tools/stress/src/org/apache/cassandra/stress/settings/OptionDistribution.java:305-311 | tools/stress/src/org/apache/cassandra/stress/settings/OptionDistribution.java:334-340 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `tools/stress/src/org/apache/cassandra/stress/settings/OptionDistribution.java:252` 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 × 3) src/java/org/apache/cassandra/repair/autorepair/AutoRepairUtils.java:545— src/java/org/apache/cassandra/repair/autorepair/AutoRepairUtils.java:545-551 | src/java/org/apache/cassandra/repair/autorepair/AutoRepairUtils.java:561-567 | src/java/org/apache/cassandra/repair/autorepair/AutoRepairUtils.java:578-584 — 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 `src/java/org/apache/cassandra/repair/autorepair/AutoRepairUtils.java:545` 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 (7 lines × 3) src/java/org/apache/cassandra/tools/nodetool/RepairAdmin.java:144— src/java/org/apache/cassandra/tools/nodetool/RepairAdmin.java:144-150 | src/java/org/apache/cassandra/tools/nodetool/RepairAdmin.java:218-224 | src/java/org/apache/cassandra/tools/nodetool/RepairAdmin.java:284-290 — 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, `src/java/org/apache/cassandra/tools/nodetool/RepairAdmin.java:228` calls `add` and `src/java/org/apache/cassandra/tools/nodetool/RepairAdmin.java:293` 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 × 3) src/java/org/apache/cassandra/utils/obs/BitUtil.java:738— src/java/org/apache/cassandra/utils/obs/BitUtil.java:738-744 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:752-758 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:771-777 — 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 `src/java/org/apache/cassandra/utils/obs/BitUtil.java:738` 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 (7 lines × 3) src/java/org/apache/cassandra/db/memtable/ShardedSkipListMemtable.java:270— src/java/org/apache/cassandra/db/memtable/ShardedSkipListMemtable.java:270-276 | src/java/org/apache/cassandra/db/memtable/SkipListMemtable.java:211-217 | src/java/org/apache/cassandra/db/memtable/TrieMemtable.java:337-343 — before extracting anything, compare `src/java/org/apache/cassandra/db/memtable/ShardedSkipListMemtable.java` and `src/java/org/apache/cassandra/db/memtable/SkipListMemtable.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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) src/java/org/apache/cassandra/db/marshal/UserType.java:760— src/java/org/apache/cassandra/db/marshal/UserType.java:760-766 | src/java/org/apache/cassandra/schema/KeyspaceMetadata.java:403-409 | src/java/org/apache/cassandra/schema/TableMetadata.java:1658-1664 — 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. 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.
X15 · Unvalidated length from an untrusted reader· Length read from the parsed input is spent without ever being bounded · ×5
Length read from the parsed input is spent without ever being bounded src/java/org/apache/cassandra/streaming/async/StreamCompressionSerializer.java:103— `compressedLength` is read from the bytes being parsed at line 80 (`readInt`), then used to size a `new byte[]` at line 103 — and nowhere in its scope is `compressedLength` 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). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `compressedLength` against the bytes actually remaining and a maximum the format allows before allocating.
Length read from the parsed input is spent without ever being bounded src/java/org/apache/cassandra/index/sai/disk/v1/segment/SegmentMetadata.java:194— `len` is read from the bytes being parsed at line 193 (`readInt`), then used to size a `new byte[]` at line 194 — and nowhere in its scope is `len` 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). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `len` against the bytes actually remaining and a maximum the format allows before allocating.
Length read from the parsed input is spent without ever being bounded src/java/org/apache/cassandra/hints/HintsDescriptor.java:459— `paramsLength` is read from the bytes being parsed at line 455 (`readInt`), then used to size a `new byte[]` at line 459 — and nowhere in its scope is `paramsLength` 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). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `paramsLength` against the bytes actually remaining and a maximum the format allows before allocating.
Length read from the parsed input is spent without ever being bounded src/java/org/apache/cassandra/db/compression/CompressionDictionary.java:302— `length` is read from the bytes being parsed at line 301 (`readInt`), then used to size a `new byte[]` at line 302 — and nowhere in its scope is `length` 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). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `length` against the bytes actually remaining and a maximum the format allows before allocating.
Length read from the parsed input is spent without ever being bounded src/java/org/apache/cassandra/cql3/ResultSet.java:619— `numPKNames` is read from the bytes being parsed at line 616 (`readInt`), then used to size a `new short[]` at line 619 — and nowhere in its scope is `numPKNames` 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). Whoever wrote those bytes therefore chooses the allocation directly: a 32-bit length asks for up to 2 GiB before a single byte of the payload is known to exist, which either exhausts the heap with an `OutOfMemoryError` or, negative, throws `NegativeArraySizeException` out of a parser whose failure path was written for malformed input, not for hostile input. Bound `numPKNames` against the bytes actually remaining and a maximum the format allows before allocating.
D4 · Code Duplication· Edited copy of a member (38 corresponding lines) · ×4
Edited copy of a member (38 corresponding lines) src/java/org/apache/cassandra/repair/RepairJob.java:595— src/java/org/apache/cassandra/repair/RepairJob.java:595-632 | src/java/org/apache/cassandra/repair/RepairJob.java:638-686 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (38 corresponding lines) src/java/org/apache/cassandra/tools/nodetool/RepairAdmin.java:204— src/java/org/apache/cassandra/tools/nodetool/RepairAdmin.java:204-247 | src/java/org/apache/cassandra/tools/nodetool/RepairAdmin.java:275-312 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (38 corresponding lines) src/java/org/apache/cassandra/io/util/DataOutputPlus.java:102— src/java/org/apache/cassandra/io/util/DataOutputPlus.java:102-139 | src/java/org/apache/cassandra/io/util/DataOutputPlus.java:165-202 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (38 corresponding lines) src/java/org/apache/cassandra/cql3/functions/types/ParseUtils.java:518— src/java/org/apache/cassandra/cql3/functions/types/ParseUtils.java:518-555 | src/java/org/apache/cassandra/cql3/functions/types/ParseUtils.java:567-617 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (36 corresponding lines) · ×4
Edited copy of a member (36 corresponding lines) src/java/org/apache/cassandra/db/ClusteringComparator.java:530— src/java/org/apache/cassandra/db/ClusteringComparator.java:530-572 | src/java/org/apache/cassandra/db/ClusteringComparator.java:587-622 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (36 corresponding lines) src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java:278— src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java:278-327 | tools/stress/src/org/apache/cassandra/io/sstable/StressCQLSSTableWriter.java:257-292 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (36 corresponding lines) src/java/org/apache/cassandra/index/accord/RangeMemoryIndex.java:123— src/java/org/apache/cassandra/index/accord/RangeMemoryIndex.java:123-158 | src/java/org/apache/cassandra/service/accord/journal/SegmentRangeSearcher.java:263-298 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (36 corresponding lines) src/java/org/apache/cassandra/io/tries/IncrementalDeepTrieWriterPageAware.java:297— src/java/org/apache/cassandra/io/tries/IncrementalDeepTrieWriterPageAware.java:297-335 | src/java/org/apache/cassandra/io/tries/IncrementalTrieWriterPageAware.java:331-366 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 10+ corresponding lines) · ×4
Edited copies of one member (3 members, 10+ corresponding lines) src/java/org/apache/cassandra/utils/memory/BigEndianMemoryUtil.java:81— src/java/org/apache/cassandra/utils/memory/BigEndianMemoryUtil.java:81-90 | src/java/org/apache/cassandra/utils/memory/LittleEndianMemoryUtil.java:81-90 | src/java/org/apache/cassandra/utils/memory/NativeEndianMemoryUtil.java:112-127 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 10+ corresponding lines) src/java/org/apache/cassandra/db/ClusteringBoundOrBoundary.java:78— src/java/org/apache/cassandra/db/ClusteringBoundOrBoundary.java:78-88 | src/java/org/apache/cassandra/db/ClusteringPrefix.java:434-444 | src/java/org/apache/cassandra/db/marshal/TypeParser.java:653-662 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 10+ corresponding lines) src/java/org/apache/cassandra/cql3/terms/Terms.java:704— src/java/org/apache/cassandra/cql3/terms/Terms.java:704-713 | src/java/org/apache/cassandra/cql3/terms/Terms.java:717-726 | src/java/org/apache/cassandra/cql3/terms/Terms.java:730-739 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 10+ corresponding lines) src/java/org/apache/cassandra/io/util/Memory.java:145— src/java/org/apache/cassandra/io/util/Memory.java:145-157 | src/java/org/apache/cassandra/io/util/Memory.java:186-196 | src/java/org/apache/cassandra/utils/memory/MemoryUtil.java:272-281 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 14+ corresponding lines) · ×4
Edited copies of one member (3 members, 14+ corresponding lines) src/java/org/apache/cassandra/io/sstable/SSTable.java:109— src/java/org/apache/cassandra/io/sstable/SSTable.java:109-122 | src/java/org/apache/cassandra/io/sstable/SSTable.java:125-138 | src/java/org/apache/cassandra/io/sstable/SSTable.java:141-154 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 14+ corresponding lines) src/java/org/apache/cassandra/tcm/sequences/BootstrapAndJoin.java:512— src/java/org/apache/cassandra/tcm/sequences/BootstrapAndJoin.java:512-525 | src/java/org/apache/cassandra/tcm/sequences/BootstrapAndReplace.java:420-433 | src/java/org/apache/cassandra/tcm/sequences/Move.java:620-633 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 14+ corresponding lines) src/java/org/apache/cassandra/repair/autorepair/AutoRepairUtils.java:543— src/java/org/apache/cassandra/repair/autorepair/AutoRepairUtils.java:543-556 | src/java/org/apache/cassandra/repair/autorepair/AutoRepairUtils.java:559-573 | src/java/org/apache/cassandra/repair/autorepair/AutoRepairUtils.java:576-589 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 14+ corresponding lines) src/java/org/apache/cassandra/db/compression/TrainingState.java:153— src/java/org/apache/cassandra/db/compression/TrainingState.java:153-168 | src/java/org/apache/cassandra/streaming/management/SessionCompleteEventCompositeData.java:65-79 | src/java/org/apache/cassandra/streaming/management/StreamSummaryCompositeData.java:67-80 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 12+ corresponding lines) · ×4
Edited copies of one member (3 members, 12+ corresponding lines) src/java/org/apache/cassandra/service/accord/AccordObjectSizes.java:210— src/java/org/apache/cassandra/service/accord/AccordObjectSizes.java:210-221 | src/java/org/apache/cassandra/service/accord/serializers/KeySerializers.java:469-486 | src/java/org/apache/cassandra/service/accord/serializers/KeySerializers.java:489-506 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) src/java/org/apache/cassandra/db/virtual/BatchMetricsTable.java:49— src/java/org/apache/cassandra/db/virtual/BatchMetricsTable.java:49-60 | src/java/org/apache/cassandra/db/virtual/CIDRFilteringMetricsTable.java:152-164 | src/java/org/apache/cassandra/db/virtual/QueriesTable.java:58-69 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) src/java/org/apache/cassandra/utils/vint/VIntCoding.java:97— src/java/org/apache/cassandra/utils/vint/VIntCoding.java:97-114 | src/java/org/apache/cassandra/utils/vint/VIntCoding.java:118-129 | src/java/org/apache/cassandra/utils/vint/VIntCoding.java:133-144 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java:229— src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java:229-240 | src/java/org/apache/cassandra/db/compaction/TimeWindowCompactionStrategy.java:414-425 | src/java/org/apache/cassandra/db/compaction/UnifiedCompactionStrategy.java:236-247 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 8+ corresponding lines) · ×4
Edited copies of one member (4 members, 8+ corresponding lines) src/java/org/apache/cassandra/tcm/serialization/MessageSerializers.java:43— src/java/org/apache/cassandra/tcm/serialization/MessageSerializers.java:43-50 | src/java/org/apache/cassandra/tcm/serialization/MessageSerializers.java:53-60 | src/java/org/apache/cassandra/tcm/serialization/MessageSerializers.java:63-70 | src/java/org/apache/cassandra/tcm/serialization/MessageSerializers.java:73-80 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 8+ corresponding lines) src/java/org/apache/cassandra/cql3/selection/ListSelector.java:48— src/java/org/apache/cassandra/cql3/selection/ListSelector.java:48-56 | src/java/org/apache/cassandra/cql3/selection/SetSelector.java:50-58 | src/java/org/apache/cassandra/cql3/selection/TupleSelector.java:49-57 | src/java/org/apache/cassandra/cql3/selection/VectorSelector.java:47-54 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 8+ corresponding lines) src/java/org/apache/cassandra/service/accord/debug/DebugBlockedTxns.java:178— src/java/org/apache/cassandra/service/accord/debug/DebugBlockedTxns.java:178-185 | src/java/org/apache/cassandra/service/accord/debug/DebugBlockedTxns.java:188-195 | src/java/org/apache/cassandra/service/accord/debug/DebugTxnGraph.java:223-230 | src/java/org/apache/cassandra/service/accord/debug/DebugTxnGraph.java:233-241 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 8+ corresponding lines) src/java/org/apache/cassandra/db/compaction/CompactionStrategyHolder.java:149— src/java/org/apache/cassandra/db/compaction/CompactionStrategyHolder.java:149-156 | src/java/org/apache/cassandra/db/compaction/CompactionStrategyHolder.java:160-167 | src/java/org/apache/cassandra/db/compaction/PendingRepairHolder.java:192-199 | src/java/org/apache/cassandra/db/compaction/PendingRepairHolder.java:203-210 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 4+ corresponding lines) · ×4
Edited copies of one member (6 members, 4+ corresponding lines) src/java/org/apache/cassandra/serializers/DoubleSerializer.java:43— src/java/org/apache/cassandra/serializers/DoubleSerializer.java:43-46 | src/java/org/apache/cassandra/serializers/FloatSerializer.java:44-47 | src/java/org/apache/cassandra/serializers/Int32Serializer.java:41-44 | src/java/org/apache/cassandra/serializers/LongSerializer.java:41-44 | src/java/org/apache/cassandra/serializers/TimestampSerializer.java:186-189 | src/java/org/apache/cassandra/serializers/UUIDSerializer.java:43-47 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
Edited copies of one member (6 members, 4+ corresponding lines) src/java/org/apache/cassandra/cql3/statements/schema/CommentOnColumnStatement.java:129— src/java/org/apache/cassandra/cql3/statements/schema/CommentOnColumnStatement.java:129-135 | src/java/org/apache/cassandra/cql3/statements/schema/CommentOnTableStatement.java:122-127 | src/java/org/apache/cassandra/cql3/statements/schema/CreateTriggerStatement.java:153-156 | src/java/org/apache/cassandra/cql3/statements/schema/DropTriggerStatement.java:117-120 | src/java/org/apache/cassandra/cql3/statements/schema/SecurityLabelOnColumnStatement.java:158-165 | src/java/org/apache/cassandra/cql3/statements/schema/SecurityLabelOnTableStatement.java:151-157 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
Edited copies of one member (6 members, 4+ corresponding lines) src/java/org/apache/cassandra/cql3/statements/schema/AlterViewStatement.java:148— src/java/org/apache/cassandra/cql3/statements/schema/AlterViewStatement.java:148-151 | src/java/org/apache/cassandra/cql3/statements/schema/CreateTypeStatement.java:163-166 | src/java/org/apache/cassandra/cql3/statements/schema/DropIndexStatement.java:123-126 | src/java/org/apache/cassandra/cql3/statements/schema/DropTableStatement.java:152-155 | src/java/org/apache/cassandra/cql3/statements/schema/DropTypeStatement.java:157-160 | src/java/org/apache/cassandra/cql3/statements/schema/DropViewStatement.java:111-114 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
Edited copies of one member (6 members, 4+ corresponding lines) src/java/org/apache/cassandra/serializers/BooleanSerializer.java:47— src/java/org/apache/cassandra/serializers/BooleanSerializer.java:47-50 | src/java/org/apache/cassandra/serializers/ByteSerializer.java:41-44 | src/java/org/apache/cassandra/serializers/DecimalSerializer.java:59-63 | src/java/org/apache/cassandra/serializers/ShortSerializer.java:41-44 | src/java/org/apache/cassandra/serializers/SimpleDateSerializer.java:119-122 | src/java/org/apache/cassandra/serializers/TimeSerializer.java:72-75 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 4+ corresponding lines) · ×4
Edited copies of one member (4 members, 4+ corresponding lines) src/java/org/apache/cassandra/cql3/selection/ListSelector.java:87— src/java/org/apache/cassandra/cql3/selection/ListSelector.java:87-90 | src/java/org/apache/cassandra/cql3/selection/SetSelector.java:89-92 | src/java/org/apache/cassandra/cql3/selection/TupleSelector.java:88-91 | src/java/org/apache/cassandra/cql3/selection/VectorSelector.java:106-109 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 4+ corresponding lines) src/java/org/apache/cassandra/cql3/selection/ListSelector.java:93— src/java/org/apache/cassandra/cql3/selection/ListSelector.java:93-96 | src/java/org/apache/cassandra/cql3/selection/SetSelector.java:95-98 | src/java/org/apache/cassandra/cql3/selection/TupleSelector.java:94-97 | src/java/org/apache/cassandra/cql3/selection/VectorSelector.java:113-116 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 4+ corresponding lines) src/java/org/apache/cassandra/cql3/selection/ListSelector.java:109— src/java/org/apache/cassandra/cql3/selection/ListSelector.java:109-112 | src/java/org/apache/cassandra/cql3/selection/SetSelector.java:111-114 | src/java/org/apache/cassandra/cql3/selection/TupleSelector.java:110-113 | src/java/org/apache/cassandra/cql3/selection/VectorSelector.java:126-129 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 4+ corresponding lines) src/java/org/apache/cassandra/db/commitlog/CompressedSegment.java:108— src/java/org/apache/cassandra/db/commitlog/CompressedSegment.java:108-111 | src/java/org/apache/cassandra/db/commitlog/DirectIOSegment.java:180-189 | src/java/org/apache/cassandra/db/commitlog/EncryptedSegment.java:169-172 | src/java/org/apache/cassandra/db/commitlog/MemoryMappedSegment.java:125-128 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Duplicated block (13–20 lines × 3) src/java/org/apache/cassandra/utils/obs/BitUtil.java:215— src/java/org/apache/cassandra/utils/obs/BitUtil.java:215-229 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:230-249 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:268-280 — 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 `src/java/org/apache/cassandra/utils/obs/BitUtil.java:215` 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 (13–20 lines × 3) src/java/org/apache/cassandra/utils/obs/BitUtil.java:344— src/java/org/apache/cassandra/utils/obs/BitUtil.java:344-358 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:359-378 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:397-409 — 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 `src/java/org/apache/cassandra/utils/obs/BitUtil.java:344` 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 (13–20 lines × 3) src/java/org/apache/cassandra/utils/obs/BitUtil.java:473— src/java/org/apache/cassandra/utils/obs/BitUtil.java:473-487 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:488-507 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:526-538 — 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 `src/java/org/apache/cassandra/utils/obs/BitUtil.java:473` 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 (13–20 lines × 3) src/java/org/apache/cassandra/utils/obs/BitUtil.java:598— src/java/org/apache/cassandra/utils/obs/BitUtil.java:598-612 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:613-632 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:651-663 — 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 `src/java/org/apache/cassandra/utils/obs/BitUtil.java:598` 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) src/java/org/apache/cassandra/config/EncryptionOptions.java:226— src/java/org/apache/cassandra/config/EncryptionOptions.java:226-244 | src/java/org/apache/cassandra/config/EncryptionOptions.java:573-591 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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) src/java/org/apache/cassandra/config/YamlConfigurationLoader.java:201— src/java/org/apache/cassandra/config/YamlConfigurationLoader.java:201-219 | src/java/org/apache/cassandra/config/YamlConfigurationLoader.java:235-253 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/config/YamlConfigurationLoader.java: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.
Duplicated block (19 lines × 2) src/java/org/apache/cassandra/utils/NoSpamLogger.java:136— src/java/org/apache/cassandra/utils/NoSpamLogger.java:136-154 | src/java/org/apache/cassandra/utils/NoSpamLogger.java:274-292 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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) src/java/org/apache/cassandra/db/RangeTombstoneList.java:413— src/java/org/apache/cassandra/db/RangeTombstoneList.java:413-431 | src/java/org/apache/cassandra/db/RangeTombstoneList.java:461-479 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/db/RangeTombstoneList.java:413` 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 (18 lines × 2) src/java/org/apache/cassandra/db/CounterMutation.java:380— src/java/org/apache/cassandra/db/CounterMutation.java:380-397 | src/java/org/apache/cassandra/db/Mutation.java:405-422 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 (18 lines × 2) src/java/org/apache/cassandra/db/partitions/PartitionIterators.java:41— src/java/org/apache/cassandra/db/partitions/PartitionIterators.java:41-58 | src/java/org/apache/cassandra/db/partitions/UnfilteredPartitionIterators.java:91-108 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 `src/java/org/apache/cassandra/db/partitions/PartitionIterators.java:41` 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 first that the copies are not typed on the same thing: the declarations holding them bind `iter` to `PartitionIterator` in one and `UnfilteredPartitionIterator` 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 × 2) src/java/org/apache/cassandra/locator/EndpointsForRange.java:97— src/java/org/apache/cassandra/locator/EndpointsForRange.java:97-114 | src/java/org/apache/cassandra/locator/EndpointsForToken.java:93-110 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 `src/java/org/apache/cassandra/locator/EndpointsForRange.java:97` 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 (18 lines × 2) src/java/org/apache/cassandra/utils/MerkleTree.java:271— src/java/org/apache/cassandra/utils/MerkleTree.java:271-288 | src/java/org/apache/cassandra/utils/MerkleTree.java:291-308 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:2695— src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:2695-2710 | src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:2967-2982 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) src/java/org/apache/cassandra/cql3/statements/GrantPermissionsStatement.java:71— src/java/org/apache/cassandra/cql3/statements/GrantPermissionsStatement.java:71-86 | src/java/org/apache/cassandra/cql3/statements/RevokePermissionsStatement.java:53-68 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/cql3/statements/GrantPermissionsStatement.java:71` 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 (16 lines × 2) src/java/org/apache/cassandra/hints/HintsReader.java:213— src/java/org/apache/cassandra/hints/HintsReader.java:213-228 | src/java/org/apache/cassandra/hints/HintsReader.java:319-334 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) src/java/org/apache/cassandra/tcm/sequences/BootstrapAndJoin.java:269— src/java/org/apache/cassandra/tcm/sequences/BootstrapAndJoin.java:269-284 | src/java/org/apache/cassandra/tcm/sequences/BootstrapAndReplace.java:259-274 — before extracting anything, compare `src/java/org/apache/cassandra/tcm/sequences/BootstrapAndJoin.java` and `src/java/org/apache/cassandra/tcm/sequences/BootstrapAndReplace.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/tcm/sequences/BootstrapAndJoin.java:269` 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 (13–14 lines × 2) src/java/org/apache/cassandra/db/compaction/AbstractCompactionStrategy.java:536— src/java/org/apache/cassandra/db/compaction/AbstractCompactionStrategy.java:536-549 | src/java/org/apache/cassandra/db/compaction/LeveledCompactionStrategy.java:273-285 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (13–14 lines × 2) src/java/org/apache/cassandra/io/sstable/AbstractSSTableIterator.java:544— src/java/org/apache/cassandra/io/sstable/AbstractSSTableIterator.java:544-556 | src/java/org/apache/cassandra/io/sstable/format/big/SSTableIterator.java:171-184 — 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 `src/java/org/apache/cassandra/io/sstable/AbstractSSTableIterator.java:544` 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 (13–14 lines × 2) src/java/org/apache/cassandra/locator/InetAddressAndPort.java:455— src/java/org/apache/cassandra/locator/InetAddressAndPort.java:455-468 | src/java/org/apache/cassandra/locator/InetAddressAndPort.java:536-548 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/locator/InetAddressAndPort.java:455` 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, `src/java/org/apache/cassandra/locator/InetAddressAndPort.java:453` calls `AssertionError` and `src/java/org/apache/cassandra/locator/InetAddressAndPort.java:534` 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) src/java/org/apache/cassandra/schema/PartitionDenylist.java:259— src/java/org/apache/cassandra/schema/PartitionDenylist.java:259-271 | src/java/org/apache/cassandra/schema/PartitionDenylist.java:281-294 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/schema/PartitionDenylist.java:259` 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 × 3) src/java/org/apache/cassandra/cql3/selection/ListSelector.java:176— src/java/org/apache/cassandra/cql3/selection/ListSelector.java:176-180 | src/java/org/apache/cassandra/cql3/selection/SetSelector.java:179-183 | src/java/org/apache/cassandra/cql3/selection/TupleSelector.java:178-182 — before extracting anything, compare `src/java/org/apache/cassandra/cql3/selection/ListSelector.java` and `src/java/org/apache/cassandra/cql3/selection/SetSelector.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `src/java/org/apache/cassandra/cql3/selection/ListSelector.java: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. 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 (5 lines × 3) src/java/org/apache/cassandra/repair/RepairJob.java:575— src/java/org/apache/cassandra/repair/RepairJob.java:575-579 | src/java/org/apache/cassandra/repair/RepairJob.java:596-600 | src/java/org/apache/cassandra/repair/RepairJob.java:639-643 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) src/java/org/apache/cassandra/schema/Tables.java:150— src/java/org/apache/cassandra/schema/Tables.java:150-154 | src/java/org/apache/cassandra/schema/Types.java:175-179 | src/java/org/apache/cassandra/schema/Views.java:143-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 all 3 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `predicate` to `Predicate<TableMetadata>` in one and `Predicate<UserType>` 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 (5 lines × 3) src/java/org/apache/cassandra/schema/Tables.java:305— src/java/org/apache/cassandra/schema/Tables.java:305-309 | src/java/org/apache/cassandra/schema/Triggers.java:167-171 | src/java/org/apache/cassandra/schema/Views.java:275-279 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `t` to `Tables` in one and `Triggers` 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.
D4 · Code Duplication· Edited copy of a member (37 corresponding lines) · ×3
Edited copy of a member (37 corresponding lines) src/java/org/apache/cassandra/service/accord/serializers/CommandSerializers.java:338— src/java/org/apache/cassandra/service/accord/serializers/CommandSerializers.java:338-383 | src/java/org/apache/cassandra/service/accord/serializers/CommandSerializers.java:441-477 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (37 corresponding lines) src/java/org/apache/cassandra/dht/ByteOrderedPartitioner.java:421— src/java/org/apache/cassandra/dht/ByteOrderedPartitioner.java:421-457 | src/java/org/apache/cassandra/dht/OrderPreservingPartitioner.java:279-315 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (37 corresponding lines) src/java/org/apache/cassandra/cql3/selection/AbstractFunctionSelector.java:334— src/java/org/apache/cassandra/cql3/selection/AbstractFunctionSelector.java:334-371 | src/java/org/apache/cassandra/cql3/selection/AbstractFunctionSelector.java:375-411 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (41 corresponding lines) · ×3
Edited copy of a member (41 corresponding lines) src/java/org/apache/cassandra/tools/nodetool/GetInterDCStreamThroughput.java:42— src/java/org/apache/cassandra/tools/nodetool/GetInterDCStreamThroughput.java:42-83 | src/java/org/apache/cassandra/tools/nodetool/GetStreamThroughput.java:42-82 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (41 corresponding lines) src/java/org/apache/cassandra/service/consensus/TransactionalMode.java:175— src/java/org/apache/cassandra/service/consensus/TransactionalMode.java:175-215 | src/java/org/apache/cassandra/service/consensus/TransactionalMode.java:218-267 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (41 corresponding lines) src/java/org/apache/cassandra/cql3/functions/AggregateFcts.java:856— src/java/org/apache/cassandra/cql3/functions/AggregateFcts.java:856-896 | src/java/org/apache/cassandra/cql3/functions/AggregateFcts.java:905-945 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (33 corresponding lines) · ×3
Edited copy of a member (33 corresponding lines) src/java/org/apache/cassandra/auth/CassandraAuthorizer.java:154— src/java/org/apache/cassandra/auth/CassandraAuthorizer.java:154-188 | src/java/org/apache/cassandra/auth/CassandraAuthorizer.java:194-226 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (33 corresponding lines) src/java/org/apache/cassandra/service/accord/serializers/KeySerializers.java:289— src/java/org/apache/cassandra/service/accord/serializers/KeySerializers.java:289-321 | src/java/org/apache/cassandra/service/accord/serializers/KeySerializers.java:324-356 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (33 corresponding lines) src/java/org/apache/cassandra/index/sai/disk/v1/vector/RandomAccessReaderAdapter.java:48— src/java/org/apache/cassandra/index/sai/disk/v1/vector/RandomAccessReaderAdapter.java:48-80 | src/java/org/apache/cassandra/index/sai/disk/v1/vector/RandomAccessReaderAdapter.java:93-128 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (31 corresponding lines) · ×3
Edited copy of a member (31 corresponding lines) src/java/org/apache/cassandra/repair/consistent/CoordinatorSession.java:194— src/java/org/apache/cassandra/repair/consistent/CoordinatorSession.java:194-231 | src/java/org/apache/cassandra/repair/consistent/CoordinatorSession.java:251-281 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (31 corresponding lines) src/java/org/apache/cassandra/utils/ExecutorUtils.java:84— src/java/org/apache/cassandra/utils/ExecutorUtils.java:84-114 | src/java/org/apache/cassandra/utils/ExecutorUtils.java:117-150 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (31 corresponding lines) src/java/org/apache/cassandra/hints/HintMessage.java:81— src/java/org/apache/cassandra/hints/HintMessage.java:81-111 | src/java/org/apache/cassandra/hints/HintMessage.java:114-146 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 16+ corresponding lines) · ×3
Edited copies of one member (3 members, 16+ corresponding lines) src/java/org/apache/cassandra/service/ActiveRepairService.java:387— src/java/org/apache/cassandra/service/ActiveRepairService.java:387-404 | src/java/org/apache/cassandra/service/ActiveRepairService.java:408-424 | src/java/org/apache/cassandra/service/ActiveRepairService.java:428-443 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 16+ corresponding lines) src/java/org/apache/cassandra/db/marshal/VectorType.java:519— src/java/org/apache/cassandra/db/marshal/VectorType.java:519-535 | src/java/org/apache/cassandra/db/marshal/VectorType.java:612-627 | src/java/org/apache/cassandra/db/marshal/VectorType.java:660-675 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 16+ corresponding lines) src/java/org/apache/cassandra/db/PartitionRangeReadCommand.java:231— src/java/org/apache/cassandra/db/PartitionRangeReadCommand.java:231-250 | src/java/org/apache/cassandra/db/PartitionRangeReadCommand.java:253-272 | src/java/org/apache/cassandra/db/SinglePartitionReadCommand.java:1365-1380 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 11+ corresponding lines) · ×3
Edited copies of one member (4 members, 11+ corresponding lines) src/java/org/apache/cassandra/db/marshal/ListType.java:203— src/java/org/apache/cassandra/db/marshal/ListType.java:203-214 | src/java/org/apache/cassandra/db/marshal/MapType.java:294-304 | src/java/org/apache/cassandra/db/marshal/SetType.java:196-207 | src/java/org/apache/cassandra/db/marshal/UserType.java:648-659 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 11+ corresponding lines) src/java/org/apache/cassandra/db/compaction/CompactionStrategyHolder.java:129— src/java/org/apache/cassandra/db/compaction/CompactionStrategyHolder.java:129-139 | src/java/org/apache/cassandra/db/compaction/CompactionStrategyHolder.java:193-203 | src/java/org/apache/cassandra/db/compaction/PendingRepairHolder.java:139-150 | src/java/org/apache/cassandra/db/compaction/PendingRepairHolder.java:231-241 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 11+ corresponding lines) src/java/org/apache/cassandra/cql3/statements/schema/CommentOnTableStatement.java:72— src/java/org/apache/cassandra/cql3/statements/schema/CommentOnTableStatement.java:72-83 | src/java/org/apache/cassandra/cql3/statements/schema/CommentOnUserTypeFieldStatement.java:73-84 | src/java/org/apache/cassandra/cql3/statements/schema/SecurityLabelOnTableStatement.java:97-110 | src/java/org/apache/cassandra/cql3/statements/schema/SecurityLabelOnUserTypeStatement.java:96-106 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 9+ corresponding lines) · ×3
Edited copies of one member (4 members, 9+ corresponding lines) src/java/org/apache/cassandra/db/SerializationHeader.java:652— src/java/org/apache/cassandra/db/SerializationHeader.java:652-660 | src/java/org/apache/cassandra/net/CustomParamsSerializer.java:51-59 | src/java/org/apache/cassandra/service/writes/thresholds/WriteThresholdMapSerializer.java:59-67 | src/java/org/apache/cassandra/tcm/ownership/MovementMap.java:158-166 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 9+ corresponding lines) src/java/org/apache/cassandra/tcm/sequences/BootstrapAndJoin.java:150— src/java/org/apache/cassandra/tcm/sequences/BootstrapAndJoin.java:150-160 | src/java/org/apache/cassandra/tcm/sequences/BootstrapAndReplace.java:143-153 | src/java/org/apache/cassandra/tcm/sequences/Move.java:164-174 | src/java/org/apache/cassandra/tcm/sequences/UnbootstrapAndLeave.java:115-123 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 9+ corresponding lines) src/java/org/apache/cassandra/repair/autorepair/AutoRepairUtils.java:504— src/java/org/apache/cassandra/repair/autorepair/AutoRepairUtils.java:504-512 | src/java/org/apache/cassandra/repair/autorepair/AutoRepairUtils.java:523-533 | src/java/org/apache/cassandra/repair/autorepair/AutoRepairUtils.java:1150-1158 | src/java/org/apache/cassandra/repair/autorepair/AutoRepairUtils.java:1161-1170 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 7+ corresponding lines) · ×3
Edited copies of one member (4 members, 7+ corresponding lines) src/java/org/apache/cassandra/service/accord/interop/AccordInteropRead.java:94— src/java/org/apache/cassandra/service/accord/interop/AccordInteropRead.java:94-100 | src/java/org/apache/cassandra/service/accord/interop/AccordInteropReadRepair.java:77-83 | src/java/org/apache/cassandra/service/accord/serializers/CheckStatusSerializers.java:141-148 | src/java/org/apache/cassandra/service/accord/serializers/CommitSerializers.java:105-111 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 7+ corresponding lines) src/java/org/apache/cassandra/cql3/selection/ListSelector.java:174— src/java/org/apache/cassandra/cql3/selection/ListSelector.java:174-180 | src/java/org/apache/cassandra/cql3/selection/SetSelector.java:176-183 | src/java/org/apache/cassandra/cql3/selection/TupleSelector.java:175-182 | src/java/org/apache/cassandra/cql3/selection/VectorSelector.java:143-149 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 7+ corresponding lines) src/java/org/apache/cassandra/net/CustomParamsSerializer.java:63— src/java/org/apache/cassandra/net/CustomParamsSerializer.java:63-71 | src/java/org/apache/cassandra/schema/TableParams.java:777-787 | src/java/org/apache/cassandra/schema/TableParams.java:789-799 | src/java/org/apache/cassandra/service/writes/thresholds/WriteThresholdMapSerializer.java:49-55 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Duplicated block (24 lines × 2) src/java/org/apache/cassandra/index/accord/RouteSecondaryIndexBuilder.java:146— src/java/org/apache/cassandra/index/accord/RouteSecondaryIndexBuilder.java:146-169 | src/java/org/apache/cassandra/index/sai/StorageAttachedIndexBuilder.java:220-243 — 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 `src/java/org/apache/cassandra/index/accord/RouteSecondaryIndexBuilder.java:146` 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) src/java/org/apache/cassandra/index/internal/composites/CompositesSearcher.java:80— src/java/org/apache/cassandra/index/internal/composites/CompositesSearcher.java:80-103 | src/java/org/apache/cassandra/index/internal/keys/KeysSearcher.java:65-88 — 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 `src/java/org/apache/cassandra/index/internal/composites/CompositesSearcher.java:80` 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 (24 lines × 2) src/java/org/apache/cassandra/service/StorageProxy.java:1298— src/java/org/apache/cassandra/service/StorageProxy.java:1298-1321 | src/java/org/apache/cassandra/service/StorageProxy.java:1528-1551 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/service/StorageProxy.java:1298` 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 (23 lines × 2) src/java/org/apache/cassandra/db/ClusteringComparator.java:531— src/java/org/apache/cassandra/db/ClusteringComparator.java:531-553 | src/java/org/apache/cassandra/db/ClusteringComparator.java:588-610 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/db/ClusteringComparator.java:531` 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) src/java/org/apache/cassandra/db/partitions/UnfilteredPartitionIterators.java:200— src/java/org/apache/cassandra/db/partitions/UnfilteredPartitionIterators.java:200-222 | src/java/org/apache/cassandra/db/partitions/UnfilteredPartitionIterators.java:263-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 `src/java/org/apache/cassandra/db/partitions/UnfilteredPartitionIterators.java:200` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/java/org/apache/cassandra/db/partitions/UnfilteredPartitionIterators.java:225` calls `close` and `src/java/org/apache/cassandra/db/partitions/UnfilteredPartitionIterators.java:286` 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 (23 lines × 2) src/java/org/apache/cassandra/io/tries/IncrementalDeepTrieWriterPageAware.java:313— src/java/org/apache/cassandra/io/tries/IncrementalDeepTrieWriterPageAware.java:313-335 | src/java/org/apache/cassandra/io/tries/IncrementalTrieWriterPageAware.java:344-366 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 `src/java/org/apache/cassandra/io/tries/IncrementalDeepTrieWriterPageAware.java:313` 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–18 lines × 2) src/java/org/apache/cassandra/cql3/Duration.java:358— src/java/org/apache/cassandra/cql3/Duration.java:358-375 | src/java/org/apache/cassandra/cql3/functions/types/Duration.java:354-369 — before extracting anything, compare `src/java/org/apache/cassandra/cql3/Duration.java` and `src/java/org/apache/cassandra/cql3/functions/types/Duration.java` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 112 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 `src/java/org/apache/cassandra/cql3/Duration.java:358` 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–18 lines × 2) src/java/org/apache/cassandra/cql3/functions/types/DataTypeClassNameParser.java:269— src/java/org/apache/cassandra/cql3/functions/types/DataTypeClassNameParser.java:269-284 | src/java/org/apache/cassandra/db/marshal/TypeParser.java:271-288 — 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 `src/java/org/apache/cassandra/cql3/functions/types/DataTypeClassNameParser.java:269` 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–18 lines × 2) src/java/org/apache/cassandra/locator/ReplicaPlan.java:179— src/java/org/apache/cassandra/locator/ReplicaPlan.java:179-194 | src/java/org/apache/cassandra/locator/ReplicaPlan.java:383-400 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/locator/ReplicaPlan.java:179` 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 (11–12 lines × 2) src/java/org/apache/cassandra/cql3/selection/AbstractFunctionSelector.java:170— src/java/org/apache/cassandra/cql3/selection/AbstractFunctionSelector.java:170-181 | src/java/org/apache/cassandra/cql3/selection/MultiElementFactory.java:93-103 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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–12 lines × 2) src/java/org/apache/cassandra/db/marshal/AbstractTimeUUIDType.java:61— src/java/org/apache/cassandra/db/marshal/AbstractTimeUUIDType.java:61-71 | src/java/org/apache/cassandra/db/marshal/UUIDType.java:78-89 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11–12 lines × 2) src/java/org/apache/cassandra/transport/CQLMessageHandler.java:240— src/java/org/apache/cassandra/transport/CQLMessageHandler.java:240-251 | src/java/org/apache/cassandra/transport/PreV5Handlers.java:208-218 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 `src/java/org/apache/cassandra/transport/CQLMessageHandler.java:240` 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) src/java/org/apache/cassandra/io/AsymmetricParameterisedUnversionedSerializer.java:35— src/java/org/apache/cassandra/io/AsymmetricParameterisedUnversionedSerializer.java:35-43 | src/java/org/apache/cassandra/io/AsymmetricVersionedSerializer.java:35-43 | src/java/org/apache/cassandra/io/IVersionedAsymmetricSerializer.java:43-51 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `version` to `Version` in one and `int` 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 (9 lines × 3) src/java/org/apache/cassandra/utils/obs/BitUtil.java:89— src/java/org/apache/cassandra/utils/obs/BitUtil.java:89-99 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:102-112 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:147-155 — 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 `src/java/org/apache/cassandra/utils/obs/BitUtil.java:89` 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) src/java/org/apache/cassandra/cql3/selection/Selectable.java:877— src/java/org/apache/cassandra/cql3/selection/Selectable.java:877-885 | src/java/org/apache/cassandra/cql3/selection/Selectable.java:946-954 | src/java/org/apache/cassandra/cql3/selection/Selectable.java:1028-1036 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/java/org/apache/cassandra/cql3/selection/Selectable.java:943` calls `size`, `invalidRequest`, `asCQL3Type` and `src/java/org/apache/cassandra/cql3/selection/Selectable.java:875` 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 × 4) src/java/org/apache/cassandra/db/marshal/ListType.java:237— src/java/org/apache/cassandra/db/marshal/ListType.java:237-244 | src/java/org/apache/cassandra/db/marshal/SetType.java:228-235 | src/java/org/apache/cassandra/db/marshal/TupleType.java:491-498 | src/java/org/apache/cassandra/db/marshal/VectorType.java:315-322 — before extracting anything, compare `src/java/org/apache/cassandra/db/marshal/ListType.java` and `src/java/org/apache/cassandra/db/marshal/SetType.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/java/org/apache/cassandra/db/marshal/VectorType.java:323` calls `size`, `MarshalException`, `format` and `src/java/org/apache/cassandra/db/marshal/ListType.java:245` 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 × 4) src/java/org/apache/cassandra/tools/nodetool/Info.java:90— src/java/org/apache/cassandra/tools/nodetool/Info.java:90-97 | src/java/org/apache/cassandra/tools/nodetool/Info.java:101-108 | src/java/org/apache/cassandra/tools/nodetool/Info.java:112-119 | src/java/org/apache/cassandra/tools/nodetool/Info.java:142-149 — 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 `src/java/org/apache/cassandra/tools/nodetool/Info.java:90` 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 × 4) src/java/org/apache/cassandra/cql3/selection/ListSelector.java:116— src/java/org/apache/cassandra/cql3/selection/ListSelector.java:116-123 | src/java/org/apache/cassandra/cql3/selection/SetSelector.java:118-125 | src/java/org/apache/cassandra/cql3/selection/TupleSelector.java:117-124 | src/java/org/apache/cassandra/cql3/selection/VectorSelector.java:161-168 — before extracting anything, compare `src/java/org/apache/cassandra/cql3/selection/ListSelector.java` and `src/java/org/apache/cassandra/cql3/selection/SetSelector.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 3) src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:2356— src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:2356-2363 | src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:2653-2660 | src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:2952-2959 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:2950` calls `newInstance` and `src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:2354` 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 × 3) src/java/org/apache/cassandra/service/StorageProxy.java:3751— src/java/org/apache/cassandra/service/StorageProxy.java:3751-3758 | src/java/org/apache/cassandra/service/StorageProxy.java:3772-3779 | src/java/org/apache/cassandra/service/StorageProxy.java:3788-3795 — 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 (8 lines × 3) tools/stress/src/org/apache/cassandra/stress/settings/OptionDistribution.java:253— tools/stress/src/org/apache/cassandra/stress/settings/OptionDistribution.java:253-260 | tools/stress/src/org/apache/cassandra/stress/settings/OptionDistribution.java:279-286 | tools/stress/src/org/apache/cassandra/stress/settings/OptionDistribution.java:335-342 — 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 `tools/stress/src/org/apache/cassandra/stress/settings/OptionDistribution.java:253` 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.
Builder.complete (cognitive 20) src/java/org/apache/cassandra/index/sasi/plan/Operation.java:432— Builder.complete has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 4, ternaries 1 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Builder.complete (cognitive 20) src/java/org/apache/cassandra/io/util/FileHandle.java:477— Builder.complete has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 5 (9 pts), error handling 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.
BTree.transformAndFilterLeaf (cognitive 16) src/java/org/apache/cassandra/utils/btree/BTree.java:1203— BTree.transformAndFilterLeaf has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (BTree.transformAndFilterLeaf) 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.
BTree.transformAndFilterLeaf (cognitive 16) src/java/org/apache/cassandra/utils/btree/BTree.java:1092— BTree.transformAndFilterLeaf has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (BTree.transformAndFilterLeaf) 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.
D4 · Code Duplication· Edited copy of a member (42 corresponding lines) · ×2
Edited copy of a member (42 corresponding lines) src/java/org/apache/cassandra/cql3/Operation.java:333— src/java/org/apache/cassandra/cql3/Operation.java:333-374 | src/java/org/apache/cassandra/cql3/Operation.java:397-439 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (42 corresponding lines) src/java/org/apache/cassandra/db/filter/DataLimits.java:1430— src/java/org/apache/cassandra/db/filter/DataLimits.java:1430-1471 | src/java/org/apache/cassandra/db/filter/DataLimits.java:1527-1571 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (39 corresponding lines) · ×2
Edited copy of a member (39 corresponding lines) src/java/org/apache/cassandra/cql3/ResultSet.java:398— src/java/org/apache/cassandra/cql3/ResultSet.java:398-440 | src/java/org/apache/cassandra/cql3/ResultSet.java:608-646 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (39 corresponding lines) src/java/org/apache/cassandra/index/accord/RouteJournalIndex.java:461— src/java/org/apache/cassandra/index/accord/RouteJournalIndex.java:461-499 | src/java/org/apache/cassandra/index/accord/RouteJournalIndex.java:504-544 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (40 corresponding lines) · ×2
Edited copy of a member (40 corresponding lines) src/java/org/apache/cassandra/db/guardrails/ValueGenerator.java:130— src/java/org/apache/cassandra/db/guardrails/ValueGenerator.java:130-170 | src/java/org/apache/cassandra/db/guardrails/ValueValidator.java:115-154 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (40 corresponding lines) src/java/org/apache/cassandra/cql3/CQL3Type.java:391— src/java/org/apache/cassandra/cql3/CQL3Type.java:391-431 | src/java/org/apache/cassandra/cql3/CQL3Type.java:479-518 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (34 corresponding lines) · ×2
Edited copy of a member (34 corresponding lines) src/java/org/apache/cassandra/service/accord/serializers/IVersionedWithKeysSerializer.java:87— src/java/org/apache/cassandra/service/accord/serializers/IVersionedWithKeysSerializer.java:87-138 | src/java/org/apache/cassandra/service/accord/serializers/IVersionedWithKeysSerializer.java:141-174 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (34 corresponding lines) src/java/org/apache/cassandra/utils/vint/VIntCoding.java:476— src/java/org/apache/cassandra/utils/vint/VIntCoding.java:476-509 | src/java/org/apache/cassandra/utils/vint/VIntCoding.java:531-564 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 22+ corresponding lines) · ×2
Edited copies of one member (3 members, 22+ corresponding lines) src/java/org/apache/cassandra/db/virtual/ClientsTable.java:57— src/java/org/apache/cassandra/db/virtual/ClientsTable.java:57-79 | src/java/org/apache/cassandra/db/virtual/ClusterMetadataDirectoryTable.java:68-89 | src/java/org/apache/cassandra/db/virtual/LocalTable.java:72-100 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 22+ corresponding lines) src/java/org/apache/cassandra/io/IVersionedSerializer.java:28— src/java/org/apache/cassandra/io/IVersionedSerializer.java:28-49 | src/java/org/apache/cassandra/service/accord/serializers/IVersionedSerializer.java:31-52 | src/java/org/apache/cassandra/service/accord/serializers/IVersionedSerializer.java:55-76 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 24+ corresponding lines) · ×2
Edited copies of one member (3 members, 24+ corresponding lines) src/java/org/apache/cassandra/locator/EndpointsForRange.java:91— src/java/org/apache/cassandra/locator/EndpointsForRange.java:91-114 | src/java/org/apache/cassandra/locator/EndpointsForToken.java:87-110 | src/java/org/apache/cassandra/locator/RangesAtEndpoint.java:203-226 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 24+ corresponding lines) src/java/org/apache/cassandra/service/paxos/PaxosPrepareRefresh.java:121— src/java/org/apache/cassandra/service/paxos/PaxosPrepareRefresh.java:121-144 | src/java/org/apache/cassandra/service/paxos/PaxosRequestCallback.java:57-81 | src/java/org/apache/cassandra/service/paxos/PaxosRequestCallback.java:84-108 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 17+ corresponding lines) · ×2
Edited copies of one member (3 members, 17+ corresponding lines) src/java/org/apache/cassandra/schema/Tables.java:283— src/java/org/apache/cassandra/schema/Tables.java:283-299 | src/java/org/apache/cassandra/schema/Types.java:509-525 | src/java/org/apache/cassandra/schema/Views.java:253-269 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 17+ corresponding lines) src/java/org/apache/cassandra/db/ClusteringComparator.java:320— src/java/org/apache/cassandra/db/ClusteringComparator.java:320-336 | src/java/org/apache/cassandra/db/marshal/TupleType.java:551-568 | src/java/org/apache/cassandra/db/marshal/TupleType.java:572-589 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 19+ corresponding lines) · ×2
Edited copies of one member (3 members, 19+ corresponding lines) src/java/org/apache/cassandra/index/internal/composites/CollectionKeyIndexBase.java:72— src/java/org/apache/cassandra/index/internal/composites/CollectionKeyIndexBase.java:72-92 | src/java/org/apache/cassandra/index/internal/composites/CollectionValueIndex.java:84-102 | src/java/org/apache/cassandra/index/internal/composites/RegularColumnIndex.java:86-106 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 19+ corresponding lines) src/java/org/apache/cassandra/service/reads/DataResolver.java:374— src/java/org/apache/cassandra/service/reads/DataResolver.java:374-392 | src/java/org/apache/cassandra/service/reads/DataResolver.java:395-413 | src/java/org/apache/cassandra/service/reads/DataResolver.java:416-440 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 6+ corresponding lines) · ×2
Edited copies of one member (4 members, 6+ corresponding lines) src/java/org/apache/cassandra/db/marshal/VectorType.java:66— src/java/org/apache/cassandra/db/marshal/VectorType.java:66-71 | src/java/org/apache/cassandra/index/Index.java:778-783 | src/java/org/apache/cassandra/index/accord/Key.java:38-43 | src/java/org/apache/cassandra/tcm/sequences/LockedRanges.java:378-383 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 6+ corresponding lines) src/java/org/apache/cassandra/cql3/statements/schema/CommentOnUserTypeFieldStatement.java:125— src/java/org/apache/cassandra/cql3/statements/schema/CommentOnUserTypeFieldStatement.java:125-131 | src/java/org/apache/cassandra/cql3/statements/schema/CommentOnUserTypeStatement.java:119-124 | src/java/org/apache/cassandra/cql3/statements/schema/SecurityLabelOnUserTypeFieldStatement.java:155-162 | src/java/org/apache/cassandra/cql3/statements/schema/SecurityLabelOnUserTypeStatement.java:147-153 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Duplicated block (25 lines × 2) src/java/org/apache/cassandra/db/SystemKeyspace.java:1544— src/java/org/apache/cassandra/db/SystemKeyspace.java:1544-1568 | src/java/org/apache/cassandra/db/SystemKeyspace.java:1577-1601 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/db/SystemKeyspace.java:1544` 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 lines × 2) src/java/org/apache/cassandra/service/accord/serializers/CommandSerializers.java:562— src/java/org/apache/cassandra/service/accord/serializers/CommandSerializers.java:562-586 | src/java/org/apache/cassandra/service/accord/serializers/CommandSerializers.java:887-911 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 2) src/java/org/apache/cassandra/cql3/functions/UDAggregate.java:314— src/java/org/apache/cassandra/cql3/functions/UDAggregate.java:314-334 | src/java/org/apache/cassandra/cql3/functions/UDFunction.java:673-693 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (21 lines × 2) src/java/org/apache/cassandra/tcm/sequences/BootstrapAndJoin.java:330— src/java/org/apache/cassandra/tcm/sequences/BootstrapAndJoin.java:330-350 | src/java/org/apache/cassandra/tcm/sequences/Move.java:433-453 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 lines × 4) src/java/org/apache/cassandra/cql3/functions/types/DataTypeClassNameParser.java:269— src/java/org/apache/cassandra/cql3/functions/types/DataTypeClassNameParser.java:269-281 | src/java/org/apache/cassandra/db/marshal/TypeParser.java:271-285 | src/java/org/apache/cassandra/db/marshal/TypeParser.java:305-320 | src/java/org/apache/cassandra/db/marshal/TypeParser.java:353-367 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/cql3/functions/types/DataTypeClassNameParser.java:269` 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 × 4) src/java/org/apache/cassandra/tcm/sequences/BootstrapAndJoin.java:483— src/java/org/apache/cassandra/tcm/sequences/BootstrapAndJoin.java:483-495 | src/java/org/apache/cassandra/tcm/sequences/BootstrapAndReplace.java:390-402 | src/java/org/apache/cassandra/tcm/sequences/Move.java:588-600 | src/java/org/apache/cassandra/tcm/sequences/UnbootstrapAndLeave.java:300-312 — before extracting anything, compare `src/java/org/apache/cassandra/tcm/sequences/BootstrapAndJoin.java` and `src/java/org/apache/cassandra/tcm/sequences/BootstrapAndReplace.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9–13 lines × 2) src/java/org/apache/cassandra/cql3/statements/schema/CreateAggregateStatement.java:119— src/java/org/apache/cassandra/cql3/statements/schema/CreateAggregateStatement.java:119-131 | src/java/org/apache/cassandra/cql3/statements/schema/CreateFunctionStatement.java:116-124 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9–13 lines × 2) src/java/org/apache/cassandra/utils/btree/BTree.java:3705— src/java/org/apache/cassandra/utils/btree/BTree.java:3705-3717 | src/java/org/apache/cassandra/utils/btree/BTree.java:3915-3923 — both copies are in the same file, so extract the block into 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 × 8) src/java/org/apache/cassandra/tools/AuditLogViewer.java:192— src/java/org/apache/cassandra/tools/AuditLogViewer.java:192-202 | src/java/org/apache/cassandra/tools/SSTableExpiredBlockers.java:83-93 | src/java/org/apache/cassandra/tools/StandaloneSSTableUtil.java:176-186 | src/java/org/apache/cassandra/tools/StandaloneScrubber.java:264-274 | src/java/org/apache/cassandra/tools/StandaloneSplitter.java:203-213 | src/java/org/apache/cassandra/tools/StandaloneUpgrader.java:166-176 | src/java/org/apache/cassandra/tools/StandaloneVerifier.java:198-208 | tools/sstableloader/src/org/apache/cassandra/tools/LoaderOptions.java:424-434 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 8 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 8 times. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/tools/AuditLogViewer.java:192` 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 × 8) src/java/org/apache/cassandra/db/marshal/AbstractTimeUUIDType.java:169— src/java/org/apache/cassandra/db/marshal/AbstractTimeUUIDType.java:169-179 | src/java/org/apache/cassandra/db/marshal/AsciiType.java:74-84 | src/java/org/apache/cassandra/db/marshal/DurationType.java:65-75 | src/java/org/apache/cassandra/db/marshal/LexicalUUIDType.java:127-137 | src/java/org/apache/cassandra/db/marshal/SimpleDateType.java:84-95 | src/java/org/apache/cassandra/db/marshal/TimeType.java:77-87 | src/java/org/apache/cassandra/db/marshal/UTF8Type.java:52-62 | src/java/org/apache/cassandra/db/marshal/UUIDType.java:238-248 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 8 call sites, so a change lands once.
Duplicated block (11 lines × 3) src/java/org/apache/cassandra/schema/DistributedMetadataLogKeyspace.java:197— src/java/org/apache/cassandra/schema/DistributedMetadataLogKeyspace.java:197-207 | src/java/org/apache/cassandra/schema/DistributedMetadataLogKeyspace.java:218-228 | src/java/org/apache/cassandra/tcm/log/SystemKeyspaceStorage.java:161-171 — 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 `src/java/org/apache/cassandra/schema/DistributedMetadataLogKeyspace.java:197` 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 × 3) src/java/org/apache/cassandra/tools/StandaloneSSTableUtil.java:191— src/java/org/apache/cassandra/tools/StandaloneSSTableUtil.java:191-201 | src/java/org/apache/cassandra/tools/StandaloneScrubber.java:279-289 | src/java/org/apache/cassandra/tools/StandaloneVerifier.java:213-223 — before extracting anything, compare `src/java/org/apache/cassandra/tools/StandaloneSSTableUtil.java` and `src/java/org/apache/cassandra/tools/StandaloneScrubber.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 69 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `src/java/org/apache/cassandra/tools/StandaloneSSTableUtil.java:191` 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, `src/java/org/apache/cassandra/tools/StandaloneSSTableUtil.java:202` calls `fromOption`, `getOptionValue` and `src/java/org/apache/cassandra/tools/StandaloneVerifier.java:224` 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 (10–11 lines × 2) src/java/org/apache/cassandra/db/rows/Cell.java:307— src/java/org/apache/cassandra/db/rows/Cell.java:307-316 | src/java/org/apache/cassandra/db/rows/Cell.java:319-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 `src/java/org/apache/cassandra/db/rows/Cell.java:319` 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–11 lines × 2) src/java/org/apache/cassandra/dht/Range.java:609— src/java/org/apache/cassandra/dht/Range.java:609-619 | src/java/org/apache/cassandra/dht/Range.java:682-691 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7–9 lines × 2) src/java/org/apache/cassandra/db/marshal/CollectionType.java:402— src/java/org/apache/cassandra/db/marshal/CollectionType.java:402-408 | src/java/org/apache/cassandra/db/marshal/MapType.java:363-371 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/db/marshal/CollectionType.java:402` 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–9 lines × 2) src/java/org/apache/cassandra/index/sai/disk/v1/SSTableIndexWriter.java:156— src/java/org/apache/cassandra/index/sai/disk/v1/SSTableIndexWriter.java:156-162 | src/java/org/apache/cassandra/index/sai/disk/v1/SSTableIndexWriter.java:190-198 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6–7 lines × 2) src/java/org/apache/cassandra/cql3/functions/types/ParseUtils.java:413— src/java/org/apache/cassandra/cql3/functions/types/ParseUtils.java:413-418 | src/java/org/apache/cassandra/serializers/TimeSerializer.java:165-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 `src/java/org/apache/cassandra/cql3/functions/types/ParseUtils.java:413` 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–7 lines × 2) src/java/org/apache/cassandra/schema/DistributedSchema.java:222— src/java/org/apache/cassandra/schema/DistributedSchema.java:222-228 | src/java/org/apache/cassandra/schema/DistributedSchema.java:291-296 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/schema/DistributedSchema.java:222` 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 × 4) src/java/org/apache/cassandra/cql3/CQL3Type.java:289— src/java/org/apache/cassandra/cql3/CQL3Type.java:289-294 | src/java/org/apache/cassandra/cql3/CQL3Type.java:306-311 | src/java/org/apache/cassandra/db/marshal/CollectionType.java:404-409 | src/java/org/apache/cassandra/db/marshal/MapType.java:365-372 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/cql3/CQL3Type.java:289` 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 × 4) src/java/org/apache/cassandra/utils/CollectionSerializers.java:478— src/java/org/apache/cassandra/utils/CollectionSerializers.java:478-483 | src/java/org/apache/cassandra/utils/CollectionSerializers.java:487-492 | src/java/org/apache/cassandra/utils/CollectionSerializers.java:496-501 | src/java/org/apache/cassandra/utils/CollectionSerializers.java:505-510 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `valueSerializer` to `IVersionedSerializer<V>` in one and `IPartitionerDependentSerializer<V>` 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.
X13 · Undrained process stream· Redirected process stream is never drained (deadlock) · ×2
Redirected process stream is never drained (deadlock) src/java/org/apache/cassandra/utils/FBUtilities.java:1253— The JDK pipes both `stdout` and `stderr` of this child — no `redirectErrorStream`, `redirectError`, `redirectOutput` or `inheritIO` is set — and `process.waitFor()` is written before stdout and stderr is read, so nothing drains it while the parent waits. The JDK's own `Process` documentation warns that failing to read a child's output promptly "may cause the process to block, or even deadlock": once the child writes more than the pipe holds (measured on OpenJDK 25 / Linux: 60,000 bytes finishes, 70,000 hangs forever), it blocks on the write, never exits, and the wait never returns. Nothing fails loudly. Read every piped stream before (or while) waiting — a thread or `CompletableFuture` per stream — merge them with `redirectErrorStream(true)` and read the one stream before `waitFor`, or discard what you do not want with `redirectOutput`/`redirectError(ProcessBuilder.Redirect.DISCARD)` (or a file).
Redirected process stream is never drained (deadlock) src/java/org/apache/cassandra/io/util/PathUtils.java:368— The JDK pipes both `stdout` and `stderr` of this child — no `redirectErrorStream`, `redirectError`, `redirectOutput` or `inheritIO` is set — and `p.waitFor()` is written before stdout and stderr is read, so nothing drains it while the parent waits. The JDK's own `Process` documentation warns that failing to read a child's output promptly "may cause the process to block, or even deadlock": once the child writes more than the pipe holds (measured on OpenJDK 25 / Linux: 60,000 bytes finishes, 70,000 hangs forever), it blocks on the write, never exits, and the wait never returns. Nothing fails loudly. Read every piped stream before (or while) waiting — a thread or `CompletableFuture` per stream — merge them with `redirectErrorStream(true)` and read the one stream before `waitFor`, or discard what you do not want with `redirectOutput`/`redirectError(ProcessBuilder.Redirect.DISCARD)` (or a file).
DatabaseDescriptor.applySimpleConfig (cyclomatic 157) src/java/org/apache/cassandra/config/DatabaseDescriptor.java:617— DatabaseDescriptor.applySimpleConfig has cyclomatic complexity 157 (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.
StatsTableComparator.compare (cyclomatic 94) src/java/org/apache/cassandra/tools/nodetool/stats/StatsTableComparator.java:123— StatsTableComparator.compare has cyclomatic complexity 94 (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.
NodeProbe.getColumnFamilyMetric (cyclomatic 52) src/java/org/apache/cassandra/tools/NodeProbe.java:2124— NodeProbe.getColumnFamilyMetric has cyclomatic complexity 52 (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.
Task.<init> (cyclomatic 47) src/java/org/apache/cassandra/service/accord/execution/Task.java:313— Task.<init> has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
StatementRestrictions.<init> (cyclomatic 45) src/java/org/apache/cassandra/cql3/restrictions/StatementRestrictions.java:190— StatementRestrictions.<init> 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.
RepairMessageVerbHandler.doVerb (cyclomatic 44) src/java/org/apache/cassandra/repair/RepairMessageVerbHandler.java:97— RepairMessageVerbHandler.doVerb has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TableStatsHolder.initializeKeyspaces (cyclomatic 43) src/java/org/apache/cassandra/tools/nodetool/stats/TableStatsHolder.java:212— TableStatsHolder.initializeKeyspaces 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.
CodecRegistry.maybeCreateCodec (cyclomatic 42) src/java/org/apache/cassandra/cql3/functions/types/CodecRegistry.java:822— CodecRegistry.maybeCreateCodec has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Literal.testAssignment (cyclomatic 40) src/java/org/apache/cassandra/cql3/terms/Constants.java:325— Literal.testAssignment has cyclomatic complexity 40 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
PaxosPrepare.permitted (cyclomatic 38) src/java/org/apache/cassandra/service/paxos/PaxosPrepare.java:560— PaxosPrepare.permitted 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.
CreateViewStatement.apply (cyclomatic 35) src/java/org/apache/cassandra/cql3/statements/schema/CreateViewStatement.java:140— CreateViewStatement.apply has cyclomatic complexity 35 (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.
AutoRepairUtils.myTurnToRunRepair (cyclomatic 35) src/java/org/apache/cassandra/repair/autorepair/AutoRepairUtils.java:955— AutoRepairUtils.myTurnToRunRepair 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.
CassandraPasswordConfiguration.validateParameters (cyclomatic 33) src/java/org/apache/cassandra/db/guardrails/CassandraPasswordConfiguration.java:163— CassandraPasswordConfiguration.validateParameters has cyclomatic complexity 33 (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.
ParseUtils.skipCQLValue (cyclomatic 32) src/java/org/apache/cassandra/cql3/functions/types/ParseUtils.java:76— ParseUtils.skipCQLValue 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.
StoreParticipantsSerializer.serialize (cyclomatic 32) src/java/org/apache/cassandra/service/accord/serializers/CommandSerializers.java:337— StoreParticipantsSerializer.serialize 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.
Gossiper.mergeNodeToGossip (cyclomatic 31) src/java/org/apache/cassandra/gms/Gossiper.java:2289— Gossiper.mergeNodeToGossip 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.
BigTableScrubber.scrubInternal (cyclomatic 31) src/java/org/apache/cassandra/io/sstable/format/big/BigTableScrubber.java:86— BigTableScrubber.scrubInternal 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.
SetAutoRepairConfig.execute (cyclomatic 31) src/java/org/apache/cassandra/tools/nodetool/SetAutoRepairConfig.java:72— SetAutoRepairConfig.execute has cyclomatic complexity 31 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
IntervalIndexAdapter.override (cyclomatic 31) src/java/org/apache/cassandra/utils/btree/IntervalBTree.java:243— IntervalIndexAdapter.override 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.
cqlshmain.main (cyclomatic 31) pylib/cqlshlib/cqlshmain.py:2202— cqlshmain.main 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.
SSTableImporter.importNewSSTables (cyclomatic 30) src/java/org/apache/cassandra/db/SSTableImporter.java:78— SSTableImporter.importNewSSTables 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.
BtiTableScrubber.scrubInternal (cyclomatic 30) src/java/org/apache/cassandra/io/sstable/format/bti/BtiTableScrubber.java:96— BtiTableScrubber.scrubInternal 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.
BatchStatement.validate (cyclomatic 29) src/java/org/apache/cassandra/cql3/statements/BatchStatement.java:253— BatchStatement.validate 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.
Controller.validateOptions (cyclomatic 29) src/java/org/apache/cassandra/db/compaction/unified/Controller.java:512— Controller.validateOptions 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.
RemoteToLocalVirtualTable.rebind (cyclomatic 29) src/java/org/apache/cassandra/db/virtual/RemoteToLocalVirtualTable.java:379— RemoteToLocalVirtualTable.rebind has cyclomatic complexity 29 (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.
CodecRegistry.maybeCreateCodec (cyclomatic 28) src/java/org/apache/cassandra/cql3/functions/types/CodecRegistry.java:747— CodecRegistry.maybeCreateCodec has cyclomatic complexity 28 (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.
JavaBasedUDFunction.<init> (cyclomatic 28) src/java/org/apache/cassandra/cql3/functions/JavaBasedUDFunction.java:211— JavaBasedUDFunction.<init> 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.
CreateIndexStatement.validateIndexTarget (cyclomatic 28) src/java/org/apache/cassandra/cql3/statements/schema/CreateIndexStatement.java:250— CreateIndexStatement.validateIndexTarget 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.
AccordCacheEntryQueue.validate (cyclomatic 28) src/java/org/apache/cassandra/service/accord/execution/AccordCacheEntryQueue.java:447— AccordCacheEntryQueue.validate has cyclomatic complexity 28 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
SafeTask.preSetup (cyclomatic 28) src/java/org/apache/cassandra/service/accord/execution/SafeTask.java:580— SafeTask.preSetup 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.
ConsensusRequestRouter.splitReadIntoAccordAndNormal (cyclomatic 28) src/java/org/apache/cassandra/service/consensus/migration/ConsensusRequestRouter.java:718— ConsensusRequestRouter.splitReadIntoAccordAndNormal 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.
Keyspace.applyInternal (cyclomatic 28) src/java/org/apache/cassandra/db/Keyspace.java:459— Keyspace.applyInternal 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.
StorageAttachedIndex.validateOptions (cyclomatic 28) src/java/org/apache/cassandra/index/sai/StorageAttachedIndex.java:243— StorageAttachedIndex.validateOptions 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.
1.decode (cyclomatic 28) src/java/org/apache/cassandra/transport/messages/ErrorMessage.java:79— 1.decode has cyclomatic complexity 28 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This shape REPEATS in the file: one other method here (3504.decode) 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.
BTree.updateLeaves (cyclomatic 28) src/java/org/apache/cassandra/utils/btree/BTree.java:429— BTree.updateLeaves 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.
LongTimSort.mergeHi (cyclomatic 28) src/java/org/apache/cassandra/utils/LongTimSort.java:711— LongTimSort.mergeHi 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. This shape REPEATS in the file: one other method here (LongTimSort.mergeLo) 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.
LongTimSort.mergeLo (cyclomatic 28) src/java/org/apache/cassandra/utils/LongTimSort.java:603— LongTimSort.mergeLo 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. This shape REPEATS in the file: one other method here (LongTimSort.mergeHi) 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.
3504.decode (cyclomatic 28) src/java/org/apache/cassandra/transport/messages/ErrorMessage.java:79— 3504.decode has cyclomatic complexity 28 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This shape REPEATS in the file: one other method here (1.decode) 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.
CreateTableStatement.builder (cyclomatic 27) src/java/org/apache/cassandra/cql3/statements/schema/CreateTableStatement.java:265— CreateTableStatement.builder has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CounterContext.compare (cyclomatic 27) src/java/org/apache/cassandra/db/context/CounterContext.java:456— CounterContext.compare 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.
NormalizedRanges.subtract (cyclomatic 27) src/java/org/apache/cassandra/dht/NormalizedRanges.java:137— NormalizedRanges.subtract 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.
Range.intersectionAndRemainder (cyclomatic 27) src/java/org/apache/cassandra/dht/Range.java:818— Range.intersectionAndRemainder has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
BigTableReader.getRowIndexEntry (cyclomatic 27) src/java/org/apache/cassandra/io/sstable/format/big/BigTableReader.java:251— BigTableReader.getRowIndexEntry 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.
CreateAggregateStatement.apply (cyclomatic 26) src/java/org/apache/cassandra/cql3/statements/schema/CreateAggregateStatement.java:103— CreateAggregateStatement.apply 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.
CounterContext.diff (cyclomatic 26) src/java/org/apache/cassandra/db/context/CounterContext.java:199— CounterContext.diff 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.
CounterContext.merge (cyclomatic 26) src/java/org/apache/cassandra/db/context/CounterContext.java:298— CounterContext.merge 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.
Builder.build (cyclomatic 26) src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java:693— Builder.build 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.
UTF8Validator.validateSlowPath (cyclomatic 26) src/java/org/apache/cassandra/serializers/UTF8Serializer.java:107— UTF8Validator.validateSlowPath 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.
matrix.main (cyclomatic 26) formalise/accord/execution/tla/matrix.py:475— matrix.main has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
notify.main (cyclomatic 26) formalise/accord/execution/tla/notify.py:358— notify.main has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SafeTask.onFailingKeyExclusive (cyclomatic 25) src/java/org/apache/cassandra/service/accord/execution/SafeTask.java:1844— SafeTask.onFailingKeyExclusive 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.
Paxos.begin (cyclomatic 25) src/java/org/apache/cassandra/service/paxos/Paxos.java:1039— Paxos.begin 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.
ReadCallback.awaitResults (cyclomatic 25) src/java/org/apache/cassandra/service/reads/ReadCallback.java:140— ReadCallback.awaitResults 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.
Builder.maybeCreateOrEnrichManifest (cyclomatic 25) src/java/org/apache/cassandra/service/snapshot/TableSnapshot.java:535— Builder.maybeCreateOrEnrichManifest 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.
StorageService.drain (cyclomatic 25) src/java/org/apache/cassandra/service/StorageService.java:3883— StorageService.drain 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.
ClientDriverVersionGuardrail.guard (cyclomatic 25) src/java/org/apache/cassandra/db/guardrails/ClientDriverVersionGuardrail.java:60— ClientDriverVersionGuardrail.guard 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.
SinglePartitionReadCommand.queryMemtableAndDiskInternal (cyclomatic 25) src/java/org/apache/cassandra/db/SinglePartitionReadCommand.java:751— SinglePartitionReadCommand.queryMemtableAndDiskInternal 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.
BigSSTableReaderLoadingBuilder.openComponents (cyclomatic 25) src/java/org/apache/cassandra/io/sstable/format/big/BigSSTableReaderLoadingBuilder.java:72— BigSSTableReaderLoadingBuilder.openComponents 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.
cqlshmain.read_options (cyclomatic 25) pylib/cqlshlib/cqlshmain.py:2021— cqlshmain.read_options 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.
run_ci.jenkins_service_url (cyclomatic 25) .build/run-ci.d/run_ci.py:727— run_ci.jenkins_service_url 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.
AddColumns.addColumn (cyclomatic 24) src/java/org/apache/cassandra/cql3/statements/schema/AlterTableStatement.java:341— AddColumns.addColumn 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.
TableAttributes.build (cyclomatic 24) src/java/org/apache/cassandra/cql3/statements/schema/TableAttributes.java:126— TableAttributes.build has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
StoreParticipantsSerializer.serializedSize (cyclomatic 24) src/java/org/apache/cassandra/service/accord/serializers/CommandSerializers.java:440— StoreParticipantsSerializer.serializedSize 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.
StorageProxy.mutateAtomically (cyclomatic 24) src/java/org/apache/cassandra/service/StorageProxy.java:1436— StorageProxy.mutateAtomically 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.
ArrayBackedSlices.toCQLString (cyclomatic 24) src/java/org/apache/cassandra/db/Slices.java:553— ArrayBackedSlices.toCQLString 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.
ByteBufferUtil.objectToBytes (cyclomatic 24) src/java/org/apache/cassandra/utils/ByteBufferUtil.java:582— ByteBufferUtil.objectToBytes has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
run_ci.main (cyclomatic 24) .build/run-ci.d/run_ci.py:1606— run_ci.main has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CreateIndexStatement.apply (cyclomatic 23) src/java/org/apache/cassandra/cql3/statements/schema/CreateIndexStatement.java:145— CreateIndexStatement.apply has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SelectStatement.asCQL (cyclomatic 23) src/java/org/apache/cassandra/cql3/statements/SelectStatement.java:2044— SelectStatement.asCQL 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.
AccordService.catchup (cyclomatic 23) src/java/org/apache/cassandra/service/accord/AccordService.java:795— AccordService.catchup 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.
AccordService.localStartup (cyclomatic 23) src/java/org/apache/cassandra/service/accord/AccordService.java:570— AccordService.localStartup 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.
RowIteratorMergeListener.onMergedRangeTombstoneMarkers (cyclomatic 23) src/java/org/apache/cassandra/service/reads/repair/RowIteratorMergeListener.java:236— RowIteratorMergeListener.onMergedRangeTombstoneMarkers 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.
SEPWorker.run (cyclomatic 23) src/java/org/apache/cassandra/concurrent/SEPWorker.java:128— SEPWorker.run 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.
SinglePartitionReadCommand.reduceFilter (cyclomatic 23) src/java/org/apache/cassandra/db/SinglePartitionReadCommand.java:1158— SinglePartitionReadCommand.reduceFilter 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.
SortedTableVerifier.verifySSTable (cyclomatic 23) src/java/org/apache/cassandra/io/sstable/format/SortedTableVerifier.java:271— SortedTableVerifier.verifySSTable 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.
StatsMetadataSerializer.deserialize (cyclomatic 23) src/java/org/apache/cassandra/io/sstable/metadata/StatsMetadata.java:523— StatsMetadataSerializer.deserialize 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.
RepairOption.parse (cyclomatic 23) src/java/org/apache/cassandra/repair/messages/RepairOption.java:193— RepairOption.parse 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.
ProgressBarrier.await (cyclomatic 23) src/java/org/apache/cassandra/tcm/sequences/ProgressBarrier.java:157— ProgressBarrier.await 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.
StandaloneSplitter.main (cyclomatic 23) src/java/org/apache/cassandra/tools/StandaloneSplitter.java:65— StandaloneSplitter.main 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.
Shell.perform_simple_statement (cyclomatic 23) pylib/cqlshlib/cqlshmain.py:905— Shell.perform_simple_statement 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.
ParsingRuleSet.read_rule_tokens_until (cyclomatic 23) REDACTED:415— ParsingRuleSet.read_rule_tokens_until 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.
run_ci.parse_arguments (cyclomatic 23) .build/run-ci.d/run_ci.py:334— run_ci.parse_arguments has cyclomatic complexity 23 (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.
SimpleRestriction.addToRowFilter (cyclomatic 22) src/java/org/apache/cassandra/cql3/restrictions/SimpleRestriction.java:374— SimpleRestriction.addToRowFilter 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.
AccordExecutorSignalLoop.fetchWorkExclusive (cyclomatic 22) src/java/org/apache/cassandra/service/accord/execution/AccordExecutorSignalLoop.java:176— AccordExecutorSignalLoop.fetchWorkExclusive 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.
ReadDataSerializer.serialize (cyclomatic 22) src/java/org/apache/cassandra/service/accord/serializers/ReadDataSerializer.java:80— ReadDataSerializer.serialize 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. This shape REPEATS in the file: one other method here (ReadDataSerializer.serializedSize) 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.
ReadDataSerializer.serializedSize (cyclomatic 22) src/java/org/apache/cassandra/service/accord/serializers/ReadDataSerializer.java:237— ReadDataSerializer.serializedSize 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. This shape REPEATS in the file: one other method here (ReadDataSerializer.serialize) 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.
Rebuild.rebuild (cyclomatic 22) src/java/org/apache/cassandra/service/Rebuild.java:75— Rebuild.rebuild 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.
RetryStrategy.parse (cyclomatic 22) src/java/org/apache/cassandra/service/RetryStrategy.java:264— RetryStrategy.parse 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.
CompactionTask.runMayThrow (cyclomatic 22) src/java/org/apache/cassandra/db/compaction/CompactionTask.java:181— CompactionTask.runMayThrow 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.
IndexTermType.calculateCapabilities (cyclomatic 22) src/java/org/apache/cassandra/index/sai/utils/IndexTermType.java:749— IndexTermType.calculateCapabilities 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.
Expression.isSatisfiedBy (cyclomatic 22) src/java/org/apache/cassandra/index/sasi/plan/Expression.java:207— Expression.isSatisfiedBy 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.
StatsMetadataSerializer.serialize (cyclomatic 22) src/java/org/apache/cassandra/io/sstable/metadata/StatsMetadata.java:400— StatsMetadataSerializer.serialize 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.
EventLoopDelivery.doRun (cyclomatic 22) src/java/org/apache/cassandra/net/OutboundConnection.java:774— EventLoopDelivery.doRun 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.
Move.executeNext (cyclomatic 22) src/java/org/apache/cassandra/tcm/sequences/Move.java:261— Move.executeNext 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.
DumpJournal.processKey (cyclomatic 22) src/java/org/apache/cassandra/tools/StandaloneJournalUtil.java:281— DumpJournal.processKey has cyclomatic complexity 22 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
JVMStabilityInspector.inspectThrowable (cyclomatic 22) src/java/org/apache/cassandra/utils/JVMStabilityInspector.java:109— JVMStabilityInspector.inspectThrowable 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.
AccordResult.tryFailure (cyclomatic 21) src/java/org/apache/cassandra/service/accord/AccordResult.java:126— AccordResult.tryFailure 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.
GCInspector.handleNotification (cyclomatic 21) src/java/org/apache/cassandra/service/GCInspector.java:269— GCInspector.handleNotification 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.
LeveledManifest.getCandidatesFor (cyclomatic 21) src/java/org/apache/cassandra/db/compaction/LeveledManifest.java:497— LeveledManifest.getCandidatesFor 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.
Rows.removeShadowedCells (cyclomatic 21) src/java/org/apache/cassandra/db/rows/Rows.java:273— Rows.removeShadowedCells 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.
SimplePartition.row (cyclomatic 21) src/java/org/apache/cassandra/db/virtual/AbstractLazyVirtualTable.java:405— SimplePartition.row 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.
Expression.add (cyclomatic 21) src/java/org/apache/cassandra/index/sai/plan/Expression.java:177— Expression.add 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.
IndexSummaryRedistribution.adjustSamplingLevels (cyclomatic 21) src/java/org/apache/cassandra/io/sstable/indexsummary/IndexSummaryRedistribution.java:162— IndexSummaryRedistribution.adjustSamplingLevels 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.
Builder.build (cyclomatic 21) src/java/org/apache/cassandra/schema/TableMetadata.java:1016— Builder.build 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.
AbstractLocalProcessor.commit (cyclomatic 21) src/java/org/apache/cassandra/tcm/AbstractLocalProcessor.java:61— AbstractLocalProcessor.commit 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.
ClearSnapshot.execute (cyclomatic 21) src/java/org/apache/cassandra/tools/nodetool/ClearSnapshot.java:61— ClearSnapshot.execute 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.
Status.execute (cyclomatic 21) src/java/org/apache/cassandra/tools/nodetool/Status.java:84— Status.execute has cyclomatic complexity 21 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
TableHistograms.execute (cyclomatic 21) src/java/org/apache/cassandra/tools/nodetool/TableHistograms.java:58— TableHistograms.execute 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.
Diff.diff (cyclomatic 21) src/java/org/apache/cassandra/tools/JMXTool.java:239— Diff.diff 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.
Client.parseLine (cyclomatic 21) src/java/org/apache/cassandra/transport/Client.java:112— Client.parseLine 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.
AbstractSeekingTransformer.apply (cyclomatic 21) src/java/org/apache/cassandra/utils/btree/BTree.java:3936— AbstractSeekingTransformer.apply 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.
ExportTask.get_ranges (cyclomatic 21) pylib/cqlshlib/copyutil.py:677— ExportTask.get_ranges 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.
CopyTableStatement.apply (cyclomatic 20) src/java/org/apache/cassandra/cql3/statements/schema/CopyTableStatement.java:122— CopyTableStatement.apply 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.
StoreParticipantsSerializer.deserialize (cyclomatic 20) src/java/org/apache/cassandra/service/accord/serializers/CommandSerializers.java:412— StoreParticipantsSerializer.deserialize 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.
PaxosPrepare.checkForLinearizabilityViolation (cyclomatic 20) src/java/org/apache/cassandra/service/paxos/PaxosPrepare.java:745— PaxosPrepare.checkForLinearizabilityViolation 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.
StorageService.initServer (cyclomatic 20) src/java/org/apache/cassandra/service/StorageService.java:731— StorageService.initServer 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.
1.getReduced (cyclomatic 20) src/java/org/apache/cassandra/db/rows/Rows.java:167— 1.getReduced 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 shape REPEATS in the file: one other method here (6454.getReduced) 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.
CommandStoreOpsTable.applyRowUpdate (cyclomatic 20) src/java/org/apache/cassandra/db/virtual/AccordDebugKeyspace.java:2027— CommandStoreOpsTable.applyRowUpdate 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.
OnDiskIndex.searchRange (cyclomatic 20) src/java/org/apache/cassandra/index/sasi/disk/OnDiskIndex.java:303— OnDiskIndex.searchRange 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.
LocalLog.processPendingInternal (cyclomatic 20) src/java/org/apache/cassandra/tcm/log/LocalLog.java:508— LocalLog.processPendingInternal 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.
AlterSchema.execute (cyclomatic 20) src/java/org/apache/cassandra/tcm/transformations/AlterSchema.java:108— AlterSchema.execute has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
DefaultPrinter.printStatsTable (cyclomatic 20) src/java/org/apache/cassandra/tools/nodetool/stats/TableStatsPrinter.java:87— DefaultPrinter.printStatsTable 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.
InvalidatePermissionsCache.execute (cyclomatic 20) src/java/org/apache/cassandra/tools/nodetool/InvalidatePermissionsCache.java:105— InvalidatePermissionsCache.execute 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.
CQLMessageHandler.processFirstFrameOfLargeMessage (cyclomatic 20) src/java/org/apache/cassandra/transport/CQLMessageHandler.java:524— CQLMessageHandler.processFirstFrameOfLargeMessage 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.
CQLMessageHandler.processOneContainedMessage (cyclomatic 20) src/java/org/apache/cassandra/transport/CQLMessageHandler.java:186— CQLMessageHandler.processOneContainedMessage 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.
6454.getReduced (cyclomatic 20) src/java/org/apache/cassandra/db/rows/Rows.java:167— 6454.getReduced 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 shape REPEATS in the file: one other method here (1.getReduced) 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.
heatmap.compute_repo_heat (cyclomatic 20) .claude/skills/heatmap/heatmap.py:327— heatmap.compute_repo_heat 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.
SelectStatement.execute (cyclomatic 19) src/java/org/apache/cassandra/cql3/statements/SelectStatement.java:382— SelectStatement.execute 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.
SafeTask.onLoadOneExclusive (cyclomatic 19) src/java/org/apache/cassandra/service/accord/execution/SafeTask.java:1230— SafeTask.onLoadOneExclusive 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.
SafeTask.setupExclusive (cyclomatic 19) src/java/org/apache/cassandra/service/accord/execution/SafeTask.java:865— SafeTask.setupExclusive 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.
AbstractSegmentCompactor.compact (cyclomatic 19) src/java/org/apache/cassandra/service/accord/journal/AbstractSegmentCompactor.java:101— AbstractSegmentCompactor.compact 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.
Exists.applies (cyclomatic 19) src/java/org/apache/cassandra/service/accord/txn/TxnCondition.java:315— Exists.applies 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.
Block.merge (cyclomatic 19) src/java/org/apache/cassandra/service/accord/txn/TxnUpdate.java:441— Block.merge 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.
StorageProxy.dispatchReadWithRetryOnDifferentSystem (cyclomatic 19) src/java/org/apache/cassandra/service/StorageProxy.java:2445— StorageProxy.dispatchReadWithRetryOnDifferentSystem 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.
StorageService.onChange (cyclomatic 19) src/java/org/apache/cassandra/service/StorageService.java:2202— StorageService.onChange has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
AutoSavingCache.loadSaved (cyclomatic 19) src/java/org/apache/cassandra/cache/AutoSavingCache.java:201— AutoSavingCache.loadSaved 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.
DatabaseDescriptor.applyAddressConfig (cyclomatic 19) src/java/org/apache/cassandra/config/DatabaseDescriptor.java:1525— DatabaseDescriptor.applyAddressConfig 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.
CommitLogArchiver.maybeRestoreArchive (cyclomatic 19) src/java/org/apache/cassandra/db/commitlog/CommitLogArchiver.java:271— CommitLogArchiver.maybeRestoreArchive 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.
TrieMemtable.getFlushSet (cyclomatic 19) src/java/org/apache/cassandra/db/memtable/TrieMemtable.java:367— TrieMemtable.getFlushSet 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.
RangeStreamer.calculateRangesToFetchWithPreferredEndpoints (cyclomatic 19) src/java/org/apache/cassandra/dht/RangeStreamer.java:474— RangeStreamer.calculateRangesToFetchWithPreferredEndpoints 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.
RouteJournalIndex.searcherFor (cyclomatic 19) src/java/org/apache/cassandra/index/accord/RouteJournalIndex.java:390— RouteJournalIndex.searcherFor has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
FilterTree.localSatisfiedBy (cyclomatic 19) src/java/org/apache/cassandra/index/sai/plan/FilterTree.java:90— FilterTree.localSatisfiedBy 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.
AutoRepair.repairKeyspace (cyclomatic 19) src/java/org/apache/cassandra/repair/autorepair/AutoRepair.java:295— AutoRepair.repairKeyspace 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.
StandaloneScrubber.main (cyclomatic 19) src/java/org/apache/cassandra/tools/StandaloneScrubber.java:84— StandaloneScrubber.main 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.
1.encode (cyclomatic 19) src/java/org/apache/cassandra/transport/messages/ErrorMessage.java:224— 1.encode 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 (3504.encode) 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.
CassandraVersion.compareIdentifiers (cyclomatic 19) src/java/org/apache/cassandra/utils/CassandraVersion.java:202— CassandraVersion.compareIdentifiers 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.
IntervalNode.<init> (cyclomatic 19) src/java/org/apache/cassandra/utils/IntervalTree.java:645— IntervalNode.<init> 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.
3504.encode (cyclomatic 19) src/java/org/apache/cassandra/transport/messages/ErrorMessage.java:224— 3504.encode 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 (1.encode) 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.
run_ci.count_test_splits (cyclomatic 19) .build/run-ci.d/run_ci.py:894— run_ci.count_test_splits 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.
matrix.run_one (cyclomatic 19) formalise/accord/execution/tla/matrix.py:374— matrix.run_one 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.
UDAggregate.compare (cyclomatic 18) src/java/org/apache/cassandra/cql3/functions/UDAggregate.java:283— UDAggregate.compare 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.
ClusteringElements.compareTo (cyclomatic 18) src/java/org/apache/cassandra/cql3/restrictions/ClusteringElements.java:358— ClusteringElements.compareTo 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.
AccordService.applyProtocolModifiers (cyclomatic 18) src/java/org/apache/cassandra/service/accord/AccordService.java:531— AccordService.applyProtocolModifiers 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.
ConsensusRequestRouter.splitReadsIntoAccordAndNormal (cyclomatic 18) src/java/org/apache/cassandra/service/consensus/migration/ConsensusRequestRouter.java:840— ConsensusRequestRouter.splitReadsIntoAccordAndNormal 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.
Paxos.cas (cyclomatic 18) src/java/org/apache/cassandra/service/paxos/Paxos.java:708— Paxos.cas 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.
SSTablesGlobalTracker.handleSSTablesChange (cyclomatic 18) src/java/org/apache/cassandra/service/SSTablesGlobalTracker.java:147— SSTablesGlobalTracker.handleSSTablesChange 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.
StorageProxy.sendToHintedReplicas (cyclomatic 18) src/java/org/apache/cassandra/service/StorageProxy.java:1827— StorageProxy.sendToHintedReplicas 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.
RoleOptions.validate (cyclomatic 18) src/java/org/apache/cassandra/auth/RoleOptions.java:135— RoleOptions.validate has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CommitLogReader.readSection (cyclomatic 18) src/java/org/apache/cassandra/db/commitlog/CommitLogReader.java:297— CommitLogReader.readSection 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.
CompactionController.getFullyExpiredSSTables (cyclomatic 18) src/java/org/apache/cassandra/db/compaction/CompactionController.java:160— CompactionController.getFullyExpiredSSTables 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.
AccordCommandRowCompactor.result (cyclomatic 18) src/java/org/apache/cassandra/db/compaction/CompactionIterator.java:1161— AccordCommandRowCompactor.result 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.
CompactionTask.maybeNotifyIndexersAboutRowsInFullyExpiredSSTables (cyclomatic 18) src/java/org/apache/cassandra/db/compaction/CompactionTask.java:619— CompactionTask.maybeNotifyIndexersAboutRowsInFullyExpiredSSTables has cyclomatic 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.
TimeWindowCompactionStrategyOptions.validateOptions (cyclomatic 18) src/java/org/apache/cassandra/db/compaction/TimeWindowCompactionStrategyOptions.java:94— TimeWindowCompactionStrategyOptions.validateOptions 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.
BTreeRow.filter (cyclomatic 18) src/java/org/apache/cassandra/db/rows/BTreeRow.java:343— BTreeRow.filter 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.
Serializer.serialize (cyclomatic 18) src/java/org/apache/cassandra/db/rows/Cell.java:287— Serializer.serialize 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.
RemoteToLocalVirtualTable.collect (cyclomatic 18) src/java/org/apache/cassandra/db/virtual/RemoteToLocalVirtualTable.java:142— RemoteToLocalVirtualTable.collect 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.
SinglePartitionReadCommand.queryMemtableAndSSTablesInTimestampOrder (cyclomatic 18) src/java/org/apache/cassandra/db/SinglePartitionReadCommand.java:1029— SinglePartitionReadCommand.queryMemtableAndSSTablesInTimestampOrder 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.
IndexWriterConfig.fromOptions (cyclomatic 18) src/java/org/apache/cassandra/index/sai/disk/v1/IndexWriterConfig.java:105— IndexWriterConfig.fromOptions 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.
IndexTermType.supports (cyclomatic 18) src/java/org/apache/cassandra/index/sai/utils/IndexTermType.java:671— IndexTermType.supports 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.
Operation.localSatisfiedBy (cyclomatic 18) src/java/org/apache/cassandra/index/sasi/plan/Operation.java:205— Operation.localSatisfiedBy 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.
RepairJob.createStandardSyncTasks (cyclomatic 18) src/java/org/apache/cassandra/repair/RepairJob.java:374— RepairJob.createStandardSyncTasks 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.
GossipHelper.nodeStateToStatus (cyclomatic 18) src/java/org/apache/cassandra/tcm/compatibility/GossipHelper.java:116— GossipHelper.nodeStateToStatus 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.
PaxosBackedProcessor.fetchLogAndWait (cyclomatic 18) src/java/org/apache/cassandra/tcm/PaxosBackedProcessor.java:79— PaxosBackedProcessor.fetchLogAndWait 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.
Message.encode (cyclomatic 18) src/java/org/apache/cassandra/transport/Message.java:339— Message.encode has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
IntervalBTree.accumulate (cyclomatic 18) src/java/org/apache/cassandra/utils/btree/IntervalBTree.java:105— IntervalBTree.accumulate 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.
IntervalTree.buildUpdatedArrayForUpdate (cyclomatic 18) src/java/org/apache/cassandra/utils/IntervalTree.java:264— IntervalTree.buildUpdatedArrayForUpdate 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.
MerkleTree.differenceHelper (cyclomatic 18) src/java/org/apache/cassandra/utils/MerkleTree.java:250— MerkleTree.differenceHelper 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.
ImportTask.import_records (cyclomatic 18) pylib/cqlshlib/copyutil.py:1210— ImportTask.import_records 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.
CqlParsingRuleSet.cql_complete_single (cyclomatic 18) pylib/cqlshlib/cqlhandling.py:180— CqlParsingRuleSet.cql_complete_single 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.
ParseUtils.parseTime (cyclomatic 17) src/java/org/apache/cassandra/cql3/functions/types/ParseUtils.java:387— ParseUtils.parseTime 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.
MergedRestriction.validate (cyclomatic 17) src/java/org/apache/cassandra/cql3/restrictions/MergedRestriction.java:124— MergedRestriction.validate 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.
StatementRestrictions.processClusteringColumnsRestrictions (cyclomatic 17) src/java/org/apache/cassandra/cql3/restrictions/StatementRestrictions.java:662— StatementRestrictions.processClusteringColumnsRestrictions 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.
AccordCacheEntry.remove (cyclomatic 17) src/java/org/apache/cassandra/service/accord/execution/AccordCacheEntry.java:299— AccordCacheEntry.remove 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.
AccordCacheEntryQueue.removePriorityOrUnsequenced (cyclomatic 17) src/java/org/apache/cassandra/service/accord/execution/AccordCacheEntryQueue.java:711— AccordCacheEntryQueue.removePriorityOrUnsequenced 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.
SafeTask.submitExclusiveMayThrow (cyclomatic 17) src/java/org/apache/cassandra/service/accord/execution/SafeTask.java:692— SafeTask.submitExclusiveMayThrow 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.
AccordInteropApply.apply (cyclomatic 17) src/java/org/apache/cassandra/service/accord/interop/AccordInteropApply.java:108— AccordInteropApply.apply 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.
AccordCommandStore.ensureDurable (cyclomatic 17) src/java/org/apache/cassandra/service/accord/AccordCommandStore.java:679— AccordCommandStore.ensureDurable has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
OrderedKeys.flush (cyclomatic 17) src/java/org/apache/cassandra/service/accord/OrderedKeys.java:77— OrderedKeys.flush 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.
Loader.ifRelevant (cyclomatic 17) src/java/org/apache/cassandra/service/accord/RangeIndex.java:97— Loader.ifRelevant 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.
PendingCleanup.cleanup (cyclomatic 17) src/java/org/apache/cassandra/service/paxos/cleanup/PaxosRepairState.java:138— PendingCleanup.cleanup has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
PartitionMergeListerner.onMergedRows (cyclomatic 17) src/java/org/apache/cassandra/service/reads/ReplicaFilteringProtection.java:224— PartitionMergeListerner.onMergedRows 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.
CassandraDaemon.setup (cyclomatic 17) src/java/org/apache/cassandra/service/CassandraDaemon.java:244— CassandraDaemon.setup has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
StorageProxy.dispatchMutationsWithRetryOnDifferentSystem (cyclomatic 17) src/java/org/apache/cassandra/service/StorageProxy.java:1269— StorageProxy.dispatchMutationsWithRetryOnDifferentSystem 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.
ParameterizedClass.newInstance (cyclomatic 17) src/java/org/apache/cassandra/config/ParameterizedClass.java:80— ParameterizedClass.newInstance 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.
LeveledManifest.getOverlappingStarvedSSTables (cyclomatic 17) src/java/org/apache/cassandra/db/compaction/LeveledManifest.java:344— LeveledManifest.getOverlappingStarvedSSTables 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.
RemoteToLocalVirtualTable.apply (cyclomatic 17) src/java/org/apache/cassandra/db/virtual/RemoteToLocalVirtualTable.java:496— RemoteToLocalVirtualTable.apply 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.
RangeTombstoneList.insertFrom (cyclomatic 17) src/java/org/apache/cassandra/db/RangeTombstoneList.java:553— RangeTombstoneList.insertFrom 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.
WriteThresholds.checkWriteThresholds (cyclomatic 17) src/java/org/apache/cassandra/db/WriteThresholds.java:54— WriteThresholds.checkWriteThresholds 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.
Gossiper.applyNewStates (cyclomatic 17) src/java/org/apache/cassandra/gms/Gossiper.java:1547— Gossiper.applyNewStates has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
Operation.analyzeGroup (cyclomatic 17) src/java/org/apache/cassandra/index/sasi/plan/Operation.java:269— Operation.analyzeGroup has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
BigTableVerifier.deserializeIndex (cyclomatic 17) src/java/org/apache/cassandra/io/sstable/format/big/BigTableVerifier.java:111— BigTableVerifier.deserializeIndex 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.
ReverseReader.loadFromDisk (cyclomatic 17) src/java/org/apache/cassandra/io/sstable/format/big/SSTableReversedIterator.java:191— ReverseReader.loadFromDisk 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.
AbstractSSTableIterator.<init> (cyclomatic 17) src/java/org/apache/cassandra/io/sstable/AbstractSSTableIterator.java:87— AbstractSSTableIterator.<init> 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.
UnbufferedDataOutputStreamPlus.writeUTF (cyclomatic 17) src/java/org/apache/cassandra/io/util/UnbufferedDataOutputStreamPlus.java:252— UnbufferedDataOutputStreamPlus.writeUTF 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.
RepairJob.runRepair (cyclomatic 17) src/java/org/apache/cassandra/repair/RepairJob.java:159— RepairJob.runRepair 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.
MemtableParams.expandDefinitions (cyclomatic 17) src/java/org/apache/cassandra/schema/MemtableParams.java:139— MemtableParams.expandDefinitions 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.
TableMetadata.validateCompatibility (cyclomatic 17) src/java/org/apache/cassandra/schema/TableMetadata.java:696— TableMetadata.validateCompatibility 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.
TimeSerializer.parseTimeStrictly (cyclomatic 17) src/java/org/apache/cassandra/serializers/TimeSerializer.java:137— TimeSerializer.parseTimeStrictly 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.
DescribeCluster.execute (cyclomatic 17) src/java/org/apache/cassandra/tools/nodetool/DescribeCluster.java:47— DescribeCluster.execute 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.
NetStats.execute (cyclomatic 17) src/java/org/apache/cassandra/tools/nodetool/NetStats.java:49— NetStats.execute 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.
1.encodedSize (cyclomatic 17) src/java/org/apache/cassandra/transport/messages/ErrorMessage.java:308— 1.encodedSize has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions. This shape REPEATS in the file: one other method here (3504.encodedSize) 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.
AbstractSeekingTransformer.finishAndDrain (cyclomatic 17) src/java/org/apache/cassandra/utils/btree/BTree.java:4095— AbstractSeekingTransformer.finishAndDrain 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.
BTreeRemoval.removeFromLeaf (cyclomatic 17) src/java/org/apache/cassandra/utils/btree/BTreeRemoval.java:76— BTreeRemoval.removeFromLeaf 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.
TreeCursor.seekTo (cyclomatic 17) src/java/org/apache/cassandra/utils/btree/TreeCursor.java:100— TreeCursor.seekTo 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.
SignalLock.awaitAsyncOrLock (cyclomatic 17) src/java/org/apache/cassandra/utils/concurrent/SignalLock.java:209— SignalLock.awaitAsyncOrLock 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.
MicroQueueOfChunks.removeIf (cyclomatic 17) src/java/org/apache/cassandra/utils/memory/BufferPool.java:673— MicroQueueOfChunks.removeIf 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.
LongTimSort.gallopLeft (cyclomatic 17) src/java/org/apache/cassandra/utils/LongTimSort.java:470— LongTimSort.gallopLeft 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 shape REPEATS in the file: one other method here (LongTimSort.gallopRight) 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.
LongTimSort.gallopRight (cyclomatic 17) src/java/org/apache/cassandra/utils/LongTimSort.java:535— LongTimSort.gallopRight 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 shape REPEATS in the file: one other method here (LongTimSort.gallopLeft) 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.
3504.encodedSize (cyclomatic 17) src/java/org/apache/cassandra/transport/messages/ErrorMessage.java:308— 3504.encodedSize has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions. This shape REPEATS in the file: one other method here (1.encodedSize) 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.
ant-log-summary.main (cyclomatic 17) .build/sh/ant-log-summary.py:99— ant-log-summary.main 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.
cqlprotodoc.parse_spec_file (cyclomatic 17) doc/scripts/cqlprotodoc.py:44— cqlprotodoc.parse_spec_file 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.
FunctionResolver.pickBestMatch (cyclomatic 16) src/java/org/apache/cassandra/cql3/functions/FunctionResolver.java:129— FunctionResolver.pickBestMatch 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.
PartitionKeyRestrictions.bounds (cyclomatic 16) src/java/org/apache/cassandra/cql3/restrictions/PartitionKeyRestrictions.java:137— PartitionKeyRestrictions.bounds 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.
CreateFunctionStatement.apply (cyclomatic 16) src/java/org/apache/cassandra/cql3/statements/schema/CreateFunctionStatement.java:95— CreateFunctionStatement.apply 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.
BatchStatement.getMutations (cyclomatic 16) src/java/org/apache/cassandra/cql3/statements/BatchStatement.java:359— BatchStatement.getMutations 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.
ModificationStatement.<init> (cyclomatic 16) src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java:189— ModificationStatement.<init> 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.
DebugTxnGraph.visitLatestCommitted (cyclomatic 16) src/java/org/apache/cassandra/service/accord/debug/DebugTxnGraph.java:316— DebugTxnGraph.visitLatestCommitted has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Instance.release (cyclomatic 16) src/java/org/apache/cassandra/service/accord/execution/AccordCache.java:570— Instance.release 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.
AccordCacheEntryQueue.addFifo (cyclomatic 16) src/java/org/apache/cassandra/service/accord/execution/AccordCacheEntryQueue.java:223— AccordCacheEntryQueue.addFifo 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.
SafeTask.onChangeKeyRunnableStatus (cyclomatic 16) src/java/org/apache/cassandra/service/accord/execution/SafeTask.java:1394— SafeTask.onChangeKeyRunnableStatus 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.
StoreParticipantsSerializer.skip (cyclomatic 16) src/java/org/apache/cassandra/service/accord/serializers/CommandSerializers.java:385— StoreParticipantsSerializer.skip 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.
BTreeReducingRangeMapSerializer.deserialize (cyclomatic 16) src/java/org/apache/cassandra/service/accord/serializers/CommandStoreSerializers.java:436— BTreeReducingRangeMapSerializer.deserialize 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.
ColumnReference.toByteBuffer (cyclomatic 16) src/java/org/apache/cassandra/service/accord/txn/TxnReference.java:422— ColumnReference.toByteBuffer 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.
TransactionalMode.readCLForMode (cyclomatic 16) src/java/org/apache/cassandra/service/consensus/TransactionalMode.java:217— TransactionalMode.readCLForMode 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.
Paxos.read (cyclomatic 16) src/java/org/apache/cassandra/service/paxos/Paxos.java:890— Paxos.read 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.
StorageService.getEffectiveOwnership (cyclomatic 16) src/java/org/apache/cassandra/service/StorageService.java:4254— StorageService.getEffectiveOwnership 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.
AbstractCompactionStrategy.validateOptions (cyclomatic 16) src/java/org/apache/cassandra/db/compaction/AbstractCompactionStrategy.java:451— AbstractCompactionStrategy.validateOptions 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.
Merger.merge (cyclomatic 16) src/java/org/apache/cassandra/db/rows/Row.java:769— Merger.merge has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TableViews.generateViewUpdates (cyclomatic 16) src/java/org/apache/cassandra/db/view/TableViews.java:219— TableViews.generateViewUpdates 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.
ViewUpdateGenerator.addDifferentCells (cyclomatic 16) src/java/org/apache/cassandra/db/view/ViewUpdateGenerator.java:302— ViewUpdateGenerator.addDifferentCells 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.
ViewUpdateGenerator.updateAction (cyclomatic 16) src/java/org/apache/cassandra/db/view/ViewUpdateGenerator.java:172— ViewUpdateGenerator.updateAction 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.
TxnTraceTable.applyRowUpdate (cyclomatic 16) src/java/org/apache/cassandra/db/virtual/AccordDebugKeyspace.java:1154— TxnTraceTable.applyRowUpdate has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
AbstractMutationVerbHandler.checkSchemaVersion (cyclomatic 16) src/java/org/apache/cassandra/db/AbstractMutationVerbHandler.java:122— AbstractMutationVerbHandler.checkSchemaVersion 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.
ReadCommandVerbHandler.checkTokenOwnership (cyclomatic 16) src/java/org/apache/cassandra/db/ReadCommandVerbHandler.java:170— ReadCommandVerbHandler.checkTokenOwnership 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.
HintsDispatcher.doSendHintsAndAwait (cyclomatic 16) src/java/org/apache/cassandra/hints/HintsDispatcher.java:192— HintsDispatcher.doSendHintsAndAwait 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.
Expression.isSatisfiedBy (cyclomatic 16) src/java/org/apache/cassandra/index/sai/plan/Expression.java:272— Expression.isSatisfiedBy 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.
Expression.add (cyclomatic 16) src/java/org/apache/cassandra/index/sasi/plan/Expression.java:141— Expression.add 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.
SecondaryIndexManager.indexPartition (cyclomatic 16) src/java/org/apache/cassandra/index/SecondaryIndexManager.java:1091— SecondaryIndexManager.indexPartition 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.
ReplicaPlans.assureSufficientLiveReplicas (cyclomatic 16) src/java/org/apache/cassandra/locator/ReplicaPlans.java:148— ReplicaPlans.assureSufficientLiveReplicas 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.
AutoRepair.repair (cyclomatic 16) src/java/org/apache/cassandra/repair/autorepair/AutoRepair.java:163— AutoRepair.repair 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.
TableMetadata.<init> (cyclomatic 16) src/java/org/apache/cassandra/schema/TableMetadata.java:228— TableMetadata.<init> 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.
AbstractMapSerializer.getIndexesRangeFromSerialized (cyclomatic 16) src/java/org/apache/cassandra/serializers/AbstractMapSerializer.java:150— AbstractMapSerializer.getIndexesRangeFromSerialized 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.
Transformer.build (cyclomatic 16) src/java/org/apache/cassandra/tcm/ClusterMetadata.java:978— Transformer.build has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Startup.initializeCMSLookup (cyclomatic 16) src/java/org/apache/cassandra/tcm/Startup.java:286— Startup.initializeCMSLookup 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.
ReconfigureCMS.execute (cyclomatic 16) src/java/org/apache/cassandra/tools/nodetool/CMSAdmin.java:138— ReconfigureCMS.execute has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ProfileLoad.execute (cyclomatic 16) src/java/org/apache/cassandra/tools/nodetool/ProfileLoad.java:84— ProfileLoad.execute has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Repair.createOptions (cyclomatic 16) src/java/org/apache/cassandra/tools/nodetool/Repair.java:183— Repair.createOptions 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.
HashPassword.main (cyclomatic 16) src/java/org/apache/cassandra/tools/HashPassword.java:51— HashPassword.main 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.
SSTableMetadataViewer.printScannedOverview (cyclomatic 16) src/java/org/apache/cassandra/tools/SSTableMetadataViewer.java:173— SSTableMetadataViewer.printScannedOverview 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.
TermHistogram.printHistogram (cyclomatic 16) src/java/org/apache/cassandra/tools/Util.java:215— TermHistogram.printHistogram 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.
LegacyDispatchHandler.checkLimits (cyclomatic 16) src/java/org/apache/cassandra/transport/PreV5Handlers.java:162— LegacyDispatchHandler.checkLimits 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.
Builder.mergeAll (cyclomatic 16) src/java/org/apache/cassandra/utils/btree/BTree.java:1709— Builder.mergeAll 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.
Visitor.traverse (cyclomatic 16) src/java/org/apache/cassandra/utils/concurrent/Ref.java:635— Visitor.traverse 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.
FBUtilities.parseHumanReadable (cyclomatic 16) src/java/org/apache/cassandra/utils/FBUtilities.java:1111— FBUtilities.parseHumanReadable 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.
CqlParsingRuleSet.cql_complete_multiple (cyclomatic 16) pylib/cqlshlib/cqlhandling.py:302— CqlParsingRuleSet.cql_complete_multiple 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.
notify.run_one (cyclomatic 16) formalise/accord/execution/tla/notify.py:289— notify.run_one 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.
XxxComment src/java/org/apache/cassandra/cql3/statements/QualifiedStatement.java:48— // XXX: We explicitly only want to call state.getKeyspace() in this case, as we don't want to throw — 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.
DatabaseDescriptor.applySimpleConfig (cognitive 196) src/java/org/apache/cassandra/config/DatabaseDescriptor.java:617— DatabaseDescriptor.applySimpleConfig has cognitive complexity 196 (threshold 15). Drivers by points: if/else 126 (152 pts), ternaries 14 (20 pts), boolean chains 12, error handling 9 (10 pts), loops 1, match/switch 1 (nesting depth added 33). 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.
TableStatsHolder.initializeKeyspaces (cognitive 139) src/java/org/apache/cassandra/tools/nodetool/stats/TableStatsHolder.java:212— TableStatsHolder.initializeKeyspaces has cognitive complexity 139 (threshold 15). Drivers by points: if/else 20 (63 pts), ternaries 16 (61 pts), loops 5 (12 pts), error handling 1 (3 pts) (nesting depth added 97). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StatsTableComparator.compare (cognitive 107) src/java/org/apache/cassandra/tools/nodetool/stats/StatsTableComparator.java:123— StatsTableComparator.compare has cognitive complexity 107 (threshold 15). Drivers by points: if/else 73 (80 pts), boolean chains 25, ternaries 2 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Task.<init> (cognitive 103) src/java/org/apache/cassandra/service/accord/execution/Task.java:313— Task.<init> has cognitive complexity 103 (threshold 15). Drivers by points: if/else 23 (91 pts), match/switch 2 (7 pts), boolean chains 4, ternaries 1 (nesting depth added 73). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
SSTableImporter.importNewSSTables (cognitive 93) src/java/org/apache/cassandra/db/SSTableImporter.java:78— SSTableImporter.importNewSSTables has cognitive complexity 93 (threshold 15). Drivers by points: if/else 19 (64 pts), loops 7 (17 pts), error handling 3 (9 pts), boolean chains 3 (nesting depth added 61). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Keyspace.applyInternal (cognitive 80) src/java/org/apache/cassandra/db/Keyspace.java:459— Keyspace.applyInternal has cognitive complexity 80 (threshold 15). Drivers by points: if/else 19 (45 pts), loops 7 (23 pts), error handling 2 (9 pts), boolean chains 3 (nesting depth added 49). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ArrayBackedSlices.toCQLString (cognitive 78) src/java/org/apache/cassandra/db/Slices.java:553— ArrayBackedSlices.toCQLString has cognitive complexity 78 (threshold 15). Drivers by points: if/else 17 (42 pts), ternaries 5 (25 pts), loops 5 (11 pts) (nesting depth added 51). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
BTree.updateLeaves (cognitive 78) src/java/org/apache/cassandra/utils/btree/BTree.java:429— BTree.updateLeaves has cognitive complexity 78 (threshold 15). Drivers by points: if/else 24 (64 pts), ternaries 2 (8 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 48). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
StatementRestrictions.<init> (cognitive 75) src/java/org/apache/cassandra/cql3/restrictions/StatementRestrictions.java:190— StatementRestrictions.<init> has cognitive complexity 75 (threshold 15). Drivers by points: if/else 28 (57 pts), boolean chains 16, loops 1, ternaries 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
matrix.main (cognitive 73) formalise/accord/execution/tla/matrix.py:475— matrix.main has cognitive complexity 73 (threshold 15). Drivers by points: if/else 19 (51 pts), ternaries 4 (12 pts), loops 5 (9 pts), boolean chains 1 (nesting depth added 44). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BtiTableScrubber.scrubInternal (cognitive 72) src/java/org/apache/cassandra/io/sstable/format/bti/BtiTableScrubber.java:96— BtiTableScrubber.scrubInternal has cognitive complexity 72 (threshold 15). Drivers by points: if/else 19 (51 pts), error handling 4 (12 pts), boolean chains 6, ternaries 1 (2 pts), loops 1 (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IntervalIndexAdapter.override (cognitive 70) src/java/org/apache/cassandra/utils/btree/IntervalBTree.java:243— IntervalIndexAdapter.override has cognitive complexity 70 (threshold 15). Drivers by points: if/else 14 (36 pts), loops 7 (13 pts), ternaries 2 (12 pts), boolean chains 9 (nesting depth added 38). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
1.getReduced (cognitive 67) src/java/org/apache/cassandra/db/rows/Rows.java:167— 1.getReduced has cognitive complexity 67 (threshold 15). Drivers by points: if/else 12 (35 pts), loops 6 (26 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 45). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: one other method here (6454.getReduced) 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.
BigTableScrubber.scrubInternal (cognitive 67) src/java/org/apache/cassandra/io/sstable/format/big/BigTableScrubber.java:86— BigTableScrubber.scrubInternal has cognitive complexity 67 (threshold 15). Drivers by points: if/else 18 (48 pts), error handling 4 (9 pts), boolean chains 6, ternaries 2 (3 pts), loops 1 (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
6454.getReduced (cognitive 67) src/java/org/apache/cassandra/db/rows/Rows.java:167— 6454.getReduced has cognitive complexity 67 (threshold 15). Drivers by points: if/else 12 (35 pts), loops 6 (26 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 45). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: one other method here (1.getReduced) 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.
CodecRegistry.maybeCreateCodec (cognitive 65) src/java/org/apache/cassandra/cql3/functions/types/CodecRegistry.java:822— CodecRegistry.maybeCreateCodec has cognitive complexity 65 (threshold 15). Drivers by points: ternaries 10 (28 pts), boolean chains 21, if/else 13 (16 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AutoRepairUtils.myTurnToRunRepair (cognitive 65) src/java/org/apache/cassandra/repair/autorepair/AutoRepairUtils.java:955— AutoRepairUtils.myTurnToRunRepair has cognitive complexity 65 (threshold 15). Drivers by points: if/else 25 (48 pts), loops 4 (8 pts), boolean chains 6, ternaries 2, error handling 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cqlshmain.main (cognitive 65) pylib/cqlshlib/cqlshmain.py:2202— cqlshmain.main has cognitive complexity 65 (threshold 15). Drivers by points: if/else 21 (34 pts), error handling 11 (29 pts), boolean chains 2 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AccordService.catchup (cognitive 63) src/java/org/apache/cassandra/service/accord/AccordService.java:795— AccordService.catchup has cognitive complexity 63 (threshold 15). Drivers by points: if/else 16 (49 pts), match/switch 2 (8 pts), ternaries 1 (4 pts), loops 1 (2 pts) (nesting depth added 43). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
AbstractSeekingTransformer.apply (cognitive 62) src/java/org/apache/cassandra/utils/btree/BTree.java:3936— AbstractSeekingTransformer.apply has cognitive complexity 62 (threshold 15). Drivers by points: if/else 16 (47 pts), loops 5 (14 pts), boolean chains 1 (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RepairMessageVerbHandler.doVerb (cognitive 61) src/java/org/apache/cassandra/repair/RepairMessageVerbHandler.java:97— RepairMessageVerbHandler.doVerb has cognitive complexity 61 (threshold 15). Drivers by points: if/else 23 (47 pts), error handling 4 (7 pts), boolean chains 2, loops 1 (2 pts), ternaries 1 (2 pts), match/switch 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LongTimSort.mergeHi (cognitive 61) src/java/org/apache/cassandra/utils/LongTimSort.java:711— LongTimSort.mergeHi has cognitive complexity 61 (threshold 15). Drivers by points: if/else 22 (52 pts), loops 3 (5 pts), boolean chains 3, ternaries 1 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (LongTimSort.mergeLo) 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.
LongTimSort.mergeLo (cognitive 61) src/java/org/apache/cassandra/utils/LongTimSort.java:603— LongTimSort.mergeLo has cognitive complexity 61 (threshold 15). Drivers by points: if/else 22 (52 pts), loops 3 (5 pts), boolean chains 3, ternaries 1 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (LongTimSort.mergeHi) 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.
PaxosPrepare.permitted (cognitive 60) src/java/org/apache/cassandra/service/paxos/PaxosPrepare.java:560— PaxosPrepare.permitted has cognitive complexity 60 (threshold 15). Drivers by points: if/else 24 (46 pts), ternaries 2 (6 pts), boolean chains 4, match/switch 2 (4 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
notify.main (cognitive 60) formalise/accord/execution/tla/notify.py:358— notify.main has cognitive complexity 60 (threshold 15). Drivers by points: if/else 15 (41 pts), loops 5 (10 pts), ternaries 2 (6 pts), boolean chains 3 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TableHistograms.execute (cognitive 57) src/java/org/apache/cassandra/tools/nodetool/TableHistograms.java:58— TableHistograms.execute has cognitive complexity 57 (threshold 15). Drivers by points: loops 11 (34 pts), if/else 11 (21 pts), boolean chains 2 (nesting depth added 33). 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.
ParseUtils.skipCQLValue (cognitive 56) src/java/org/apache/cassandra/cql3/functions/types/ParseUtils.java:76— ParseUtils.skipCQLValue has cognitive complexity 56 (threshold 15). Drivers by points: if/else 23 (47 pts), boolean chains 8, loops 1 (nesting depth added 24). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
SelectStatement.asCQL (cognitive 56) src/java/org/apache/cassandra/cql3/statements/SelectStatement.java:2044— SelectStatement.asCQL has cognitive complexity 56 (threshold 15). Drivers by points: if/else 22 (52 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 32). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
SafeTask.preSetup (cognitive 55) src/java/org/apache/cassandra/service/accord/execution/SafeTask.java:580— SafeTask.preSetup has cognitive complexity 55 (threshold 15). Drivers by points: if/else 17 (30 pts), ternaries 4 (12 pts), boolean chains 5, loops 2 (5 pts), match/switch 1 (3 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CompactionTask.maybeNotifyIndexersAboutRowsInFullyExpiredSSTables (cognitive 52) src/java/org/apache/cassandra/db/compaction/CompactionTask.java:619— CompactionTask.maybeNotifyIndexersAboutRowsInFullyExpiredSSTables has cognitive complexity 52 (threshold 15). Drivers by points: loops 9 (30 pts), if/else 7 (20 pts), error handling 1 (2 pts) (nesting depth added 35). 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.
CounterContext.compare (cognitive 51) src/java/org/apache/cassandra/db/context/CounterContext.java:456— CounterContext.compare has cognitive complexity 51 (threshold 15). Drivers by points: if/else 19 (31 pts), boolean chains 10, ternaries 3 (10 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UTF8Validator.validateSlowPath (cognitive 51) src/java/org/apache/cassandra/serializers/UTF8Serializer.java:107— UTF8Validator.validateSlowPath has cognitive complexity 51 (threshold 15). Drivers by points: if/else 20 (48 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RowIteratorMergeListener.onMergedRangeTombstoneMarkers (cognitive 50) src/java/org/apache/cassandra/service/reads/repair/RowIteratorMergeListener.java:236— RowIteratorMergeListener.onMergedRangeTombstoneMarkers has cognitive complexity 50 (threshold 15). Drivers by points: if/else 16 (39 pts), boolean chains 5, ternaries 2 (5 pts), loops 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConsensusRequestRouter.splitReadIntoAccordAndNormal (cognitive 49) src/java/org/apache/cassandra/service/consensus/migration/ConsensusRequestRouter.java:718— ConsensusRequestRouter.splitReadIntoAccordAndNormal has cognitive complexity 49 (threshold 15). Drivers by points: if/else 17 (28 pts), ternaries 7 (15 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Rows.removeShadowedCells (cognitive 49) src/java/org/apache/cassandra/db/rows/Rows.java:273— Rows.removeShadowedCells has cognitive complexity 49 (threshold 15). Drivers by points: ternaries 11 (30 pts), if/else 9 (17 pts), boolean chains 1, loops 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StorageProxy.sendToHintedReplicas (cognitive 48) src/java/org/apache/cassandra/service/StorageProxy.java:1827— StorageProxy.sendToHintedReplicas has cognitive complexity 48 (threshold 15). Drivers by points: if/else 16 (42 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 28). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
SEPWorker.run (cognitive 47) src/java/org/apache/cassandra/concurrent/SEPWorker.java:128— SEPWorker.run has cognitive complexity 47 (threshold 15). Drivers by points: if/else 16 (36 pts), loops 4 (8 pts), boolean chains 2, error handling 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SinglePartitionReadCommand.queryMemtableAndDiskInternal (cognitive 47) src/java/org/apache/cassandra/db/SinglePartitionReadCommand.java:751— SinglePartitionReadCommand.queryMemtableAndDiskInternal has cognitive complexity 47 (threshold 15). Drivers by points: if/else 18 (36 pts), boolean chains 3, error handling 2 (3 pts), ternaries 1 (3 pts), loops 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BigTableReader.getRowIndexEntry (cognitive 47) src/java/org/apache/cassandra/io/sstable/format/big/BigTableReader.java:251— BigTableReader.getRowIndexEntry has cognitive complexity 47 (threshold 15). Drivers by points: if/else 19 (37 pts), boolean chains 8, error handling 1, loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LeveledManifest.getCandidatesFor (cognitive 46) src/java/org/apache/cassandra/db/compaction/LeveledManifest.java:497— LeveledManifest.getCandidatesFor has cognitive complexity 46 (threshold 15). Drivers by points: if/else 14 (35 pts), loops 4 (8 pts), boolean chains 3 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Move.executeNext (cognitive 46) src/java/org/apache/cassandra/tcm/sequences/Move.java:261— Move.executeNext has cognitive complexity 46 (threshold 15). Drivers by points: if/else 10 (26 pts), error handling 6 (12 pts), loops 2 (5 pts), boolean chains 2, match/switch 1 (nesting depth added 25). 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.
SimpleRestriction.addToRowFilter (cognitive 45) src/java/org/apache/cassandra/cql3/restrictions/SimpleRestriction.java:374— SimpleRestriction.addToRowFilter has cognitive complexity 45 (threshold 15). Drivers by points: if/else 15 (34 pts), loops 2 (7 pts), boolean chains 3, match/switch 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StoreParticipantsSerializer.serialize (cognitive 45) src/java/org/apache/cassandra/service/accord/serializers/CommandSerializers.java:337— StoreParticipantsSerializer.serialize has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (26 pts), ternaries 10 (11 pts), boolean chains 8 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BTreeReducingRangeMapSerializer.deserialize (cognitive 45) src/java/org/apache/cassandra/service/accord/serializers/CommandStoreSerializers.java:436— BTreeReducingRangeMapSerializer.deserialize has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (33 pts), ternaries 2 (7 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
AccordCommandStore.ensureDurable (cognitive 45) src/java/org/apache/cassandra/service/accord/AccordCommandStore.java:679— AccordCommandStore.ensureDurable has cognitive complexity 45 (threshold 15). Drivers by points: loops 6 (17 pts), if/else 7 (14 pts), error handling 4 (13 pts), boolean chains 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Controller.validateOptions (cognitive 45) src/java/org/apache/cassandra/db/compaction/unified/Controller.java:512— Controller.validateOptions has cognitive complexity 45 (threshold 15). Drivers by points: if/else 18 (26 pts), error handling 9 (18 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RangeTombstoneList.insertFrom (cognitive 45) src/java/org/apache/cassandra/db/RangeTombstoneList.java:553— RangeTombstoneList.insertFrom has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (41 pts), boolean chains 3, loops 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StoreParticipantsSerializer.deserialize (cognitive 44) src/java/org/apache/cassandra/service/accord/serializers/CommandSerializers.java:412— StoreParticipantsSerializer.deserialize has cognitive complexity 44 (threshold 15). Drivers by points: ternaries 18 (42 pts), if/else 2 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NormalizedRanges.subtract (cognitive 44) src/java/org/apache/cassandra/dht/NormalizedRanges.java:137— NormalizedRanges.subtract has cognitive complexity 44 (threshold 15). Drivers by points: if/else 12 (20 pts), ternaries 6 (14 pts), boolean chains 8, loops 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AbstractLocalProcessor.commit (cognitive 44) src/java/org/apache/cassandra/tcm/AbstractLocalProcessor.java:61— AbstractLocalProcessor.commit has cognitive complexity 44 (threshold 15). Drivers by points: if/else 16 (35 pts), error handling 2 (5 pts), boolean chains 3, loops 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ViewUpdateGenerator.addDifferentCells (cognitive 43) src/java/org/apache/cassandra/db/view/ViewUpdateGenerator.java:302— ViewUpdateGenerator.addDifferentCells has cognitive complexity 43 (threshold 15). Drivers by points: if/else 11 (32 pts), loops 4 (10 pts), boolean chains 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RangeStreamer.calculateRangesToFetchWithPreferredEndpoints (cognitive 43) src/java/org/apache/cassandra/dht/RangeStreamer.java:474— RangeStreamer.calculateRangesToFetchWithPreferredEndpoints has cognitive complexity 43 (threshold 15). Drivers by points: if/else 14 (34 pts), boolean chains 5, ternaries 1 (3 pts), loops 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Gossiper.mergeNodeToGossip (cognitive 43) src/java/org/apache/cassandra/gms/Gossiper.java:2289— Gossiper.mergeNodeToGossip has cognitive complexity 43 (threshold 15). Drivers by points: if/else 11 (27 pts), ternaries 4 (9 pts), boolean chains 3, match/switch 1 (2 pts), error handling 1, loops 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SecondaryIndexManager.indexPartition (cognitive 43) src/java/org/apache/cassandra/index/SecondaryIndexManager.java:1091— SecondaryIndexManager.indexPartition has cognitive complexity 43 (threshold 15). Drivers by points: if/else 11 (30 pts), loops 4 (12 pts), boolean chains 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RepairJob.createStandardSyncTasks (cognitive 43) src/java/org/apache/cassandra/repair/RepairJob.java:374— RepairJob.createStandardSyncTasks has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 5 (20 pts), if/else 6 (15 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CounterContext.merge (cognitive 42) src/java/org/apache/cassandra/db/context/CounterContext.java:298— CounterContext.merge has cognitive complexity 42 (threshold 15). Drivers by points: if/else 25 (36 pts), boolean chains 3, loops 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StorageAttachedIndex.validateOptions (cognitive 42) src/java/org/apache/cassandra/index/sai/StorageAttachedIndex.java:243— StorageAttachedIndex.validateOptions has cognitive complexity 42 (threshold 15). Drivers by points: if/else 20 (32 pts), boolean chains 4, error handling 1 (3 pts), loops 2 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PlacementTransitionPlan.assertPreExistingWriteReplica (cognitive 42) src/java/org/apache/cassandra/tcm/ownership/PlacementTransitionPlan.java:188— PlacementTransitionPlan.assertPreExistingWriteReplica has cognitive complexity 42 (threshold 15). Drivers by points: if/else 5 (24 pts), loops 5 (15 pts), boolean chains 3 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GCInspector.handleNotification (cognitive 41) src/java/org/apache/cassandra/service/GCInspector.java:269— GCInspector.handleNotification has cognitive complexity 41 (threshold 15). Drivers by points: if/else 16 (34 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LeveledManifest.getOverlappingStarvedSSTables (cognitive 41) src/java/org/apache/cassandra/db/compaction/LeveledManifest.java:344— LeveledManifest.getOverlappingStarvedSSTables has cognitive complexity 41 (threshold 15). Drivers by points: if/else 7 (25 pts), loops 5 (12 pts), boolean chains 4 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CounterContext.diff (cognitive 41) src/java/org/apache/cassandra/db/context/CounterContext.java:199— CounterContext.diff has cognitive complexity 41 (threshold 15). Drivers by points: if/else 20 (35 pts), boolean chains 5, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SimplePartition.row (cognitive 41) src/java/org/apache/cassandra/db/virtual/AbstractLazyVirtualTable.java:405— SimplePartition.row has cognitive complexity 41 (threshold 15). Drivers by points: if/else 15 (30 pts), loops 2 (6 pts), boolean chains 5 (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.
CassandraIndexSearcher.makeIndexFilter (cognitive 41) src/java/org/apache/cassandra/index/internal/CassandraIndexSearcher.java:105— CassandraIndexSearcher.makeIndexFilter has cognitive complexity 41 (threshold 15). Drivers by points: if/else 13 (36 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
InvalidatePermissionsCache.execute (cognitive 41) src/java/org/apache/cassandra/tools/nodetool/InvalidatePermissionsCache.java:105— InvalidatePermissionsCache.execute has cognitive complexity 41 (threshold 15). Drivers by points: if/else 20 (37 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AbstractSeekingTransformer.finishAndDrain (cognitive 41) src/java/org/apache/cassandra/utils/btree/BTree.java:4095— AbstractSeekingTransformer.finishAndDrain has cognitive complexity 41 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 6 (16 pts), boolean chains 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SafeTask.onFailingKeyExclusive (cognitive 40) src/java/org/apache/cassandra/service/accord/execution/SafeTask.java:1844— SafeTask.onFailingKeyExclusive has cognitive complexity 40 (threshold 15). Drivers by points: if/else 13 (25 pts), boolean chains 10, ternaries 2 (5 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DebugTxnGraph.visitParent (cognitive 39) src/java/org/apache/cassandra/service/accord/debug/DebugTxnGraph.java:243— DebugTxnGraph.visitParent has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (31 pts), ternaries 1 (4 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
AccordExecutorSignalLoop.fetchWorkExclusive (cognitive 39) src/java/org/apache/cassandra/service/accord/execution/AccordExecutorSignalLoop.java:176— AccordExecutorSignalLoop.fetchWorkExclusive has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (33 pts), boolean chains 5, loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Block.merge (cognitive 39) src/java/org/apache/cassandra/service/accord/txn/TxnUpdate.java:441— Block.merge has cognitive complexity 39 (threshold 15). Drivers by points: if/else 19 (29 pts), loops 2 (4 pts), ternaries 1 (4 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AutoSavingCache.loadSaved (cognitive 39) src/java/org/apache/cassandra/cache/AutoSavingCache.java:201— AutoSavingCache.loadSaved has cognitive complexity 39 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 4 (11 pts), boolean chains 5, error handling 2 (4 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommitLogArchiver.maybeRestoreArchive (cognitive 39) src/java/org/apache/cassandra/db/commitlog/CommitLogArchiver.java:271— CommitLogArchiver.maybeRestoreArchive has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (23 pts), error handling 2 (7 pts), boolean chains 3, loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BigTableVerifier.deserializeIndex (cognitive 39) src/java/org/apache/cassandra/io/sstable/format/big/BigTableVerifier.java:111— BigTableVerifier.deserializeIndex has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (33 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AbstractSSTableIterator.<init> (cognitive 39) src/java/org/apache/cassandra/io/sstable/AbstractSSTableIterator.java:87— AbstractSSTableIterator.<init> has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (26 pts), error handling 3 (10 pts), boolean chains 3 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AutoRepair.repairKeyspace (cognitive 39) src/java/org/apache/cassandra/repair/autorepair/AutoRepair.java:295— AutoRepair.repairKeyspace has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (26 pts), error handling 2 (6 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CQLMessageHandler.processOneContainedMessage (cognitive 39) src/java/org/apache/cassandra/transport/CQLMessageHandler.java:186— CQLMessageHandler.processOneContainedMessage has cognitive complexity 39 (threshold 15). Drivers by points: if/else 17 (36 pts), boolean chains 3 (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
BatchStatement.validate (cognitive 38) src/java/org/apache/cassandra/cql3/statements/BatchStatement.java:253— BatchStatement.validate has cognitive complexity 38 (threshold 15). Drivers by points: if/else 18 (25 pts), boolean chains 10, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Builder.maybeCreateOrEnrichManifest (cognitive 38) src/java/org/apache/cassandra/service/snapshot/TableSnapshot.java:535— Builder.maybeCreateOrEnrichManifest has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (21 pts), loops 5 (8 pts), boolean chains 6, error handling 1 (2 pts), ternaries 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.
StorageProxy.mutateAtomically (cognitive 38) src/java/org/apache/cassandra/service/StorageProxy.java:1436— StorageProxy.mutateAtomically has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (18 pts), error handling 5 (9 pts), ternaries 4 (7 pts), boolean chains 2, loops 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RemoteToLocalVirtualTable.rebind (cognitive 38) src/java/org/apache/cassandra/db/virtual/RemoteToLocalVirtualTable.java:379— RemoteToLocalVirtualTable.rebind has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (20 pts), boolean chains 9, loops 2 (5 pts), ternaries 2 (4 pts) (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
1.prepareNext (cognitive 38) src/java/org/apache/cassandra/index/internal/composites/CompositesSearcher.java:102— 1.prepareNext has cognitive complexity 38 (threshold 15). Drivers by points: if/else 9 (22 pts), ternaries 3 (11 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IndexWriterConfig.fromOptions (cognitive 38) src/java/org/apache/cassandra/index/sai/disk/v1/IndexWriterConfig.java:105— IndexWriterConfig.fromOptions has cognitive complexity 38 (threshold 15). Drivers by points: if/else 10 (23 pts), error handling 4 (12 pts), boolean chains 3 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ResultRetriever.computeNext (cognitive 38) src/java/org/apache/cassandra/index/sai/plan/StorageAttachedIndexSearcher.java:223— ResultRetriever.computeNext has cognitive complexity 38 (threshold 15). Drivers by points: if/else 10 (35 pts), boolean chains 2, ternaries 1 (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
SortedTableVerifier.verifySSTable (cognitive 38) src/java/org/apache/cassandra/io/sstable/format/SortedTableVerifier.java:271— SortedTableVerifier.verifySSTable has cognitive complexity 38 (threshold 15). Drivers by points: if/else 8 (15 pts), error handling 5 (10 pts), ternaries 4 (8 pts), boolean chains 4, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Builder.build (cognitive 38) src/java/org/apache/cassandra/schema/TableMetadata.java:1016— Builder.build has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (21 pts), loops 4 (8 pts), boolean chains 5, ternaries 1 (4 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CreateViewStatement.apply (cognitive 37) src/java/org/apache/cassandra/cql3/statements/schema/CreateViewStatement.java:140— CreateViewStatement.apply has cognitive complexity 37 (threshold 15). Drivers by points: if/else 31 (33 pts), boolean chains 4 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
StoreParticipantsSerializer.serializedSize (cognitive 37) src/java/org/apache/cassandra/service/accord/serializers/CommandSerializers.java:440— StoreParticipantsSerializer.serializedSize has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (26 pts), boolean chains 8, ternaries 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AccordService.localStartup (cognitive 37) src/java/org/apache/cassandra/service/accord/AccordService.java:570— AccordService.localStartup has cognitive complexity 37 (threshold 15). Drivers by points: if/else 17 (28 pts), match/switch 2 (5 pts), loops 1 (2 pts), boolean chains 1, ternaries 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Paxos.begin (cognitive 37) src/java/org/apache/cassandra/service/paxos/Paxos.java:1039— Paxos.begin has cognitive complexity 37 (threshold 15). Drivers by points: if/else 7 (17 pts), ternaries 2 (8 pts), match/switch 2 (5 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReadCallback.awaitResults (cognitive 37) src/java/org/apache/cassandra/service/reads/ReadCallback.java:140— ReadCallback.awaitResults has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (17 pts), ternaries 7 (15 pts), boolean chains 4, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AbstractMutationVerbHandler.checkSchemaVersion (cognitive 37) src/java/org/apache/cassandra/db/AbstractMutationVerbHandler.java:122— AbstractMutationVerbHandler.checkSchemaVersion has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (28 pts), loops 2 (6 pts), boolean chains 3 (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Expression.isSatisfiedBy (cognitive 37) src/java/org/apache/cassandra/index/sasi/plan/Expression.java:207— Expression.isSatisfiedBy has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (29 pts), boolean chains 7, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LocalLog.processPendingInternal (cognitive 37) src/java/org/apache/cassandra/tcm/log/LocalLog.java:508— LocalLog.processPendingInternal has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (20 pts), error handling 3 (9 pts), boolean chains 7, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BTreeRemoval.removeFromLeaf (cognitive 37) src/java/org/apache/cassandra/utils/btree/BTreeRemoval.java:76— BTreeRemoval.removeFromLeaf has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (22 pts), ternaries 3 (9 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AddColumns.addColumn (cognitive 36) src/java/org/apache/cassandra/cql3/statements/schema/AlterTableStatement.java:341— AddColumns.addColumn has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (23 pts), ternaries 3 (5 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CreateAggregateStatement.apply (cognitive 36) src/java/org/apache/cassandra/cql3/statements/schema/CreateAggregateStatement.java:103— CreateAggregateStatement.apply has cognitive complexity 36 (threshold 15). Drivers by points: if/else 19 (28 pts), boolean chains 5, error handling 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CreateTableStatement.builder (cognitive 36) src/java/org/apache/cassandra/cql3/statements/schema/CreateTableStatement.java:265— CreateTableStatement.builder has cognitive complexity 36 (threshold 15). Drivers by points: if/else 24 (30 pts), loops 3, boolean chains 2, ternaries 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Exists.applies (cognitive 36) src/java/org/apache/cassandra/service/accord/txn/TxnCondition.java:315— Exists.applies has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (30 pts), match/switch 1 (5 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SSTableMetadataViewer.printScannedOverview (cognitive 36) src/java/org/apache/cassandra/tools/SSTableMetadataViewer.java:173— SSTableMetadataViewer.printScannedOverview has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 3 (7 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StandaloneSplitter.main (cognitive 36) src/java/org/apache/cassandra/tools/StandaloneSplitter.java:65— StandaloneSplitter.main has cognitive complexity 36 (threshold 15). Drivers by points: if/else 16 (27 pts), error handling 3 (5 pts), loops 3, boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Client.parseLine (cognitive 36) src/java/org/apache/cassandra/transport/Client.java:112— Client.parseLine has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (21 pts), error handling 4 (10 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClusteringElements.compareTo (cognitive 35) src/java/org/apache/cassandra/cql3/restrictions/ClusteringElements.java:358— ClusteringElements.compareTo has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 10 (24 pts), if/else 6 (10 pts), loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
1.hasNext (cognitive 35) src/java/org/apache/cassandra/service/reads/ReplicaFilteringProtection.java:400— 1.hasNext has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (25 pts), loops 2 (8 pts), boolean chains 2 (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
CommitLogReader.readSection (cognitive 35) src/java/org/apache/cassandra/db/commitlog/CommitLogReader.java:297— CommitLogReader.readSection has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (30 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IndexSummaryRedistribution.adjustSamplingLevels (cognitive 35) src/java/org/apache/cassandra/io/sstable/indexsummary/IndexSummaryRedistribution.java:162— IndexSummaryRedistribution.adjustSamplingLevels has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (26 pts), loops 4 (5 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CQLMessageHandler.processFirstFrameOfLargeMessage (cognitive 35) src/java/org/apache/cassandra/transport/CQLMessageHandler.java:524— CQLMessageHandler.processFirstFrameOfLargeMessage has cognitive complexity 35 (threshold 15). Drivers by points: if/else 17 (31 pts), boolean chains 3, error handling 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IntervalBTree.accumulate (cognitive 35) src/java/org/apache/cassandra/utils/btree/IntervalBTree.java:105— IntervalBTree.accumulate has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (24 pts), boolean chains 4, loops 2 (4 pts), ternaries 1 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IntervalTree.buildUpdatedArrayForUpdate (cognitive 35) src/java/org/apache/cassandra/utils/IntervalTree.java:264— IntervalTree.buildUpdatedArrayForUpdate has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 6 (12 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JavaBasedUDFunction.<init> (cognitive 34) src/java/org/apache/cassandra/cql3/functions/JavaBasedUDFunction.java:211— JavaBasedUDFunction.<init> has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (21 pts), loops 4 (5 pts), error handling 3, match/switch 1 (3 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AccordCacheEntryQueue.validate (cognitive 34) src/java/org/apache/cassandra/service/accord/execution/AccordCacheEntryQueue.java:447— AccordCacheEntryQueue.validate has cognitive complexity 34 (threshold 15). Drivers by points: loops 12 (15 pts), if/else 7 (8 pts), boolean chains 6, ternaries 2 (5 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Rebuild.rebuild (cognitive 34) src/java/org/apache/cassandra/service/Rebuild.java:75— Rebuild.rebuild has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (18 pts), error handling 3 (6 pts), loops 2 (5 pts), ternaries 3, boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CassandraPasswordConfiguration.validateParameters (cognitive 34) src/java/org/apache/cassandra/db/guardrails/CassandraPasswordConfiguration.java:163— CassandraPasswordConfiguration.validateParameters has cognitive complexity 34 (threshold 15). Drivers by points: if/else 30 (32 pts), loops 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
AbstractRow.toString (cognitive 34) src/java/org/apache/cassandra/db/rows/AbstractRow.java:121— AbstractRow.toString has cognitive complexity 34 (threshold 15). Drivers by points: if/else 17 (29 pts), loops 2 (5 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FilterTree.localSatisfiedBy (cognitive 34) src/java/org/apache/cassandra/index/sai/plan/FilterTree.java:90— FilterTree.localSatisfiedBy has cognitive complexity 34 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 3 (7 pts), boolean chains 6, ternaries 3 (5 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BigSSTableReaderLoadingBuilder.openComponents (cognitive 34) src/java/org/apache/cassandra/io/sstable/format/big/BigSSTableReaderLoadingBuilder.java:72— BigSSTableReaderLoadingBuilder.openComponents has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 8, ternaries 2 (3 pts), error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StatsMetadataSerializer.serialize (cognitive 34) src/java/org/apache/cassandra/io/sstable/metadata/StatsMetadata.java:400— StatsMetadataSerializer.serialize has cognitive complexity 34 (threshold 15). Drivers by points: if/else 19 (25 pts), loops 2 (4 pts), ternaries 2 (4 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StandaloneScrubber.main (cognitive 34) src/java/org/apache/cassandra/tools/StandaloneScrubber.java:84— StandaloneScrubber.main has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (20 pts), error handling 4 (9 pts), loops 4 (5 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SignalLock.awaitAsyncOrLock (cognitive 34) src/java/org/apache/cassandra/utils/concurrent/SignalLock.java:209— SignalLock.awaitAsyncOrLock has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 3 (5 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ManyToOne.sinkInBinaryHeap (cognitive 34) src/java/org/apache/cassandra/utils/MergeIterator.java:336— ManyToOne.sinkInBinaryHeap has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (33 pts), loops 1 (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
heatmap.compute_repo_heat (cognitive 34) .claude/skills/heatmap/heatmap.py:327— heatmap.compute_repo_heat has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (18 pts), ternaries 4 (9 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CreateIndexStatement.validateIndexTarget (cognitive 33) src/java/org/apache/cassandra/cql3/statements/schema/CreateIndexStatement.java:250— CreateIndexStatement.validateIndexTarget has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17 (23 pts), boolean chains 10 (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.
AbstractSegmentCompactor.compact (cognitive 33) src/java/org/apache/cassandra/service/accord/journal/AbstractSegmentCompactor.java:101— AbstractSegmentCompactor.compact has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 3 (4 pts), boolean chains 3, error handling 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StorageProxy.dispatchReadWithRetryOnDifferentSystem (cognitive 33) src/java/org/apache/cassandra/service/StorageProxy.java:2445— StorageProxy.dispatchReadWithRetryOnDifferentSystem has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (13 pts), error handling 5 (10 pts), boolean chains 4, loops 2 (4 pts), ternaries 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StorageService.getEffectiveOwnership (cognitive 33) src/java/org/apache/cassandra/service/StorageService.java:4254— StorageService.getEffectiveOwnership has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 5 (10 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Builder.build (cognitive 33) src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java:693— Builder.build has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17 (23 pts), boolean chains 5, ternaries 2 (3 pts), error handling 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnbufferedDataOutputStreamPlus.writeUTF (cognitive 33) src/java/org/apache/cassandra/io/util/UnbufferedDataOutputStreamPlus.java:252— UnbufferedDataOutputStreamPlus.writeUTF has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 5 (11 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProgressBarrier.await (cognitive 33) src/java/org/apache/cassandra/tcm/sequences/ProgressBarrier.java:157— ProgressBarrier.await has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 7 (11 pts), match/switch 1 (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.
Startup.initializeCMSLookup (cognitive 33) src/java/org/apache/cassandra/tcm/Startup.java:286— Startup.initializeCMSLookup has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (26 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
run_ci.jenkins_service_url (cognitive 33) .build/run-ci.d/run_ci.py:727— run_ci.jenkins_service_url has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (15 pts), ternaries 6 (8 pts), boolean chains 5, loops 3 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
run_ci.count_test_splits (cognitive 33) .build/run-ci.d/run_ci.py:894— run_ci.count_test_splits has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 5, ternaries 2 (5 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FunctionResolver.pickBestMatch (cognitive 32) src/java/org/apache/cassandra/cql3/functions/FunctionResolver.java:129— FunctionResolver.pickBestMatch has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 2 (5 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
AccordResult.tryFailure (cognitive 32) src/java/org/apache/cassandra/service/accord/AccordResult.java:126— AccordResult.tryFailure has cognitive complexity 32 (threshold 15). Drivers by points: if/else 19 (28 pts), boolean chains 4 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConsensusRequestRouter.splitReadsIntoAccordAndNormal (cognitive 32) src/java/org/apache/cassandra/service/consensus/migration/ConsensusRequestRouter.java:840— ConsensusRequestRouter.splitReadsIntoAccordAndNormal has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (21 pts), ternaries 3 (5 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Paxos.cas (cognitive 32) src/java/org/apache/cassandra/service/paxos/Paxos.java:708— Paxos.cas has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (26 pts), match/switch 2 (5 pts), loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RoleOptions.validate (cognitive 32) src/java/org/apache/cassandra/auth/RoleOptions.java:135— RoleOptions.validate has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (26 pts), error handling 1 (3 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LogReplicaSet.readRecords (cognitive 32) src/java/org/apache/cassandra/db/lifecycle/LogReplicaSet.java:119— LogReplicaSet.readRecords has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (28 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TableViews.generateViewUpdates (cognitive 32) src/java/org/apache/cassandra/db/view/TableViews.java:219— TableViews.generateViewUpdates has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (25 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SinglePartitionReadCommand.queryMemtableAndSSTablesInTimestampOrder (cognitive 32) src/java/org/apache/cassandra/db/SinglePartitionReadCommand.java:1029— SinglePartitionReadCommand.queryMemtableAndSSTablesInTimestampOrder has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (19 pts), ternaries 3 (8 pts), boolean chains 3, loops 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MemtableParams.expandDefinitions (cognitive 32) src/java/org/apache/cassandra/schema/MemtableParams.java:139— MemtableParams.expandDefinitions has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 6 (9 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReconfigureCMS.execute (cognitive 32) src/java/org/apache/cassandra/tools/nodetool/CMSAdmin.java:138— ReconfigureCMS.execute has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (22 pts), error handling 2 (6 pts), loops 2 (4 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NetStats.execute (cognitive 32) src/java/org/apache/cassandra/tools/nodetool/NetStats.java:49— NetStats.execute has cognitive complexity 32 (threshold 15). Drivers by points: loops 11 (21 pts), if/else 5 (11 pts) (nesting depth added 16). 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.
Message.encode (cognitive 32) src/java/org/apache/cassandra/transport/Message.java:339— Message.encode has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (29 pts), error handling 2, ternaries 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BTreePrinter.printNode (cognitive 32) src/java/org/apache/cassandra/utils/btree/BTreePrinter.java:72— BTreePrinter.printNode has cognitive complexity 32 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 4 (9 pts), ternaries 3 (9 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AbstractDepsSerializer.serializePackedXtoY (cognitive 31) src/java/org/apache/cassandra/service/accord/serializers/DepsSerializers.java:110— AbstractDepsSerializer.serializePackedXtoY has cognitive complexity 31 (threshold 15). Drivers by points: loops 4 (16 pts), if/else 7 (10 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 16). 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.
TxnRead.merge (cognitive 31) src/java/org/apache/cassandra/service/accord/txn/TxnRead.java:298— TxnRead.merge has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 2 (4 pts), boolean chains 2, match/switch 1 (nesting depth added 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
StorageService.drain (cognitive 31) src/java/org/apache/cassandra/service/StorageService.java:3883— StorageService.drain has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (15 pts), error handling 6 (8 pts), loops 6 (8 pts) (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SinglePartitionReadCommand.reduceFilter (cognitive 31) src/java/org/apache/cassandra/db/SinglePartitionReadCommand.java:1158— SinglePartitionReadCommand.reduceFilter has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 8, loops 2 (3 pts), ternaries 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.
Gossiper.applyStateLocally (cognitive 31) src/java/org/apache/cassandra/gms/Gossiper.java:1473— Gossiper.applyStateLocally has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (29 pts), boolean chains 1, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CassandraVersion.compareIdentifiers (cognitive 31) src/java/org/apache/cassandra/utils/CassandraVersion.java:202— CassandraVersion.compareIdentifiers has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (21 pts), ternaries 3 (6 pts), boolean chains 3, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IntervalTree.replace (cognitive 31) src/java/org/apache/cassandra/utils/IntervalTree.java:563— IntervalTree.replace has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 3 (7 pts), boolean chains 3 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CodecRegistry.maybeCreateCodec (cognitive 30) src/java/org/apache/cassandra/cql3/functions/types/CodecRegistry.java:747— CodecRegistry.maybeCreateCodec has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 17, if/else 10 (13 pts) (nesting depth added 3). 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.
ClusteringComparator.compare (cognitive 30) src/java/org/apache/cassandra/db/ClusteringComparator.java:185— ClusteringComparator.compare has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (25 pts), ternaries 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReadCommandVerbHandler.checkTokenOwnership (cognitive 30) src/java/org/apache/cassandra/db/ReadCommandVerbHandler.java:170— ReadCommandVerbHandler.checkTokenOwnership has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (17 pts), ternaries 4 (12 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BlockBalancedTreeWriter.recursePackIndex (cognitive 30) src/java/org/apache/cassandra/index/sai/disk/v1/bbtree/BlockBalancedTreeWriter.java:304— BlockBalancedTreeWriter.recursePackIndex has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (26 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EventLoopDelivery.doRun (cognitive 30) src/java/org/apache/cassandra/net/OutboundConnection.java:774— EventLoopDelivery.doRun has cognitive complexity 30 (threshold 15). Drivers by points: if/else 18 (24 pts), error handling 2 (3 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Status.execute (cognitive 30) src/java/org/apache/cassandra/tools/nodetool/Status.java:84— Status.execute has cognitive complexity 30 (threshold 15). Drivers by points: loops 7 (13 pts), if/else 7 (9 pts), error handling 3 (4 pts), boolean chains 2, ternaries 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Updater.updateRecursive (cognitive 30) src/java/org/apache/cassandra/utils/btree/BTree.java:3804— Updater.updateRecursive has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (23 pts), ternaries 2 (5 pts), boolean chains 1, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ByteBufferUtil.objectToBytes (cognitive 30) src/java/org/apache/cassandra/utils/ByteBufferUtil.java:582— ByteBufferUtil.objectToBytes has cognitive complexity 30 (threshold 15). Drivers by points: if/else 22 (26 pts), loops 2 (4 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
matrix.run_one (cognitive 30) formalise/accord/execution/tla/matrix.py:374— matrix.run_one has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (19 pts), error handling 3 (6 pts), loops 3, ternaries 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ParseUtils.parseTime (cognitive 29) src/java/org/apache/cassandra/cql3/functions/types/ParseUtils.java:387— ParseUtils.parseTime has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 6 (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.
UDAggregate.compare (cognitive 29) src/java/org/apache/cassandra/cql3/functions/UDAggregate.java:283— UDAggregate.compare has cognitive complexity 29 (threshold 15). Drivers by points: if/else 17 (24 pts), boolean chains 3, loops 1, ternaries 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.
StatementRestrictions.processClusteringColumnsRestrictions (cognitive 29) src/java/org/apache/cassandra/cql3/restrictions/StatementRestrictions.java:662— StatementRestrictions.processClusteringColumnsRestrictions has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 8, loops 1 (4 pts) (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
TakeSnapshotTask.parseEntitiesForSnapshot (cognitive 29) src/java/org/apache/cassandra/service/snapshot/TakeSnapshotTask.java:195— TakeSnapshotTask.parseEntitiesForSnapshot has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SSTablesGlobalTracker.handleSSTablesChange (cognitive 29) src/java/org/apache/cassandra/service/SSTablesGlobalTracker.java:147— SSTablesGlobalTracker.handleSSTablesChange has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 5, loops 3 (4 pts), ternaries 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StorageProxy.dispatchMutationsWithRetryOnDifferentSystem (cognitive 29) src/java/org/apache/cassandra/service/StorageProxy.java:1269— StorageProxy.dispatchMutationsWithRetryOnDifferentSystem has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (13 pts), error handling 5 (10 pts), boolean chains 3, ternaries 1 (2 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WriteThresholds.checkWriteThresholds (cognitive 29) src/java/org/apache/cassandra/db/WriteThresholds.java:54— WriteThresholds.checkWriteThresholds has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (24 pts), boolean chains 3, loops 1, ternaries 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Range.intersectionAndRemainder (cognitive 29) src/java/org/apache/cassandra/dht/Range.java:818— Range.intersectionAndRemainder has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 11, ternaries 4 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
StatsMetadataSerializer.deserialize (cognitive 29) src/java/org/apache/cassandra/io/sstable/metadata/StatsMetadata.java:523— StatsMetadataSerializer.deserialize has cognitive complexity 29 (threshold 15). Drivers by points: if/else 18 (21 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
TimeSerializer.parseTimeStrictly (cognitive 29) src/java/org/apache/cassandra/serializers/TimeSerializer.java:137— TimeSerializer.parseTimeStrictly has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 6 (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.
PaxosBackedProcessor.fetchLogAndWait (cognitive 29) src/java/org/apache/cassandra/tcm/PaxosBackedProcessor.java:79— PaxosBackedProcessor.fetchLogAndWait has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 4 (6 pts), boolean chains 4, error handling 1 (2 pts), ternaries 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.
SignalLock.releaseAndSignalExclusive (cognitive 29) src/java/org/apache/cassandra/utils/concurrent/SignalLock.java:362— SignalLock.releaseAndSignalExclusive has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (23 pts), boolean chains 5, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExportTask.get_ranges (cognitive 29) pylib/cqlshlib/copyutil.py:677— ExportTask.get_ranges has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 7, ternaries 1 (3 pts), loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ParsingRuleSet.read_rule_tokens_until (cognitive 29) REDACTED:415— ParsingRuleSet.read_rule_tokens_until has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (26 pts), boolean chains 2, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CopyTableStatement.apply (cognitive 28) src/java/org/apache/cassandra/cql3/statements/schema/CopyTableStatement.java:122— CopyTableStatement.apply has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16 (23 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CreateIndexStatement.apply (cognitive 28) src/java/org/apache/cassandra/cql3/statements/schema/CreateIndexStatement.java:145— CreateIndexStatement.apply has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (19 pts), ternaries 4, boolean chains 3, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
ModificationStatement.<init> (cognitive 28) src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java:189— ModificationStatement.<init> has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 4 (8 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SafeTask.submitExclusiveMayThrow (cognitive 28) src/java/org/apache/cassandra/service/accord/execution/SafeTask.java:692— SafeTask.submitExclusiveMayThrow has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 4, match/switch 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StoreParticipantsSerializer.skip (cognitive 28) src/java/org/apache/cassandra/service/accord/serializers/CommandSerializers.java:385— StoreParticipantsSerializer.skip has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (26 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OrderedKeys.flush (cognitive 28) src/java/org/apache/cassandra/service/accord/OrderedKeys.java:77— OrderedKeys.flush has cognitive complexity 28 (threshold 15). Drivers by points: if/else 17 (25 pts), loops 2, boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AbstractWriteResponseHandler.get (cognitive 28) src/java/org/apache/cassandra/service/AbstractWriteResponseHandler.java:130— AbstractWriteResponseHandler.get has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 1 (2 pts), boolean chains 1, error handling 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CompactionController.getFullyExpiredSSTables (cognitive 28) src/java/org/apache/cassandra/db/compaction/CompactionController.java:160— CompactionController.getFullyExpiredSSTables has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 5 (6 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClientDriverVersionGuardrail.guard (cognitive 28) src/java/org/apache/cassandra/db/guardrails/ClientDriverVersionGuardrail.java:60— ClientDriverVersionGuardrail.guard has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 11, ternaries 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
RemoteToLocalVirtualTable.apply (cognitive 28) src/java/org/apache/cassandra/db/virtual/RemoteToLocalVirtualTable.java:496— RemoteToLocalVirtualTable.apply has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 5 (9 pts), boolean chains 2, ternaries 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.
RemoteToLocalVirtualTable.collect (cognitive 28) src/java/org/apache/cassandra/db/virtual/RemoteToLocalVirtualTable.java:142— RemoteToLocalVirtualTable.collect has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 4 (7 pts), ternaries 1 (4 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Operation.localSatisfiedBy (cognitive 28) src/java/org/apache/cassandra/index/sasi/plan/Operation.java:205— Operation.localSatisfiedBy has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 6, loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ResultIterator.computeNext (cognitive 28) src/java/org/apache/cassandra/index/sasi/plan/SASIIndexSearcher.java:109— ResultIterator.computeNext has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
1.runMayThrow (cognitive 28) src/java/org/apache/cassandra/repair/RepairCoordinator.java:563— 1.runMayThrow has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (16 pts), ternaries 3 (9 pts), loops 2 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GuardrailsConfigCommand.display (cognitive 28) src/java/org/apache/cassandra/tools/nodetool/GuardrailsConfigCommand.java:389— GuardrailsConfigCommand.display has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (17 pts), loops 4 (9 pts), boolean chains 1, error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Relevel.relevel (cognitive 28) src/java/org/apache/cassandra/tools/SSTableOfflineRelevel.java:173— Relevel.relevel has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 7 (13 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JVMStabilityInspector.inspectThrowable (cognitive 28) src/java/org/apache/cassandra/utils/JVMStabilityInspector.java:109— JVMStabilityInspector.inspectThrowable has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 5, error handling 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ant-log-summary.main (cognitive 28) .build/sh/ant-log-summary.py:99— ant-log-summary.main has cognitive complexity 28 (threshold 15). Drivers by points: loops 5 (14 pts), if/else 8 (10 pts), boolean chains 2, error handling 2 (nesting depth added 11). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
ModificationStatement.addUpdates (cognitive 27) src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java:1139— ModificationStatement.addUpdates has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 4 (12 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DebugTask.onCompleted (cognitive 27) src/java/org/apache/cassandra/service/accord/debug/DebugExecution.java:278— DebugTask.onCompleted has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (21 pts), boolean chains 6 (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
TransactionalMode.readCLForMode (cognitive 27) src/java/org/apache/cassandra/service/consensus/TransactionalMode.java:217— TransactionalMode.readCLForMode has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 2 (5 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RetryStrategy.parse (cognitive 27) src/java/org/apache/cassandra/service/RetryStrategy.java:264— RetryStrategy.parse has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 5, match/switch 1 (2 pts), loops 1, ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReverseValueIterator.advanceNode (cognitive 27) src/java/org/apache/cassandra/io/tries/ReverseValueIterator.java:162— ReverseValueIterator.advanceNode has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (26 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Sink.run (cognitive 27) src/java/org/apache/cassandra/net/ArtificialLatency.java:225— Sink.run has cognitive complexity 27 (threshold 15). Drivers by points: if/else 3 (10 pts), ternaries 2 (8 pts), loops 3 (7 pts), boolean chains 1, match/switch 1 (nesting depth added 17). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
RepairOption.parse (cognitive 27) src/java/org/apache/cassandra/repair/messages/RepairOption.java:193— RepairOption.parse has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (13 pts), loops 3 (6 pts), boolean chains 5, error handling 1 (2 pts), ternaries 1 (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AlterSchema.execute (cognitive 27) src/java/org/apache/cassandra/tcm/transformations/AlterSchema.java:108— AlterSchema.execute has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 6 (10 pts), error handling 5 (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.
Diff.diff (cognitive 27) src/java/org/apache/cassandra/tools/JMXTool.java:239— Diff.diff has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 7, loops 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LegacyDispatchHandler.checkLimits (cognitive 27) src/java/org/apache/cassandra/transport/PreV5Handlers.java:162— LegacyDispatchHandler.checkLimits has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 4 (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.
TreeCursor.seekTo (cognitive 27) src/java/org/apache/cassandra/utils/btree/TreeCursor.java:100— TreeCursor.seekTo has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 3 (8 pts), boolean chains 3, loops 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IntervalNode.replace (cognitive 27) src/java/org/apache/cassandra/utils/IntervalTree.java:791— IntervalNode.replace has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 3 (7 pts), boolean chains 2, ternaries 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LongTimSort.gallopLeft (cognitive 27) src/java/org/apache/cassandra/utils/LongTimSort.java:470— LongTimSort.gallopLeft has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 3 (5 pts), boolean chains 4 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (LongTimSort.gallopRight) 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.
LongTimSort.gallopRight (cognitive 27) src/java/org/apache/cassandra/utils/LongTimSort.java:535— LongTimSort.gallopRight has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 3 (5 pts), boolean chains 4 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (LongTimSort.gallopLeft) 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.
cqlshmain.read_options (cognitive 27) pylib/cqlshlib/cqlshmain.py:2021— cqlshmain.read_options has cognitive complexity 27 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 4, error handling 3 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
BatchStatement.makeCasRequest (cognitive 26) src/java/org/apache/cassandra/cql3/statements/BatchStatement.java:608— BatchStatement.makeCasRequest has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 2 (4 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TransactionStatement.execute (cognitive 26) src/java/org/apache/cassandra/cql3/statements/TransactionStatement.java:669— TransactionStatement.execute has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 4 (8 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AccordCacheEntry.remove (cognitive 26) src/java/org/apache/cassandra/service/accord/execution/AccordCacheEntry.java:299— AccordCacheEntry.remove has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 6 (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.
ReadDataSerializer.serialize (cognitive 26) src/java/org/apache/cassandra/service/accord/serializers/ReadDataSerializer.java:80— ReadDataSerializer.serialize has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 9 (14 pts), if/else 7 (11 pts), match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (ReadDataSerializer.serializedSize) 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.
ReadDataSerializer.serializedSize (cognitive 26) src/java/org/apache/cassandra/service/accord/serializers/ReadDataSerializer.java:237— ReadDataSerializer.serializedSize has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 9 (14 pts), if/else 7 (11 pts), match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (ReadDataSerializer.serialize) 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.
ParameterizedFastPathStrategy.fromMap (cognitive 26) src/java/org/apache/cassandra/service/accord/topology/ParameterizedFastPathStrategy.java:241— ParameterizedFastPathStrategy.fromMap has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 1 (2 pts), boolean chains 1, error handling 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TxnUpdate.completeUpdatesForKey (cognitive 26) src/java/org/apache/cassandra/service/accord/txn/TxnUpdate.java:976— TxnUpdate.completeUpdatesForKey has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (17 pts), loops 3 (8 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StorageService.initServer (cognitive 26) src/java/org/apache/cassandra/service/StorageService.java:731— StorageService.initServer has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 3, error handling 3 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
DatabaseDescriptor.applyAddressConfig (cognitive 26) src/java/org/apache/cassandra/config/DatabaseDescriptor.java:1525— DatabaseDescriptor.applyAddressConfig has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (16 pts), error handling 4 (8 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
GarbageSkippingUnfilteredRowIterator.hasNext (cognitive 26) src/java/org/apache/cassandra/db/compaction/CompactionIterator.java:613— GarbageSkippingUnfilteredRowIterator.hasNext has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 2, ternaries 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TimeWindowCompactionStrategy.newestBucket (cognitive 26) src/java/org/apache/cassandra/db/compaction/TimeWindowCompactionStrategy.java:308— TimeWindowCompactionStrategy.newestBucket has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 2 (7 pts), boolean chains 2, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ViewUpdateGenerator.computeLivenessInfoForEntry (cognitive 26) src/java/org/apache/cassandra/db/view/ViewUpdateGenerator.java:454— ViewUpdateGenerator.computeLivenessInfoForEntry has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NoReplicationTokenAllocator.addUnit (cognitive 26) src/java/org/apache/cassandra/dht/tokenallocator/NoReplicationTokenAllocator.java:115— NoReplicationTokenAllocator.addUnit has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 4 (6 pts), ternaries 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NormalizedRanges.intersection (cognitive 26) src/java/org/apache/cassandra/dht/NormalizedRanges.java:232— NormalizedRanges.intersection has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BounceIntersectionIterator.computeNext (cognitive 26) src/java/org/apache/cassandra/index/sasi/utils/RangeIntersectionIterator.java:127— BounceIntersectionIterator.computeNext has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 2 (3 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReverseReader.loadFromDisk (cognitive 26) src/java/org/apache/cassandra/io/sstable/format/big/SSTableReversedIterator.java:191— ReverseReader.loadFromDisk has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 4, ternaries 2 (4 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReplicaPlans.assureSufficientLiveReplicas (cognitive 26) src/java/org/apache/cassandra/locator/ReplicaPlans.java:148— ReplicaPlans.assureSufficientLiveReplicas has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 1 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
RepairJob.runRepair (cognitive 26) src/java/org/apache/cassandra/repair/RepairJob.java:159— RepairJob.runRepair has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 6, ternaries 2 (3 pts), loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Builder.mergeAll (cognitive 26) src/java/org/apache/cassandra/utils/btree/BTree.java:1709— Builder.mergeAll has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 3 (8 pts), boolean chains 2, loops 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FBUtilities.waitOnFirstFuture (cognitive 26) src/java/org/apache/cassandra/utils/FBUtilities.java:609— FBUtilities.waitOnFirstFuture has cognitive complexity 26 (threshold 15). Drivers by points: error handling 3 (12 pts), if/else 3 (10 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IntervalNode.<init> (cognitive 26) src/java/org/apache/cassandra/utils/IntervalTree.java:645— IntervalNode.<init> has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (15 pts), loops 4 (5 pts), boolean chains 4, ternaries 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
FeedingProcess.inner_run (cognitive 26) pylib/cqlshlib/copyutil.py:1326— FeedingProcess.inner_run has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (13 pts), ternaries 2 (6 pts), error handling 2 (4 pts), loops 2 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MergedRestriction.validate (cognitive 25) src/java/org/apache/cassandra/cql3/restrictions/MergedRestriction.java:124— MergedRestriction.validate has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 7, ternaries 2 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BatchStatement.getMutations (cognitive 25) src/java/org/apache/cassandra/cql3/statements/BatchStatement.java:359— BatchStatement.getMutations has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 3 (6 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Codec.decode (cognitive 25) src/java/org/apache/cassandra/cql3/QueryOptions.java:731— Codec.decode has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 8 (15 pts), if/else 6 (10 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QueryProcessor.prepare (cognitive 25) src/java/org/apache/cassandra/cql3/QueryProcessor.java:781— QueryProcessor.prepare has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DebugTxnGraph.visitLatestCommitted (cognitive 25) src/java/org/apache/cassandra/service/accord/debug/DebugTxnGraph.java:316— DebugTxnGraph.visitLatestCommitted has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 2 (5 pts), boolean chains 4, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BTreeReducingRangeMapSerializer.serialize (cognitive 25) src/java/org/apache/cassandra/service/accord/serializers/CommandStoreSerializers.java:379— BTreeReducingRangeMapSerializer.serialize has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PendingCleanup.cleanup (cognitive 25) src/java/org/apache/cassandra/service/paxos/cleanup/PaxosRepairState.java:138— PendingCleanup.cleanup has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 5 (7 pts), error handling 4 (5 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StorageProxy.mutateMV (cognitive 25) src/java/org/apache/cassandra/service/StorageProxy.java:1113— StorageProxy.mutateMV has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (17 pts), error handling 1 (4 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
YamlConfigurationLoader.maybeAddEnvironmentVariables (cognitive 25) src/java/org/apache/cassandra/config/YamlConfigurationLoader.java:221— YamlConfigurationLoader.maybeAddEnvironmentVariables has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (22 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: one other method here (YamlConfigurationLoader.maybeAddSystemProperties) 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.
YamlConfigurationLoader.maybeAddSystemProperties (cognitive 25) src/java/org/apache/cassandra/config/YamlConfigurationLoader.java:186— YamlConfigurationLoader.maybeAddSystemProperties has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (22 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: one other method here (YamlConfigurationLoader.maybeAddEnvironmentVariables) 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.
RowAndDeletionMergeIterator.computeNextInternal (cognitive 25) src/java/org/apache/cassandra/db/rows/RowAndDeletionMergeIterator.java:77— RowAndDeletionMergeIterator.computeNextInternal has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (20 pts), ternaries 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ViewUpdateGenerator.updateAction (cognitive 25) src/java/org/apache/cassandra/db/view/ViewUpdateGenerator.java:172— ViewUpdateGenerator.updateAction has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 7 (14 pts), if/else 6 (8 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClusterMetadataDirectoryTable.directory (cognitive 25) src/java/org/apache/cassandra/db/virtual/ClusterMetadataDirectoryTable.java:105— ClusterMetadataDirectoryTable.directory has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 10 (20 pts), if/else 2 (4 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Expression.isSatisfiedBy (cognitive 25) src/java/org/apache/cassandra/index/sai/plan/Expression.java:272— Expression.isSatisfiedBy has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 6 (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.
QueryController.getIndexQueryResults (cognitive 25) src/java/org/apache/cassandra/index/sai/plan/QueryController.java:265— QueryController.getIndexQueryResults has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 3 (7 pts), error handling 1, ternaries 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AutoRepair.repair (cognitive 25) src/java/org/apache/cassandra/repair/autorepair/AutoRepair.java:163— AutoRepair.repair has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (14 pts), error handling 2 (4 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GossipCMSListener.onJoin (cognitive 25) src/java/org/apache/cassandra/tcm/migration/GossipCMSListener.java:46— GossipCMSListener.onJoin has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 2, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Visitor.traverse (cognitive 25) src/java/org/apache/cassandra/utils/concurrent/Ref.java:635— Visitor.traverse has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ImportTask.import_records (cognitive 25) pylib/cqlshlib/copyutil.py:1210— ImportTask.import_records has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 3 (4 pts), boolean chains 3, ternaries 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cqlprotodoc.parse_spec_file (cognitive 25) doc/scripts/cqlprotodoc.py:44— cqlprotodoc.parse_spec_file has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 3, loops 3, ternaries 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.
UDFunction.secureResource (cognitive 24) src/java/org/apache/cassandra/cql3/functions/UDFunction.java:177— UDFunction.secureResource has cognitive complexity 24 (threshold 15). Drivers by points: if/else 4 (14 pts), loops 4 (9 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TableAttributes.build (cognitive 24) src/java/org/apache/cassandra/cql3/statements/schema/TableAttributes.java:126— TableAttributes.build has cognitive complexity 24 (threshold 15). Drivers by points: if/else 22, error handling 1 (2 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SafeTask.onLoadOneExclusive (cognitive 24) src/java/org/apache/cassandra/service/accord/execution/SafeTask.java:1230— SafeTask.onLoadOneExclusive has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (21 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PartitionMergeListerner.onMergedRows (cognitive 24) src/java/org/apache/cassandra/service/reads/ReplicaFilteringProtection.java:224— PartitionMergeListerner.onMergedRows has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 6 (8 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CompactionTask.runMayThrow (cognitive 24) src/java/org/apache/cassandra/db/compaction/CompactionTask.java:181— CompactionTask.runMayThrow has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (14 pts), loops 4, ternaries 2 (3 pts), boolean chains 2, error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
LeveledManifest.getCompactionCandidates (cognitive 24) src/java/org/apache/cassandra/db/compaction/LeveledManifest.java:201— LeveledManifest.getCompactionCandidates has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TrieMemtable.getFlushSet (cognitive 24) src/java/org/apache/cassandra/db/memtable/TrieMemtable.java:367— TrieMemtable.getFlushSet has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 9, loops 2, ternaries 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ColumnDataReducer.getReduced (cognitive 24) src/java/org/apache/cassandra/db/rows/Row.java:912— ColumnDataReducer.getReduced has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (6 pts), ternaries 1 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseRows.hasNext (cognitive 24) src/java/org/apache/cassandra/db/transform/BaseRows.java:129— BaseRows.hasNext has cognitive complexity 24 (threshold 15). Drivers by points: loops 4 (11 pts), if/else 4 (9 pts), boolean chains 4 (nesting depth added 12). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
Gossiper.doStatusCheck (cognitive 24) src/java/org/apache/cassandra/gms/Gossiper.java:963— Gossiper.doStatusCheck has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Operation.buildIndexedExpression (cognitive 24) src/java/org/apache/cassandra/index/sai/plan/Operation.java:187— Operation.buildIndexedExpression has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 2 (7 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OnDiskIndex.searchRange (cognitive 24) src/java/org/apache/cassandra/index/sasi/disk/OnDiskIndex.java:303— OnDiskIndex.searchRange has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 5 (8 pts), boolean chains 6, if/else 4 (5 pts), loops 4 (5 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReconfigureCMS.maybeReconfigureCMS (cognitive 24) src/java/org/apache/cassandra/tcm/sequences/ReconfigureCMS.java:252— ReconfigureCMS.maybeReconfigureCMS has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 2 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StandaloneUpgrader.main (cognitive 24) src/java/org/apache/cassandra/tools/StandaloneUpgrader.java:57— StandaloneUpgrader.main has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (17 pts), error handling 3 (5 pts), loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StartupMessage.execute (cognitive 24) src/java/org/apache/cassandra/transport/messages/StartupMessage.java:85— StartupMessage.execute has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (23 pts), error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FBUtilities.parseHumanReadable (cognitive 24) src/java/org/apache/cassandra/utils/FBUtilities.java:1111— FBUtilities.parseHumanReadable has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CqlParsingRuleSet.cql_complete_multiple (cognitive 24) pylib/cqlshlib/cqlhandling.py:302— CqlParsingRuleSet.cql_complete_multiple has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 3, error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
run_ci.main (cognitive 24) .build/run-ci.d/run_ci.py:1606— run_ci.main has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 10, ternaries 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SelectStatement.execute (cognitive 23) src/java/org/apache/cassandra/cql3/statements/SelectStatement.java:382— SelectStatement.execute has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 8, ternaries 1 (3 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SSLFactory.validateSslContext (cognitive 23) src/java/org/apache/cassandra/security/SSLFactory.java:360— SSLFactory.validateSslContext has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 6 (17 pts), if/else 2 (3 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
2.run (cognitive 23) src/java/org/apache/cassandra/service/accord/execution/AbstractLockLoop.java:256— 2.run has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (15 pts), error handling 2 (5 pts), loops 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SafeTask.completeExclusiveMayThrow (cognitive 23) src/java/org/apache/cassandra/service/accord/execution/SafeTask.java:1744— SafeTask.completeExclusiveMayThrow has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 3 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
TxnData.merge (cognitive 23) src/java/org/apache/cassandra/service/accord/txn/TxnData.java:142— TxnData.merge has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 2, ternaries 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
TxnData.without (cognitive 23) src/java/org/apache/cassandra/service/accord/txn/TxnData.java:183— TxnData.without has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 2 (5 pts), ternaries 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CassandraStreamReceiver.finished (cognitive 23) src/java/org/apache/cassandra/db/streaming/CassandraStreamReceiver.java:220— CassandraStreamReceiver.finished has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 2 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
TableViews.readExistingRowsCommand (cognitive 23) src/java/org/apache/cassandra/db/view/TableViews.java:421— TableViews.readExistingRowsCommand has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 3 (7 pts), ternaries 4, boolean chains 2 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ShardEpochsTable.collect (cognitive 23) src/java/org/apache/cassandra/db/virtual/AccordDebugKeyspace.java:2353— ShardEpochsTable.collect has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 5 (7 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IndexTermType.supports (cognitive 23) src/java/org/apache/cassandra/index/sai/utils/IndexTermType.java:671— IndexTermType.supports has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 5 (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.
PrunableArrayQueue.prune (cognitive 23) src/java/org/apache/cassandra/net/PrunableArrayQueue.java:109— PrunableArrayQueue.prune has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (13 pts), error handling 3 (9 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RepairJob.createOptimisedSyncingSyncTasks (cognitive 23) src/java/org/apache/cassandra/repair/RepairJob.java:496— RepairJob.createOptimisedSyncingSyncTasks has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (14 pts), ternaries 1 (5 pts), loops 2 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AbstractMapSerializer.getIndexesRangeFromSerialized (cognitive 23) src/java/org/apache/cassandra/serializers/AbstractMapSerializer.java:150— AbstractMapSerializer.getIndexesRangeFromSerialized has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 2, ternaries 2, error handling 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StreamDeserializingTask.run (cognitive 23) src/java/org/apache/cassandra/streaming/StreamDeserializingTask.java:56— StreamDeserializingTask.run has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (16 pts), error handling 2 (4 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Move.movementMap (cognitive 23) src/java/org/apache/cassandra/tcm/sequences/Move.java:460— Move.movementMap has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 6, loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClearSnapshot.execute (cognitive 23) src/java/org/apache/cassandra/tools/nodetool/ClearSnapshot.java:61— ClearSnapshot.execute has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15, boolean chains 5, error handling 2 (3 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Info.execute (cognitive 23) src/java/org/apache/cassandra/tools/nodetool/Info.java:44— Info.execute has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (15 pts), error handling 4, loops 1 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HashPassword.main (cognitive 23) src/java/org/apache/cassandra/tools/HashPassword.java:51— HashPassword.main has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (14 pts), error handling 2 (4 pts), loops 1 (3 pts), boolean chains 1, ternaries 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
BaseCommand.findTablePaths (cognitive 23) src/java/org/apache/cassandra/tools/OfflineClusterMetadataDump.java:317— BaseCommand.findTablePaths has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
1.encode (cognitive 23) src/java/org/apache/cassandra/transport/messages/ErrorMessage.java:224— 1.encode has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 3 (7 pts), loops 1 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (3504.encode) 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.
BTree.buildMaximallyDense (cognitive 23) src/java/org/apache/cassandra/utils/btree/BTree.java:231— BTree.buildMaximallyDense has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 4 (12 pts), if/else 5 (7 pts), loops 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IntervalBTree.accumulateMaxOnly (cognitive 23) src/java/org/apache/cassandra/utils/btree/IntervalBTree.java:178— IntervalBTree.accumulateMaxOnly has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExecutorUtils.awaitTerminationUntil (cognitive 23) src/java/org/apache/cassandra/utils/ExecutorUtils.java:173— ExecutorUtils.awaitTerminationUntil has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (17 pts), ternaries 1 (4 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IntervalNode.searchInternal (cognitive 23) src/java/org/apache/cassandra/utils/IntervalTree.java:750— IntervalNode.searchInternal has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
3504.encode (cognitive 23) src/java/org/apache/cassandra/transport/messages/ErrorMessage.java:224— 3504.encode has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 3 (7 pts), loops 1 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (1.encode) 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.
Shell.perform_simple_statement (cognitive 23) pylib/cqlshlib/cqlshmain.py:905— Shell.perform_simple_statement has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (11 pts), error handling 4 (6 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CreateFunctionStatement.apply (cognitive 22) src/java/org/apache/cassandra/cql3/statements/schema/CreateFunctionStatement.java:95— CreateFunctionStatement.apply has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RawStatement.getAggregationSpecFactory (cognitive 22) src/java/org/apache/cassandra/cql3/statements/SelectStatement.java:1630— RawStatement.getAggregationSpecFactory has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 3, loops 2 (3 pts), ternaries 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BTreeReducingRangeMapSerializer.serializedSize (cognitive 22) src/java/org/apache/cassandra/service/accord/serializers/CommandStoreSerializers.java:524— BTreeReducingRangeMapSerializer.serializedSize has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Paxos.read (cognitive 22) src/java/org/apache/cassandra/service/paxos/Paxos.java:890— Paxos.read has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 3 (7 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PaxosState.promiseIfNewer (cognitive 22) src/java/org/apache/cassandra/service/paxos/PaxosState.java:588— PaxosState.promiseIfNewer has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (16 pts), ternaries 2 (5 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FileSystemOwnershipCheck.execute (cognitive 22) src/java/org/apache/cassandra/service/FileSystemOwnershipCheck.java:133— FileSystemOwnershipCheck.execute has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (14 pts), error handling 1 (5 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StorageProxy.commitPaxos (cognitive 22) src/java/org/apache/cassandra/service/StorageProxy.java:876— StorageProxy.commitPaxos has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AbstractCompactionStrategy.validateOptions (cognitive 22) src/java/org/apache/cassandra/db/compaction/AbstractCompactionStrategy.java:451— AbstractCompactionStrategy.validateOptions has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (15 pts), error handling 2 (4 pts), boolean chains 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.
Keyspace.getValidColumnFamilies (cognitive 22) src/java/org/apache/cassandra/db/Keyspace.java:626— Keyspace.getValidColumnFamilies has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RangeFetchMapCalculator.getRangeFetchMapForTrivialRanges (cognitive 22) src/java/org/apache/cassandra/dht/RangeFetchMapCalculator.java:156— RangeFetchMapCalculator.getRangeFetchMapForTrivialRanges has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (15 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Operation.analyzeGroup (cognitive 22) src/java/org/apache/cassandra/index/sasi/plan/Operation.java:269— Operation.analyzeGroup has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (7 pts), boolean chains 3, match/switch 1 (2 pts), ternaries 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.
SequentialReader.doAdvance (cognitive 22) src/java/org/apache/cassandra/journal/StaticSegment.java:432— SequentialReader.doAdvance has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (13 pts), error handling 2 (4 pts), match/switch 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DescribeCluster.execute (cognitive 22) src/java/org/apache/cassandra/tools/nodetool/DescribeCluster.java:47— DescribeCluster.execute has cognitive complexity 22 (threshold 15). Drivers by points: loops 6 (8 pts), if/else 4 (7 pts), error handling 3 (4 pts), ternaries 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PartitionStats.addUnfiltered (cognitive 22) src/java/org/apache/cassandra/tools/SSTablePartitions.java:646— PartitionStats.addUnfiltered has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (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.
Updater.updateRecursive (cognitive 22) src/java/org/apache/cassandra/utils/btree/BTree.java:3747— Updater.updateRecursive has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (16 pts), ternaries 2 (5 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DynamicList.isWellFormed (cognitive 22) src/java/org/apache/cassandra/utils/DynamicList.java:204— DynamicList.isWellFormed has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (15 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Overlaps.assignOverlapsIntoBuckets (cognitive 22) src/java/org/apache/cassandra/utils/Overlaps.java:118— Overlaps.assignOverlapsIntoBuckets has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 3 (7 pts), ternaries 1 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExportTask.export_records (cognitive 22) pylib/cqlshlib/copyutil.py:806— ExportTask.export_records has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CqlParsingRuleSet.cql_complete_single (cognitive 22) pylib/cqlshlib/cqlhandling.py:180— CqlParsingRuleSet.cql_complete_single has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 3, loops 1 (2 pts), ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cell_balance.print_worst_cell (cognitive 22) .build/ci/cell_balance.py:216— cell_balance.print_worst_cell has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (11 pts), ternaries 4 (6 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
run_ci.parse_arguments (cognitive 22) .build/run-ci.d/run_ci.py:334— run_ci.parse_arguments has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 16, if/else 5, error handling 1. 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.
run_ci.download_results_and_print_summary (cognitive 22) .build/run-ci.d/run_ci.py:1335— run_ci.download_results_and_print_summary has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (9 pts), error handling 3 (7 pts), boolean chains 3, loops 1 (2 pts), ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
heatmap.parse_file_log (cognitive 22) .claude/skills/heatmap/heatmap.py:223— heatmap.parse_file_log has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 2 (8 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
notify.run_one (cognitive 22) formalise/accord/execution/tla/notify.py:289— notify.run_one has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClusteringElements.buildRangeSet (cognitive 21) src/java/org/apache/cassandra/cql3/restrictions/ClusteringElements.java:292— ClusteringElements.buildRangeSet has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 7 (15 pts), if/else 3 (4 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PartitionKeyRestrictions.bounds (cognitive 21) src/java/org/apache/cassandra/cql3/restrictions/PartitionKeyRestrictions.java:137— PartitionKeyRestrictions.bounds has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 5 (7 pts), boolean chains 6 (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.
AccordCacheEntryQueue.addFifo (cognitive 21) src/java/org/apache/cassandra/service/accord/execution/AccordCacheEntryQueue.java:223— AccordCacheEntryQueue.addFifo has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4, ternaries 2 (4 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AccordCacheEntryQueue.removePriorityOrUnsequenced (cognitive 21) src/java/org/apache/cassandra/service/accord/execution/AccordCacheEntryQueue.java:711— AccordCacheEntryQueue.removePriorityOrUnsequenced has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 5, match/switch 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SafeTask.setupExclusive (cognitive 21) src/java/org/apache/cassandra/service/accord/execution/SafeTask.java:865— SafeTask.setupExclusive has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (19 pts), error handling 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.
AbstractDepsSerializer.deserializePackedXtoY (cognitive 21) src/java/org/apache/cassandra/service/accord/serializers/DepsSerializers.java:172— AbstractDepsSerializer.deserializePackedXtoY has cognitive complexity 21 (threshold 15). Drivers by points: loops 3 (9 pts), if/else 6 (7 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Block.select (cognitive 21) src/java/org/apache/cassandra/service/accord/txn/TxnUpdate.java:378— Block.select has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 4 (6 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PaxosPrepare.checkForLinearizabilityViolation (cognitive 21) src/java/org/apache/cassandra/service/paxos/PaxosPrepare.java:745— PaxosPrepare.checkForLinearizabilityViolation has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 3, match/switch 2 (3 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
StorageService.onChange (cognitive 21) src/java/org/apache/cassandra/service/StorageService.java:2202— StorageService.onChange has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (12 pts), error handling 2 (6 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AbstractCommitLogSegmentManager.flushDataFrom (cognitive 21) src/java/org/apache/cassandra/db/commitlog/AbstractCommitLogSegmentManager.java:460— AbstractCommitLogSegmentManager.flushDataFrom has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 2 (8 pts), loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommitLogReplayer.construct (cognitive 21) src/java/org/apache/cassandra/db/commitlog/CommitLogReplayer.java:115— CommitLogReplayer.construct has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (17 pts), ternaries 1 (3 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TimeWindowCompactionStrategyOptions.validateOptions (cognitive 21) src/java/org/apache/cassandra/db/compaction/TimeWindowCompactionStrategyOptions.java:94— TimeWindowCompactionStrategyOptions.validateOptions has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (13 pts), error handling 4, boolean chains 2, ternaries 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnfilteredSerializer.readComplexColumn (cognitive 21) src/java/org/apache/cassandra/db/rows/UnfilteredSerializer.java:685— UnfilteredSerializer.readComplexColumn has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Mutation.merge (cognitive 21) src/java/org/apache/cassandra/db/Mutation.java:244— Mutation.merge has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (4 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IndexTermType.calculateCapabilities (cognitive 21) src/java/org/apache/cassandra/index/sai/utils/IndexTermType.java:749— IndexTermType.calculateCapabilities has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16, boolean chains 5. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
BtiTableReader.estimatedKeysForRanges (cognitive 21) src/java/org/apache/cassandra/io/sstable/format/bti/BtiTableReader.java:380— BtiTableReader.estimatedKeysForRanges has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4, ternaries 2 (4 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ValueIterator.advanceNode (cognitive 21) src/java/org/apache/cassandra/io/tries/ValueIterator.java:211— ValueIterator.advanceNode has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ValueIterator.initializeWithLeftBound (cognitive 21) src/java/org/apache/cassandra/io/tries/ValueIterator.java:123— ValueIterator.initializeWithLeftBound has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AbstractReplicaCollection.filter (cognitive 21) src/java/org/apache/cassandra/locator/AbstractReplicaCollection.java:517— AbstractReplicaCollection.filter has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TableMetrics.totalNonSystemTablesSize (cognitive 21) src/java/org/apache/cassandra/metrics/TableMetrics.java:338— TableMetrics.totalNonSystemTablesSize has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 3 (7 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RepairCoordinator.getNeighborsAndRanges (cognitive 21) src/java/org/apache/cassandra/repair/RepairCoordinator.java:394— RepairCoordinator.getNeighborsAndRanges has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Validator.prepare (cognitive 21) src/java/org/apache/cassandra/repair/Validator.java:119— Validator.prepare has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (9 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TableMetadata.<init> (cognitive 21) src/java/org/apache/cassandra/schema/TableMetadata.java:228— TableMetadata.<init> has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 5, ternaries 2, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Serializer.deserialize (cognitive 21) src/java/org/apache/cassandra/tcm/membership/Directory.java:699— Serializer.deserialize has cognitive complexity 21 (threshold 15). Drivers by points: loops 6 (11 pts), if/else 6 (9 pts), boolean chains 1 (nesting depth added 8). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
AffectedRangesImpl.intersects (cognitive 21) src/java/org/apache/cassandra/tcm/sequences/LockedRanges.java:328— AffectedRangesImpl.intersects has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CassandraCliHelpLayout.parentCommandOptionsWithJmxOptions (cognitive 21) src/java/org/apache/cassandra/tools/nodetool/layout/CassandraCliHelpLayout.java:257— CassandraCliHelpLayout.parentCommandOptionsWithJmxOptions has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DefaultPrinter.printStatsTable (cognitive 21) src/java/org/apache/cassandra/tools/nodetool/stats/TableStatsPrinter.java:87— DefaultPrinter.printStatsTable has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13, loops 2 (4 pts), boolean chains 3, ternaries 1 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CompactionStats.reportCompactionTable (cognitive 21) src/java/org/apache/cassandra/tools/nodetool/CompactionStats.java:130— CompactionStats.reportCompactionTable has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 4 (9 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProfileLoad.execute (cognitive 21) src/java/org/apache/cassandra/tools/nodetool/ProfileLoad.java:84— ProfileLoad.execute has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 4, loops 2 (3 pts), error handling 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Wrapper.prepare (cognitive 21) src/java/org/apache/cassandra/tools/nodetool/Sjk.java:122— Wrapper.prepare has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 2 (4 pts), error handling 3, boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SSTablePartitions.processDirectory (cognitive 21) src/java/org/apache/cassandra/tools/SSTablePartitions.java:267— SSTablePartitions.processDirectory has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 3, error handling 1 (3 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
1.decode (cognitive 21) src/java/org/apache/cassandra/transport/messages/ErrorMessage.java:79— 1.decode has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 1 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident. This shape REPEATS in the file: one other method here (3504.decode) 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.
MerkleTree.differenceHelper (cognitive 21) src/java/org/apache/cassandra/utils/MerkleTree.java:250— MerkleTree.differenceHelper has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 6 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
3504.decode (cognitive 21) src/java/org/apache/cassandra/transport/messages/ErrorMessage.java:79— 3504.decode has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 1 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident. This shape REPEATS in the file: one other method here (1.decode) 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.
cell_balance.suite_times (cognitive 21) .build/ci/cell_balance.py:139— cell_balance.suite_times has cognitive complexity 21 (threshold 15). Drivers by points: error handling 2 (7 pts), loops 3 (6 pts), if/else 1 (3 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UDFunction.async (cognitive 20) src/java/org/apache/cassandra/cql3/functions/UDFunction.java:496— UDFunction.async has cognitive complexity 20 (threshold 15). Drivers by points: error handling 7 (11 pts), if/else 3 (6 pts), ternaries 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AbstractCryptoProvider.install (cognitive 20) src/java/org/apache/cassandra/security/AbstractCryptoProvider.java:96— AbstractCryptoProvider.install has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (16 pts), error handling 3 (4 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
SaferCommandStore.visitForKey (cognitive 20) src/java/org/apache/cassandra/service/accord/execution/SaferCommandStore.java:228— SaferCommandStore.visitForKey has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 3, loops 1 (2 pts), ternaries 1 (2 pts), match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JournalRangeIndex.onUpdate (cognitive 20) src/java/org/apache/cassandra/service/accord/journal/JournalRangeIndex.java:270— JournalRangeIndex.onUpdate has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (15 pts), ternaries 1 (5 pts) (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Querying.execute (cognitive 20) src/java/org/apache/cassandra/service/paxos/PaxosRepair.java:239— Querying.execute has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 5, ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ManyToOneConcurrentLinkedQueue.internalOffer (cognitive 20) src/java/org/apache/cassandra/concurrent/ManyToOneConcurrentLinkedQueue.java:194— ManyToOneConcurrentLinkedQueue.internalOffer has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 2 (6 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DatabaseDescriptor.resolveCommitLogWriteDiskAccessMode (cognitive 20) src/java/org/apache/cassandra/config/DatabaseDescriptor.java:1881— DatabaseDescriptor.resolveCommitLogWriteDiskAccessMode has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 2 (5 pts), error handling 2 (4 pts), boolean chains 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.
DefaultLoader.getProperties (cognitive 20) src/java/org/apache/cassandra/config/DefaultLoader.java:42— DefaultLoader.getProperties has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (5 pts), boolean chains 4, error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ParameterizedClass.newInstance (cognitive 20) src/java/org/apache/cassandra/config/ParameterizedClass.java:80— ParameterizedClass.newInstance has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (7 pts), boolean chains 4, error handling 3 (4 pts), ternaries 2 (4 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReplayFilter.create (cognitive 20) src/java/org/apache/cassandra/db/commitlog/CommitLogReplayer.java:394— ReplayFilter.create has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AccordCommandRowCompactor.result (cognitive 20) src/java/org/apache/cassandra/db/compaction/CompactionIterator.java:1161— AccordCommandRowCompactor.result has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 2 (4 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CompactionTask.buildCompactionCandidatesForAvailableDiskSpace (cognitive 20) src/java/org/apache/cassandra/db/compaction/CompactionTask.java:491— CompactionTask.buildCompactionCandidatesForAvailableDiskSpace has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (7 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BTreeRow.filter (cognitive 20) src/java/org/apache/cassandra/db/rows/BTreeRow.java:343— BTreeRow.filter has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 7, if/else 6 (7 pts), ternaries 4 (6 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
Serializer.deserialize (cognitive 20) src/java/org/apache/cassandra/db/rows/Cell.java:379— Serializer.deserialize has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 6 (8 pts), boolean chains 4 (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.
Merger.merge (cognitive 20) src/java/org/apache/cassandra/db/rows/Row.java:769— Merger.merge has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 2, loops 2, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommandStoreOpsTable.applyRowUpdate (cognitive 20) src/java/org/apache/cassandra/db/virtual/AccordDebugKeyspace.java:2027— CommandStoreOpsTable.applyRowUpdate has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (13 pts), match/switch 2 (3 pts), loops 2, ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ColumnFamilyStore.scrubDataDirectories (cognitive 20) src/java/org/apache/cassandra/db/ColumnFamilyStore.java:828— ColumnFamilyStore.scrubDataDirectories has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 4 (7 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Flush.flushMemtable (cognitive 20) src/java/org/apache/cassandra/db/ColumnFamilyStore.java:1328— Flush.flushMemtable has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 6 (8 pts), error handling 2, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Gossiper.applyNewStates (cognitive 20) src/java/org/apache/cassandra/gms/Gossiper.java:1547— Gossiper.applyNewStates has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 5, loops 3 (4 pts), match/switch 2 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RouteJournalIndex.searcherFor (cognitive 20) src/java/org/apache/cassandra/index/accord/RouteJournalIndex.java:390— RouteJournalIndex.searcherFor has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (8 pts), match/switch 2 (6 pts), error handling 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OnHeapGraph.add (cognitive 20) src/java/org/apache/cassandra/index/sai/disk/v1/vector/OnHeapGraph.java:153— OnHeapGraph.add has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 1 (3 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StorageAttachedIndexBuilder.indexSSTable (cognitive 20) src/java/org/apache/cassandra/index/sai/StorageAttachedIndexBuilder.java:181— StorageAttachedIndexBuilder.indexSSTable has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 2 (3 pts), error handling 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.
DynamicTokenTreeBuilder.constructTree (cognitive 20) src/java/org/apache/cassandra/index/sasi/disk/DynamicTokenTreeBuilder.java:104— DynamicTokenTreeBuilder.constructTree has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, ternaries 1 (3 pts), loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AutoRepairUtils.migrateAutoRepairHistoryForUpgrade (cognitive 20) src/java/org/apache/cassandra/repair/autorepair/AutoRepairUtils.java:272— AutoRepairUtils.migrateAutoRepairHistoryForUpgrade has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (4 pts), error handling 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.
RepairTokenRangeSplitter.getRepairAssignmentsForKeyspace (cognitive 20) src/java/org/apache/cassandra/repair/autorepair/RepairTokenRangeSplitter.java:262— RepairTokenRangeSplitter.getRepairAssignmentsForKeyspace has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TableMetadata.validate (cognitive 20) src/java/org/apache/cassandra/schema/TableMetadata.java:617— TableMetadata.validate has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 3 (5 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SourceHolder.addSource (cognitive 20) src/java/org/apache/cassandra/tcm/sequences/Move.java:526— SourceHolder.addSource has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
CassandraCliHelpLayout.commandList (cognitive 20) src/java/org/apache/cassandra/tools/nodetool/layout/CassandraCliHelpLayout.java:481— CassandraCliHelpLayout.commandList has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (6 pts), ternaries 2 (5 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExecuteMessage.execute (cognitive 20) src/java/org/apache/cassandra/transport/messages/ExecuteMessage.java:132— ExecuteMessage.execute has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 2, error handling 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.
AbstractSubtraction.transformLeaf (cognitive 20) src/java/org/apache/cassandra/utils/btree/BTree.java:4309— AbstractSubtraction.transformLeaf has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ListenerList.notify (cognitive 20) src/java/org/apache/cassandra/utils/concurrent/ListenerList.java:102— ListenerList.notify has cognitive complexity 20 (threshold 15). Drivers by points: if/else 3 (8 pts), error handling 2 (7 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InProgressVisit.nextChild (cognitive 20) src/java/org/apache/cassandra/utils/concurrent/Ref.java:528— InProgressVisit.nextChild has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CompactionManager.antiCompactGroup (cognitive 20) src/java/org/apache/cassandra/db/compaction/CompactionManager.java:1933— CompactionManager.antiCompactGroup has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 2, ternaries 2, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TransactionStatement.createWriteFragments (cognitive 19) src/java/org/apache/cassandra/cql3/statements/TransactionStatement.java:412— TransactionStatement.createWriteFragments has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 3 (6 pts), ternaries 2 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Parsed.prepare (cognitive 19) src/java/org/apache/cassandra/cql3/statements/TransactionStatement.java:835— Parsed.prepare has cognitive complexity 19 (threshold 15). Drivers by points: loops 6 (9 pts), if/else 5 (7 pts), boolean chains 3 (nesting depth added 5). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
Literal.testAssignment (cognitive 19) src/java/org/apache/cassandra/cql3/terms/Constants.java:325— Literal.testAssignment has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 8 (15 pts), if/else 3, boolean chains 1 (nesting depth added 7). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
TxnEvents.trace (cognitive 19) src/java/org/apache/cassandra/service/accord/debug/AccordTracing.java:393— TxnEvents.trace has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 4 (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.
1.run (cognitive 19) src/java/org/apache/cassandra/service/accord/execution/AbstractLockLoop.java:197— 1.run has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (11 pts), error handling 2 (5 pts), loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AccordExecutor.addToSnapshot (cognitive 19) src/java/org/apache/cassandra/service/accord/execution/AccordExecutor.java:782— AccordExecutor.addToSnapshot has cognitive complexity 19 (threshold 15). Drivers by points: loops 3 (9 pts), if/else 3 (7 pts), ternaries 1 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AccordExecutor.onLoadedExclusive (cognitive 19) src/java/org/apache/cassandra/service/accord/execution/AccordExecutor.java:628— AccordExecutor.onLoadedExclusive has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), error handling 2 (6 pts), loops 2 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExclusiveExecutor.runTask (cognitive 19) src/java/org/apache/cassandra/service/accord/execution/ExclusiveExecutor.java:152— ExclusiveExecutor.runTask has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SafeTask.onChangeKeyRunnableStatus (cognitive 19) src/java/org/apache/cassandra/service/accord/execution/SafeTask.java:1394— SafeTask.onChangeKeyRunnableStatus has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SafeTask.txnIdUpdates (cognitive 19) src/java/org/apache/cassandra/service/accord/execution/SafeTask.java:1636— SafeTask.txnIdUpdates has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 2 (6 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AbstractSearchableSerializer.deserialize (cognitive 19) src/java/org/apache/cassandra/service/accord/serializers/KeySerializers.java:842— AbstractSearchableSerializer.deserialize has cognitive complexity 19 (threshold 15). Drivers by points: loops 4 (12 pts), if/else 4 (7 pts) (nesting depth added 11). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
ColumnReference.toByteBuffer (cognitive 19) src/java/org/apache/cassandra/service/accord/txn/TxnReference.java:422— ColumnReference.toByteBuffer has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (14 pts), ternaries 3 (5 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
StorageProxy.mutate (cognitive 19) src/java/org/apache/cassandra/service/StorageProxy.java:978— StorageProxy.mutate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 3, loops 3, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Controller.getNumShards (cognitive 19) src/java/org/apache/cassandra/db/compaction/unified/Controller.java:292— Controller.getNumShards has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (19 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LeveledGenerations.addAll (cognitive 19) src/java/org/apache/cassandra/db/compaction/LeveledGenerations.java:123— LeveledGenerations.addAll has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 3, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TupleType.compareCustom (cognitive 19) src/java/org/apache/cassandra/db/marshal/TupleType.java:167— TupleType.compareCustom has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, ternaries 2 (3 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CellInLegacyOrderIterator.computeNext (cognitive 19) src/java/org/apache/cassandra/db/rows/BTreeRow.java:782— CellInLegacyOrderIterator.computeNext has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Rows.diff (cognitive 19) src/java/org/apache/cassandra/db/rows/Rows.java:133— Rows.diff has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 5 (8 pts), boolean chains 4, if/else 2 (4 pts), loops 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnfilteredSerializer.deserializeTombstonesOnly (cognitive 19) src/java/org/apache/cassandra/db/rows/UnfilteredSerializer.java:502— UnfilteredSerializer.deserializeTombstonesOnly has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 1 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Component.toHeader (cognitive 19) src/java/org/apache/cassandra/db/SerializationHeader.java:351— Component.toHeader has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 2 (3 pts), boolean chains 2, ternaries 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Slice.forPaging (cognitive 19) src/java/org/apache/cassandra/db/Slice.java:197— Slice.forPaging has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), ternaries 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.
RangeStreamer.fetchAsync (cognitive 19) src/java/org/apache/cassandra/dht/RangeStreamer.java:690— RangeStreamer.fetchAsync has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HintsDispatcher.doSendHintsAndAwait (cognitive 19) src/java/org/apache/cassandra/hints/HintsDispatcher.java:192— HintsDispatcher.doSendHintsAndAwait has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 5, loops 1, ternaries 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
RouteSecondaryIndexBuilder.indexSSTable (cognitive 19) src/java/org/apache/cassandra/index/accord/RouteSecondaryIndexBuilder.java:114— RouteSecondaryIndexBuilder.indexSSTable has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 2 (3 pts), error handling 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.
V1OnDiskFormat.validatePerColumnIndexComponents (cognitive 19) src/java/org/apache/cassandra/index/sai/disk/v1/V1OnDiskFormat.java:218— V1OnDiskFormat.validatePerColumnIndexComponents has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 2 (4 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KeyRangeUnionIterator.computeNext (cognitive 19) src/java/org/apache/cassandra/index/sai/iterators/KeyRangeUnionIterator.java:44— KeyRangeUnionIterator.computeNext has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StorageAttachedIndexQueryPlan.create (cognitive 19) src/java/org/apache/cassandra/index/sai/plan/StorageAttachedIndexQueryPlan.java:67— StorageAttachedIndexQueryPlan.create has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BigFormatPartitionWriter.addIndexBlock (cognitive 19) src/java/org/apache/cassandra/io/sstable/format/big/BigFormatPartitionWriter.java:130— BigFormatPartitionWriter.addIndexBlock has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 2 (4 pts), loops 1 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RowMergingSSTableIterator.hasOverflowedLocalExpirationTimeRow (cognitive 19) src/java/org/apache/cassandra/io/sstable/format/SortedTableScrubber.java:558— RowMergingSSTableIterator.hasOverflowedLocalExpirationTimeRow has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SegmentKeyIterator.<init> (cognitive 19) src/java/org/apache/cassandra/journal/Journal.java:1094— SegmentKeyIterator.<init> has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 3, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
4.select (cognitive 19) src/java/org/apache/cassandra/locator/ReplicaPlans.java:701— 4.select has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (5 pts), ternaries 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OutboundConnection.acquireCapacity (cognitive 19) src/java/org/apache/cassandra/net/OutboundConnection.java:394— OutboundConnection.acquireCapacity has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ColumnMetadata.hashCode (cognitive 19) src/java/org/apache/cassandra/schema/ColumnMetadata.java:518— ColumnMetadata.hashCode has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 9 (18 pts), if/else 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.
TableMetadata.validateCompatibility (cognitive 19) src/java/org/apache/cassandra/schema/TableMetadata.java:696— TableMetadata.validateCompatibility has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 3, loops 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
RawBuilder.build (cognitive 19) src/java/org/apache/cassandra/schema/Types.java:336— RawBuilder.build has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 6 (8 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GossipHelper.nodeStateToStatus (cognitive 19) src/java/org/apache/cassandra/tcm/compatibility/GossipHelper.java:116— GossipHelper.nodeStateToStatus has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 2, 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.
LegacyStateListener.processChangesToRemotePeers (cognitive 19) src/java/org/apache/cassandra/tcm/listeners/LegacyStateListener.java:171— LegacyStateListener.processChangesToRemotePeers has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Startup.initializeFromGossip (cognitive 19) src/java/org/apache/cassandra/tcm/Startup.java:498— Startup.initializeFromGossip has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 3 (4 pts), boolean chains 1, error handling 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.
GetInterDCStreamThroughput.execute (cognitive 19) src/java/org/apache/cassandra/tools/nodetool/GetInterDCStreamThroughput.java:41— GetInterDCStreamThroughput.execute has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 3 (6 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GetStreamThroughput.execute (cognitive 19) src/java/org/apache/cassandra/tools/nodetool/GetStreamThroughput.java:41— GetStreamThroughput.execute has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 3 (6 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsonTransformer.serializeCell (cognitive 19) src/java/org/apache/cassandra/tools/JsonTransformer.java:502— JsonTransformer.serializeCell has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7, boolean chains 5, loops 2 (4 pts), error handling 2 (3 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StandaloneVerifier.main (cognitive 19) src/java/org/apache/cassandra/tools/StandaloneVerifier.java:70— StandaloneVerifier.main has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), error handling 3 (5 pts), loops 4, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DataType.fromType (cognitive 19) src/java/org/apache/cassandra/transport/DataType.java:251— DataType.fromType has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BTree.accumulate (cognitive 19) src/java/org/apache/cassandra/utils/btree/BTree.java:1952— BTree.accumulate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BTree.isWellFormedReturnHeight (cognitive 19) src/java/org/apache/cassandra/utils/btree/BTree.java:2362— BTree.isWellFormedReturnHeight has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 2, ternaries 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LoadingMap.blockingLoadIfAbsent (cognitive 19) src/java/org/apache/cassandra/utils/concurrent/LoadingMap.java:91— LoadingMap.blockingLoadIfAbsent has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (14 pts), error handling 1 (4 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ImportProcess.split_into_batches (cognitive 19) pylib/cqlshlib/copyutil.py:2603— ImportProcess.split_into_batches has cognitive complexity 19 (threshold 15). Drivers by points: loops 6 (10 pts), if/else 3 (4 pts), ternaries 1 (3 pts), error handling 1 (2 pts) (nesting depth added 8). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
Shell.perform_statement (cognitive 19) pylib/cqlshlib/cqlshmain.py:858— Shell.perform_statement has cognitive complexity 19 (threshold 15). Drivers by points: loops 2 (7 pts), error handling 2 (6 pts), if/else 3 (5 pts), ternaries 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.
DeleteStatement.addUpdateForKey (cognitive 18) src/java/org/apache/cassandra/cql3/statements/DeleteStatement.java:72— DeleteStatement.addUpdateForKey has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 2 (6 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TxnKindsAndDomains.parse (cognitive 18) src/java/org/apache/cassandra/service/accord/debug/TxnKindsAndDomains.java:69— TxnKindsAndDomains.parse has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AccordCacheEntryQueue.addPrioritised (cognitive 18) src/java/org/apache/cassandra/service/accord/execution/AccordCacheEntryQueue.java:286— AccordCacheEntryQueue.addPrioritised has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 4 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
TxnRead.select (cognitive 18) src/java/org/apache/cassandra/service/accord/txn/TxnRead.java:244— TxnRead.select has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 2 (4 pts), boolean chains 2, 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.
AccordService.applyProtocolModifiers (cognitive 18) src/java/org/apache/cassandra/service/accord/AccordService.java:531— AccordService.applyProtocolModifiers has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, ternaries 1 (2 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ConsensusRequestRouter.validateSafeToReadNonTransactionally (cognitive 18) src/java/org/apache/cassandra/service/consensus/migration/ConsensusRequestRouter.java:550— ConsensusRequestRouter.validateSafeToReadNonTransactionally has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 1, ternaries 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
TransactionalMode.readCLForMode (cognitive 18) src/java/org/apache/cassandra/service/consensus/TransactionalMode.java:174— TransactionalMode.readCLForMode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PaxosCleanupLocalCoordinator.scheduleKeyRepairsOrFinish (cognitive 18) src/java/org/apache/cassandra/service/paxos/cleanup/PaxosCleanupLocalCoordinator.java:197— PaxosCleanupLocalCoordinator.scheduleKeyRepairsOrFinish has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PaxosKeyStateRowsIterator.hasNext (cognitive 18) src/java/org/apache/cassandra/service/paxos/uncommitted/PaxosStateTracker.java:194— PaxosKeyStateRowsIterator.hasNext has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RequestHandler.execute (cognitive 18) src/java/org/apache/cassandra/service/paxos/PaxosPrepare.java:1152— RequestHandler.execute has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (8 pts), ternaries 3 (6 pts), boolean chains 3, match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ResponseSerializer.serialize (cognitive 18) src/java/org/apache/cassandra/service/paxos/PaxosPrepare.java:1310— ResponseSerializer.serialize has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 4 (8 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.
ActiveRepairService.filterNeighbors (cognitive 18) src/java/org/apache/cassandra/service/ActiveRepairService.java:618— ActiveRepairService.filterNeighbors has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 3, error handling 1 (3 pts), loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CassandraDaemon.setup (cognitive 18) src/java/org/apache/cassandra/service/CassandraDaemon.java:244— CassandraDaemon.setup has cognitive complexity 18 (threshold 15). Drivers by points: error handling 9 (10 pts), if/else 6, boolean chains 1, loops 1 (nesting depth added 1). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StorageProxy.beginAndRepairPaxos (cognitive 18) src/java/org/apache/cassandra/service/StorageProxy.java:677— StorageProxy.beginAndRepairPaxos has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 2 (4 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LeveledCompactionStrategy.<init> (cognitive 18) src/java/org/apache/cassandra/db/compaction/LeveledCompactionStrategy.java:79— LeveledCompactionStrategy.<init> has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (18 pts) (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
CompositeLifecycleTransaction.partCommittedOrAborted (cognitive 18) src/java/org/apache/cassandra/db/lifecycle/CompositeLifecycleTransaction.java:130— CompositeLifecycleTransaction.partCommittedOrAborted has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 1 (4 pts) (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
UserType.compareCQL (cognitive 18) src/java/org/apache/cassandra/db/marshal/UserType.java:577— UserType.compareCQL has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Serializer.serialize (cognitive 18) src/java/org/apache/cassandra/db/rows/Cell.java:287— Serializer.serialize has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, boolean chains 5. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Directories.<init> (cognitive 18) src/java/org/apache/cassandra/db/Directories.java:224— Directories.<init> has cognitive complexity 18 (threshold 15). Drivers by points: loops 6 (11 pts), if/else 4, error handling 1 (2 pts), boolean chains 1 (nesting depth added 6). 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.
SinglePartitionReadCommand.getThroughCache (cognitive 18) src/java/org/apache/cassandra/db/SinglePartitionReadCommand.java:578— SinglePartitionReadCommand.getThroughCache has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, error handling 1 (2 pts), ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Gossiper.examineGossiper (cognitive 18) src/java/org/apache/cassandra/gms/Gossiper.java:1702— Gossiper.examineGossiper has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VectorIndexSegmentSearcher.searchInternal (cognitive 18) src/java/org/apache/cassandra/index/sai/disk/v1/segment/VectorIndexSegmentSearcher.java:129— VectorIndexSegmentSearcher.searchInternal has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 2 (3 pts), boolean chains 1, error handling 1, ternaries 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
IndexMode.getMode (cognitive 18) src/java/org/apache/cassandra/index/sasi/conf/IndexMode.java:126— IndexMode.getMode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 4 (5 pts), error handling 3 (4 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TermIterator.computeNext (cognitive 18) src/java/org/apache/cassandra/index/sasi/disk/OnDiskIndex.java:751— TermIterator.computeNext has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 4, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SSTableReader.getApproximateKeyCount (cognitive 18) src/java/org/apache/cassandra/io/sstable/format/SSTableReader.java:308— SSTableReader.getApproximateKeyCount has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 2 (4 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FixNegativeLocalDeletionTimeIterator.hasNegativeLocalExpirationTime (cognitive 18) src/java/org/apache/cassandra/io/sstable/format/SortedTableScrubber.java:640— FixNegativeLocalDeletionTimeIterator.hasNegativeLocalExpirationTime has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
2.getValue (cognitive 18) src/java/org/apache/cassandra/metrics/CompactionMetrics.java:95— 2.getValue has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StartupClusterConnectivityChecker.execute (cognitive 18) src/java/org/apache/cassandra/net/StartupClusterConnectivityChecker.java:85— StartupClusterConnectivityChecker.execute has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 4, boolean chains 2 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AutoRepairUtils.getHostsBeingRepaired (cognitive 18) src/java/org/apache/cassandra/repair/autorepair/AutoRepairUtils.java:732— AutoRepairUtils.getHostsBeingRepaired has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (7 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AutoRepairUtils.hasReplicaWithOngoingRepair (cognitive 18) src/java/org/apache/cassandra/repair/autorepair/AutoRepairUtils.java:852— AutoRepairUtils.hasReplicaWithOngoingRepair has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RepairTokenRangeSplitter.getRepairAssignments (cognitive 18) src/java/org/apache/cassandra/repair/autorepair/RepairTokenRangeSplitter.java:500— RepairTokenRangeSplitter.getRepairAssignments has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TableMetadata.appendColumnDefinitions (cognitive 18) src/java/org/apache/cassandra/schema/TableMetadata.java:1731— TableMetadata.appendColumnDefinitions has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AbstractMapSerializer.getSliceFromSerialized (cognitive 18) src/java/org/apache/cassandra/serializers/AbstractMapSerializer.java:45— AbstractMapSerializer.getSliceFromSerialized has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 2, ternaries 1 (2 pts), error handling 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BootstrapAndJoin.executeNext (cognitive 18) src/java/org/apache/cassandra/tcm/sequences/BootstrapAndJoin.java:203— BootstrapAndJoin.executeNext has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), error handling 4 (8 pts), match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
BootstrapAndReplace.executeNext (cognitive 18) src/java/org/apache/cassandra/tcm/sequences/BootstrapAndReplace.java:196— BootstrapAndReplace.executeNext has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), error handling 4 (8 pts), match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
AccordMarkHardRemoved.execute (cognitive 18) src/java/org/apache/cassandra/tcm/transformations/AccordMarkHardRemoved.java:75— AccordMarkHardRemoved.execute has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (5 pts), match/switch 1 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClusterMetadata.legacyToString (cognitive 18) src/java/org/apache/cassandra/tcm/ClusterMetadata.java:1125— ClusterMetadata.legacyToString has cognitive complexity 18 (threshold 15). Drivers by points: loops 6 (13 pts), if/else 3, match/switch 1 (2 pts) (nesting depth added 8). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
Transformer.build (cognitive 18) src/java/org/apache/cassandra/tcm/ClusterMetadata.java:978— Transformer.build has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 1, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
Startup.initializeForDiscovery (cognitive 18) src/java/org/apache/cassandra/tcm/Startup.java:432— Startup.initializeForDiscovery has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Compact.execute (cognitive 18) src/java/org/apache/cassandra/tools/nodetool/Compact.java:67— Compact.execute has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 5, error handling 2 (4 pts), loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Repair.createOptions (cognitive 18) src/java/org/apache/cassandra/tools/nodetool/Repair.java:183— Repair.createOptions has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 8 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Ring.printDc (cognitive 18) src/java/org/apache/cassandra/tools/nodetool/Ring.java:129— Ring.printDc has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 3 (7 pts), if/else 5 (6 pts), error handling 1 (2 pts), loops 2, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Snapshot.execute (cognitive 18) src/java/org/apache/cassandra/tools/nodetool/Snapshot.java:62— Snapshot.execute has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 3, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SSTableExport.main (cognitive 18) src/java/org/apache/cassandra/tools/SSTableExport.java:115— SSTableExport.main has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 5, error handling 2, ternaries 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
SSTableMetadataViewer.printSStableMetadata (cognitive 18) src/java/org/apache/cassandra/tools/SSTableMetadataViewer.java:317— SSTableMetadataViewer.printSStableMetadata has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 2 (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.
SSTablePartitions.processSSTable (cognitive 18) src/java/org/apache/cassandra/tools/SSTablePartitions.java:346— SSTablePartitions.processSSTable has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (3 pts), boolean chains 2, error handling 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.
DumpJournal.processKey (cognitive 18) src/java/org/apache/cassandra/tools/StandaloneJournalUtil.java:281— DumpJournal.processKey has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 6, error handling 1, match/switch 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DumpJournal.run (cognitive 18) src/java/org/apache/cassandra/tools/StandaloneJournalUtil.java:221— DumpJournal.run has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (8 pts), loops 1 (3 pts), ternaries 3, boolean chains 2, error handling 1 (2 pts) (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
BatchMessage.execute (cognitive 18) src/java/org/apache/cassandra/transport/messages/BatchMessage.java:173— BatchMessage.execute has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2, error handling 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConnectionLimitHandler.channelActive (cognitive 18) src/java/org/apache/cassandra/transport/ConnectionLimitHandler.java:85— ConnectionLimitHandler.channelActive has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (18 pts) (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ExecutorUtils.shutdownThenWait (cognitive 18) src/java/org/apache/cassandra/utils/ExecutorUtils.java:116— ExecutorUtils.shutdownThenWait has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), error handling 1 (2 pts), loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NoDuplicateSpamLogStatement.shouldLog (cognitive 18) src/java/org/apache/cassandra/utils/NoSpamLogger.java:225— NoDuplicateSpamLogStatement.shouldLog has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Shell.__init__ (cognitive 18) pylib/cqlshlib/cqlshmain.py:268— Shell.__init__ has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (15 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Shell.prepare_loop (cognitive 18) pylib/cqlshlib/cqlshmain.py:670— Shell.prepare_loop has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AbstractUDTCodec.parse (cognitive 17) src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:2647— AbstractUDTCodec.parse has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), error handling 2 (4 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SelectStatement.processPartition (cognitive 17) src/java/org/apache/cassandra/cql3/statements/SelectStatement.java:1238— SelectStatement.processPartition has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 2 (7 pts), loops 3 (6 pts), if/else 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TransactionStatement.createTxn (cognitive 17) src/java/org/apache/cassandra/cql3/statements/TransactionStatement.java:560— TransactionStatement.createTxn has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (6 pts), loops 3 (6 pts), boolean chains 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.
AccordExecutorSignalLoop.drainUnqueuedNewWorkExclusive (cognitive 17) src/java/org/apache/cassandra/service/accord/execution/AccordExecutorSignalLoop.java:117— AccordExecutorSignalLoop.drainUnqueuedNewWorkExclusive has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SafeTask.runMayThrow (cognitive 17) src/java/org/apache/cassandra/service/accord/execution/SafeTask.java:1570— SafeTask.runMayThrow has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 2 (3 pts), boolean chains 1, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SafeTask.waitOnTxnsExclusive (cognitive 17) src/java/org/apache/cassandra/service/accord/execution/SafeTask.java:1082— SafeTask.waitOnTxnsExclusive has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AccordNodeInfoCoordinator.declareSelf (cognitive 17) src/java/org/apache/cassandra/service/accord/topology/AccordNodeInfoCoordinator.java:310— AccordNodeInfoCoordinator.declareSelf has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 5 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PagersIterator.computeNext (cognitive 17) src/java/org/apache/cassandra/service/pager/MultiPartitionPager.java:272— PagersIterator.computeNext has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 4, ternaries 2 (4 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Snapshot.merge (cognitive 17) src/java/org/apache/cassandra/service/paxos/PaxosState.java:234— Snapshot.merge has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 3 (6 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StorageProxy.mutateWithTriggers (cognitive 17) src/java/org/apache/cassandra/service/StorageProxy.java:1227— StorageProxy.mutateWithTriggers has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (7 pts), loops 2 (5 pts), ternaries 2 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StorageProxy.updateCoordinatorWriteLatencyTableMetric (cognitive 17) src/java/org/apache/cassandra/service/StorageProxy.java:1604— StorageProxy.updateCoordinatorWriteLatencyTableMetric has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (3 pts), error handling 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.
LocalReadRunnable.runMayThrow (cognitive 17) src/java/org/apache/cassandra/service/StorageProxy.java:2743— LocalReadRunnable.runMayThrow has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), error handling 3, boolean chains 2, ternaries 1 (2 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StorageService.constructRangeToEndpointMap (cognitive 17) src/java/org/apache/cassandra/service/StorageService.java:2120— StorageService.constructRangeToEndpointMap has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 2 (6 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommitLogArchiver.getArchiverFromProperties (cognitive 17) src/java/org/apache/cassandra/db/commitlog/CommitLogArchiver.java:125— CommitLogArchiver.getArchiverFromProperties has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), error handling 3, loops 1 (2 pts), boolean chains 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CellResolver.resolve (cognitive 17) src/java/org/apache/cassandra/db/rows/BTreeRow.java:831— CellResolver.resolve has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Cells.resolveCounter (cognitive 17) src/java/org/apache/cassandra/db/rows/Cells.java:110— Cells.resolveCounter has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (7 pts), ternaries 3 (7 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CassandraStreamManager.createOutgoingStreams (cognitive 17) src/java/org/apache/cassandra/db/streaming/CassandraStreamManager.java:91— CassandraStreamManager.createOutgoingStreams has cognitive complexity 17 (threshold 15). Drivers by points: loops 5 (7 pts), if/else 5 (6 pts), ternaries 1 (2 pts), boolean chains 1, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AbstractSchemaMetadataTable.data (cognitive 17) src/java/org/apache/cassandra/db/virtual/AbstractSchemaMetadataTable.java:208— AbstractSchemaMetadataTable.data has cognitive complexity 17 (threshold 15). Drivers by points: loops 6 (14 pts), if/else 2, match/switch 1 (nesting depth added 8). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
PartitionKeyStatsTable.getBounds (cognitive 17) src/java/org/apache/cassandra/db/virtual/PartitionKeyStatsTable.java:285— PartitionKeyStatsTable.getBounds has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), error handling 1 (3 pts), loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Serializer.serializeLargeSubset (cognitive 17) src/java/org/apache/cassandra/db/Columns.java:634— Serializer.serializeLargeSubset has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (9 pts), if/else 4 (8 pts) (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline. This shape REPEATS in the file: one other method here (Serializer.serializeLargeSubsetSize) 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.
Serializer.serializeLargeSubsetSize (cognitive 17) src/java/org/apache/cassandra/db/Columns.java:708— Serializer.serializeLargeSubsetSize has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (9 pts), if/else 4 (8 pts) (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline. This shape REPEATS in the file: one other method here (Serializer.serializeLargeSubset) 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.
RangeFetchMapCalculator.getRangeFetchMapFromGraphResult (cognitive 17) src/java/org/apache/cassandra/dht/RangeFetchMapCalculator.java:215— RangeFetchMapCalculator.getRangeFetchMapFromGraphResult has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Gossiper.getStateForVersionBiggerThan (cognitive 17) src/java/org/apache/cassandra/gms/Gossiper.java:1113— Gossiper.getStateForVersionBiggerThan has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Callback.accept (cognitive 17) src/java/org/apache/cassandra/hints/HintsDispatcher.java:531— Callback.accept has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SSTableIndexWriter.addRow (cognitive 17) src/java/org/apache/cassandra/index/sai/disk/v1/SSTableIndexWriter.java:81— SSTableIndexWriter.addRow has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 2 (6 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VectorMemoryIndex.update (cognitive 17) src/java/org/apache/cassandra/index/sai/memory/VectorMemoryIndex.java:110— VectorMemoryIndex.update has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 3 (4 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Expression.add (cognitive 17) src/java/org/apache/cassandra/index/sai/plan/Expression.java:177— Expression.add has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 2 (4 pts), match/switch 1 (nesting depth added 6). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Operation.buildIndexExpressions (cognitive 17) src/java/org/apache/cassandra/index/sai/plan/Operation.java:118— Operation.buildIndexExpressions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 1, ternaries 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
IndexViewManager.getBuiltIndexes (cognitive 17) src/java/org/apache/cassandra/index/sai/view/IndexViewManager.java:154— IndexViewManager.getBuiltIndexes has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), error handling 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QueryController.getView (cognitive 17) src/java/org/apache/cassandra/index/sasi/plan/QueryController.java:197— QueryController.getView has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 2 (4 pts), boolean chains 3, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LookupIntersectionIterator.computeNext (cognitive 17) src/java/org/apache/cassandra/index/sasi/utils/RangeIntersectionIterator.java:242— LookupIntersectionIterator.computeNext has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SASIIndexBuilder.build (cognitive 17) src/java/org/apache/cassandra/index/sasi/SASIIndexBuilder.java:75— SASIIndexBuilder.build has cognitive complexity 17 (threshold 15). Drivers by points: if/else 2 (6 pts), loops 3 (6 pts), ternaries 1 (3 pts), error handling 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BigScanningIterator.prepareToIterateRow (cognitive 17) src/java/org/apache/cassandra/io/sstable/format/big/BigTableScanner.java:114— BigScanningIterator.prepareToIterateRow has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BigTableVerifier.verifyPartition (cognitive 17) src/java/org/apache/cassandra/io/sstable/format/big/BigTableVerifier.java:53— BigTableVerifier.verifyPartition has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReverseReader.fillOffsets (cognitive 17) src/java/org/apache/cassandra/io/sstable/format/bti/SSTableReversedIterator.java:185— ReverseReader.fillOffsets has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SSTableScanner.addRange (cognitive 17) src/java/org/apache/cassandra/io/sstable/format/SSTableScanner.java:93— SSTableScanner.addRange has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Delivery.run (cognitive 17) src/java/org/apache/cassandra/net/OutboundConnection.java:671— Delivery.run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LargeMessageDelivery.doRun (cognitive 17) src/java/org/apache/cassandra/net/OutboundConnection.java:985— LargeMessageDelivery.doRun has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), error handling 2 (5 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ColumnMetadata.makeCellPathComparator (cognitive 17) src/java/org/apache/cassandra/schema/ColumnMetadata.java:303— ColumnMetadata.makeCellPathComparator has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 3 (8 pts), if/else 4 (6 pts), boolean chains 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.
Directory.clusterVersions (cognitive 17) src/java/org/apache/cassandra/tcm/membership/Directory.java:843— Directory.clusterVersions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 3, loops 1, ternaries 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.
SetGuardrailsConfig.castType (cognitive 17) src/java/org/apache/cassandra/tools/nodetool/GuardrailsConfigCommand.java:308— SetGuardrailsConfig.castType has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 5, ternaries 1 (2 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
SSTableRepairedSet.execute (cognitive 17) src/java/org/apache/cassandra/tools/nodetool/SSTableRepairedSet.java:66— SSTableRepairedSet.execute has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7, ternaries 4 (6 pts), error handling 1 (2 pts), loops 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
UpgradeSSTable.execute (cognitive 17) src/java/org/apache/cassandra/tools/nodetool/UpgradeSSTable.java:66— UpgradeSSTable.execute has cognitive complexity 17 (threshold 15). Drivers by points: if/else 2 (7 pts), error handling 2 (6 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TermHistogram.printHistogram (cognitive 17) src/java/org/apache/cassandra/tools/Util.java:215— TermHistogram.printHistogram has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 13 (15 pts), loops 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
BTreeRemoval.copyWithKeyAndChildInserted (cognitive 17) src/java/org/apache/cassandra/utils/btree/BTreeRemoval.java:185— BTreeRemoval.copyWithKeyAndChildInserted has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 2 (4 pts), loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MicroQueueOfChunks.removeIf (cognitive 17) src/java/org/apache/cassandra/utils/memory/BufferPool.java:673— MicroQueueOfChunks.removeIf has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (15 pts), match/switch 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.
ByteBufferUtil.contains (cognitive 17) src/java/org/apache/cassandra/utils/ByteBufferUtil.java:937— ByteBufferUtil.contains has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Shell.do_describe (cognitive 17) pylib/cqlshlib/cqlshmain.py:1143— Shell.do_describe has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), error handling 2 (4 pts), ternaries 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.
Shell.do_help (cognitive 17) pylib/cqlshlib/cqlshmain.py:1798— Shell.do_help has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
run_ci.matching_running_build (cognitive 17) .build/run-ci.d/run_ci.py:1545— run_ci.matching_running_build has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 3 (4 pts), error handling 2 (3 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
heatmap.compute_line_heat (cognitive 17) .claude/skills/heatmap/heatmap.py:396— heatmap.compute_line_heat has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Raw.prepare (cognitive 16) src/java/org/apache/cassandra/cql3/statements/schema/CreateIndexStatement.java:376— Raw.prepare has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 3, ternaries 2 (3 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
AlterRoleStatement.authorize (cognitive 16) src/java/org/apache/cassandra/cql3/statements/AlterRoleStatement.java:97— AlterRoleStatement.authorize has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 3). 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.
BatchStatement.<init> (cognitive 16) src/java/org/apache/cassandra/cql3/statements/BatchStatement.java:140— BatchStatement.<init> has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModificationStatement.validateDiskUsage (cognitive 16) src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java:483— ModificationStatement.validateDiskUsage has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (11 pts), if/else 4 (5 pts) (nesting depth added 8). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
SelectStatement.loggableTokens (cognitive 16) src/java/org/apache/cassandra/cql3/statements/SelectStatement.java:2012— SelectStatement.loggableTokens has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 2 (4 pts), loops 1 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AccordCacheEntry.lockExclusive (cognitive 16) src/java/org/apache/cassandra/service/accord/execution/AccordCacheEntry.java:515— AccordCacheEntry.lockExclusive has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NonSyncState.postRunExclusive (cognitive 16) src/java/org/apache/cassandra/service/accord/execution/SafeTask.java:363— NonSyncState.postRunExclusive has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 2 (6 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AbstractSortedCollector.collect (cognitive 16) src/java/org/apache/cassandra/service/accord/serializers/AbstractSortedCollector.java:53— AbstractSortedCollector.collect has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 2 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DiskUsageBroadcaster.computeUsageStateForEpDatacenter (cognitive 16) src/java/org/apache/cassandra/service/disk/usage/DiskUsageBroadcaster.java:177— DiskUsageBroadcaster.computeUsageStateForEpDatacenter has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PaxosStateTracker.create (cognitive 16) src/java/org/apache/cassandra/service/paxos/uncommitted/PaxosStateTracker.java:110— PaxosStateTracker.create has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UncommittedTableData.load (cognitive 16) src/java/org/apache/cassandra/service/paxos/uncommitted/UncommittedTableData.java:369— UncommittedTableData.load has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CassandraDaemon.enableAutoCompaction (cognitive 16) src/java/org/apache/cassandra/service/CassandraDaemon.java:553— CassandraDaemon.enableAutoCompaction has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 3 (6 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CassandraDaemon.validateTransportsCanStart (cognitive 16) src/java/org/apache/cassandra/service/CassandraDaemon.java:898— CassandraDaemon.validateTransportsCanStart has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DataResurrectionCheck.execute (cognitive 16) src/java/org/apache/cassandra/service/DataResurrectionCheck.java:214— DataResurrectionCheck.execute has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (3 pts), error handling 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.
Writer.deleteOldCacheFiles (cognitive 16) src/java/org/apache/cassandra/cache/AutoSavingCache.java:437— Writer.deleteOldCacheFiles has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DatabaseDescriptor.createAllDirectories (cognitive 16) src/java/org/apache/cassandra/config/DatabaseDescriptor.java:2432— DatabaseDescriptor.createAllDirectories has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 pts), error handling 2, ternaries 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
Replacements.getReplacements (cognitive 16) src/java/org/apache/cassandra/config/Replacements.java:86— Replacements.getReplacements has cognitive complexity 16 (threshold 15). Drivers by points: loops 3 (8 pts), if/else 3 (6 pts), boolean chains 1, ternaries 1 (nesting depth added 8). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
CommitLogReader.readCommitLogSegment (cognitive 16) src/java/org/apache/cassandra/db/commitlog/CommitLogReader.java:176— CommitLogReader.readCommitLogSegment has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), error handling 3, boolean chains 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LeveledCompactionStrategy.getNextBackgroundTasks (cognitive 16) src/java/org/apache/cassandra/db/compaction/LeveledCompactionStrategy.java:146— LeveledCompactionStrategy.getNextBackgroundTasks has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ShardManager.splitSSTablesInShards (cognitive 16) src/java/org/apache/cassandra/db/compaction/ShardManager.java:248— ShardManager.splitSSTablesInShards has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (6 pts), boolean chains 5, loops 3 (5 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClusteringIndexNamesFilter.toCQLString (cognitive 16) src/java/org/apache/cassandra/db/filter/ClusteringIndexNamesFilter.java:174— ClusteringIndexNamesFilter.toCQLString has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 7 (10 pts), loops 2 (3 pts), if/else 2, boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IntegerType.compareIntegers (cognitive 16) src/java/org/apache/cassandra/db/marshal/IntegerType.java:100— IntegerType.compareIntegers has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 2 (5 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IntegerType.findMostSignificantByte (cognitive 16) src/java/org/apache/cassandra/db/marshal/IntegerType.java:55— IntegerType.findMostSignificantByte has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Reconciler.removeShadowed (cognitive 16) src/java/org/apache/cassandra/db/rows/ColumnData.java:206— Reconciler.removeShadowed has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 2 (7 pts) (nesting depth added 9). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
BasePartitions.hasNext (cognitive 16) src/java/org/apache/cassandra/db/transform/BasePartitions.java:78— BasePartitions.hasNext has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), loops 3 (6 pts), boolean chains 2, error handling 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.
ViewBuilderTask.call (cognitive 16) src/java/org/apache/cassandra/db/view/ViewBuilderTask.java:122— ViewBuilderTask.call has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BoundedMap.removeEldestEntry (cognitive 16) src/java/org/apache/cassandra/db/virtual/ExceptionsTable.java:300— BoundedMap.removeEldestEntry has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KeyRangeIntersectionIterator.computeNext (cognitive 16) src/java/org/apache/cassandra/index/sai/iterators/KeyRangeIntersectionIterator.java:66— KeyRangeIntersectionIterator.computeNext has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Expression.add (cognitive 16) src/java/org/apache/cassandra/index/sasi/plan/Expression.java:141— Expression.add has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 pts), match/switch 1 (nesting depth added 5). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
SecondaryIndexManager.getBestIndexQueryPlanFor (cognitive 16) src/java/org/apache/cassandra/index/SecondaryIndexManager.java:1278— SecondaryIndexManager.getBestIndexQueryPlanFor has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), loops 3 (4 pts), ternaries 2 (4 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BigSSTableReaderLoadingBuilder.buildSummaryAndBloomFilter (cognitive 16) src/java/org/apache/cassandra/io/sstable/format/big/BigSSTableReaderLoadingBuilder.java:191— BigSSTableReaderLoadingBuilder.buildSummaryAndBloomFilter has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 3, boolean chains 2, error handling 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BtiTableReader.getRowIndexEntry (cognitive 16) src/java/org/apache/cassandra/io/sstable/format/bti/BtiTableReader.java:141— BtiTableReader.getRowIndexEntry has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 2 (4 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SortedTableWriter.guardCollectionSize (cognitive 16) src/java/org/apache/cassandra/io/sstable/format/SortedTableWriter.java:428— SortedTableWriter.guardCollectionSize has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StatsMetadataSerializer.serializedSize (cognitive 16) src/java/org/apache/cassandra/io/sstable/metadata/StatsMetadata.java:312— StatsMetadataSerializer.serializedSize has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
AllocateRunnable.runNormal (cognitive 16) src/java/org/apache/cassandra/journal/Journal.java:691— AllocateRunnable.runNormal has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), error handling 2, loops 1 (2 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReplicaPlans.filterBatchlogEndpointsDynamic (cognitive 16) src/java/org/apache/cassandra/locator/ReplicaPlans.java:492— ReplicaPlans.filterBatchlogEndpointsDynamic has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PreviewRepairTask.maybeSnapshotReplicas (cognitive 16) src/java/org/apache/cassandra/repair/PreviewRepairTask.java:114— PreviewRepairTask.maybeSnapshotReplicas has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 4 (7 pts), error handling 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.
CompactionParams.validate (cognitive 16) src/java/org/apache/cassandra/schema/CompactionParams.java:193— CompactionParams.validate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 3, error handling 3, ternaries 1 (2 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
4.apply (cognitive 16) src/java/org/apache/cassandra/schema/SchemaTransformations.java:184— 4.apply has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (6 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReplicaGroups.splitRangesForPlacement (cognitive 16) src/java/org/apache/cassandra/tcm/ownership/ReplicaGroups.java:304— ReplicaGroups.splitRangesForPlacement has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClusterMetadata.calculateCMSPlacement (cognitive 16) src/java/org/apache/cassandra/tcm/ClusterMetadata.java:348— ClusterMetadata.calculateCMSPlacement has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 1 (3 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClientStats.execute (cognitive 16) src/java/org/apache/cassandra/tools/nodetool/ClientStats.java:57— ClientStats.execute has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
1.encodedSize (cognitive 16) src/java/org/apache/cassandra/transport/messages/ErrorMessage.java:308— 1.encodedSize has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 1 (3 pts), boolean chains 1, match/switch 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (3504.encodedSize) 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.
Decoder.decode (cognitive 16) src/java/org/apache/cassandra/transport/Envelope.java:359— Decoder.decode has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), error handling 2, ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BTree.update (cognitive 16) src/java/org/apache/cassandra/utils/btree/BTree.java:366— BTree.update has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SlabAllocator.getRegion (cognitive 16) src/java/org/apache/cassandra/utils/memory/SlabAllocator.java:125— SlabAllocator.getRegion has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), ternaries 1 (3 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HistogramBuilder.buildRange (cognitive 16) src/java/org/apache/cassandra/utils/HistogramBuilder.java:114— HistogramBuilder.buildRange has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 3 (5 pts), boolean chains 1, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
IntervalNode.add (cognitive 16) src/java/org/apache/cassandra/utils/IntervalTree.java:870— IntervalNode.add has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 4 (6 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LongTimSort.binarySort (cognitive 16) src/java/org/apache/cassandra/utils/LongTimSort.java:227— LongTimSort.binarySort has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 2 (3 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SystemInfo.getMaxProcess (cognitive 16) src/java/org/apache/cassandra/utils/SystemInfo.java:101— SystemInfo.getMaxProcess has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), ternaries 1 (4 pts), error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
3504.encodedSize (cognitive 16) src/java/org/apache/cassandra/transport/messages/ErrorMessage.java:308— 3504.encodedSize has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 1 (3 pts), boolean chains 1, match/switch 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (1.encodedSize) 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.
Shell.onecmd (cognitive 16) pylib/cqlshlib/cqlshmain.py:759— Shell.onecmd has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), error handling 2 (3 pts), boolean chains 2, loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
run_ci.get_jenkins (cognitive 16) .build/run-ci.d/run_ci.py:772— run_ci.get_jenkins has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 3, error handling 1 (2 pts), ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
convert_yaml_to_adoc.convert (cognitive 16) doc/scripts/convert_yaml_to_adoc.py:60— convert_yaml_to_adoc.convert has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 1 (3 pts), error handling 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication· Near-duplicate member family (5 members, 82 shared lines) · ×1
Near-duplicate member family (5 members, 82 shared lines) src/java/org/apache/cassandra/utils/obs/BitUtil.java:54— src/java/org/apache/cassandra/utils/obs/BitUtil.java:54-195 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:201-318 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:324-447 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:453-576 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:579-701 — These 5 members are variants of one another: a block of 82 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 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.
Near-duplicate member pair (42 shared lines) src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:2648— src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:2648-2725 | src/java/org/apache/cassandra/cql3/functions/types/TypeCodec.java:2947-2998 — These two members are variants of one another: 42 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (31 shared lines) src/java/org/apache/cassandra/utils/LongTimSort.java:603— src/java/org/apache/cassandra/utils/LongTimSort.java:603-699 | src/java/org/apache/cassandra/utils/LongTimSort.java:711-811 — These two members are variants of one another: 31 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (29 shared lines) src/java/org/apache/cassandra/utils/btree/BTree.java:1274— src/java/org/apache/cassandra/utils/btree/BTree.java:1274-1313 | src/java/org/apache/cassandra/utils/btree/BTree.java:1323-1362 — These two members are variants of one another: 29 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (26 shared lines) src/java/org/apache/cassandra/cql3/statements/schema/DropAggregateStatement.java:79— src/java/org/apache/cassandra/cql3/statements/schema/DropAggregateStatement.java:79-126 | src/java/org/apache/cassandra/cql3/statements/schema/DropFunctionStatement.java:81-144 — These two members are variants of one another: 26 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 (8 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (8 members, 50+ identical tokens) src/java/org/apache/cassandra/tools/AuditLogViewer.java:189— src/java/org/apache/cassandra/tools/AuditLogViewer.java:189-228 | src/java/org/apache/cassandra/tools/SSTableExpiredBlockers.java:79-116 | src/java/org/apache/cassandra/tools/StandaloneSSTableUtil.java:173-213 | src/java/org/apache/cassandra/tools/StandaloneScrubber.java:261-303 | src/java/org/apache/cassandra/tools/StandaloneSplitter.java:200-235 | src/java/org/apache/cassandra/tools/StandaloneUpgrader.java:163-202 | src/java/org/apache/cassandra/tools/StandaloneVerifier.java:195-248 | tools/sstableloader/src/org/apache/cassandra/tools/LoaderOptions.java:421-701 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
D4 · Code Duplication· Members sharing a duplicated core (6 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (6 members, 50+ identical tokens) src/java/org/apache/cassandra/utils/memory/BigEndianMemoryUtil.java:110— src/java/org/apache/cassandra/utils/memory/BigEndianMemoryUtil.java:110-119 | src/java/org/apache/cassandra/utils/memory/BigEndianMemoryUtil.java:123-128 | src/java/org/apache/cassandra/utils/memory/LittleEndianMemoryUtil.java:110-119 | src/java/org/apache/cassandra/utils/memory/LittleEndianMemoryUtil.java:123-128 | src/java/org/apache/cassandra/utils/memory/NativeEndianMemoryUtil.java:146-169 | src/java/org/apache/cassandra/utils/memory/NativeEndianMemoryUtil.java:173-188 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication· Edited copy of a member (87 corresponding lines) · ×1
Edited copy of a member (87 corresponding lines) formalise/accord/execution/tla/matrix.py:476— formalise/accord/execution/tla/matrix.py:476-573 | formalise/accord/execution/tla/notify.py:359-445 — These two members are one piece of code written twice and then edited apart: 87 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (74 corresponding lines) · ×1
Edited copy of a member (74 corresponding lines) src/java/org/apache/cassandra/utils/MurmurHash.java:255— src/java/org/apache/cassandra/utils/MurmurHash.java:255-328 | src/java/org/apache/cassandra/utils/MurmurHash.java:331-404 — These two members are one piece of code written twice and then edited apart: 74 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (69 corresponding lines) · ×1
Edited copy of a member (69 corresponding lines) src/java/org/apache/cassandra/service/accord/serializers/ReadDataSerializer.java:81— src/java/org/apache/cassandra/service/accord/serializers/ReadDataSerializer.java:81-149 | src/java/org/apache/cassandra/service/accord/serializers/ReadDataSerializer.java:238-307 — These two members are one piece of code written twice and then edited apart: 69 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (99 corresponding lines) · ×1
Edited copy of a member (99 corresponding lines) src/java/org/apache/cassandra/index/accord/RouteSecondaryIndexBuilder.java:115— src/java/org/apache/cassandra/index/accord/RouteSecondaryIndexBuilder.java:115-213 | src/java/org/apache/cassandra/index/sai/StorageAttachedIndexBuilder.java:182-293 — These two members are one piece of code written twice and then edited apart: 99 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (66 corresponding lines) · ×1
Edited copy of a member (66 corresponding lines) formalise/accord/execution/tla/matrix.py:375— formalise/accord/execution/tla/matrix.py:375-455 | formalise/accord/execution/tla/notify.py:290-355 — These two members are one piece of code written twice and then edited apart: 66 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (54 corresponding lines) · ×1
Edited copy of a member (54 corresponding lines) src/java/org/apache/cassandra/utils/MurmurHash.java:103— src/java/org/apache/cassandra/utils/MurmurHash.java:103-156 | src/java/org/apache/cassandra/utils/MurmurHash.java:159-212 — These two members are one piece of code written twice and then edited apart: 54 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (55 corresponding lines) · ×1
Edited copy of a member (55 corresponding lines) src/java/org/apache/cassandra/cql3/functions/types/ParseUtils.java:388— src/java/org/apache/cassandra/cql3/functions/types/ParseUtils.java:388-442 | src/java/org/apache/cassandra/serializers/TimeSerializer.java:138-201 — These two members are one piece of code written twice and then edited apart: 55 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (104 corresponding lines) · ×1
Edited copy of a member (104 corresponding lines) src/java/org/apache/cassandra/tcm/sequences/BootstrapAndJoin.java:204— src/java/org/apache/cassandra/tcm/sequences/BootstrapAndJoin.java:204-310 | src/java/org/apache/cassandra/tcm/sequences/BootstrapAndReplace.java:197-300 — These two members are one piece of code written twice and then edited apart: 104 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (97 corresponding lines) · ×1
Edited copy of a member (97 corresponding lines) src/java/org/apache/cassandra/cql3/selection/MapSelector.java:80— src/java/org/apache/cassandra/cql3/selection/MapSelector.java:80-183 | src/java/org/apache/cassandra/cql3/selection/UserTypeSelector.java:82-178 — These two members are one piece of code written twice and then edited apart: 97 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (45 corresponding lines) · ×1
Edited copy of a member (45 corresponding lines) src/java/org/apache/cassandra/db/RangeTombstoneList.java:401— src/java/org/apache/cassandra/db/RangeTombstoneList.java:401-445 | src/java/org/apache/cassandra/db/RangeTombstoneList.java:448-492 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (51 corresponding lines) · ×1
Edited copy of a member (51 corresponding lines) src/java/org/apache/cassandra/utils/LongTimSort.java:471— src/java/org/apache/cassandra/utils/LongTimSort.java:471-521 | src/java/org/apache/cassandra/utils/LongTimSort.java:536-586 — These two members are one piece of code written twice and then edited apart: 51 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (61 corresponding lines) · ×1
Edited copy of a member (61 corresponding lines) src/java/org/apache/cassandra/utils/btree/BTree.java:1093— src/java/org/apache/cassandra/utils/btree/BTree.java:1093-1153 | src/java/org/apache/cassandra/utils/btree/BTree.java:1204-1264 — These two members are one piece of code written twice and then edited apart: 61 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (53 corresponding lines) · ×1
Edited copy of a member (53 corresponding lines) src/java/org/apache/cassandra/service/accord/serializers/CommandStoreSerializers.java:380— src/java/org/apache/cassandra/service/accord/serializers/CommandStoreSerializers.java:380-433 | src/java/org/apache/cassandra/service/accord/serializers/CommandStoreSerializers.java:525-577 — These two members are one piece of code written twice and then edited apart: 53 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 40+ corresponding lines) · ×1
Edited copies of one member (3 members, 40+ corresponding lines) src/java/org/apache/cassandra/cql3/terms/Lists.java:405— src/java/org/apache/cassandra/cql3/terms/Lists.java:405-446 | src/java/org/apache/cassandra/cql3/terms/Maps.java:324-363 | src/java/org/apache/cassandra/cql3/terms/Sets.java:259-300 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 40 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (46 corresponding lines) · ×1
Edited copy of a member (46 corresponding lines) src/java/org/apache/cassandra/cql3/selection/ElementsSelector.java:142— src/java/org/apache/cassandra/cql3/selection/ElementsSelector.java:142-187 | src/java/org/apache/cassandra/cql3/selection/ElementsSelector.java:203-250 — These two members are one piece of code written twice and then edited apart: 46 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (57 corresponding lines) · ×1
Edited copy of a member (57 corresponding lines) src/java/org/apache/cassandra/service/accord/execution/AbstractLockLoop.java:193— src/java/org/apache/cassandra/service/accord/execution/AbstractLockLoop.java:193-249 | src/java/org/apache/cassandra/service/accord/execution/AbstractLockLoop.java:252-327 — These two members are one piece of code written twice and then edited apart: 57 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (50 corresponding lines) · ×1
Edited copy of a member (50 corresponding lines) src/java/org/apache/cassandra/service/accord/execution/AbstractLockLoop.java:198— src/java/org/apache/cassandra/service/accord/execution/AbstractLockLoop.java:198-247 | src/java/org/apache/cassandra/service/accord/execution/AbstractLockLoop.java:257-325 — These two members are one piece of code written twice and then edited apart: 50 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 21+ corresponding lines) · ×1
Edited copies of one member (3 members, 21+ corresponding lines) src/java/org/apache/cassandra/io/sstable/SSTableIdentityIterator.java:69— src/java/org/apache/cassandra/io/sstable/SSTableIdentityIterator.java:69-89 | src/java/org/apache/cassandra/io/sstable/SSTableIdentityIterator.java:97-122 | src/java/org/apache/cassandra/io/sstable/SSTableIdentityIterator.java:130-154 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 41+ corresponding lines) · ×1
Edited copies of one member (3 members, 41+ corresponding lines) src/java/org/apache/cassandra/io/compress/ZstdDictionaryCompressor.java:114— src/java/org/apache/cassandra/io/compress/ZstdDictionaryCompressor.java:114-161 | src/java/org/apache/cassandra/io/compress/ZstdDictionaryCompressor.java:165-205 | src/java/org/apache/cassandra/io/compress/ZstdDictionaryCompressor.java:209-249 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 41 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 31+ corresponding lines) · ×1
Edited copies of one member (3 members, 31+ corresponding lines) src/java/org/apache/cassandra/serializers/ListSerializer.java:96— src/java/org/apache/cassandra/serializers/ListSerializer.java:96-140 | src/java/org/apache/cassandra/serializers/MapSerializer.java:123-157 | src/java/org/apache/cassandra/serializers/SetSerializer.java:96-126 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 31 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 23+ corresponding lines) · ×1
Edited copies of one member (3 members, 23+ corresponding lines) src/java/org/apache/cassandra/cql3/selection/Selectable.java:865— src/java/org/apache/cassandra/cql3/selection/Selectable.java:865-887 | src/java/org/apache/cassandra/cql3/selection/Selectable.java:932-956 | src/java/org/apache/cassandra/cql3/selection/Selectable.java:1009-1039 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 13+ corresponding lines) · ×1
Edited copies of one member (3 members, 13+ corresponding lines) src/java/org/apache/cassandra/service/paxos/cleanup/PaxosCleanupComplete.java:130— src/java/org/apache/cassandra/service/paxos/cleanup/PaxosCleanupComplete.java:130-143 | src/java/org/apache/cassandra/service/paxos/cleanup/PaxosCleanupRequest.java:133-145 | src/java/org/apache/cassandra/service/paxos/cleanup/PaxosStartPrepareCleanup.java:156-172 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 26+ corresponding lines) · ×1
Edited copies of one member (3 members, 26+ corresponding lines) src/java/org/apache/cassandra/service/consensus/migration/ConsensusRequestRouter.java:395— src/java/org/apache/cassandra/service/consensus/migration/ConsensusRequestRouter.java:395-421 | src/java/org/apache/cassandra/service/consensus/migration/ConsensusRequestRouter.java:437-462 | src/java/org/apache/cassandra/service/consensus/migration/ConsensusRequestRouter.java:478-505 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 26 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 18+ corresponding lines) · ×1
Edited copies of one member (3 members, 18+ corresponding lines) src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java:162— src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java:162-179 | src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java:182-200 | src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java:204-221 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 28+ corresponding lines) · ×1
Edited copies of one member (3 members, 28+ corresponding lines) src/java/org/apache/cassandra/io/sstable/SSTableIdentityIterator.java:187— src/java/org/apache/cassandra/io/sstable/SSTableIdentityIterator.java:187-214 | src/java/org/apache/cassandra/io/sstable/SSTableIdentityIterator.java:217-247 | src/java/org/apache/cassandra/io/sstable/SSTableIdentityIterator.java:272-300 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 28 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 12+ corresponding lines) · ×1
Edited copies of one member (5 members, 12+ corresponding lines) src/java/org/apache/cassandra/service/StorageService.java:2710— src/java/org/apache/cassandra/service/StorageService.java:2710-2724 | src/java/org/apache/cassandra/service/StorageService.java:2737-2748 | src/java/org/apache/cassandra/service/StorageService.java:2815-2826 | src/java/org/apache/cassandra/service/StorageService.java:2864-2875 | src/java/org/apache/cassandra/service/StorageService.java:2878-2890 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 27+ corresponding lines) · ×1
Edited copies of one member (5 members, 27+ corresponding lines) src/java/org/apache/cassandra/cql3/functions/AggregateFcts.java:156— src/java/org/apache/cassandra/cql3/functions/AggregateFcts.java:156-182 | src/java/org/apache/cassandra/cql3/functions/AggregateFcts.java:237-263 | src/java/org/apache/cassandra/cql3/functions/AggregateFcts.java:322-348 | src/java/org/apache/cassandra/cql3/functions/AggregateFcts.java:382-408 | src/java/org/apache/cassandra/cql3/functions/AggregateFcts.java:442-468 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 27 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 13+ corresponding lines) · ×1
Edited copies of one member (4 members, 13+ corresponding lines) src/java/org/apache/cassandra/cql3/QueryEvents.java:73— src/java/org/apache/cassandra/cql3/QueryEvents.java:73-85 | src/java/org/apache/cassandra/cql3/QueryEvents.java:92-104 | src/java/org/apache/cassandra/cql3/QueryEvents.java:112-124 | src/java/org/apache/cassandra/cql3/QueryEvents.java:130-144 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 6+ corresponding lines) · ×1
Edited copies of one member (6 members, 6+ corresponding lines) src/java/org/apache/cassandra/net/MessagingServiceMBeanImpl.java:57— src/java/org/apache/cassandra/net/MessagingServiceMBeanImpl.java:57-62 | src/java/org/apache/cassandra/net/MessagingServiceMBeanImpl.java:84-89 | src/java/org/apache/cassandra/net/MessagingServiceMBeanImpl.java:111-116 | src/java/org/apache/cassandra/net/MessagingServiceMBeanImpl.java:138-143 | src/java/org/apache/cassandra/net/MessagingServiceMBeanImpl.java:165-170 | src/java/org/apache/cassandra/net/MessagingServiceMBeanImpl.java:192-197 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 16+ corresponding lines) · ×1
Edited copies of one member (4 members, 16+ corresponding lines) src/java/org/apache/cassandra/utils/FastByteOperations.java:254— src/java/org/apache/cassandra/utils/FastByteOperations.java:254-271 | src/java/org/apache/cassandra/utils/FastByteOperations.java:286-301 | src/java/org/apache/cassandra/utils/FastByteOperations.java:386-403 | src/java/org/apache/cassandra/utils/FastByteOperations.java:407-427 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 15+ corresponding lines) · ×1
Edited copies of one member (6 members, 15+ corresponding lines) src/java/org/apache/cassandra/tools/nodetool/Cleanup.java:54— src/java/org/apache/cassandra/tools/nodetool/Cleanup.java:54-74 | src/java/org/apache/cassandra/tools/nodetool/DisableAutoCompaction.java:48-64 | src/java/org/apache/cassandra/tools/nodetool/EnableAutoCompaction.java:48-64 | src/java/org/apache/cassandra/tools/nodetool/Flush.java:47-63 | src/java/org/apache/cassandra/tools/nodetool/RecompressSSTables.java:53-70 | src/java/org/apache/cassandra/tools/nodetool/RelocateSSTables.java:53-67 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 10+ corresponding lines) · ×1
Edited copies of one member (4 members, 10+ corresponding lines) src/java/org/apache/cassandra/db/ColumnFamilyStore.java:3031— src/java/org/apache/cassandra/db/ColumnFamilyStore.java:3031-3041 | src/java/org/apache/cassandra/db/SizeEstimatesRecorder.java:211-220 | src/java/org/apache/cassandra/metrics/TableMetrics.java:807-817 | src/java/org/apache/cassandra/metrics/TableMetrics.java:821-834 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 7+ corresponding lines) · ×1
Edited copies of one member (6 members, 7+ corresponding lines) src/java/org/apache/cassandra/repair/autorepair/RepairTokenRangeSplitter.java:711— src/java/org/apache/cassandra/repair/autorepair/RepairTokenRangeSplitter.java:711-717 | src/java/org/apache/cassandra/service/accord/txn/TxnCondition.java:289-295 | src/java/org/apache/cassandra/service/accord/txn/TxnCondition.java:553-559 | src/java/org/apache/cassandra/service/accord/txn/TxnCondition.java:682-688 | src/java/org/apache/cassandra/service/accord/txn/TxnNamedRead.java:196-202 | src/java/org/apache/cassandra/service/accord/txn/TxnWrite.java:120-126 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (8 members, 7+ corresponding lines) · ×1
Edited copies of one member (8 members, 7+ corresponding lines) src/java/org/apache/cassandra/cql3/functions/types/AbstractGettableByIndexData.java:116— src/java/org/apache/cassandra/cql3/functions/types/AbstractGettableByIndexData.java:116-122 | src/java/org/apache/cassandra/cql3/functions/types/AbstractGettableByIndexData.java:129-135 | src/java/org/apache/cassandra/cql3/functions/types/AbstractGettableByIndexData.java:142-148 | src/java/org/apache/cassandra/cql3/functions/types/AbstractGettableByIndexData.java:155-161 | src/java/org/apache/cassandra/cql3/functions/types/AbstractGettableByIndexData.java:168-174 | src/java/org/apache/cassandra/cql3/functions/types/AbstractGettableByIndexData.java:201-207 | src/java/org/apache/cassandra/cql3/functions/types/AbstractGettableByIndexData.java:214-220 | src/java/org/apache/cassandra/cql3/functions/types/AbstractGettableByIndexData.java:227-233 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 18+ corresponding lines) · ×1
Edited copies of one member (5 members, 18+ corresponding lines) src/java/org/apache/cassandra/db/marshal/ByteType.java:68— src/java/org/apache/cassandra/db/marshal/ByteType.java:68-85 | src/java/org/apache/cassandra/db/marshal/InetAddressType.java:57-74 | src/java/org/apache/cassandra/db/marshal/Int32Type.java:86-103 | src/java/org/apache/cassandra/db/marshal/LongType.java:98-115 | src/java/org/apache/cassandra/db/marshal/ShortType.java:71-88 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 25+ corresponding lines) · ×1
Edited copies of one member (4 members, 25+ corresponding lines) src/java/org/apache/cassandra/db/virtual/AccordDebugKeyspace.java:579— src/java/org/apache/cassandra/db/virtual/AccordDebugKeyspace.java:579-604 | src/java/org/apache/cassandra/db/virtual/AccordDebugKeyspace.java:1028-1052 | src/java/org/apache/cassandra/db/virtual/AccordDebugKeyspace.java:1561-1586 | src/java/org/apache/cassandra/db/virtual/AccordDebugKeyspace.java:1667-1693 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 25 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 4+ corresponding lines) · ×1
Edited copies of one member (3 members, 4+ corresponding lines) src/java/org/apache/cassandra/cql3/terms/Lists.java:142— src/java/org/apache/cassandra/cql3/terms/Lists.java:142-145 | src/java/org/apache/cassandra/cql3/terms/Sets.java:128-131 | src/java/org/apache/cassandra/cql3/terms/Vectors.java:79-84 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 15+ corresponding lines) · ×1
Edited copies of one member (4 members, 15+ corresponding lines) src/java/org/apache/cassandra/db/PartitionRangeReadCommand.java:292— src/java/org/apache/cassandra/db/PartitionRangeReadCommand.java:292-306 | src/java/org/apache/cassandra/db/SinglePartitionReadCommand.java:422-437 | src/java/org/apache/cassandra/db/SinglePartitionReadCommand.java:441-456 | src/java/org/apache/cassandra/db/SinglePartitionReadCommand.java:479-497 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 8+ corresponding lines) · ×1
Edited copies of one member (5 members, 8+ corresponding lines) src/java/org/apache/cassandra/db/virtual/CredentialsCacheKeysTable.java:36— src/java/org/apache/cassandra/db/virtual/CredentialsCacheKeysTable.java:36-45 | src/java/org/apache/cassandra/db/virtual/JmxPermissionsCacheKeysTable.java:31-38 | src/java/org/apache/cassandra/db/virtual/NetworkPermissionsCacheKeysTable.java:31-38 | src/java/org/apache/cassandra/db/virtual/PermissionsCacheKeysTable.java:34-42 | src/java/org/apache/cassandra/db/virtual/RolesCacheKeysTable.java:31-38 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 12+ corresponding lines) · ×1
Edited copies of one member (6 members, 12+ corresponding lines) src/java/org/apache/cassandra/cql3/selection/FieldSelector.java:172— src/java/org/apache/cassandra/cql3/selection/FieldSelector.java:172-184 | src/java/org/apache/cassandra/cql3/selection/ListSelector.java:153-164 | src/java/org/apache/cassandra/cql3/selection/MapSelector.java:277-288 | src/java/org/apache/cassandra/cql3/selection/SetSelector.java:155-166 | src/java/org/apache/cassandra/cql3/selection/TupleSelector.java:154-165 | src/java/org/apache/cassandra/cql3/selection/UserTypeSelector.java:249-260 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 3+ corresponding lines) · ×1
Edited copies of one member (4 members, 3+ corresponding lines) src/java/org/apache/cassandra/cql3/terms/Lists.java:78— src/java/org/apache/cassandra/cql3/terms/Lists.java:78-80 | src/java/org/apache/cassandra/cql3/terms/Maps.java:57-59 | src/java/org/apache/cassandra/cql3/terms/Sets.java:58-60 | src/java/org/apache/cassandra/cql3/terms/Vectors.java:46-48 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 3+ corresponding lines) · ×1
Edited copies of one member (3 members, 3+ corresponding lines) src/java/org/apache/cassandra/tcm/transformations/PrepareLeave.java:284— src/java/org/apache/cassandra/tcm/transformations/PrepareLeave.java:284-286 | src/java/org/apache/cassandra/tcm/transformations/PrepareMove.java:194-196 | src/java/org/apache/cassandra/tcm/transformations/PrepareReplace.java:294-297 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (32 lines × 2) src/java/org/apache/cassandra/utils/btree/BTree.java:1114— src/java/org/apache/cassandra/utils/btree/BTree.java:1114-1145 | src/java/org/apache/cassandra/utils/btree/BTree.java:1225-1256 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/utils/btree/BTree.java:1114` 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `apply` to `Function<? super I, ? extends O>` in one and `BiFunction<? super I, ? super I2, ? extends O>` 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 (31 lines × 2) src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java:220— src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java:220-250 | src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java:296-326 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java:220` 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 (30 lines × 2) src/java/org/apache/cassandra/index/sai/disk/v1/bbtree/BlockBalancedTreeWalker.java:72— src/java/org/apache/cassandra/index/sai/disk/v1/bbtree/BlockBalancedTreeWalker.java:72-101 | src/java/org/apache/cassandra/index/sai/disk/v1/bbtree/BlockBalancedTreeWalker.java:116-145 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/index/sai/disk/v1/bbtree/BlockBalancedTreeWalker.java:72` 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–29 lines × 5) src/java/org/apache/cassandra/utils/obs/BitUtil.java:115— src/java/org/apache/cassandra/utils/obs/BitUtil.java:115-143 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:243-266 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:372-395 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:501-524 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:626-649 — 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 `src/java/org/apache/cassandra/utils/obs/BitUtil.java:115` 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 (28 lines × 2) src/java/org/apache/cassandra/hints/HintsReader.java:182— src/java/org/apache/cassandra/hints/HintsReader.java:182-209 | src/java/org/apache/cassandra/hints/HintsReader.java:288-315 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/hints/HintsReader.java:182` 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 (2–27 lines × 3) src/java/org/apache/cassandra/tcm/sequences/BootstrapAndJoin.java:238— src/java/org/apache/cassandra/tcm/sequences/BootstrapAndJoin.java:238-264 | src/java/org/apache/cassandra/tcm/sequences/BootstrapAndReplace.java:228-254 | src/java/org/apache/cassandra/tcm/sequences/ReplaceSameAddress.java:96-97 — before extracting anything, compare `src/java/org/apache/cassandra/tcm/sequences/BootstrapAndJoin.java` and `src/java/org/apache/cassandra/tcm/sequences/BootstrapAndReplace.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/tcm/sequences/BootstrapAndJoin.java:238` 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–26 lines × 2) src/java/org/apache/cassandra/cql3/Duration.java:771— src/java/org/apache/cassandra/cql3/Duration.java:771-785 | src/java/org/apache/cassandra/cql3/functions/types/Duration.java:621-646 — before extracting anything, compare `src/java/org/apache/cassandra/cql3/Duration.java` and `src/java/org/apache/cassandra/cql3/functions/types/Duration.java` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 112 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–26 lines × 2) src/java/org/apache/cassandra/cql3/terms/Lists.java:408— src/java/org/apache/cassandra/cql3/terms/Lists.java:408-433 | src/java/org/apache/cassandra/cql3/terms/Sets.java:262-285 — before extracting anything, compare `src/java/org/apache/cassandra/cql3/terms/Lists.java` and `src/java/org/apache/cassandra/cql3/terms/Sets.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `src/java/org/apache/cassandra/cql3/terms/Lists.java:408` 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–24 lines × 3) src/java/org/apache/cassandra/cql3/terms/Lists.java:408— src/java/org/apache/cassandra/cql3/terms/Lists.java:408-431 | src/java/org/apache/cassandra/cql3/terms/Maps.java:327-348 | src/java/org/apache/cassandra/cql3/terms/Sets.java:262-283 — before extracting anything, compare `src/java/org/apache/cassandra/cql3/terms/Lists.java` and `src/java/org/apache/cassandra/cql3/terms/Sets.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `src/java/org/apache/cassandra/cql3/terms/Lists.java:408` 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–24 lines × 2) src/java/org/apache/cassandra/io/compress/ZstdCompressorBase.java:139— src/java/org/apache/cassandra/io/compress/ZstdCompressorBase.java:139-162 | src/java/org/apache/cassandra/io/compress/ZstdCompressorBase.java:185-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/io/compress/ZstdCompressorBase.java:139` 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 lines × 3) src/java/org/apache/cassandra/io/sstable/SSTableIdentityIterator.java:192— src/java/org/apache/cassandra/io/sstable/SSTableIdentityIterator.java:192-214 | src/java/org/apache/cassandra/io/sstable/SSTableIdentityIterator.java:225-247 | src/java/org/apache/cassandra/io/sstable/SSTableIdentityIterator.java:278-300 — 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 `src/java/org/apache/cassandra/io/sstable/SSTableIdentityIterator.java:192` 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 (22 lines × 3) src/java/org/apache/cassandra/metrics/AccordCoordinatorMetrics.java:188— src/java/org/apache/cassandra/metrics/AccordCoordinatorMetrics.java:188-209 | src/java/org/apache/cassandra/metrics/AccordReplicaMetrics.java:125-146 | src/java/org/apache/cassandra/metrics/AccordSystemMetrics.java:248-269 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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.
Duplicated block (20–22 lines × 2) src/java/org/apache/cassandra/db/context/CounterContext.java:467— src/java/org/apache/cassandra/db/context/CounterContext.java:467-486 | src/java/org/apache/cassandra/db/context/CounterContext.java:506-527 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/db/context/CounterContext.java:467` 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 (22 lines × 2) src/java/org/apache/cassandra/index/accord/CheckpointIntervalArrayIndex.java:549— src/java/org/apache/cassandra/index/accord/CheckpointIntervalArrayIndex.java:549-570 | src/java/org/apache/cassandra/index/accord/CheckpointIntervalArrayIndex.java:576-597 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/index/accord/CheckpointIntervalArrayIndex.java:549` 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 (20–21 lines × 2) src/java/org/apache/cassandra/serializers/ListSerializer.java:72— src/java/org/apache/cassandra/serializers/ListSerializer.java:72-92 | src/java/org/apache/cassandra/serializers/SetSerializer.java:73-92 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from 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 (18–19 lines × 2) src/java/org/apache/cassandra/io/sstable/format/big/BigTableScrubber.java:188— src/java/org/apache/cassandra/io/sstable/format/big/BigTableScrubber.java:188-205 | src/java/org/apache/cassandra/io/sstable/format/bti/BtiTableScrubber.java:207-225 — before extracting anything, compare `src/java/org/apache/cassandra/io/sstable/format/big/BigTableScrubber.java` and `src/java/org/apache/cassandra/io/sstable/format/bti/BtiTableScrubber.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 `src/java/org/apache/cassandra/io/sstable/format/big/BigTableScrubber.java:188` 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, `src/java/org/apache/cassandra/io/sstable/format/big/BigTableScrubber.java:208` calls `warn` and `src/java/org/apache/cassandra/io/sstable/format/bti/BtiTableScrubber.java:228` 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 × 5) src/java/org/apache/cassandra/utils/obs/BitUtil.java:151— src/java/org/apache/cassandra/utils/obs/BitUtil.java:151-168 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:274-291 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:403-420 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:532-549 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:657-674 — 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 `src/java/org/apache/cassandra/utils/obs/BitUtil.java:151` 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 × 3) src/java/org/apache/cassandra/db/ClusteringComparator.java:483— src/java/org/apache/cassandra/db/ClusteringComparator.java:483-500 | src/java/org/apache/cassandra/db/ClusteringComparator.java:535-552 | src/java/org/apache/cassandra/db/ClusteringComparator.java:592-609 — 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 `src/java/org/apache/cassandra/db/ClusteringComparator.java: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 (17–18 lines × 3) src/java/org/apache/cassandra/tools/SSTableExpiredBlockers.java:89— src/java/org/apache/cassandra/tools/SSTableExpiredBlockers.java:89-106 | src/java/org/apache/cassandra/tools/StandaloneSSTableUtil.java:182-198 | src/java/org/apache/cassandra/tools/StandaloneScrubber.java:270-286 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/tools/SSTableExpiredBlockers.java:89` 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–28 lines × 2) src/java/org/apache/cassandra/cql3/functions/types/ParseUtils.java:455— src/java/org/apache/cassandra/cql3/functions/types/ParseUtils.java:455-475 | src/java/org/apache/cassandra/serializers/TimeSerializer.java:88-115 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `value` to `long` in one and `Long` 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 after the matched lines, `src/java/org/apache/cassandra/serializers/TimeSerializer.java:116` calls `leftPadZeros` and `src/java/org/apache/cassandra/cql3/functions/types/ParseUtils.java:476` 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–17 lines × 5) src/java/org/apache/cassandra/utils/obs/BitUtil.java:69— src/java/org/apache/cassandra/utils/obs/BitUtil.java:69-85 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:203-213 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:326-342 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:455-471 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:580-596 — 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 `src/java/org/apache/cassandra/utils/obs/BitUtil.java: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.
Duplicated block (16 lines × 5) src/java/org/apache/cassandra/utils/obs/BitUtil.java:170— src/java/org/apache/cassandra/utils/obs/BitUtil.java:170-185 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:293-308 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:422-437 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:551-566 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:676-691 — 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 `src/java/org/apache/cassandra/utils/obs/BitUtil.java:170` 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–16 lines × 2) src/java/org/apache/cassandra/cql3/statements/SelectStatement.java:1252— src/java/org/apache/cassandra/cql3/statements/SelectStatement.java:1252-1260 | src/java/org/apache/cassandra/cql3/statements/SelectStatement.java:1275-1290 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/cql3/statements/SelectStatement.java:1252` 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–16 lines × 2) src/java/org/apache/cassandra/tools/NodeTool.java:108— src/java/org/apache/cassandra/tools/NodeTool.java:108-123 | tools/fqltool/src/org/apache/cassandra/fqltool/FullQueryLogTool.java:44-54 — 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 `src/java/org/apache/cassandra/tools/NodeTool.java:108` 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. 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 (36 lines × 2) src/java/org/apache/cassandra/utils/MurmurHash.java:256— src/java/org/apache/cassandra/utils/MurmurHash.java:256-291 | src/java/org/apache/cassandra/utils/MurmurHash.java:332-367 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/utils/MurmurHash.java:256` 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 `key` to `ByteBuffer` 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 (14–15 lines × 4) src/java/org/apache/cassandra/tools/SSTableExpiredBlockers.java:83— src/java/org/apache/cassandra/tools/SSTableExpiredBlockers.java:83-97 | src/java/org/apache/cassandra/tools/StandaloneSSTableUtil.java:176-189 | src/java/org/apache/cassandra/tools/StandaloneScrubber.java:264-277 | src/java/org/apache/cassandra/tools/StandaloneVerifier.java:198-211 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/tools/SSTableExpiredBlockers.java:83` 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–15 lines × 2) src/java/org/apache/cassandra/cql3/Duration.java:152— src/java/org/apache/cassandra/cql3/Duration.java:152-166 | src/java/org/apache/cassandra/cql3/functions/types/Duration.java:142-154 — before extracting anything, compare `src/java/org/apache/cassandra/cql3/Duration.java` and `src/java/org/apache/cassandra/cql3/functions/types/Duration.java` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 112 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–14 lines × 7) src/java/org/apache/cassandra/tools/SSTableExpiredBlockers.java:80— src/java/org/apache/cassandra/tools/SSTableExpiredBlockers.java:80-93 | src/java/org/apache/cassandra/tools/StandaloneSSTableUtil.java:174-186 | src/java/org/apache/cassandra/tools/StandaloneScrubber.java:262-274 | src/java/org/apache/cassandra/tools/StandaloneSplitter.java:201-213 | src/java/org/apache/cassandra/tools/StandaloneUpgrader.java:164-176 | src/java/org/apache/cassandra/tools/StandaloneVerifier.java:196-208 | tools/sstableloader/src/org/apache/cassandra/tools/LoaderOptions.java:422-434 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 7 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 7 times. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/tools/SSTableExpiredBlockers.java:80` 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–14 lines × 2) src/java/org/apache/cassandra/cql3/statements/schema/AlterViewStatement.java:72— src/java/org/apache/cassandra/cql3/statements/schema/AlterViewStatement.java:72-83 | src/java/org/apache/cassandra/cql3/statements/schema/DropViewStatement.java:58-71 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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–14 lines × 2) src/java/org/apache/cassandra/io/util/RebufferingInputStream.java:84— src/java/org/apache/cassandra/io/util/RebufferingInputStream.java:84-94 | src/java/org/apache/cassandra/io/util/RebufferingInputStream.java: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 `src/java/org/apache/cassandra/io/util/RebufferingInputStream.java: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.
Duplicated block (13 lines × 3) src/java/org/apache/cassandra/io/sstable/SSTableIdentityIterator.java:77— src/java/org/apache/cassandra/io/sstable/SSTableIdentityIterator.java:77-89 | src/java/org/apache/cassandra/io/sstable/SSTableIdentityIterator.java:110-122 | src/java/org/apache/cassandra/io/sstable/SSTableIdentityIterator.java:142-154 — 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 `src/java/org/apache/cassandra/io/sstable/SSTableIdentityIterator.java: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 (12–13 lines × 3) src/java/org/apache/cassandra/io/util/CompressedChunkReader.java:156— src/java/org/apache/cassandra/io/util/CompressedChunkReader.java:156-168 | src/java/org/apache/cassandra/io/util/CompressedChunkReader.java:191-202 | src/java/org/apache/cassandra/io/util/CompressedChunkReader.java:239-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/io/util/CompressedChunkReader.java:156` 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 lines × 10) src/java/org/apache/cassandra/utils/obs/BitUtil.java:94— src/java/org/apache/cassandra/utils/obs/BitUtil.java:94-105 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:114-126 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:222-233 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:242-254 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:351-362 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:371-383 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:480-491 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:500-512 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:605-616 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:625-637 — all 10 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/utils/obs/BitUtil.java:94` 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 × 3) src/java/org/apache/cassandra/tools/StandaloneScrubber.java:194— src/java/org/apache/cassandra/tools/StandaloneScrubber.java:194-205 | src/java/org/apache/cassandra/tools/StandaloneSplitter.java:166-177 | src/java/org/apache/cassandra/tools/StandaloneUpgrader.java:133-144 — before extracting anything, compare `src/java/org/apache/cassandra/tools/StandaloneScrubber.java` and `src/java/org/apache/cassandra/tools/StandaloneSplitter.java` 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 `src/java/org/apache/cassandra/tools/StandaloneScrubber.java:194` 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, `src/java/org/apache/cassandra/tools/StandaloneScrubber.java:193` calls `checkManifest`, `getCompactionStrategyManager` and `src/java/org/apache/cassandra/tools/StandaloneSplitter.java:165` 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 × 4) src/java/org/apache/cassandra/io/compress/ZstdCompressorBase.java:180— src/java/org/apache/cassandra/io/compress/ZstdCompressorBase.java:180-190 | src/java/org/apache/cassandra/io/compress/ZstdCompressorBase.java:225-235 | src/java/org/apache/cassandra/io/compress/ZstdDictionaryCompressor.java:184-194 | src/java/org/apache/cassandra/io/compress/ZstdDictionaryCompressor.java:228-238 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/io/compress/ZstdCompressorBase.java:180` 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, `src/java/org/apache/cassandra/io/compress/ZstdDictionaryCompressor.java:182` calls `acquireDecompressCtx` and `src/java/org/apache/cassandra/io/compress/ZstdCompressorBase.java:177` 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 × 3) src/java/org/apache/cassandra/service/ActiveRepairService.java:388— src/java/org/apache/cassandra/service/ActiveRepairService.java:388-398 | src/java/org/apache/cassandra/service/ActiveRepairService.java:409-418 | src/java/org/apache/cassandra/service/ActiveRepairService.java:429-438 — 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 `src/java/org/apache/cassandra/service/ActiveRepairService.java:388` 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–11 lines × 2) src/java/org/apache/cassandra/db/compaction/CompactionManager.java:1375— src/java/org/apache/cassandra/db/compaction/CompactionManager.java:1375-1385 | src/java/org/apache/cassandra/io/sstable/Descriptor.java:282-290 — 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 `src/java/org/apache/cassandra/db/compaction/CompactionManager.java:1375` 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–10 lines × 2) src/java/org/apache/cassandra/cql3/Duration.java:178— src/java/org/apache/cassandra/cql3/Duration.java:178-187 | src/java/org/apache/cassandra/cql3/functions/types/Duration.java:166-172 — before extracting anything, compare `src/java/org/apache/cassandra/cql3/Duration.java` and `src/java/org/apache/cassandra/cql3/functions/types/Duration.java` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 112 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 `src/java/org/apache/cassandra/cql3/Duration.java:178` 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 × 12) src/java/org/apache/cassandra/utils/obs/BitUtil.java:222— src/java/org/apache/cassandra/utils/obs/BitUtil.java:222-231 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:242-251 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:274-282 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:351-360 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:371-380 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:403-411 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:480-489 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:500-509 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:532-540 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:605-614 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:625-634 | src/java/org/apache/cassandra/utils/obs/BitUtil.java:657-665 — all 12 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 `src/java/org/apache/cassandra/utils/obs/BitUtil.java:222` 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 (7–9 lines × 3) src/java/org/apache/cassandra/tcm/transformations/PrepareJoin.java:151— src/java/org/apache/cassandra/tcm/transformations/PrepareJoin.java:151-157 | src/java/org/apache/cassandra/tcm/transformations/PrepareLeave.java:111-119 | src/java/org/apache/cassandra/tcm/transformations/PrepareMove.java:99-106 — before extracting anything, compare `src/java/org/apache/cassandra/tcm/transformations/PrepareJoin.java` and `src/java/org/apache/cassandra/tcm/transformations/PrepareMove.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/tcm/transformations/PrepareLeave.java:111` 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 (8–9 lines × 2) src/java/org/apache/cassandra/cql3/Duration.java:205— src/java/org/apache/cassandra/cql3/Duration.java:205-212 | src/java/org/apache/cassandra/cql3/functions/types/Duration.java:189-197 — before extracting anything, compare `src/java/org/apache/cassandra/cql3/Duration.java` and `src/java/org/apache/cassandra/cql3/functions/types/Duration.java` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 112 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 `src/java/org/apache/cassandra/cql3/Duration.java: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. 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 (2–9 lines × 8) src/java/org/apache/cassandra/utils/memory/BigEndianMemoryUtil.java:112— src/java/org/apache/cassandra/utils/memory/BigEndianMemoryUtil.java:112-113 | src/java/org/apache/cassandra/utils/memory/BigEndianMemoryUtil.java:116-119 | src/java/org/apache/cassandra/utils/memory/BigEndianMemoryUtil.java:125-128 | src/java/org/apache/cassandra/utils/memory/LittleEndianMemoryUtil.java:112-113 | src/java/org/apache/cassandra/utils/memory/LittleEndianMemoryUtil.java:125-126 | src/java/org/apache/cassandra/utils/memory/NativeEndianMemoryUtil.java:150-151 | src/java/org/apache/cassandra/utils/memory/NativeEndianMemoryUtil.java:154-162 | src/java/org/apache/cassandra/utils/memory/NativeEndianMemoryUtil.java:177-185 — before extracting anything, compare `src/java/org/apache/cassandra/utils/memory/LittleEndianMemoryUtil.java` and `src/java/org/apache/cassandra/utils/memory/NativeEndianMemoryUtil.java` as WHOLE FILES: 87% 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 3 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/utils/memory/BigEndianMemoryUtil.java:116` 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 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 `value` to `long` in one and `int` 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 after the matched lines, `src/java/org/apache/cassandra/utils/memory/LittleEndianMemoryUtil.java:126` calls `putByte` and `src/java/org/apache/cassandra/utils/memory/BigEndianMemoryUtil.java:119` 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–8 lines × 2) src/java/org/apache/cassandra/service/accord/journal/AccordJournal.java:480— src/java/org/apache/cassandra/service/accord/journal/AccordJournal.java:480-487 | src/java/org/apache/cassandra/service/accord/journal/AccordJournal.java:511-517 — both copies are in the same file, so extract the 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 `src/java/org/apache/cassandra/service/accord/journal/AccordJournal.java:480` 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–16 lines × 2) src/java/org/apache/cassandra/service/reads/DataResolver.java:400— src/java/org/apache/cassandra/service/reads/DataResolver.java:400-413 | src/java/org/apache/cassandra/service/reads/DataResolver.java:425-440 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/service/reads/DataResolver.java:400` 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `merged` to `Row` in one and `RangeTombstoneMarker` 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–7 lines × 4) src/java/org/apache/cassandra/serializers/AbstractMapSerializer.java:122— src/java/org/apache/cassandra/serializers/AbstractMapSerializer.java:122-127 | src/java/org/apache/cassandra/serializers/CollectionSerializer.java:290-296 | src/java/org/apache/cassandra/serializers/MapSerializer.java:165-170 | src/java/org/apache/cassandra/serializers/SetSerializer.java:162-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 all 4 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/serializers/AbstractMapSerializer.java:122` 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, `src/java/org/apache/cassandra/serializers/AbstractMapSerializer.java:121` calls `duplicate` and `src/java/org/apache/cassandra/serializers/CollectionSerializer.java:289` 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 (4–6 lines × 3) src/java/org/apache/cassandra/utils/IntervalTree.java:269— src/java/org/apache/cassandra/utils/IntervalTree.java:269-272 | src/java/org/apache/cassandra/utils/IntervalTree.java:335-340 | src/java/org/apache/cassandra/utils/IntervalTree.java:549-554 — 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 `src/java/org/apache/cassandra/utils/IntervalTree.java:269` 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 `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 (4–5 lines × 4) src/java/org/apache/cassandra/utils/memory/LittleEndianMemoryUtil.java:116— src/java/org/apache/cassandra/utils/memory/LittleEndianMemoryUtil.java:116-119 | src/java/org/apache/cassandra/utils/memory/LittleEndianMemoryUtil.java:125-128 | src/java/org/apache/cassandra/utils/memory/NativeEndianMemoryUtil.java:165-169 | src/java/org/apache/cassandra/utils/memory/NativeEndianMemoryUtil.java:184-188 — before extracting anything, compare `src/java/org/apache/cassandra/utils/memory/LittleEndianMemoryUtil.java` and `src/java/org/apache/cassandra/utils/memory/NativeEndianMemoryUtil.java` as WHOLE FILES: 87% 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 3 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/utils/memory/LittleEndianMemoryUtil.java:116` 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 `value` to `long` in one and `int` 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 lines × 2) src/java/org/apache/cassandra/concurrent/ExecutorPlus.java:56— src/java/org/apache/cassandra/concurrent/ExecutorPlus.java:56-187 | src/java/org/apache/cassandra/index/sai/memory/MemtableIndex.java:62-98 — 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 (33 lines × 2) src/java/org/apache/cassandra/io/FSReadError.java:28— src/java/org/apache/cassandra/io/FSReadError.java:28-60 | src/java/org/apache/cassandra/io/FSWriteError.java:28-65 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (57 lines × 2) src/java/org/apache/cassandra/locator/AbstractEndpointSnitch.java:1— src/java/org/apache/cassandra/locator/AbstractEndpointSnitch.java:1-77 | src/java/org/apache/cassandra/locator/BaseProximity.java:1-57 — before extracting anything, compare `src/java/org/apache/cassandra/locator/AbstractEndpointSnitch.java` and `src/java/org/apache/cassandra/locator/BaseProximity.java` as WHOLE FILES: 95% 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/java/org/apache/cassandra/locator/AbstractEndpointSnitch.java:1` 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 × 7) src/java/org/apache/cassandra/db/virtual/walker/CounterMetricRowWalker.java:49— src/java/org/apache/cassandra/db/virtual/walker/CounterMetricRowWalker.java:49-61 | src/java/org/apache/cassandra/db/virtual/walker/GaugeMetricRowWalker.java:49-61 | src/java/org/apache/cassandra/db/virtual/walker/HistogramMetricRowWalker.java:63-75 | src/java/org/apache/cassandra/db/virtual/walker/MeterMetricRowWalker.java:57-69 | src/java/org/apache/cassandra/db/virtual/walker/MetricRowWalker.java:51-63 | src/java/org/apache/cassandra/db/virtual/walker/ThreadPoolRowWalker.java:63-75 | src/java/org/apache/cassandra/db/virtual/walker/TimerMetricRowWalker.java:76-88 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 7 call sites, so a change lands once.
Duplicated block (12 lines × 4) src/java/org/apache/cassandra/tools/nodetool/InvalidateCredentialsCache.java:38— src/java/org/apache/cassandra/tools/nodetool/InvalidateCredentialsCache.java:38-50 | src/java/org/apache/cassandra/tools/nodetool/InvalidateJmxPermissionsCache.java:38-49 | src/java/org/apache/cassandra/tools/nodetool/InvalidateNetworkPermissionsCache.java:38-50 | src/java/org/apache/cassandra/tools/nodetool/InvalidateRolesCache.java:39-51 — before extracting anything, compare `src/java/org/apache/cassandra/tools/nodetool/InvalidateCredentialsCache.java` and `src/java/org/apache/cassandra/tools/nodetool/InvalidateJmxPermissionsCache.java` as WHOLE FILES: 83% 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 (15–17 lines × 2) formalise/accord/execution/tla/matrix.py:532— formalise/accord/execution/tla/matrix.py:532-548 | formalise/accord/execution/tla/notify.py:403-417 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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) .build/sh/ant-log-summary.py:100— .build/sh/ant-log-summary.py:100-114 | .build/sh/test-log-summary.py:177-190 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11–15 lines × 2) formalise/accord/execution/tla/matrix.py:331— formalise/accord/execution/tla/matrix.py:331-341 | formalise/accord/execution/tla/notify.py:248-262 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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, `formalise/accord/execution/tla/notify.py:263` calls `write` and `formalise/accord/execution/tla/matrix.py:342` 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.
D4 · Code Duplication· Edited copies of one member (6 members, 14+ corresponding lines) · ×1
Edited copies of one member (6 members, 14+ corresponding lines) tools/stress/src/org/apache/cassandra/stress/settings/SettingsErrors.java:68— tools/stress/src/org/apache/cassandra/stress/settings/SettingsErrors.java:68-81 | tools/stress/src/org/apache/cassandra/stress/settings/SettingsJMX.java:74-87 | tools/stress/src/org/apache/cassandra/stress/settings/SettingsLog.java:118-131 | tools/stress/src/org/apache/cassandra/stress/settings/SettingsNode.java:172-185 | tools/stress/src/org/apache/cassandra/stress/settings/SettingsReporting.java:86-99 | tools/stress/src/org/apache/cassandra/stress/settings/SettingsSchema.java:237-253 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
Duplicated block (38 lines × 2) tools/stress/src/org/apache/cassandra/stress/settings/SettingsSchema.java:126— tools/stress/src/org/apache/cassandra/stress/settings/SettingsSchema.java:126-163 | tools/stress/src/org/apache/cassandra/stress/settings/SettingsSchema.java:168-205 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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.
No DR/backup evidence — A persistence guard (data volume / purge-protection) was found, but no backup, geo-recovery or RTO/RPO controls were evidenced — a volume that survives a container recreate is not a tested restore from catastrophic loss.
Orphaned file src/java/org/apache/cassandra/utils/streamhist/StreamingTombstoneHistogramBuilder.java:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/java/org/apache/cassandra/cql3/statements/schema/CopyTableStatement.java:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/java/org/apache/cassandra/service/accord/AccordFetchCoordinator.java:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/java/org/apache/cassandra/db/DataRange.java:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/java/org/apache/cassandra/index/sai/utils/PrimaryKey.java:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/java/org/apache/cassandra/service/pager/AggregationQueryPager.java:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/java/org/apache/cassandra/index/sai/disk/format/IndexDescriptor.java:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/java/org/apache/cassandra/index/sai/plan/Expression.java:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/java/org/apache/cassandra/security/PEMBasedSslContextFactory.java:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/java/org/apache/cassandra/db/SimpleBuilders.java:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/java/org/apache/cassandra/cql3/functions/types/AbstractData.java:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/java/org/apache/cassandra/cql3/functions/CastFcts.java:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/java/org/apache/cassandra/tools/nodetool/stats/StatsTableComparator.java:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/java/org/apache/cassandra/cql3/restrictions/PartitionKeyRestrictions.java:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/java/org/apache/cassandra/cql3/functions/UDAggregate.java:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/java/org/apache/cassandra/db/marshal/MapType.java:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/java/org/apache/cassandra/index/sai/plan/Operation.java:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/java/org/apache/cassandra/index/sai/disk/v1/bbtree/BlockBalancedTreeReader.java:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/java/org/apache/cassandra/tools/StandaloneJournalUtil.java:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/java/org/apache/cassandra/cql3/functions/OperationFcts.java:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/java/org/apache/cassandra/index/sasi/disk/TokenTree.java:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/java/org/apache/cassandra/db/virtual/PartitionKeyStatsTable.java:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/java/org/apache/cassandra/cql3/selection/AbstractFunctionSelector.java:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/java/org/apache/cassandra/io/compress/DirectCompressedSequentialWriter.java:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/java/org/apache/cassandra/db/lifecycle/LogRecord.java: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 src/java/org/apache/cassandra/gms/GossipDigestAckVerbHandler.java:44— `!Gossiper.instance.isEnabled() && !NewGossiper.instance.isInShadowRound()` appears character-identically in 2 files — src/java/org/apache/cassandra/gms/GossipDigestAckVerbHandler.java, src/java/org/apache/cassandra/gms/GossipDigestSynVerbHandler.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/java/org/apache/cassandra/tools/nodetool/EnableAuditLog.java:79— `!blocking.equalsIgnoreCase("TRUE") && !blocking.equalsIgnoreCase("FALSE")` appears character-identically in 2 files — src/java/org/apache/cassandra/tools/nodetool/EnableAuditLog.java, src/java/org/apache/cassandra/tools/nodetool/EnableFullQueryLog.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/java/org/apache/cassandra/io/sstable/SSTableCursorWriter.java:300— `!column.type.isCollection() || !column.type.isMultiCell()` appears character-identically in 2 files — src/java/org/apache/cassandra/io/sstable/SSTableCursorWriter.java, src/java/org/apache/cassandra/io/sstable/format/SortedTableWriter.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/java/org/apache/cassandra/io/sstable/format/big/BigSSTableReaderLoadingBuilder.java:81— `!online || builder.getSerializationHeader() != null` appears character-identically in 2 files — src/java/org/apache/cassandra/io/sstable/format/big/BigSSTableReaderLoadingBuilder.java, src/java/org/apache/cassandra/io/sstable/format/bti/BtiTableReaderLoadingBuilder.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/java/org/apache/cassandra/tools/nodetool/CompactionHistory.java:45— `!outputFormat.isEmpty() && !"json".equals(outputFormat) && !"yaml".equals(outputFormat)` appears character-identically in 4 files — src/java/org/apache/cassandra/tools/nodetool/CompactionHistory.java, src/java/org/apache/cassandra/tools/nodetool/DataPaths.java, src/java/org/apache/cassandra/tools/nodetool/TableStats.java, src/java/org/apache/cassandra/tools/nodetool/TpStats.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/java/org/apache/cassandra/service/paxos/uncommitted/UncommittedTableData.java:138— `!range.right.isMinimum() && range.right.compareTo(token) < 0` appears character-identically in 2 files — src/java/org/apache/cassandra/service/paxos/uncommitted/UncommittedTableData.java, src/java/org/apache/cassandra/tcm/ownership/ReplicaGroups.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/java/org/apache/cassandra/cql3/statements/schema/CreateAggregateStatement.java:112— `!raw.isImplicitlyFrozen() && raw.isFrozen()` appears character-identically in 4 files — src/java/org/apache/cassandra/cql3/statements/schema/CreateAggregateStatement.java, src/java/org/apache/cassandra/cql3/statements/schema/CreateFunctionStatement.java, src/java/org/apache/cassandra/cql3/statements/schema/DropAggregateStatement.java, src/java/org/apache/cassandra/cql3/statements/schema/DropFunctionStatement.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/java/org/apache/cassandra/tcm/AbstractLocalProcessor.java:67— `!retryPolicy.hasExpired() && !log.isClosed()` appears character-identically in 2 files — src/java/org/apache/cassandra/tcm/AbstractLocalProcessor.java, src/java/org/apache/cassandra/tcm/PaxosBackedProcessor.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/java/org/apache/cassandra/tools/nodetool/Repair.java:231— `!startToken.isEmpty() || !endToken.isEmpty()` appears character-identically in 2 files — src/java/org/apache/cassandra/tools/nodetool/Repair.java, src/java/org/apache/cassandra/tools/nodetool/RepairAdmin.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/java/org/apache/cassandra/db/transform/BasePartitions.java:90— `!stop.isSignalled && !stopChild.isSignalled && input.hasNext()` appears character-identically in 2 files — src/java/org/apache/cassandra/db/transform/BasePartitions.java, src/java/org/apache/cassandra/db/transform/BaseRows.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/java/org/apache/cassandra/dht/ExcludingBounds.java:34— `!strictlyWrapsAround(left, right) && (right.isMinimum() || left.compareTo(right) != 0)` appears character-identically in 2 files — src/java/org/apache/cassandra/dht/ExcludingBounds.java, src/java/org/apache/cassandra/dht/IncludingExcludingBounds.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/java/org/apache/cassandra/cql3/functions/types/ParseUtils.java:198— `(c >= '0' && c <= '9') || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '-' || c == '+' || c == '.' || c == '_' || c == '&'` appears character-identically in 2 files — src/java/org/apache/cassandra/cql3/functions/types/ParseUtils.java, src/java/org/apache/cassandra/db/marshal/TypeParser.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/java/org/apache/cassandra/schema/SchemaKeyspace.java:671— `DatabaseDescriptor.getRawConfig() != null && DatabaseDescriptor.getAutoRepairConfig().isAutoRepairSchedulingEnabled()` appears character-identically in 2 files — src/java/org/apache/cassandra/schema/SchemaKeyspace.java, src/java/org/apache/cassandra/schema/TableParams.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/java/org/apache/cassandra/index/accord/RangeMemoryIndex.java:142— `FastByteOperations.compareUnsigned(start, bytes) < 0 && FastByteOperations.compareUnsigned(end, bytes) >= 0` appears character-identically in 2 files — src/java/org/apache/cassandra/index/accord/RangeMemoryIndex.java, src/java/org/apache/cassandra/service/accord/journal/SegmentRangeSearcher.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/java/org/apache/cassandra/cql3/selection/ListSelector.java:162— `Objects.equal(type, s.type) && Objects.equal(elements, s.elements)` appears character-identically in 4 files — src/java/org/apache/cassandra/cql3/selection/ListSelector.java, src/java/org/apache/cassandra/cql3/selection/MapSelector.java, src/java/org/apache/cassandra/cql3/selection/SetSelector.java, src/java/org/apache/cassandra/cql3/selection/TupleSelector.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/java/org/apache/cassandra/tcm/ownership/EndpointDelta.java:153— `Objects.equals(removals, delta.removals) && Objects.equals(additions, delta.additions)` appears character-identically in 2 files — src/java/org/apache/cassandra/tcm/ownership/EndpointDelta.java, src/java/org/apache/cassandra/tcm/ownership/NodeIdDelta.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/java/org/apache/cassandra/db/compression/CompressionDictionaryScheduler.java:273— `ScheduledExecutors.nonPeriodicTasks.isShutdown() && Throwables.isCausedByInterrupt(t)` appears character-identically in 2 files — src/java/org/apache/cassandra/db/compression/CompressionDictionaryScheduler.java, src/java/org/apache/cassandra/db/compression/ZstdDictionaryTrainer.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/java/org/apache/cassandra/tcm/transformations/AccordMarkHardRemoved.java:71— `Transformation.super.eligibleToCommit(metadata) && supportsExtendedNodeInfo(metadata.directory)` appears character-identically in 2 files — src/java/org/apache/cassandra/tcm/transformations/AccordMarkHardRemoved.java, src/java/org/apache/cassandra/tcm/transformations/AccordMarkStale.java. 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 tools/sstableloader/src/org/apache/cassandra/tools/BulkLoader.java:284— `acceptedProtocols != null && acceptedProtocols.length > 0` appears character-identically in 2 files — tools/sstableloader/src/org/apache/cassandra/tools/BulkLoader.java, tools/stress/src/org/apache/cassandra/stress/util/JavaDriverClient.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/java/org/apache/cassandra/serializers/FloatSerializer.java:45— `accessor.size(value) != 4 && !accessor.isEmpty(value)` appears character-identically in 2 files — src/java/org/apache/cassandra/serializers/FloatSerializer.java, src/java/org/apache/cassandra/serializers/Int32Serializer.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/java/org/apache/cassandra/serializers/DoubleSerializer.java:44— `accessor.size(value) != 8 && !accessor.isEmpty(value)` appears character-identically in 3 files — src/java/org/apache/cassandra/serializers/DoubleSerializer.java, src/java/org/apache/cassandra/serializers/LongSerializer.java, src/java/org/apache/cassandra/serializers/TimestampSerializer.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/java/org/apache/cassandra/db/marshal/AbstractCompositeType.java:62— `accessorL.isEmpty(left) || accessorR.isEmpty(right)` appears character-identically in 8 files — src/java/org/apache/cassandra/db/marshal/AbstractCompositeType.java, src/java/org/apache/cassandra/db/marshal/AbstractType.java, src/java/org/apache/cassandra/db/marshal/BooleanType.java, src/java/org/apache/cassandra/db/marshal/CollectionType.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/java/org/apache/cassandra/tcm/ownership/EndpointDelta.java:97— `additions.isEmpty() && removals.isEmpty()` appears character-identically in 2 files — src/java/org/apache/cassandra/tcm/ownership/EndpointDelta.java, src/java/org/apache/cassandra/tcm/ownership/NodeIdDelta.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/java/org/apache/cassandra/streaming/StreamPlan.java:115— `all(fullRanges, Replica::isSelf) || RangesAtEndpoint.isDummyList(fullRanges)` appears character-identically in 2 files — src/java/org/apache/cassandra/streaming/StreamPlan.java, src/java/org/apache/cassandra/streaming/StreamSession.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/java/org/apache/cassandra/streaming/StreamPlan.java:116— `all(transientRanges, Replica::isSelf) || RangesAtEndpoint.isDummyList(transientRanges)` appears character-identically in 2 files — src/java/org/apache/cassandra/streaming/StreamPlan.java, src/java/org/apache/cassandra/streaming/StreamSession.java. 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.
Interpolated log message defeats structured logging src/java/org/apache/cassandra/utils/EstimatedHistogram.java:353— `debug` at line 353 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.debug("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text.
Interpolated log message defeats structured logging src/java/org/apache/cassandra/utils/JavaUtils.java:51— `error` at line 51 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.error("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text.
Interpolated log message defeats structured logging src/java/org/apache/cassandra/utils/ResourceWatcher.java:64— `error` at line 64 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.error("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text.
Interpolated log message defeats structured logging src/java/org/apache/cassandra/utils/StatusLogger.java:71— `info` at line 71 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text.
Interpolated log message defeats structured logging src/java/org/apache/cassandra/utils/StatusLogger.java:81— `info` at line 81 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text.
Interpolated log message defeats structured logging src/java/org/apache/cassandra/utils/StatusLogger.java:93— `info` at line 93 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text.
Interpolated log message defeats structured logging src/java/org/apache/cassandra/utils/StatusLogger.java:105— `info` at line 105 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text.
Interpolated log message defeats structured logging src/java/org/apache/cassandra/utils/StatusLogger.java:111— `info` at line 111 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text.
Interpolated log message defeats structured logging src/java/org/apache/cassandra/utils/StatusLogger.java:121— `info` at line 121 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text.
Interpolated log message defeats structured logging src/java/org/apache/cassandra/utils/SystemInfo.java:127— `error` at line 127 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.error("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text.
Interpolated log message defeats structured logging src/java/org/apache/cassandra/transport/SimpleClient.java:908— `warn` at line 908 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text.
Interpolated log message defeats structured logging src/java/org/apache/cassandra/tracing/Tracing.java:127— `error` at line 127 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.error("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text.
Interpolated log message defeats structured logging src/java/org/apache/cassandra/tcm/CMSOperations.java:376— `info` at line 376 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text.
Interpolated log message defeats structured logging src/java/org/apache/cassandra/tcm/ClusterMetadataService.java:1001— `warn` at line 1001 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text.
Interpolated log message defeats structured logging src/java/org/apache/cassandra/tcm/MetadataSnapshots.java:119— `error` at line 119 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.error("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text.
Interpolated log message defeats structured logging src/java/org/apache/cassandra/tcm/PeerLogFetcher.java:123— `warn` at line 123 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text.
Interpolated log message defeats structured logging src/java/org/apache/cassandra/tcm/RemoteProcessor.java:416— `warn` at line 416 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text.
Interpolated log message defeats structured logging src/java/org/apache/cassandra/tcm/Startup.java:439— `debug` at line 439 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.debug("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text.
Interpolated log message defeats structured logging src/java/org/apache/cassandra/tcm/Startup.java:803— `warn` at line 803 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text.
Interpolated log message defeats structured logging src/java/org/apache/cassandra/tcm/transformations/AccordMarkHardRemoved.java:109— `info` at line 109 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text.
Interpolated log message defeats structured logging src/java/org/apache/cassandra/tcm/transformations/AccordMarkStale.java:101— `info` at line 101 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text.
Interpolated log message defeats structured logging src/java/org/apache/cassandra/tcm/transformations/AccordUnmarkStale.java:74— `info` at line 74 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text.
Interpolated log message defeats structured logging src/java/org/apache/cassandra/tcm/transformations/PrepareLeave.java:177— `warn` at line 177 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text.
Interpolated log message defeats structured logging src/java/org/apache/cassandra/tcm/sequences/ProgressBarrier.java:150— `info` at line 150 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text.
Interpolated log message defeats structured logging src/java/org/apache/cassandra/tcm/compatibility/GossipHelper.java:145— `error` at line 145 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.error("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text.
Disabled test test/burn/org/apache/cassandra/concurrent/LongSharedExecutorPoolTest.java:103— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test test/distributed/org/apache/cassandra/distributed/test/AbstractHintWindowTest.java:44— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test test/distributed/org/apache/cassandra/distributed/test/AbstractNodetoolStatusTest.java:50— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test test/distributed/org/apache/cassandra/distributed/test/AbstractVirtualLogsTableTest.java:25— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test test/distributed/org/apache/cassandra/distributed/test/CASTest.java:190— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test test/distributed/org/apache/cassandra/distributed/test/LegacyCASTest.java:76— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test test/distributed/org/apache/cassandra/distributed/test/RepairCoordinatorFailingMessageTest.java:48— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test test/distributed/org/apache/cassandra/distributed/test/ResourceLeakTest.java:238— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test test/distributed/org/apache/cassandra/distributed/test/ResourceLeakTest.java:249— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test test/distributed/org/apache/cassandra/distributed/test/ResourceLeakTest.java:260— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test test/distributed/org/apache/cassandra/distributed/test/ResourceLeakTest.java:271— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test test/distributed/org/apache/cassandra/distributed/test/ResourceLeakTest.java:287— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test test/distributed/org/apache/cassandra/distributed/test/accord/AccordCQLTestBase.java:3322— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test test/distributed/org/apache/cassandra/distributed/test/accord/AccordCQLTestBase.java:3340— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test test/distributed/org/apache/cassandra/distributed/test/accord/AccordIncrementalRepairTest.java:249— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test test/distributed/org/apache/cassandra/distributed/test/accord/AccordLoadTest.java:1084— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test test/distributed/org/apache/cassandra/distributed/test/accord/AccordSimpleFastPathTest.java:87— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test test/distributed/org/apache/cassandra/distributed/test/accord/AccordWriteInteroperabilityTest.java:69— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test test/distributed/org/apache/cassandra/distributed/test/accord/MigrationFromAccordReadRaceTest.java:23— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test test/distributed/org/apache/cassandra/distributed/test/accord/MigrationFromAccordWriteRaceTest.java:23— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test test/distributed/org/apache/cassandra/distributed/test/accord/MigrationToAccordReadRaceTest.java:23— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test test/distributed/org/apache/cassandra/distributed/test/accord/MigrationToAccordWriteRaceTest.java:23— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test test/distributed/org/apache/cassandra/distributed/test/accord/journal/StatefulJournalRestartTest.java:84— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test test/distributed/org/apache/cassandra/distributed/test/cql3/FullAccordInteropMultiNodeTableWalkTest.java:28— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test test/distributed/org/apache/cassandra/distributed/test/cql3/MixedReadsAccordInteropMultiNodeTableWalkTest.java:28— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Fat interface: GettableByIndexData (32 abstract methods) src/java/org/apache/cassandra/cql3/functions/types/GettableByIndexData.java:38— `GettableByIndexData` declares 32 abstract methods: `get`, `get`, `get`, `getBool`, `getByte`, `getBytes`, `getBytesUnsafe`, `getDate`, `getDecimal`, `getDouble`, `getFloat`, `getInet`, `getInt`, `getList`, `getList`, `getLong`, `getMap`, `getMap`, `getObject`, `getSet`, `getSet`, `getShort`, `getString`, `getTime`, `getTimestamp`, `getTupleValue`, `getUDTValue`, `getUUID`, `getVarint`, `getVector`, `getVector`, `isNull`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. Those 32 declarations carry 26 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 26 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: GettableByNameData (32 abstract methods) src/java/org/apache/cassandra/cql3/functions/types/GettableByNameData.java:38— `GettableByNameData` declares 32 abstract methods: `get`, `get`, `get`, `getBool`, `getByte`, `getBytes`, `getBytesUnsafe`, `getDate`, `getDecimal`, `getDouble`, `getFloat`, `getInet`, `getInt`, `getList`, `getList`, `getLong`, `getMap`, `getMap`, `getObject`, `getSet`, `getSet`, `getShort`, `getString`, `getTime`, `getTimestamp`, `getTupleValue`, `getUDTValue`, `getUUID`, `getVarint`, `getVector`, `getVector`, `isNull`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. Those 32 declarations carry 26 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 26 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: SettableByIndexData<T> (33 abstract methods) src/java/org/apache/cassandra/cql3/functions/types/SettableByIndexData.java:38— `SettableByIndexData<T>` declares 33 abstract methods: `set`, `set`, `set`, `setBool`, `setByte`, `setBytes`, `setBytesUnsafe`, `setDate`, `setDecimal`, `setDouble`, `setFloat`, `setInet`, `setInt`, `setList`, `setList`, `setList`, `setLong`, `setMap`, `setMap`, `setMap`, `setSet`, `setSet`, `setSet`, `setShort`, `setString`, `setTime`, `setTimestamp`, `setToNull`, `setTupleValue`, `setUDTValue`, `setUUID`, `setVarint`, `setVector`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. Those 33 declarations carry 25 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 25 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: SettableByNameData<T> (33 abstract methods) src/java/org/apache/cassandra/cql3/functions/types/SettableByNameData.java:38— `SettableByNameData<T>` declares 33 abstract methods: `set`, `set`, `set`, `setBool`, `setByte`, `setBytes`, `setBytesUnsafe`, `setDate`, `setDecimal`, `setDouble`, `setFloat`, `setInet`, `setInt`, `setList`, `setList`, `setList`, `setLong`, `setMap`, `setMap`, `setMap`, `setSet`, `setSet`, `setSet`, `setShort`, `setString`, `setTime`, `setTimestamp`, `setToNull`, `setTupleValue`, `setUDTValue`, `setUUID`, `setVarint`, `setVector`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. Those 33 declarations carry 25 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 25 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: IAccordService (30 abstract methods) src/java/org/apache/cassandra/service/accord/IAccordService.java:81— `IAccordService` declares 30 abstract methods: `agent`, `awaitDone`, `coordinate`, `coordinateAsync`, `currentEpoch`, `endpointMapper`, `ensureMinHlc`, `epochReady`, `epochReadyFor`, `executors`, `flushCaches`, `getCompactionInfo`, `isEnabled`, `journalConfiguration`, `localStartup`, `maxConflict`, `minEpoch`, `node`, `receive`, `requestHandler`, `responseHandler`, `scheduler`, `setCacheSize`, `setWorkingSetSize`, `shutdownAndWait`, `stop`, `sync`, `syncKeysForMigration`, `topology`, `topologyService`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. 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: ActiveRepairServiceMBean (22 abstract methods) src/java/org/apache/cassandra/service/ActiveRepairServiceMBean.java:26— `ActiveRepairServiceMBean` declares 22 abstract methods: `cleanupPending`, `failSession`, `getConcurrentMerkleTreeRequests`, `getIncrementalRepairDiskHeadroomRejectRatio`, `getPaxosRepairParallelism`, `getPendingStats`, `getRepairPendingCompactionRejectThreshold`, `getRepairSessionSpaceInMebibytes`, `getRepairSessionSpaceInMegabytes`, `getRepairSessionSpaceInMiB`, `getRepairStats`, `getSessions`, `getUseOffheapMerkleTrees`, `parentRepairSessionsCount`, `setConcurrentMerkleTreeRequests`, `setIncrementalRepairDiskHeadroomRejectRatio`, `setPaxosRepairParallelism`, `setRepairPendingCompactionRejectThreshold`, `setRepairSessionSpaceInMebibytes`, `setRepairSessionSpaceInMegabytes`, `setRepairSessionSpaceInMiB`, `setUseOffheapMerkleTrees`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. 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: AutoRepairServiceMBean (26 abstract methods) src/java/org/apache/cassandra/service/AutoRepairServiceMBean.java:26— `AutoRepairServiceMBean` declares 26 abstract methods: `getAutoRepairConfiguration`, `getOnGoingRepairHostIds`, `isAutoRepairDisabled`, `setAllowParallelReplicaRepair`, `setAllowParallelReplicaRepairAcrossSchedules`, `setAutoRepairEnabled`, `setAutoRepairHistoryClearDeleteHostsBufferDuration`, `setAutoRepairMaxRetriesCount`, `setAutoRepairMinRepairTaskDuration`, `setAutoRepairRetryBackoff`, `setAutoRepairTableMaxRepairTime`, `setAutoRepairTokenRangeSplitterParameter`, `setForceRepairForHosts`, `setIgnoreDCs`, `setMVRepairEnabled`, `setMixedMajorVersionRepairEnabled`, `setParallelRepairCount`, `setParallelRepairPercentage`, `setPrimaryTokenRangeOnly`, `setRepairByKeyspace`, `setRepairMinInterval`, `setRepairPriorityForHosts`, `setRepairSSTableCountHigherThreshold`, `setRepairSessionTimeout`, `setRepairThreads`, `startScheduler`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. 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: CacheServiceMBean (19 abstract methods) src/java/org/apache/cassandra/service/CacheServiceMBean.java:22— `CacheServiceMBean` declares 19 abstract methods: `getCounterCacheKeysToSave`, `getCounterCacheSavePeriodInSeconds`, `getKeyCacheKeysToSave`, `getKeyCacheSavePeriodInSeconds`, `getRowCacheKeysToSave`, `getRowCacheSavePeriodInSeconds`, `invalidateCounterCache`, `invalidateKeyCache`, `invalidateRowCache`, `saveCaches`, `setCounterCacheCapacityInMB`, `setCounterCacheKeysToSave`, `setCounterCacheSavePeriodInSeconds`, `setKeyCacheCapacityInMB`, `setKeyCacheKeysToSave`, `setKeyCacheSavePeriodInSeconds`, `setRowCacheCapacityInMB`, `setRowCacheKeysToSave`, `setRowCacheSavePeriodInSeconds`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. 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: StorageProxyMBean (100 abstract methods) src/java/org/apache/cassandra/service/StorageProxyMBean.java:24— `StorageProxyMBean` declares 100 abstract methods: `denylistKey`, `disableCheckForDuplicateRowsDuringCompaction`, `disableCheckForDuplicateRowsDuringReads`, `disableHintsForDC`, `disableRepairedDataTrackingForPartitionReads`, `disableRepairedDataTrackingForRangeReads`, `disableReportingUnconfirmedRepairedDataMismatches`, `disableSnapshotOnDuplicateRowDetection`, `disableSnapshotOnRepairedDataMismatch`, `enableCheckForDuplicateRowsDuringCompaction`, `enableCheckForDuplicateRowsDuringReads`, `enableHintsForDC`, `enableRepairedDataTrackingForPartitionReads`, `enableRepairedDataTrackingForRangeReads`, `enableReportingUnconfirmedRepairedDataMismatches`, `enableSnapshotOnDuplicateRowDetection`, `enableSnapshotOnRepairedDataMismatch`, `getAllowArtificialLatencyForAllConsistencyLevels`, `getArtificialLatencies`, `getArtificialLatencyEnabled`, `getArtificialLatencyVerbs`, `getCasContentionTimeout`, `getCheckForDuplicateRowsDuringCompaction`, `getCheckForDuplicateRowsDuringReads`, `getClientRequestSizeMetricsEnabled`, `getCounterWriteRpcTimeout`, `getDumpHeapOnUncaughtException`, `getHintedHandoffDisabledDCs`, `getHintedHandoffEnabled`, `getHintsInProgress`, `getIdealConsistencyLevel`, `getMaxHintWindow`, `getMaxHintsInProgress`, `getMaxHintsSizePerHostInMiB`, `getNativeTransportMaxConcurrentConnections`, `getNativeTransportMaxConcurrentConnectionsPerIp`, `getNumberOfTables`, `getOtcBacklogExpirationInterval`, `getPartitionDenylistLoadAttempts`, `getPartitionDenylistLoadSuccesses`, and 60 more. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. 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: StorageServiceMBean (395 abstract methods) src/java/org/apache/cassandra/service/StorageServiceMBean.java:42— `StorageServiceMBean` declares 395 abstract methods: `abortBootstrap`, `abortDecommission`, `abortMove`, `abortRemoveNode`, `alterTopology`, `assassinateEndpoint`, `autoOptimiseFullRepairStreams`, `autoOptimiseIncRepairStreams`, `autoOptimisePreviewRepairStreams`, `bulkLoad`, `bulkLoadAsync`, `bypassConcurrentValidatorsLimit`, `cleanupSizeEstimates`, `clearConnectionHistory`, `clearOrphanedCompressionDictionaries`, `clearPaxosRepairs`, `clearSnapshot`, `clearSnapshot`, `decommission`, `deliverHints`, `describeRingJMX`, `describeRingWithPortJMX`, `disableAuditLog`, `disableAutoCompaction`, `disableNativeTransportOldProtocolVersions`, `drain`, `dropPreparedStatements`, `effectiveOwnership`, `effectiveOwnershipWithPort`, `enableAuditLog`, `enableAuditLog`, `enableAuditLog`, `enableAuditLog`, `enableAutoCompaction`, `enableFullQueryLogger`, `enableNativeTransportOldProtocolVersions`, `enforceConcurrentValidatorsLimit`, `evictHungRepairs`, `finishConsensusMigration`, `forceCompactionKeysIgnoringGcGrace`, and 355 more. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. Those 395 declarations carry 376 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 376 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: IRoleManager (16 abstract methods) src/java/org/apache/cassandra/auth/IRoleManager.java:38— `IRoleManager` declares 16 abstract methods: `alterRole`, `alterableOptions`, `canLogin`, `createRole`, `dropRole`, `getAllRoles`, `getCustomOptions`, `getRoles`, `grantRole`, `isExistingRole`, `isSuper`, `protectedResources`, `revokeRole`, `setup`, `supportedOptions`, `validateConfiguration`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. 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: CompactionManagerMBean (29 abstract methods) src/java/org/apache/cassandra/db/compaction/CompactionManagerMBean.java:25— `CompactionManagerMBean` declares 29 abstract methods: `forceUserDefinedCleanup`, `forceUserDefinedCompaction`, `getAutomaticSSTableUpgradeEnabled`, `getCompactionHistory`, `getCompactionSummary`, `getCompactions`, `getCoreCompactorThreads`, `getCoreSecondaryIndexExecutorThreads`, `getCoreValidationThreads`, `getCoreViewBuildThreads`, `getDisableSTCSInL0`, `getMaxConcurrentAutoUpgradeTasks`, `getMaximumCompactorThreads`, `getMaximumSecondaryIndexExecutorThreads`, `getMaximumValidatorThreads`, `getMaximumViewBuildThreads`, `setAutomaticSSTableUpgradeEnabled`, `setCoreCompactorThreads`, `setCoreSecondaryIndexExecutorThreads`, `setCoreValidationThreads`, `setCoreViewBuildThreads`, `setDisableSTCSInL0`, `setMaxConcurrentAutoUpgradeTasks`, `setMaximumCompactorThreads`, `setMaximumSecondaryIndexExecutorThreads`, `setMaximumValidatorThreads`, `setMaximumViewBuildThreads`, `stopCompaction`, `stopCompactionById`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. 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: GuardrailsConfig (124 abstract methods) src/java/org/apache/cassandra/db/guardrails/GuardrailsConfig.java:48— `GuardrailsConfig` declares 124 abstract methods: `getAllowFilteringEnabled`, `getAlterTableEnabled`, `getBulkLoadEnabled`, `getCollectionListSizeFailThreshold`, `getCollectionListSizeWarnThreshold`, `getCollectionMapSizeFailThreshold`, `getCollectionMapSizeWarnThreshold`, `getCollectionSetSizeFailThreshold`, `getCollectionSetSizeWarnThreshold`, `getCollectionSizeFailThreshold`, `getCollectionSizeWarnThreshold`, `getColumnAsciiValueSizeFailThreshold`, `getColumnAsciiValueSizeWarnThreshold`, `getColumnBlobValueSizeFailThreshold`, `getColumnBlobValueSizeWarnThreshold`, `getColumnTextAndVarcharValueSizeFailThreshold`, `getColumnTextAndVarcharValueSizeWarnThreshold`, `getColumnValueSizeFailThreshold`, `getColumnValueSizeWarnThreshold`, `getColumnsPerTableFailThreshold`, `getColumnsPerTableWarnThreshold`, `getCompactTablesEnabled`, `getDataDiskUsageKeyspaceWideProtectionEnabled`, `getDataDiskUsageMaxDiskSize`, `getDataDiskUsagePercentageFailThreshold`, `getDataDiskUsagePercentageWarnThreshold`, `getDropKeyspaceEnabled`, `getDropTruncateTableEnabled`, `getFieldsPerUDTFailThreshold`, `getFieldsPerUDTWarnThreshold`, `getGroupByEnabled`, `getInSelectCartesianProductFailThreshold`, `getInSelectCartesianProductWarnThreshold`, `getIntersectFilteringQueryEnabled`, `getIntersectFilteringQueryWarned`, `getItemsPerCollectionFailThreshold`, `getItemsPerCollectionWarnThreshold`, `getKeyspacePropertiesDisallowed`, `getKeyspacePropertiesIgnored`, `getKeyspacePropertiesWarned`, and 84 more. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. 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: GuardrailsMBean (197 abstract methods) src/java/org/apache/cassandra/db/guardrails/GuardrailsMBean.java:37— `GuardrailsMBean` declares 197 abstract methods: `getAllowFilteringEnabled`, `getAlterTableEnabled`, `getBulkLoadEnabled`, `getCollectionListSizeFailThreshold`, `getCollectionListSizeWarnThreshold`, `getCollectionMapSizeFailThreshold`, `getCollectionMapSizeWarnThreshold`, `getCollectionSetSizeFailThreshold`, `getCollectionSetSizeWarnThreshold`, `getCollectionSizeFailThreshold`, `getCollectionSizeWarnThreshold`, `getColumnAsciiValueSizeFailThreshold`, `getColumnAsciiValueSizeWarnThreshold`, `getColumnBlobValueSizeFailThreshold`, `getColumnBlobValueSizeWarnThreshold`, `getColumnTextAndVarcharValueSizeFailThreshold`, `getColumnTextAndVarcharValueSizeWarnThreshold`, `getColumnValueSizeFailThreshold`, `getColumnValueSizeWarnThreshold`, `getColumnsPerTableFailThreshold`, `getColumnsPerTableWarnThreshold`, `getCompactTablesEnabled`, `getDataDiskUsageKeyspaceWideProtectionEnabled`, `getDataDiskUsageMaxDiskSize`, `getDataDiskUsagePercentageFailThreshold`, `getDataDiskUsagePercentageWarnThreshold`, `getDropKeyspaceEnabled`, `getDropTruncateTableEnabled`, `getFieldsPerUDTFailThreshold`, `getFieldsPerUDTWarnThreshold`, `getGroupByEnabled`, `getInSelectCartesianProductFailThreshold`, `getInSelectCartesianProductWarnThreshold`, `getIntersectFilteringQueryEnabled`, `getIntersectFilteringQueryWarned`, `getItemsPerCollectionFailThreshold`, `getItemsPerCollectionWarnThreshold`, `getKeyspacePropertiesDisallowed`, `getKeyspacePropertiesDisallowedCSV`, `getKeyspacePropertiesIgnored`, and 157 more. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. 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: ValueAccessor<V> (55 abstract methods) src/java/org/apache/cassandra/db/marshal/ValueAccessor.java:64— `ValueAccessor<V>` declares 55 abstract methods: `allocate`, `compare`, `compareByteArrayTo`, `compareByteBufferTo`, `convert`, `copyByteArrayTo`, `copyByteBufferTo`, `copyTo`, `createArray`, `digest`, `empty`, `factory`, `getByte`, `getDouble`, `getFloat`, `getInt`, `getLong`, `getShort`, `getUnsignedShort`, `putByte`, `putFloat`, `putInt`, `putLong`, `putShort`, `read`, `size`, `slice`, `toArray`, `toArray`, `toBallot`, `toBuffer`, `toByte`, `toDouble`, `toFloat`, `toFloatArray`, `toHex`, `toInt`, `toLong`, `toShort`, `toString`, and 15 more. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. Those 55 declarations carry 43 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 43 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: Memtable (28 abstract methods) src/java/org/apache/cassandra/db/memtable/Memtable.java:60— `Memtable` declares 28 abstract methods: `accepts`, `addMemoryUsageTo`, `createdAtNanos`, `discard`, `ensureFlushListener`, `getApproximateCommitLogLowerBound`, `getCommitLogLowerBound`, `getFinalCommitLogUpperBound`, `getFlushSet`, `getFlushTransaction`, `getLiveDataSize`, `getMemtableId`, `hasFlushListener`, `isClean`, `localRangesUpdated`, `markExtraOffHeapUsed`, `markExtraOnHeapUsed`, `mayContainDataBefore`, `metadata`, `metadataUpdated`, `notifyFlushed`, `operationCount`, `partitionCount`, `performSnapshot`, `put`, `setFlushTransaction`, `shouldSwitch`, `switchOut`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. 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: Row (43 abstract methods) src/java/org/apache/cassandra/db/rows/Row.java:69— `Row` declares 43 abstract methods: `accumulate`, `accumulate`, `accumulate`, `accumulate`, `apply`, `apply`, `cells`, `cellsInLegacyOrder`, `clone`, `clustering`, `columnCount`, `columnData`, `columns`, `dataSize`, `deletion`, `filter`, `filter`, `getCell`, `getCell`, `getColumnData`, `getComplexColumnData`, `hasComplex`, `hasComplexDeletion`, `hasDeletion`, `hasLiveData`, `isEmpty`, `isStatic`, `liveDataSize`, `markCounterLocalToBeCleared`, `minLocalDeletionTime`, `primaryKeyLivenessInfo`, `purge`, `purgeDataOlderThan`, `searchIterator`, `toString`, `transformAndFilter`, `transformAndFilter`, `unsharedHeapSize`, `unsharedHeapSizeExcludingData`, `updateAllTimestamp`, and 3 more. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. Those 43 declarations carry 36 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 36 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: ColumnFamilyStoreMBean (58 abstract methods) src/java/org/apache/cassandra/db/ColumnFamilyStoreMBean.java:37— `ColumnFamilyStoreMBean` declares 58 abstract methods: `beginLocalSampling`, `compactionDiskSpaceCheck`, `estimateKeys`, `finishLocalSampling`, `forceCompactionForTokenRange`, `forceCompactionForTokenRanges`, `forceMajorCompaction`, `forceMajorCompaction`, `getBuiltIndexes`, `getColumnFamilyName`, `getCompactionParameters`, `getCompactionParametersJson`, `getCompressionParameters`, `getCompressionParametersJson`, `getDataPaths`, `getDroppableTombstoneRatio`, `getLevelFanoutSize`, `getMaxSSTableDuration`, `getMaxSSTableSize`, `getMaximumCompactionThreshold`, `getMinimumCompactionThreshold`, `getNeverPurgeTombstones`, `getPerLevelAvgDensity`, `getPerLevelAvgDensityMaxDensityThresholdRatio`, `getPerLevelAvgSize`, `getPerLevelAvgTokenSpace`, `getPerLevelMaxDensityMaxDensityThresholdRatio`, `getPerLevelMaxDensityThreshold`, `getPerLevelSizeBytes`, `getSSTableCountPerLevel`, `getSSTableCountPerTWCSBucket`, `getSSTablesForKey`, `getSSTablesForKey`, `getSSTablesForKeyWithLevel`, `getTableName`, `getTopSizePartitions`, `getTopSizePartitionsLastUpdate`, `getTopTombstonePartitions`, `getTopTombstonePartitionsLastUpdate`, `getUnleveledSSTables`, and 18 more. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. Those 58 declarations carry 54 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 54 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: Index (17 abstract methods) src/java/org/apache/cassandra/index/Index.java:160— `Index` declares 17 abstract methods: `customExpressionValueType`, `dependsOn`, `getBackingTable`, `getBlockingFlushTask`, `getEstimatedResultRows`, `getIndexMetadata`, `getInitializationTask`, `getInvalidateTask`, `getMetadataReloadTask`, `getPostIndexQueryFilter`, `getTruncateTask`, `indexerFor`, `register`, `searcherFor`, `shouldBuildBlocking`, `supportsExpression`, `validate`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. 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: SSTableFormat<R, W> (16 abstract methods) src/java/org/apache/cassandra/io/sstable/format/SSTableFormat.java:45— `SSTableFormat<R, W>` declares 16 abstract methods: `allComponents`, `batchComponents`, `delete`, `deleteOrphanedComponents`, `generatedOnLoadComponents`, `getFormatSpecificMetricsProviders`, `getKeyCacheValueSerializer`, `getLatestVersion`, `getReaderFactory`, `getScrubber`, `getVersion`, `getWriterFactory`, `mutableComponents`, `name`, `primaryComponents`, `uploadComponents`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. 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: ReplicaCollection<C> (17 abstract methods) src/java/org/apache/cassandra/locator/ReplicaCollection.java:33— `ReplicaCollection<C>` declares 17 abstract methods under just 15 distinct name(s): `contains`, `count`, `endpoints`, `equals`, `filter`, `filter`, `filterLazily`, `filterLazily`, `get`, `hashCode`, `isEmpty`, `iterator`, `size`, `sorted`, `stream`, `subList`, `toString`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. That is an OVERLOAD SET, not 17 separate responsibilities: a caller binds to 15 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: JmxHistogramMBean (16 abstract methods) src/java/org/apache/cassandra/metrics/CassandraMetricsRegistry.java:655— `JmxHistogramMBean` declares 16 abstract methods: `bucketsId`, `get50thPercentile`, `get75thPercentile`, `get95thPercentile`, `get98thPercentile`, `get999thPercentile`, `get99thPercentile`, `getCount`, `getMax`, `getMean`, `getMin`, `getRecentValues`, `getStdDev`, `rawBuckets`, `rawValues`, `values`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. 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: JmxTimerMBean (16 abstract methods) src/java/org/apache/cassandra/metrics/CassandraMetricsRegistry.java:950— `JmxTimerMBean` declares 16 abstract methods: `bucketsId`, `get50thPercentile`, `get75thPercentile`, `get95thPercentile`, `get98thPercentile`, `get999thPercentile`, `get99thPercentile`, `getDurationUnit`, `getMax`, `getMean`, `getMin`, `getRecentValues`, `getStdDev`, `rawBuckets`, `rawValues`, `values`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. 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: MessagingServiceMBean (27 abstract methods) src/java/org/apache/cassandra/net/MessagingServiceMBean.java:29— `MessagingServiceMBean` declares 27 abstract methods: `getBackPressurePerHost`, `getDroppedMessages`, `getGossipMessageCompletedTasks`, `getGossipMessageCompletedTasksWithPort`, `getGossipMessageDroppedTasks`, `getGossipMessageDroppedTasksWithPort`, `getGossipMessagePendingTasks`, `getGossipMessagePendingTasksWithPort`, `getLargeMessageCompletedTasks`, `getLargeMessageCompletedTasksWithPort`, `getLargeMessageDroppedTasks`, `getLargeMessageDroppedTasksWithPort`, `getLargeMessagePendingTasks`, `getLargeMessagePendingTasksWithPort`, `getSmallMessageCompletedTasks`, `getSmallMessageCompletedTasksWithPort`, `getSmallMessageDroppedTasks`, `getSmallMessageDroppedTasksWithPort`, `getSmallMessagePendingTasks`, `getSmallMessagePendingTasksWithPort`, `getTimeoutsPerHost`, `getTimeoutsPerHostWithPort`, `getTotalTimeouts`, `getVersion`, `isBackPressureEnabled`, `reloadSslCertificates`, `setBackPressureEnabled`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. 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: SharedContext (18 abstract methods) src/java/org/apache/cassandra/repair/SharedContext.java:56— `SharedContext` declares 18 abstract methods: `broadcastAddressAndPort`, `clock`, `compactionManager`, `executorFactory`, `failureDetector`, `gossiper`, `locator`, `mbean`, `messaging`, `nonPeriodicTasks`, `optionalTasks`, `paxosRepairState`, `random`, `repair`, `repairManager`, `scheduledTasks`, `streamExecutor`, `validationManager`. Counted over its ABSTRACT methods, once per signature; `default`, `static` and `private` methods and constants are not counted, because no implementer is forced to write them. 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, 18 significant file(s) lose their only recent owner: src/java/org/apache/cassandra/schema/SystemDistributedKeyspace.java, src/java/org/apache/cassandra/db/compression/CompressionDictionary.java, src/java/org/apache/cassandra/db/compression/SSTableChunkSampler.java, src/java/org/apache/cassandra/db/compression/ZstdCompressionDictionary.java, src/java/org/apache/cassandra/db/compression/CompressionDictionaryManager.java, src/java/org/apache/cassandra/db/compression/ZstdDictionaryTrainer.java, src/java/org/apache/cassandra/db/compression/CompressionDictionaryDetailsTabularData.java, src/java/org/apache/cassandra/utils/Throwables.java (+10 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: src/java/org/apache/cassandra/cql3/ResultSet.java, src/java/org/apache/cassandra/utils/MergeIterator.java, src/java/org/apache/cassandra/concurrent/SEPWorker.java, src/java/org/apache/cassandra/db/commitlog/CommitLogSegmentManagerCDC.java, src/java/org/apache/cassandra/metrics/ThreadLocalMetrics.java, src/java/org/apache/cassandra/concurrent/SEPExecutor.java, src/java/org/apache/cassandra/db/rows/NativeCell.java, tools/stress/src/org/apache/cassandra/stress/operations/userdefined/CASQuery.java (+3 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 9 significant file(s) lose their only recent owner: src/java/org/apache/cassandra/service/accord/execution/SafeTask.java, src/java/org/apache/cassandra/service/accord/execution/AccordCache.java, src/java/org/apache/cassandra/service/accord/execution/AccordCacheEntry.java, src/java/org/apache/cassandra/service/accord/AccordResult.java, src/java/org/apache/cassandra/service/accord/interop/AccordInteropApply.java, src/java/org/apache/cassandra/service/accord/execution/AbstractLockLoop.java, src/java/org/apache/cassandra/metrics/AccordReplicaMetrics.java, src/java/org/apache/cassandra/service/accord/interop/AccordInteropAdapter.java (+1 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #4 — If anonymized user #4 becomes unavailable, 4 significant file(s) lose their only recent owner: pylib/cqlshlib/copyutil.py, tools/fqltool/src/org/apache/cassandra/fqltool/QueryReplayer.java, src/java/org/apache/cassandra/tools/nodetool/Info.java, tools/fqltool/src/org/apache/cassandra/fqltool/commands/Replay.java. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #5 — If anonymized user #5 becomes unavailable, 3 significant file(s) lose their only recent owner: src/java/org/apache/cassandra/db/compaction/LeveledManifest.java, src/java/org/apache/cassandra/db/compaction/LeveledGenerations.java, src/java/org/apache/cassandra/dht/Bounds.java. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #6 — If anonymized user #6 becomes unavailable, 3 significant file(s) lose their only recent owner: src/java/org/apache/cassandra/service/reads/repair/BlockingPartitionRepair.java, src/java/org/apache/cassandra/schema/SchemaTransformation.java, src/java/org/apache/cassandra/tcm/ownership/TokenMap.java. Pair on, review, or document these before any departure.
X23 · Unguarded diagnostic materialisation· Diagnostic log message is built whether or not it is wanted · ×6
Diagnostic log message is built whether or not it is wanted src/java/org/apache/cassandra/service/accord/AccordCommandStore.java:908— `debug` at line 908 is called with an argument built by `Arrays.toString(sortedSaveDirs)` (line 908), whose cost grows with the collection it walks. Java evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isDebugEnabled`/`isTraceEnabled` test, no debug flag, no lambda or `Supplier` the logger calls only when the level is on.
Diagnostic log message is built whether or not it is wanted src/java/org/apache/cassandra/security/SSLFactory.java:389— `debug` at line 389 is called with an argument built by `String.join("…", supportedProtocols)` (line 390), whose cost grows with the collection it walks. Java evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isDebugEnabled`/`isTraceEnabled` test, no debug flag, no lambda or `Supplier` the logger calls only when the level is on.
Diagnostic log message is built whether or not it is wanted src/java/org/apache/cassandra/security/SSLFactory.java:391— `debug` at line 391 is called with an argument built by `String.join("…", enabledProtocols)` (line 392), whose cost grows with the collection it walks. Java evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isDebugEnabled`/`isTraceEnabled` test, no debug flag, no lambda or `Supplier` the logger calls only when the level is on.
Diagnostic log message is built whether or not it is wanted src/java/org/apache/cassandra/security/SSLFactory.java:394— `debug` at line 394 is called with an argument built by `String.join("…", supportedCiphers)` (line 395), whose cost grows with the collection it walks. Java evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isDebugEnabled`/`isTraceEnabled` test, no debug flag, no lambda or `Supplier` the logger calls only when the level is on.
Diagnostic log message is built whether or not it is wanted src/java/org/apache/cassandra/index/sai/disk/v1/vector/OnHeapGraph.java:346— `debug` at line 346 is called with an argument built by `stream()` (line 346), whose cost grows with the collection it walks. Java evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isDebugEnabled`/`isTraceEnabled` test, no debug flag, no lambda or `Supplier` the logger calls only when the level is on.
Diagnostic log message is built whether or not it is wanted src/java/org/apache/cassandra/db/compaction/LeveledManifest.java:693— `trace` at line 693 is called with an argument built by `Arrays.toString(estimated)` (line 694), whose cost grows with the collection it walks. Java evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because trace is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isDebugEnabled`/`isTraceEnabled` test, no debug flag, no lambda or `Supplier` the logger calls only when the level is on.
Silent fallback default in catch src/java/org/apache/cassandra/service/snapshot/TableSnapshot.java:303— `getFileSize` swallows every exception into `return 0` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the Javadoc, and the row stops firing.
Silent fallback default in catch src/java/org/apache/cassandra/service/snapshot/TrueSnapshotSizeTask.java:50— `call` swallows every exception into `return 0L` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the Javadoc, and the row stops firing.
Silent fallback default in catch src/java/org/apache/cassandra/service/AsyncProfilerService.java:337— `list` swallows every exception into `return List.of()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the Javadoc, and the row stops firing.
Silent fallback default in catch src/java/org/apache/cassandra/schema/SystemDistributedKeyspace.java:397— `viewStatus` swallows every exception into `return Collections.emptyMap()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the Javadoc, and the row stops firing.
Silent fallback default in catch pylib/cqlshlib/cql3handling.py:930— `ref_udf_name_completer` swallows every exception into `return ()` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
D21 · Naming Consistency· `isIN` spells `IN` where 971 names in the project spell it `In` · ×2
`isIN` spells `IN` where 971 names in the project spell it `In` src/java/org/apache/cassandra/cql3/Operator.java:1119— 971 of 982 names in project repository spell the token `In` (971 of 982; unit: names in project repository containing `In`). Peers: MutualTlsCertificateValidityPeriodValidator.certificateValidityPeriodInMinutes (src/java/org/apache/cassandra/auth/MutualTlsCertificateValidityPeriodValidator.java:81); MutualTlsUtil.maybeAppendRemainder(remainderInMinutes) (src/java/org/apache/cassandra/auth/MutualTlsUtil.java:77); BatchlogManager.setRate(throttleInKB) (src/java/org/apache/cassandra/batchlog/BatchlogManager.java:269); AutoSavingCache.scheduleSaving(savePeriodInSeconds) (src/java/org/apache/cassandra/cache/AutoSavingCache.java:160); CassandraRelevantProperties.getSizeInBytes (src/java/org/apache/cassandra/config/CassandraRelevantProperties.java:997). Rename to `isIn`. [rule N6]
`isIN` spells `IN` where 971 names in the project spell it `In` src/java/org/apache/cassandra/cql3/restrictions/SingleRestriction.java:49— 971 of 982 names in project repository spell the token `In` (971 of 982; unit: names in project repository containing `In`). Peers: MutualTlsCertificateValidityPeriodValidator.certificateValidityPeriodInMinutes (src/java/org/apache/cassandra/auth/MutualTlsCertificateValidityPeriodValidator.java:81); MutualTlsUtil.maybeAppendRemainder(remainderInMinutes) (src/java/org/apache/cassandra/auth/MutualTlsUtil.java:77); BatchlogManager.setRate(throttleInKB) (src/java/org/apache/cassandra/batchlog/BatchlogManager.java:269); AutoSavingCache.scheduleSaving(savePeriodInSeconds) (src/java/org/apache/cassandra/cache/AutoSavingCache.java:160); CassandraRelevantProperties.getSizeInBytes (src/java/org/apache/cassandra/config/CassandraRelevantProperties.java:997). Rename to `isIn`. [rule N6]
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 9 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 (62 single-owned of 2354 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 2354 of the 3413 production source files in this repository met that bar). They are anonymized user #7 (2 file(s)), anonymized user #8 (2 file(s)), anonymized user #9 (2 file(s)), anonymized user #10 (2 file(s)), anonymized user #11 (2 file(s)), anonymized user #12 (1 file(s)) (+3 more) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: src/java/org/apache/cassandra/index/sai/disk/v1/V1OnDiskFormat.java, src/java/org/apache/cassandra/index/sai/disk/io/IndexInputReader.java, src/java/org/apache/cassandra/utils/HttpService.java, src/java/org/apache/cassandra/locator/AbstractCloudMetadataServiceConnector.java, src/java/org/apache/cassandra/db/streaming/CassandraEntireSSTableStreamReader.java, src/java/org/apache/cassandra/db/virtual/ClientsTable.java, src/java/org/apache/cassandra/transport/Compressor.java, src/java/org/apache/cassandra/cql3/statements/ListPermissionsStatement.java (+6 more).
D21 · Naming Consistency· `broadcastRPCAddr` spells `RPC` where 77 names in the project spell it `Rpc` · ×1
`broadcastRPCAddr` spells `RPC` where 77 names in the project spell it `Rpc` src/java/org/apache/cassandra/config/DatabaseDescriptor.java:3667— 77 of 78 names in project repository spell the token `Rpc` (77 of 78; unit: names in project repository containing `Rpc`). Peers: DatabaseDescriptor.getRpcTimeout (src/java/org/apache/cassandra/config/DatabaseDescriptor.java:2722); DatabaseDescriptor.setRpcTimeout (src/java/org/apache/cassandra/config/DatabaseDescriptor.java:2727); DatabaseDescriptor.getReadRpcTimeout (src/java/org/apache/cassandra/config/DatabaseDescriptor.java:2732); DatabaseDescriptor.setReadRpcTimeout (src/java/org/apache/cassandra/config/DatabaseDescriptor.java:2737); DatabaseDescriptor.getRangeRpcTimeout (src/java/org/apache/cassandra/config/DatabaseDescriptor.java:2742). Rename to `broadcastRpcAddr`. [rule N6]
D21 · Naming Consistency· `isRestrictedByEqualsOrIN` spells `IN` where 971 names in the project spell it `In` · ×1
`isRestrictedByEqualsOrIN` spells `IN` where 971 names in the project spell it `In` src/java/org/apache/cassandra/cql3/restrictions/Restrictions.java:37— 971 of 982 names in project repository spell the token `In` (971 of 982; unit: names in project repository containing `In`). Peers: MutualTlsCertificateValidityPeriodValidator.certificateValidityPeriodInMinutes (src/java/org/apache/cassandra/auth/MutualTlsCertificateValidityPeriodValidator.java:81); MutualTlsUtil.maybeAppendRemainder(remainderInMinutes) (src/java/org/apache/cassandra/auth/MutualTlsUtil.java:77); BatchlogManager.setRate(throttleInKB) (src/java/org/apache/cassandra/batchlog/BatchlogManager.java:269); AutoSavingCache.scheduleSaving(savePeriodInSeconds) (src/java/org/apache/cassandra/cache/AutoSavingCache.java:160); CassandraRelevantProperties.getSizeInBytes (src/java/org/apache/cassandra/config/CassandraRelevantProperties.java:997). Rename to `isRestrictedByEqualsOrIn`. [rule N6]
D21 · Naming Consistency· `hasIN` spells `IN` where 971 names in the project spell it `In` · ×1
`hasIN` spells `IN` where 971 names in the project spell it `In` src/java/org/apache/cassandra/cql3/restrictions/Restrictions.java:63— 971 of 982 names in project repository spell the token `In` (971 of 982; unit: names in project repository containing `In`). Peers: MutualTlsCertificateValidityPeriodValidator.certificateValidityPeriodInMinutes (src/java/org/apache/cassandra/auth/MutualTlsCertificateValidityPeriodValidator.java:81); MutualTlsUtil.maybeAppendRemainder(remainderInMinutes) (src/java/org/apache/cassandra/auth/MutualTlsUtil.java:77); BatchlogManager.setRate(throttleInKB) (src/java/org/apache/cassandra/batchlog/BatchlogManager.java:269); AutoSavingCache.scheduleSaving(savePeriodInSeconds) (src/java/org/apache/cassandra/cache/AutoSavingCache.java:160); CassandraRelevantProperties.getSizeInBytes (src/java/org/apache/cassandra/config/CassandraRelevantProperties.java:997). Rename to `hasIn`. [rule N6]
D21 · Naming Consistency· `clusteringKeyRestrictionsHasIN` spells `IN` where 971 names in the project spell it `In` · ×1
`clusteringKeyRestrictionsHasIN` spells `IN` where 971 names in the project spell it `In` src/java/org/apache/cassandra/cql3/restrictions/StatementRestrictions.java:650— 971 of 982 names in project repository spell the token `In` (971 of 982; unit: names in project repository containing `In`). Peers: MutualTlsCertificateValidityPeriodValidator.certificateValidityPeriodInMinutes (src/java/org/apache/cassandra/auth/MutualTlsCertificateValidityPeriodValidator.java:81); MutualTlsUtil.maybeAppendRemainder(remainderInMinutes) (src/java/org/apache/cassandra/auth/MutualTlsUtil.java:77); BatchlogManager.setRate(throttleInKB) (src/java/org/apache/cassandra/batchlog/BatchlogManager.java:269); AutoSavingCache.scheduleSaving(savePeriodInSeconds) (src/java/org/apache/cassandra/cache/AutoSavingCache.java:160); CassandraRelevantProperties.getSizeInBytes (src/java/org/apache/cassandra/config/CassandraRelevantProperties.java:997). Rename to `clusteringKeyRestrictionsHasIn`. [rule N6]
D21 · Naming Consistency· `buildCASSuccessMetadata` spells `CAS` where 23 names in the project spell it `Cas` · ×1
`buildCASSuccessMetadata` spells `CAS` where 23 names in the project spell it `Cas` src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java:806— 23 of 24 names in project repository spell the token `Cas` (23 of 24; unit: names in project repository containing `Cas`). Peers: DatabaseDescriptor.getCasContentionTimeout (src/java/org/apache/cassandra/config/DatabaseDescriptor.java:2777); DatabaseDescriptor.setCasContentionTimeout (src/java/org/apache/cassandra/config/DatabaseDescriptor.java:2782); BatchStatement.makeCasRequest (src/java/org/apache/cassandra/cql3/statements/BatchStatement.java:608); org.apache.cassandra.cql3.statements.CQL3CasRequest (src/java/org/apache/cassandra/cql3/statements/CQL3CasRequest.java:99); CQL3CasRequest.toCasResult (src/java/org/apache/cassandra/cql3/statements/CQL3CasRequest.java:582). Rename to `buildCasSuccessMetadata`. [rule N6]
D21 · Naming Consistency· `inferCdcIndexFile` spells `Cdc` where 32 names in the project spell it `CDC` · ×1
`inferCdcIndexFile` spells `Cdc` where 32 names in the project spell it `CDC` src/java/org/apache/cassandra/db/commitlog/CommitLogDescriptor.java:251— 32 of 33 names in project repository spell the token `CDC` (32 of 33; unit: names in project repository containing `CDC`). Peers: DatabaseDescriptor.isCDCEnabled (src/java/org/apache/cassandra/config/DatabaseDescriptor.java:5128); DatabaseDescriptor.setCDCEnabled (src/java/org/apache/cassandra/config/DatabaseDescriptor.java:5134); DatabaseDescriptor.getCDCBlockWrites (src/java/org/apache/cassandra/config/DatabaseDescriptor.java:5139); DatabaseDescriptor.setCDCBlockWrites (src/java/org/apache/cassandra/config/DatabaseDescriptor.java:5144); DatabaseDescriptor.isCDCOnRepairEnabled (src/java/org/apache/cassandra/config/DatabaseDescriptor.java:5149). Rename to `inferCDCIndexFile`. [rule N6]
D34 · Knowledge Freshness· Further orphaned files (smaller) · ×1
Further orphaned files (smaller) — 849 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: src/java/org/apache/cassandra/utils/streamhist/StreamingTombstoneHistogramBuilder.java, src/java/org/apache/cassandra/cql3/statements/schema/CopyTableStatement.java, src/java/org/apache/cassandra/service/accord/AccordFetchCoordinator.java, src/java/org/apache/cassandra/db/DataRange.java, src/java/org/apache/cassandra/index/sai/utils/PrimaryKey.java, src/java/org/apache/cassandra/service/pager/AggregationQueryPager.java, src/java/org/apache/cassandra/index/sai/disk/format/IndexDescriptor.java, src/java/org/apache/cassandra/index/sai/plan/Expression.java (and 841 more) (939 orphaned of 2485 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 2485 of the 3413 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.
No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
Logging is not universal — Only 1/2 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`.
No SAST REDACTED:16— No static application security testing detected. For this repository's stack, add spotbugs with find-sec-bugs (or `semgrep --config=auto`, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 6 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
No dependency-update automation pylib/requirements.txt:23— `pylib/requirements.txt` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`.
X5 · Nullable reference types· Java packages are not null-marked everywhere · ×1
Java packages are not null-marked everywhere — 0/190 of this repository's Java package directories are under a non-null default: a `package-info.java` declaring `@NullMarked` (JSpecify) or `@NonNullApi`, `@ParametersAreNonnullByDefault`, `@NonNullByDefault`, `@DefaultQualifier(NonNull.class)`; a `module-info.java` declaring `@NullMarked`; every type in it `@NullMarked`; or a build that runs NullAway with the package in `AnnotatedPackages`, or the Checker Framework's `NullnessChecker`. Elsewhere every reference admits null and no checker warns on the dereference that throws a `NullPointerException`.
Silent fallback default on parse failure .build/ci/cell_balance.py:97— `read_suites` returns `[]` when `(OSError, ValueError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Skipped (documented): testPromptnessOfExecution test/burn/org/apache/cassandra/concurrent/LongSharedExecutorPoolTest.java:104— Skipped with a documented reason — a deferral, not lazy debt: switched off by @Ignore
Skipped (documented): complexReadAllocationDoesNotScale test/unit/org/apache/cassandra/db/compaction/differential/ComplexColumnCursorReadTest.java:319— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a JUnit assumption
Skipped (documented): allocationAtLargeFileSizes test/unit/org/apache/cassandra/db/compaction/differential/CursorCompactionAllocationGateTest.java:223— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a JUnit assumption
Skipped (documented): allocationDoesNotScaleWithComplexColumns test/unit/org/apache/cassandra/db/compaction/differential/CursorCompactionAllocationGateTest.java:534— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a JUnit assumption
Skipped (documented): allocationDoesNotScaleWithRangeTombstones test/unit/org/apache/cassandra/db/compaction/differential/CursorCompactionAllocationGateTest.java:456— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a JUnit assumption
Skipped (documented): allocationDoesNotScaleWithRows test/unit/org/apache/cassandra/db/compaction/differential/CursorCompactionAllocationGateTest.java:153— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a JUnit assumption
Skipped (documented): allocationDoesNotScaleWithSparseRows test/unit/org/apache/cassandra/db/compaction/differential/CursorCompactionAllocationGateTest.java:299— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a JUnit assumption
Skipped (documented): allocationDoesNotScaleWithWideSchemaSparseRows test/unit/org/apache/cassandra/db/compaction/differential/CursorCompactionAllocationGateTest.java:359— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a JUnit assumption
Skipped (documented): recordAllocationProfile test/unit/org/apache/cassandra/db/compaction/differential/CursorCompactionAllocationGateTest.java:612— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a JUnit assumption
Skipped (documented): recordComplexAllocationProfile test/unit/org/apache/cassandra/db/compaction/differential/CursorCompactionAllocationGateTest.java:677— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a JUnit assumption
Skipped (documented): recordLargeFileAllocationProfile test/unit/org/apache/cassandra/db/compaction/differential/CursorCompactionAllocationGateTest.java:695— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a JUnit assumption
Skipped (documented): recordRangeTombstoneAllocationProfile test/unit/org/apache/cassandra/db/compaction/differential/CursorCompactionAllocationGateTest.java:642— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a JUnit assumption
Skipped (documented): droppedCounterUnsupportedFromHeaders test/unit/org/apache/cassandra/db/compaction/differential/CursorSupportMatrixTest.java:356— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a JUnit assumption
Skipped (documented): ignoreGcGraceForAnyKeyUnsupported test/unit/org/apache/cassandra/db/compaction/differential/CursorSupportMatrixTest.java:178— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a JUnit assumption
Skipped (documented): droppedComplexColumnSurvivingCells test/unit/org/apache/cassandra/db/compaction/differential/DroppedColumnDifferentialCompactionTest.java:175— Skipped with a documented reason — a deferral, not lazy debt: switched off by @Ignore
Skipped (documented): testMajorLeveledCompactionWriter test/unit/org/apache/cassandra/db/compaction/writers/CompactionAwareWriterTest.java:178— Skipped with a documented reason — a deferral, not lazy debt: switched off by @Ignore
Skipped (documented): test2iCancellation test/unit/org/apache/cassandra/db/compaction/CancelCompactionsTest.java:544— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a JUnit assumption
Skipped (documented): testSubrangeCompactionWith2i test/unit/org/apache/cassandra/db/compaction/CancelCompactionsTest.java:566— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a JUnit assumption
Skipped (documented): testNeedsCleanup test/unit/org/apache/cassandra/db/compaction/CompactionsTest.java:617— Skipped with a documented reason — a deferral, not lazy debt: switched off by @Ignore
Skipped (documented): replayCommitLogWithoutFlushing test/unit/org/apache/cassandra/db/commitlog/CommitLogChainedMarkersTest.java:61— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a JUnit assumption
Skipped (documented): testHeaderOnlyFileFiltering test/unit/org/apache/cassandra/db/commitlog/CommitLogTest.java:260— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a JUnit assumption
Skipped (documented): testStoreAllCompatibleTypePairs test/unit/org/apache/cassandra/db/marshal/AbstractTypeTest.java:1023— Skipped with a documented reason — a deferral, not lazy debt: switched off by @Ignore
Skipped (documented): repro test/unit/org/apache/cassandra/db/partitions/AtomicBTreePartitionMemtableAccountingTest.java:136— Skipped with a documented reason — a deferral, not lazy debt: switched off by @Ignore
Skipped (documented): testOver1GSize test/unit/org/apache/cassandra/db/tries/InMemoryTriePutTest.java:68— Skipped with a documented reason — a deferral, not lazy debt: switched off by @Ignore
Skipped (documented): patchJournalVestigialTest test/unit/org/apache/cassandra/db/virtual/AccordDebugKeyspaceTest.java:1024— Skipped with a documented reason — a deferral, not lazy debt: switched off by @Ignore
Dependency hygiene PARTLY measured — Python dependencies read, no exact pin to grade for currency — This repository's Python dependencies were read: 4 shipped distribution(s) across 1 manifest(s) (0 development or optional declaration(s) excluded, because a consumer does not install them). Whether any of them is behind its current release is the dependency-CURRENCY question, and no declaration here carries an EXACT pin to ask it about — every one is a floor or a range, which installs the newest release it admits and therefore cannot be behind one. That is a healthy declaration style, NOT a defect and NOT a gap in this analyzer; there is simply no currency question to answer. This is NOT a finding that these dependencies are current or healthy. Lockfiles are deliberately not read (poetry.lock, uv.lock, Pipfile.lock, pdm.lock): the four disagree about dev/optional membership, and misreading one would charge a test-only package a consumer never receives. Known CVEs in the same dependency graph are a separate question, reported under D30.
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.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
Run 01a1e570-3a7e-7689-8a97-73e9131369c1 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 211 · Warnings: 5118 · Recommendations: 1025 · Info: 123 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 16-11-2026 @ 17:38 UTC.
Downloadable artifacts
Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.