Public report of mypinkhacker/Apache, published 17 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 report Measured 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, 17 November 2026, 21:21 UTC · Survey ID cd_728157b1d23e4e31a233f54b25cecd55

mypinkhacker/Apache

Measured 17 November 2026, 21:19 UTC, at code version 132743b

First survey, so nothing to compare with yet Test reliability: not measuredBus factor: not measured

Test reliability is not measured: The suite could not be re-run, but the repository declares tests of its own unreliable.

Bus factor is not measured: No living knowledge left to concentrate.

CAI score 43.3out of 100 At risk

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: 525,741 lines of product code in 38 projects, tests not counted · Estimated rebuild effort: about 5.3 person-years · Weakest lens: Code Health, 29.7

Findings by how serious they are

91 critical 2888 serious 1996 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

Assert small markCanine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
17 November 2026, 21:19 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.

A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.

The score is deterministic, which means the same code always gets the same score. 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 ▸

70of 70 dimensions measured by tools.
4966of 4975 findings point to an exact file and line, so you can open each one in the code. The other 9 concern the repository as a whole, such as missing documentation.
70dimensions across 7 lenses, read from 525,741 lines of product code in 38 projects.
Chapters

Executive summary

mypinkhacker/Apache is rated At risk because critical security findings are open, most of them in the packages it uses. It scores 43.3 out of 100, which the At risk rating leaves unchanged.

Code Health, at 29.7, is the weakest lens and counts most in the score. The best first step is adding type checking, worth about 5.0 points. Splitting the oversized files comes next, worth about 4.3 points. Raising Code Health to 70 would lift the score to about 54.2.

Sixty-eight known security holes in the packages the code depends on can be used by attackers. Fourteen weaknesses in the code could be used by an attacker, and three places in the code run text as code, which an attacker could use. Updating the vulnerable packages, fixing the weaknesses the scanner points to and replacing text run as code with direct calls would close these risks. The two passwords or keys in the code's history need replacing, with the old ones switched off. The two unsafe settings in infrastructure or container files need changing to safe values. The page that doesn't say its language needs its language set.

The product code is 525,741 lines, about €770,000 to rebuild. The check for the health of its packages couldn't finish, so that result is missing, not a clean pass.

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 for The 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.
Code Health 29.7 · counts for 46%Accessibility 46.7 · counts for 25%Production Readiness 50.3 · counts for 14%Maturity 63.3 · counts for 8%Security and Compliance 66.5 · counts for 4%Architecture 94.9 · counts for 2%Performance 100.0 · counts for 1%

If Code Health rose from 29.7 to 70, the lowest score rated Strong, the score would rise from 43.3 to about 54.2.

Code composition: what the lines of code are
Product code 59%Tests 41%
Rebuild cost: about €770,000 · Estimate
Cost to rebuild€260,000 to €1,300,000, for 4,264 to 13,526 hours of work, about 5.3 person-years for 3 to 11 engineers
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.7 at a score of 43. 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.
SizeVery large: 525,741 lines of product code
What it is notNot 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
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
Raises the score by about 5.0 points · Medium effort · Type Safety
2
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Raises the score by about 4.3 points · Medium effort · Large Files
3
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
Raises the score by about 3.5 points · Medium effort · Visual & motion safety

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 €770,000 to build again, about 5.3 person-years of work. Its weakest lens is Code Health, at 29.7 (Weak). Code Health is about how easy the code is to read and change safely, and code that is hard to read is slow and risky to change, so every future change costs more than it should. Because the weakest lens counts most in the score, work on Code Health also moves the score most.
Based on: the rebuild estimate · the Code Health grade · how much each lens counts
What to do: Start with the Code Health actions in Top priorities.
If you do one thing first · First action
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up. Of all the actions in this report, it raises the score most for the work it takes: about 5.0 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 7.0 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 2% to 6% on every change.
How this is estimated: It rests on an assumption 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. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4)
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.

732 modules, with 2001 dependencies between them. 11 loops run through 120 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 692 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.
uses →1 internal2 rpc3 serializer4 sql.types5 scheduler6 sql.catalyst.expressions.codegen7 sql.catalyst.util8 executor9 ui10 util11 api.java12 rdd13 storage14 broadcast15 org.apache.spark16 sql.catalyst.plans.logical17 sql.execution.streaming18 streaming19 sql.sources20 sql.execution.datasources.v221 sql.execution.datasources22 sql.execution23 sql.internal24 sql.catalyst.catalog25 sql.catalyst.analysis26 sql27 ml.util28 sql.catalyst.expressions29 sql.catalyst30 ml.linalg31 mllib.linalg32 sql.hive33 ml.feature34 mllib.clustering35 mllib.regression36 ml37 mllib.tree.model38 ml.regression39 ml.classification40 ml.r
1 internal
2 rpc15
3 serializer211
4 sql.types14
5 scheduler202181231127
6 sql.catalyst.expressions.codegen29283
7 sql.catalyst.util1314
8 executor641115
9 ui618
10 util1333252510
11 api.java114519
12 rdd11311590
13 storage1593116
14 broadcast325
15 org.apache.spark15143224214765
16 sql.catalyst.plans.logical1943521081
17 sql.execution.streaming1438268112423231210199
18 streaming512316
19 sql.sources342102
20 sql.execution.datasources.v246134937132311217
21 sql.execution.datasources92131222825266165232616
22 sql.execution2714283913913134531910453
23 sql.internal11112267492
24 sql.catalyst.catalog61171173
25 sql.catalyst.analysis4172387212737
26 sql4141341252251185
27 ml.util5412393
28 sql.catalyst.expressions2379392146582104
29 sql.catalyst2116
30 ml.linalg52
31 mllib.linalg142
32 sql.hive793123531516231311
33 ml.feature69145651850
34 mllib.clustering810156220
35 mllib.regression235413
36 ml4111111101
37 mllib.tree.model123331
38 ml.regression710318278118
39 ml.classification292152617261
40 ml.r12039621767
Uses a module listed above itPart of a loopThe module itself
1 internal2 rpc3 serializer4 sql.types5 scheduler6 sql.catalyst.expressions.codegen7 sql.catalyst.util8 executor9 ui10 util11 api.java12 rdd13 storage14 broadcast15 org.apache.spark16 sql.catalyst.plans.logical17 sql.execution.streaming18 streaming19 sql.sources20 sql.execution.datasources.v221 sql.execution.datasources22 sql.execution23 sql.internal24 sql.catalyst.catalog25 sql.catalyst.analysis26 sql27 ml.util28 sql.catalyst.expressions29 sql.catalyst30 ml.linalg31 mllib.linalg32 sql.hive33 ml.feature34 mllib.clustering35 mllib.regression36 ml37 mllib.tree.model38 ml.regression39 ml.classification40 ml.rinternal1rpc2serializer3sql.types4scheduler5sql.catalyst.expressions.codegen6sql.catalyst.util7executor8ui9util10api.java11rdd12storage13broadcast14org.apache.spark15sql.catalyst.plans.logical16sql.execution.streaming17streaming18sql.sources19sql.execution.datasources.v220sql.execution.datasources21sql.execution22sql.internal23sql.catalyst.catalog24sql.catalyst.analysis25sql26ml.util27sql.catalyst.expressions28sql.catalyst29ml.linalg30mllib.linalg31sql.hive32ml.feature33mllib.clustering34mllib.regression35ml36mllib.tree.model37ml.regression38ml.classification39ml.r40152111420218123112729283131464111561813332525101145191131159015931163251514322421476519435210811438268112423231210199512316342102461349371323112179213122282526616523261627142839139131345319104531111226749261171173417238721273741413412522511855412393237939214658210421165214279312353151623131169145651850810156220235413411111110112333171031827811829215261726112039621767+692 more modules (most-connected shown)

At a glance — Code Health · 29.7 · Weak · gated by R1, R3, X4, X5 ·

At a glance — Architecture · 94.9 · Exemplary ·

At a glance — Maturity · 63.3 · Adequate · gated by D34 ·

At a glance — Readiness · 50.3 · Adequate · gated by P3, P7 ·

At a glance — Security · 66.5 · Checked 5 of 11 · gated by D29 ·

At a glance — Accessibility · 46.7 · Weak · gated by AC6 ·

At a glance — Performance · 100.0 · Exemplary ·

Security & Compliance — OWASP Top-10 mapping

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 categoryFindingsSeverity
A03:2025 — Software Supply Chain Failures121High / Critical
A05:2025 — Injection75High / Critical
A02:2025 — Security Misconfiguration9High / Critical
A07:2025 — Authentication Failures3High / Critical

Roadmap

Top priorities: Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up; Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package; Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.

Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.

Do thisHelpsEffortDimension
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.+5.0 ptsMediumType Safety
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.+4.3 ptsMediumLarge Files
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.+3.5 ptsMediumVisual & motion safety
On Scala 3, add `-Yexplicit-nulls` to `scalacOptions` so `String` and `String | Null` mean different things, and type each Java API's result as nullable where it can return null; on Scala 2 (or as a first step), enable WartRemover's `Null` wart (`wartremoverErrors += Wart.Null`) or Scalafix's `DisableSyntax.noNulls = true` so the code holds absence in `Option`. Then pay the assertions down rather than adding to them: each `.nn` is a null the compiler could not rule out — wrap the Java value in `Option(…)` at the boundary, pattern-match on `null` once there, or change the API so the null cannot arrive; an `unsafeNulls` import switches the checking off for everything after it.+3.1 ptsMediumNullable reference types
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.+2.4 ptsMediumPage structure
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with main.go.+1.2 ptsLowADR Quality
Interpolated log message defeats structured logging+1.8 ptsMediumStructured logging
Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.+1.4 ptsMediumCode Duplication

File quality

Per-file score 0–10 — a quality signature. Of 969 files carrying findings, judged against the Production bar: 2% slop · 54% mixed · 44% near-clean.

FileScoreBandWorst signal
REDACTED0.0SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED0.4SlopStatic Analysis (SAST): High: REDACTED
REDACTED1.1SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED1.4SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED1.4SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED1.5SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED1.6SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED1.6SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED1.6SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED2.0SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED2.1SlopIaC & Container Security: High IaC: REDACTED
REDACTED2.5SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED2.7SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED3.2SlopStatic Analysis (SAST): High: REDACTED
REDACTED3.2SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED3.7SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED3.7SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED3.7SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED

How the grades work

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 — 91

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 — 2888

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 — 1996

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 70 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 — 70 dimensions across the health lenses
D1D2D3D4D5D6D13D14D15D17D19D20D21D24D26D28D29D30D31D34D35D36D43D44AC2AC3AC6AX10AX3AX4AX6GD1IC1M1M2M3P1P10P2P3P4P6P7PF3R1R10R2R3R7R9X1X12X13X15X16X18X19X20X21X23X24X25X26X27X28X29X3X30X4X5

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
  1. 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, 4966 of 4975 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.)
  2. Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
  3. 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.

MethodBacksVersionEvaluator
Roslyn static analysisComplexity, cohesion, coupling, dead code, API surface, layering5.3.0✓ deterministic
Native secret scannerHardcoded secrets / credentials1.0.0✓ deterministic
Canine Code Analyzer duplication detector (in-process)Code duplication1.0.0✓ deterministic
Coverage (coverlet / dotnet-coverage)Line & branch coverage10.0.400✓ deterministic
NuGet / dotnetOutdated, vulnerable & deprecated dependencies10.0.400✓ deterministic
git / LibGit2SharpChurn hotspots, knowledge concentration, history2.43.0 · 0.31.0✓ deterministic
gitleaks · semgrep · trivy · checkovSecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3 · 3.2.533✓ deterministic

Every finding is locatable in findings.md. Run 01a1eb60-baf6-743f-a900-bc84b115cce1.

The exact command behind every deep-scan dimension — tool, version, invocation and retained raw output — is in Appendix B — Reproduction & audit trail.

Run transparency — what happened this run

What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.

  • D8 Code Coverage — not measured this run — 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, but the analyzer could not read its coverage for python, so a figure over the rest would be a part of the suite. Coverage is excluded from the score rather than counted as a near-zero. This is OUR limitation, not a defect in the repo.
  • 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 1 of its own test(s) unreliable. The built-in reliability runner does not support this repository's ecosystem (.scala, .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 — 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's dependency manifests WERE read and their pinning discipline assessed; what went unanswered is the currency half, because repository.apache.org — the registry that answers it — was asked and did not reply (the build stopped because repository.apache.org, a repository this project declares, refused it with HTTP 403 — what this scan's egress allowlist returns for a host that is not on it; 2 dependencies were resolved and graded first, but the graph is partial so the result is reported and not scored). This is OUR side and it is an ENVIRONMENT fault, not a missing collector: the collector exists and ran. An HTTP 403 here is what this scan's egress allowlist returns for a host that is not on it, so the remedy is to add repository.apache.org to the allowlist and re-run — not to build anything.
  • D14 License Compliance — 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. This repository declares a Python pyproject.toml/requirements.txt (pip/uv/Poetry), but the licence verdict published here was taken over its JVM dependencies. Nothing was read about its Python dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
  • D16 Bus Factor — 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. Every one of the 1826 significant source file(s) was last meaningfully changed so long ago that no living knowledge remains, so there is no concentration to measure — the bus factor is not scored. This is not a clean bill: nobody currently holds working knowledge of this code (see D34 Knowledge Freshness).
  • 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. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
  • D21 Naming Consistency — 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. D21's naming rules read C# through Roslyn and every other language through its sidecar model; these languages are left out (PHP's reading is its own change, a Roslyn-loaded VB or F# project has no population builder yet). Their declarations carry no naming verdict this run — this says nothing about whether their 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.
  • 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 — 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 source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
  • D27 Navigability — not measured this run — 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. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
  • D32 Data Compliance (PII/GDPR) — not measured this run — 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. `Main.java`, `core/src/main/scala/org/apache/spark/deploy/history/HistoryPage.scala`, `core/src/main/scala/org/apache/spark/deploy/history/HistoryServer.scala`, `core/src/main/scala/org/apache/spark/deploy/master/ui/ApplicationPage.scala`, `core/src/main/scala/org/apache/spark/deploy/master/ui/MasterPage.scala`, … (+31 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
  • 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 core/src/main/scala/org/apache/spark/internal/config/ConfigReader.scala, 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.
  • AXB2 Runtime readiness — 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. An image the REDACTED builds FROM could not be fetched: our sandbox reaches registries only through its pull-through mirror, and the mirror did not serve it. This is a limit of our sandbox, not of your repository. (rule: registry). The renderer reported: docker build failed (exit 1) — ------ > [internal] load metadata for docker.io/library/openjdk:8-alpine: ------ REDACTED:18 -------------------- 16 | # 17 | 18 | >>> FROM openjdk:8-alpine 19 | 20 | ARG spark_uid=185 -------------------- ERROR: failed to solve: openjdk:8-alpine: failed to resolve source metadata for docker.io/library/openjdk:8-alpine: docker.io/library/openjdk:8-alpine: not found; likely cause (our sandbox): an image the REDACTED builds FROM could not be fetched: our sandbox reaches registries only through its pull-through mirror, and the mirror did not serve it. This is a limit of our sandbox, not of your repository; runtime evidence skipped.
  • AXR1 Runtime accessibility — 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. Render strategy: boot via REDACTED (REDACTED). docker build failed (exit 1) — ------ > [internal] load metadata for docker.io/library/openjdk:8-alpine: ------ REDACTED:18 -------------------- 16 | # 17 | 18 | >>> FROM openjdk:8-alpine 19 | 20 | ARG spark_uid=185 -------------------- ERROR: failed to solve: openjdk:8-alpine: failed to resolve source metadata for docker.io/library/openjdk:8-alpine: docker.io/library/openjdk:8-alpine: not found; likely cause (our sandbox): an image the REDACTED builds FROM could not be fetched: our sandbox reaches registries only through its pull-through mirror, and the mirror did not serve it. This is a limit of our sandbox, not of your repository; runtime evidence skipped.
  • 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.
  • 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. 48 further occurrence(s) are not listed individually; the score already reflects all 88.
  • 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. 71 further occurrence(s) are not listed individually; the score already reflects all 111.
  • X2 Cancellation propagation — 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 C# syntax, and JavaScript/TypeScript, Go, PHP, Dart, Kotlin, Ruby, Scala, Java, Python and Rust source only, and no C# was loaded, and no named async function in this repository's JavaScript/TypeScript, nor any Go, PHP or Dart function or Kotlin suspend function, makes a request that can be cancelled (fetch, axios, ky, ofetch, got, undici, node:http; net/http, net.Dial; amphp; Dio; Ktor, OkHttp), so there is nothing to judge, 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.
  • 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. 97 further occurrence(s) are not listed individually; the score already reflects all 137.

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.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • 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.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
  • D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
  • 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.
  • D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
  • AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
  • AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
  • 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.
  • 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".
  • 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.

Dimensions

D1 · Cyclomatic Complexity5.8 / 10Adequate✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 5.8 / 10 · rule-coverage 100% · ceiling Prevented

161 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was SparkSubmit.prepareSubmitEnvironment at 122. A further 62 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 BasicOperators.apply at 42 — they are counted neither in the figure above nor in this dimension's score. 30 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: core/src/main/scala/org/apache/spark/scheduler/SparkListenerBus.scala (SparkListenerBus.doPostEvent at 26), sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/literals.scala (Literal.componentTypeToDataType at 26), sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/ColumnValue.java (ColumnValue.toTColumnValue at 23), sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DataSourceStrategy.scala (DataSourceStrategy.translateLeafNodeFilter at 22), sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/ColumnValue.java (ColumnValue.toTColumnValue at 22), and 25 more not listed here. They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.

BLAS.gemm (cyclomatic 17) · ×2mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:417
SparkSubmit.prepareSubmitEnvironment (cyclomatic 122)core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala:219
(anonymous) (cyclomatic 108)core/src/main/resources/org/apache/spark/ui/static/stagepage.js:280
UnsupportedOperationChecker.checkForStreaming (cyclomatic 77)sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/UnsupportedOperationChecker.scala:44
LogisticRegression.train (cyclomatic 72)mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala:492

+ 154 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Bring the 6 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with SparkSubmit.prepareSubmitEnvironment (cyclomatic 122), (anonymous) (cyclomatic 108), UnsupportedOperationChecker.checkForStreaming (cyclomatic 77). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 6 together lifts Cyclomatic Complexity from 5.8 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.

D2 · Cognitive Complexity5.4 / 10Adequate✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 5.4 / 10 · rule-coverage 100% · ceiling Prevented

375 method(s) exceeded the cognitive complexity threshold of 15; the worst was SparkSubmit.prepareSubmitEnvironment at 181.

BLAS.gemm (cognitive 58) · ×2mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:417
BLAS.gemv (cognitive 30) · ×2mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:633
SparseVector.argmax (cognitive 30) · ×2mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:669
SparseVector.squared_distance (cognitive 19) · ×2python/pyspark/ml/linalg/__init__.py:615
BLAS.gemv (cognitive 18) · ×2mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:700

+ 357 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Bring the 4 bodies over 120 down to 120 or less in Cognitive Complexity — start with SparkSubmit.prepareSubmitEnvironment (cognitive 181), DAGScheduler.handleTaskCompletion (cognitive 156), LogisticRegression.train (cognitive 148). — 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 4 together lifts Cognitive Complexity from 5.4 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.

D3 · God Classes8.7 / 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.

Maturity: Documented → Verified → Prevented · effective 8.7 / 10 · rule-coverage 100% · ceiling Prevented

173 god class(es) detected.

FileTooLong: REDACTED · ×76REDACTED
TooManyMethods: functions · ×67sql/core/src/main/scala/org/apache/spark/sql/functions.scala:71
MethodTooLong: LogisticRegression.train · ×16mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala:492
ClassTooLong: Analyzer · ×14sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala:97

What to do

  1. Resolve the 76 FileTooLong finding(s) in God Classes — start with __init__.py (2), Matrices.scala (2), HiveSessionImpl.java (2). — One of this dimension's main actionable groups (76 warning-level).
  2. Resolve the 67 TooManyMethods finding(s) in God Classes — start with HiveSessionImpl.java (2), Operation.java (2), CLIService.java (2). — One of this dimension's main actionable groups (67 warning-level).
  3. Resolve the 16 MethodTooLong finding(s) in God Classes — start with LinearRegression.scala (5), HiveInspectors.scala (2), PythonRunner.scala (2). — One of this dimension's main actionable groups (16 warning-level).

Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.

D4 · Code Duplication7.2 / 10Strong✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 7.2 / 10 · rule-coverage 100% · ceiling Verified

806 duplicated block group(s) detected. 6.9 % of the production lines (36,320 of 525,741) are in a reported copy. A further 503 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 145 of the 1309 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.

Duplicated block (7 lines × 2) · ×66core/src/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala:162
Duplicated block (6 lines × 2) · ×59core/src/main/scala/org/apache/spark/api/python/PythonRDD.scala:313
Duplicated block (10 lines × 2) · ×55core/src/main/scala/org/apache/spark/rdd/CoGroupedRDD.scala:117
Duplicated block (9 lines × 2) · ×47mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:219
Duplicated block (8 lines × 2) · ×43core/src/main/scala/org/apache/spark/partial/MeanEvaluator.scala:48

+ 269 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 66 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with ColumnValue.java (7), OffHeapColumnVector.java (3), HiveAuthFactory.java (3). — One of this dimension's main actionable groups (66 warning-level).
  2. Resolve the 59 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with CLIService.java (10), Operation.java (3), PythonRDD.scala (2). — One of this dimension's main actionable groups (59 warning-level).
  3. Resolve the 55 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with ThriftCLIServiceClient.java (7), ThriftCLIService.java (3), MLUtils.scala (2). — One of this dimension's main actionable groups (55 warning-level).

Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.

D5 · Coupling10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.

Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.

Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

38 production modules (Maven+Python+sbt), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; a dependsOn spread (deps: _*) and a project whose directory a helper computes are not visible there; 0 module(s) off the main sequence, with abstractness counted on 29 of the 38 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).

✓ On the Gold path — maintain.

Detailed fixes: d5_recommendation.md.

D6 · Cohesion (LCOM4)9.6 / 10Stronggated by 28 serious findings✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 9.6 / 10 · rule-coverage 100% · ceiling Verified

28 of 847 classes have LCOM4 above 3.

Low cohesion: SparkContext (LCOM4 11) · ×28core/src/main/scala/org/apache/spark/SparkContext.scala:77

What to do

  1. Resolve the 28 Low cohesion finding(s) in Cohesion (LCOM4) — start with YarnSchedulerBackend.scala (2), SparkContext.scala, SparkHadoopUtil.scala. — One of this dimension's main actionable groups (28 warning-level).

Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.

D13 · REDACTED Scanning10.0 / 10Exemplary○ Nothing flagged

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

REDACTED scan ran and found no leaked secrets. 1 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.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

D14 · License Compliance10.0 / 10Exemplary○ Nothing flagged

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Verified

0 of 23 declared JVM dependency artifact(s) use a banned license. Licences were resolved from the POMs Maven Central publishes, over the coordinates this repository's 39 Maven/Gradle manifest(s) declare with a version resolvable from the manifest itself — the same declaration-site closure this analysis reads for dependency currency. The JVM has no lockfile a checkout is guaranteed to carry, so this is deliberately NOT the transitive closure. 466 further coordinate(s) are declared with no version at the declaration site — inherited from a parent POM, a BOM or an unresolved Gradle version reference — and are NOT graded: this verdict covers what the checkout pins, not the full transitive graph. 1 of them resolve to no licence at all on Central, even through their parent POMs; that is missing data, not a violation, and none of them is charged. A further 4 coordinate(s) are not published to Maven Central — another repository (Google's Maven hosts androidx), a SNAPSHOT, or a private artifact — so their licences are not readable from here and they are outside this verdict. ★ COVERAGE OF THIS VERDICT: it grades this repository's JVM dependencies and nothing else. The repository also declares a Python pyproject.toml/requirements.txt (pip/uv/Poetry), and the licences of those dependencies were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity Hotspots10.0 / 10Exemplary✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

No churn × complexity hotspots in the window.

✓ On the Gold path — maintain.

Detailed fixes: d15_recommendation.md.

D17 · Explicit Debt9.8 / 10Stronggated by 604 serious findings✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 9.8 / 10 · rule-coverage 100% · ceiling Prevented

604 deducted task-comment markers across 525741 LoC (0.1/KLoC) → score 9.8. 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.

TodoComment · ×577streaming/src/main/scala/org/apache/spark/streaming/scheduler/StreamingListenerBus.scala:98
HackComment · ×21sql/hive/src/test/scala/org/apache/spark/sql/hive/test/TestHive.scala:528
FixmeComment · ×4sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:100
XxxComment · ×2streaming/src/test/scala/org/apache/spark/streaming/ReceiverSuite.scala:175

What to do

  1. Resolve the 577 TodoComment finding(s) in Explicit Debt — start with DAGScheduler.scala (12), VectorizedColumnReader.java (8), Layer.scala (8). — One of this dimension's main actionable groups (577 warning-level).
  2. Resolve the 21 HackComment finding(s) in Explicit Debt — start with BlockInfoManagerSuite.scala (5), REDACTED (3), common.py (2). — One of this dimension's main actionable groups (21 warning-level).
  3. Resolve the 4 FixmeComment finding(s) in Explicit Debt — start with ThriftCLIServiceClient.java (2), Utils.scala, StandaloneAppClient.scala. — One of this dimension's main actionable groups (4 warning-level).

Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.

D19 · Documentation Quality7.5 / 10Strong✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 7.5 / 10 · rule-coverage 100% · ceiling Documented

1 of 2 documentation facets pass in full; short on: F2 example. 104 document(s) read across 30 unit(s).

Documentation: no build, run or usage examplepython/README.md:1

What to do

  1. Resolve the 1 Documentation finding(s) in Documentation Quality — start with README.md. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d19_recommendation.md · top locations in Appendix A, every location in findings.md.

D20 · ADR Quality0.0 / 10Critical✓ Tool-verified

What it measures: Whether architecture decisions are recorded well (context, decision, consequences).

Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

No architecture decision records were found.

No ADRs foundmain.go:2

What to do

  1. Resolve the 1 No ADRs found finding(s) in ADR Quality — start with main.go. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d20_recommendation.md · top locations in Appendix A, every location in findings.md.

D21 · Naming Consistency7.8 / 10Strong✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 7.8 / 10 · rule-coverage 100% · ceiling Verified

12 naming inconsistencies among 536 declarations measured against a convention their peers follow.

`toJSON` spells `JSON` where 126 names in the project spell it `Json` · ×2sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/trees/TreeNode.scala:669
`toDS` spells `DS` where 28 names in the project spell it `Ds` · ×2sql/core/src/main/scala/org/apache/spark/sql/DatasetHolder.scala:38
`getServerIPAddress` spells `IP` where 24 names in the project spell it `Ip` · ×2sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:207
`getClassFileInputStreamFromSparkRPC` spells `RPC` where 23 names in the project spell it `Rpc`repl/src/main/scala/org/apache/spark/repl/ExecutorClassLoader.scala:133
`runSQLonFile` spells `SQ` where 22 names in the project spell it `Sq`sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala:2132

+ 4 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 2 `toJSON` spells `JSON` where 126 names in the project spell it `Json` finding(s) in Naming Consistency — start with TreeNode.scala, Dataset.scala. — One of this dimension's main actionable groups (2 recommendation-level).
  2. Resolve the 2 `toDS` spells `DS` where 28 names in the project spell it `Ds` finding(s) in Naming Consistency — start with DatasetHolder.scala, memory.scala. — One of this dimension's main actionable groups (2 recommendation-level).
  3. Resolve the 2 `getServerIPAddress` spells `IP` where 24 names in the project spell it… finding(s) in Naming Consistency — start with ThriftCLIService.java (2). — One of this dimension's main actionable groups (2 recommendation-level).

Detailed fixes: d21_recommendation.md · top locations in Appendix A, every location in findings.md.

D24 · Comment Value7.3 7.2 / 10Strong✓ Tool-verified

What it measures: Whether comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).

Method: Every inline C# comment compared word by word with the identifiers, literals and constructs of the code it annotates (taken from the syntax); a comment whose words that code already contains is redundant, as are closing-brace labels and generator template text. Comments giving a reason or a reference are kept; other scripts and languages are not judged. Deterministic, exhaustive, advisory.

Maturity: Documented → Verified → Prevented · effective 7.2 / 10 · rule-coverage 98% · ceiling Documented

5 of 187 judged comments only repeat the code they sit on (2.7 %). 5 comment(s) in another language or script were not judged.

redundant comment · ×5core/src/main/resources/org/apache/spark/ui/static/executorspage.js:99

What to do

  1. Resolve the 5 redundant comment finding(s) in Comment Value — start with streaming-page.js (4), executorspage.js. — One of this dimension's main actionable groups (5 recommendation-level).

Detailed fixes: d24_recommendation.md · top locations in Appendix A, every location in findings.md.

D26 · Project Cohesion5.5 / 10Adequate✓ Tool-verified

What it measures: Whether each project is a focused, coherent unit rather than an oversized grab-bag.

Method: Project size overshoot penalties (LoC / public-type count / namespace count, 2-of-3 flag) weighted by log magnitude. Exhaustive across projects, deterministic.

Maturity: Documented → Verified → Prevented · effective 5.5 / 10 · rule-coverage 100% · ceiling Documented

7 of 31 build units (Maven, Python) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion · ×7REDACTED:1

What to do

  1. Resolve the 7 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with REDACTED (6), REDACTED. — One of this dimension's main actionable groups (7 recommendation-level).

Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.

D28 · Secrets (history)8.0 / 10Adequategated by 2 critical findings✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 8.0 / 10 · rule-coverage 100% · ceiling Documented

2 finding(s): 0 critical, 2 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.

REDACTED
REDACTED

What to do

  1. Resolve the 2 REDACTED finding(s) in Secrets (history) — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
  2. Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d28_recommendation.md · top locations in Appendix A, every location in findings.md.

D29 · Static Analysis (SAST)0.0 / 10Critical✓ Tool-verified

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).

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

75 finding(s): 0 critical, 17 high, 54 medium, 4 low. semgrep hit a parse error in 44 file(s) — `Main.java` (line 24), `R/run-tests.sh` (lines 20–64), `core/src/main/scala/org/apache/spark/deploy/history/HistoryPage.scala`, `core/src/main/scala/org/apache/spark/deploy/history/HistoryServer.scala`, `core/src/main/scala/org/apache/spark/deploy/master/ui/ApplicationPage.scala`, … (+39 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

+ 11 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 13 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3), REDACTED (2), REDACTED. — One of this dimension's main actionable groups (13 issue-level).
  2. 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).
  3. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).

Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.

D30 · Dependency Vulnerabilities0.0 / 10Critical✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

118 finding(s): 29 critical, 39 high, 50 medium, 0 low.

REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 50 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (50). — One of this dimension's main actionable groups (50 warning-level).
  2. Resolve the 39 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (39). — One of this dimension's main actionable groups (39 issue-level).
  3. Resolve the 29 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (29). — One of this dimension's main actionable groups (29 issue-level).

Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.

D31 · IaC & Container Security8.5 / 10Adequategated by 2 critical findings✓ Tool-verified

What it measures: Whether Dockerfiles / Terraform / Kubernetes config follow security best practices.

Method: IaC/container misconfiguration scan via trivy config (REDACTED/Terraform/K8s/Helm/CloudFormation); severity rules to 0-10 moderate normalizer. NotApplicable without manifests. Exhaustive, deterministic.

Maturity: Documented → Verified → Prevented · effective 8.5 / 10 · rule-coverage 100% · ceiling Documented

10 finding(s): 0 critical, 2 high, 8 medium, 0 low.

REDACTED
REDACTED

What to do

  1. Resolve the 2 High IaC finding(s) in IaC & Container Security — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
  2. Resolve the 7 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (7). — One of this dimension's main actionable groups (7 warning-level).

Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.

D34 · Knowledge Freshness0.0 / 10Critical✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

1826 of 1826 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is sql/core/src/main/scala/org/apache/spark/sql/functions.scala. Counted over 1826 of the 2532 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned file · ×1823python/pyspark/sql/functions.py:1
Most significant orphaned file · ×3sql/core/src/main/scala/org/apache/spark/sql/functions.scala:1
Dormant codebase

What to do

  1. Resolve the 1823 Orphaned file finding(s) in Knowledge Freshness — start with package.scala (11), __init__.py (5), util.py (4). — One of this dimension's main actionable groups (1823 recommendation-level).
  2. Resolve the 3 Most significant orphaned file finding(s) in Knowledge Freshness — start with functions.scala, MimaExcludes.scala, feature.py. — One of this dimension's main actionable groups (3 recommendation-level).
  3. Resolve the 1 Dormant codebase 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.

D35 · Change Coupling10.0 / 10Exemplary✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

No strong hidden change-coupling between production files.

✓ On the Gold path — maintain.

Detailed fixes: d35_recommendation.md.

D36 · Supply-chain Provenance & Signing6.7 / 10Adequate✓ Tool-verified

What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.

Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.

Maturity: Documented → Verified → Prevented · effective 6.7 / 10 · rule-coverage 100% · ceiling Documented

2/3 supply-chain integrity signals present (provenance, signing, SBOM).

REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).
  3. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.

D43 · Malicious Dependencies10.0 / 10Exemplary✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

No dependency in any ecosystem this repository declares is published as malicious.

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

D44 · Platform End-of-Life10.0 / 10Exemplary✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 1 platform declaration(s) and 73 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.

✓ On the Gold path — maintain.

Detailed fixes: d44_recommendation.md.

Frontend & cross-cutting dimensions

R = React/JS · M = Maturity · P = Readiness.

AC2 · Forms & labels10.0 / 10Exemplary○ Nothing flagged

Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.

Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

AC3 · Page structure5.6 / 10Adequate✓ Tool-verified

Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.

Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. (×3) — index.html:2, licenses-binary/LICENSE-javassist.html:1, REDACTED:3
  • The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en"). — licenses-binary/LICENSE-javassist.html:1

What to do

  • Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
AC6 · Visual & motion safety1.0 / 10Critical✓ Tool-verified

Other · Accessibility — Whether focus outlines aren't removed without a replacement, motion respects prefers-reduced-motion, and literal CSS colour pairs meet contrast — PARTIAL: inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS literals are read (hex/rgb/hsl/named), never computed/runtime/external-CDN colour. Static markup readiness, not a WCAG conformance claim.

Method: Static markup/CSS scan: inline outline:none/0, literal inline colour/background contrast against the 4.5:1 AA floor, and <style>-block animation without a prefers-reduced-motion guard. Deterministic but PARTIAL — only inline styles and in-repo CSS literals are visible.

Coverage: Population: styled elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx), plus in-repo <style> blocks, in-repo .css files and CSS-in-JS literals. Colour contrast is computed from LITERAL colour pairs only (hex/rgb/hsl/named, including var() tokens and Tailwind neutral utilities) — computed, runtime-themed and external-CDN colour is never resolved, so this is a partial read of contrast by construction. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • `div.pys-note-experimental` sets color: rgb(255, 255, 255) on background-color: rgb(88, 151, 165) — 3.3:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — python/docs/_static/pyspark.css:60
  • `.dropdown-menu li > a:hover, .dropdown-menu li > a:focus, .dropdown-submenu:hover > a` sets color: #ffffff on background-color: #0081c2 — 4.3:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — docs/css/bootstrap.css:2704
  • `.dropdown-menu .active > a, .dropdown-menu .active > a:hover` sets color: #ffffff on background-color: #0098cc — 3.3:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — docs/css/bootstrap.css:2719
  • `.btn-warning:hover, .btn-warning:active, .btn-warning.active, .btn-warning.disabled, .btn-warning[disabled]` sets color: #ffffff on background-color: #f89406 — 2.3:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — docs/css/bootstrap.css:3117
  • `.btn-success:hover, .btn-success:active, .btn-success.active, .btn-success.disabled, .btn-success[disabled]` sets color: #ffffff on background-color: #51a351 — 3.1:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — docs/css/bootstrap.css:3181
  • `.btn-info:hover, .btn-info:active, .btn-info.active, .btn-info.disabled, .btn-info[disabled]` sets color: #ffffff on background-color: #2f96b4 — 3.4:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — docs/css/bootstrap.css:3213
  • `.nav-list > .active > a, .nav-list > .active > a:hover` sets color: #ffffff on background-color: #0088cc — 3.9:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — docs/css/bootstrap.css:3675
  • `.nav-pills > .active > a, .nav-pills > .active > a:hover` sets color: #ffffff on background-color: #0088cc — 3.9:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — docs/css/bootstrap.css:3769
  • `.nav-tabs .open .dropdown-toggle, .nav-pills .open .dropdown-toggle, .nav > li.dropdown.open.active > a:hover` sets color: #ffffff on background-color: #999999 — 2.8:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — docs/css/bootstrap.css:3869
  • `.navbar .btn-navbar:hover, .navbar .btn-navbar:active, .navbar .btn-navbar.active, .navbar .btn-navbar.disabled, .navbar .btn-navbar[disabled]` sets color: #ffffff on background-color: #e5e5e5 — 1.3:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — docs/css/bootstrap.css:4301
  • `.pager .disabled a, .pager .disabled a:hover` sets color: #999999 on background-color: #fff — 2.8:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — docs/css/bootstrap.css:4706
  • `.table.dataTable tbody tr.active td, .table.dataTable tbody tr.active th` sets color: white on background-color: #08C — 3.9:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — core/src/main/resources/org/apache/spark/ui/static/dataTables.bootstrap.css:153
  • `ul.DTTT_dropdown.dropdown-menu li:hover a` sets color: white on background-color: #0088cc — 3.9:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — core/src/main/resources/org/apache/spark/ui/static/dataTables.bootstrap.css:198
  • `.open .dropdown-toggle` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — docs/css/bootstrap.css:2631
  • `.dropdown-menu .active > a` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — docs/css/bootstrap.css:2730
  • `.btn.active` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — docs/css/bootstrap.css:2989
  • `.btn-group.open .dropdown-toggle` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — docs/css/bootstrap.css:3422
  • `.navbar-inverse .navbar-search .search-query.focused` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — docs/css/bootstrap.css:4519
  • `.collapse` moves (`transition: height 0.35s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — docs/css/bootstrap.css:2873
  • `.btn:hover` moves (`transition: background-position 0.1s linear`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — docs/css/bootstrap.css:2975
  • `.modal.fade` moves (`transition: opacity 0.3s linear, top 0.3s ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — docs/css/bootstrap.css:4776
  • `.progress .bar` moves (`transition: width 0.6s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — docs/css/bootstrap.css:5309
  • `.progress.active .bar` moves (`animation: progress-bar-stripes 2s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — docs/css/bootstrap.css:5336
  • `.carousel .item` moves (`transition: 0.6s ease-in-out left`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — docs/css/bootstrap.css:5475
  • `.nav-trigger + label` moves (`transition: left 0.4s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — docs/css/main.css:256
  • `.stage-details` moves (`transition: max-height 0.25s ease-out, padding 0.25s ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — core/src/main/resources/org/apache/spark/ui/static/webui.css:121
  • `.stacktrace-details` moves (`transition: max-height 0.25s ease-out, padding 0.25s ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — core/src/main/resources/org/apache/spark/ui/static/webui.css:152

What to do

  • Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
AX10 · Code composition9.7 / 10Exemplary✓ Tool-verified

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.

AX3 · Project dependency cycles10.0 / 10Exemplary✓ Tool-verified

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.

AX4 · Dependency direction10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.

Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.

AX6 · Interface segregation9.9 / 10Exemplary✓ Tool-verified

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.

  • `SessionManager` declares 30 abstract methods: `access`, `addEventListener`, `clearEventListeners`, `complete`, `getClusterId`, `getDefaultSessionTrackingModes`, `getEffectiveSessionTrackingModes`, `getHttpOnly`, `getHttpSession`, `getMaxInactiveInterval`, `getMetaManager`, `getNodeId`, `getSessionCookie`, `getSessionCookieConfig`, `getSessionIdManager`, `getSessionIdPathParameterName`, `getSessionIdPathParameterNamePrefix`, `isCheckingRemoteSessionIdEncoding`, `isUsingCookies`, `isUsingURLs`, `isValid`, `newHttpSession`, `removeEventListener`, `renewSessionId`, `setCheckingRemoteSessionIdEncoding`, `setMaxInactiveInterval`, `setSessionHandler`, `setSessionIdManager`, `setSessionIdPathParameterName`, `setSessionTrackingModes`. 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. — resource-managers/yarn/src/test/java/org/eclipse/jetty/server/SessionManager.java:37
  • `SpecializedGetters` declares 16 abstract methods: `get`, `getArray`, `getBinary`, `getBoolean`, `getByte`, `getDecimal`, `getDouble`, `getFloat`, `getInt`, `getInterval`, `getLong`, `getMap`, `getShort`, `getStruct`, `getUTF8String`, `isNullAt`. 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. — sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/SpecializedGetters.java:28
  • `HiveSession` declares 26 abstract methods: `cancelDelegationToken`, `cancelOperation`, `close`, `closeExpiredOperations`, `closeOperation`, `executeStatement`, `executeStatement`, `executeStatementAsync`, `executeStatementAsync`, `fetchResults`, `getCatalogs`, `getColumns`, `getCrossReference`, `getDelegationToken`, `getFunctions`, `getInfo`, `getMetaStoreClient`, `getNoOperationTime`, `getPrimaryKeys`, `getResultSetMetadata`, `getSchemas`, `getTableTypes`, `getTables`, `getTypeInfo`, `open`, `renewDelegationToken`. 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 26 declarations carry 24 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 24 operations clears the >15 bar on its own, so the row is about responsibilities, not signatures. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSession.java:28
  • `HiveSessionBase` declares 17 abstract methods: `getHiveConf`, `getIpAddress`, `getLastAccessTime`, `getOperationLogSessionDir`, `getPassword`, `getProtocolVersion`, `getSessionHandle`, `getSessionManager`, `getSessionState`, `getUserName`, `getUsername`, `isOperationLogEnabled`, `setIpAddress`, `setOperationLogSessionDir`, `setOperationManager`, `setSessionManager`, `setUserName`. 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. (×2) — sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionBase.java:33, sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionBase.java:33
  • `ICLIService` declares 26 abstract methods: `cancelDelegationToken`, `cancelOperation`, `closeOperation`, `closeSession`, `executeStatement`, `executeStatement`, `executeStatementAsync`, `executeStatementAsync`, `fetchResults`, `fetchResults`, `getCatalogs`, `getColumns`, `getCrossReference`, `getDelegationToken`, `getFunctions`, `getInfo`, `getOperationStatus`, `getPrimaryKeys`, `getResultSetMetadata`, `getSchemas`, `getTableTypes`, `getTables`, `getTypeInfo`, `openSession`, `openSessionWithImpersonation`, `renewDelegationToken`. 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 26 declarations carry 23 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 23 operations clears the >15 bar on its own, so the row is about responsibilities, not signatures. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/ICLIService.java:28
  • `HiveSession` declares 22 abstract methods: `cancelDelegationToken`, `cancelOperation`, `close`, `closeExpiredOperations`, `closeOperation`, `executeStatement`, `executeStatementAsync`, `fetchResults`, `getCatalogs`, `getColumns`, `getDelegationToken`, `getFunctions`, `getInfo`, `getMetaStoreClient`, `getNoOperationTime`, `getResultSetMetadata`, `getSchemas`, `getTableTypes`, `getTables`, `getTypeInfo`, `open`, `renewDelegationToken`. 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. — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSession.java:28
  • `ICLIService` declares 22 abstract methods: `cancelDelegationToken`, `cancelOperation`, `closeOperation`, `closeSession`, `executeStatement`, `executeStatementAsync`, `fetchResults`, `fetchResults`, `getCatalogs`, `getColumns`, `getDelegationToken`, `getFunctions`, `getInfo`, `getOperationStatus`, `getResultSetMetadata`, `getSchemas`, `getTableTypes`, `getTables`, `getTypeInfo`, `openSession`, `openSessionWithImpersonation`, `renewDelegationToken`. 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 22 declarations carry 21 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 21 operations clears the >15 bar on its own, so the row is about responsibilities, not signatures. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/ICLIService.java:28
  • `ExternalCatalog` declares 38 abstract members: `createDatabase`, `dropDatabase`, `alterDatabase`, `getDatabase`, `databaseExists`, `listDatabases`, `listDatabases`, `setCurrentDatabase`, `createTable`, `dropTable`, `renameTable`, `alterTable`, `alterTableDataSchema`, `alterTableStats`, `getTable`, `getTablesByName`, `tableExists`, `listTables`, `listTables`, `loadTable`, `loadPartition`, `loadDynamicPartitions`, `createPartitions`, `dropPartitions`, `renamePartitions`, `alterPartitions`, `getPartition`, `getPartitionOption`, `listPartitionNames`, `listPartitions`, `listPartitionsByFilter`, `createFunction`, `dropFunction`, `alterFunction`, `renameFunction`, `getFunction`, `functionExists`, `listFunctions`. Counted over its ABSTRACT members — a `def` with no body or a `val`/`var` with no initializer, once per signature; concrete members, private and protected members, and members of a companion `object` are not counted, because no implementer is forced to write them. Those 38 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. — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/ExternalCatalog.scala:33
  • `LogicalPlanVisitor[T]` declares 19 abstract members: `default`, `visitAggregate`, `visitDistinct`, `visitExcept`, `visitExpand`, `visitFilter`, `visitGenerate`, `visitGlobalLimit`, `visitIntersect`, `visitJoin`, `visitLocalLimit`, `visitPivot`, `visitProject`, `visitRepartition`, `visitRepartitionByExpr`, `visitSample`, `visitScriptTransform`, `visitUnion`, `visitWindow`. Counted over its ABSTRACT members — a `def` with no body or a `val`/`var` with no initializer, once per signature; concrete members, private and protected members, and members of a companion `object` 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. — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlanVisitor.scala:23

What to do

  • Split fat interfaces into focused role-interfaces so clients depend only on what they use.
GD1 · Unfinished & placeholder code10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Unreviewed-generation residue in this repository's Scala: methods whose whole body is still `???` or a "not implemented" throw where nothing overrides them, 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.

  • `getParentLogger` is a shipped member whose whole body is still a "not implemented" error, and nothing in the repository overrides it — generated scaffolding that was never completed. Implement it or remove the dead surface. — sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/DriverWrapper.scala:40

What to do

  • Finish or delete the members whose body is still `???` or a "not implemented" throw where nothing overrides them, and replace placeholder text before shipping.
IC1 · Incompleteness & stubs9.0 / 10Exemplary✓ Tool-verified

Other · Code Health — Unfinished work detected by code SHAPE, not keywords, in this repository's Scala: methods whose body is `???` or only throws a "not implemented" error, 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.

  • `getParentLogger` throws an exception whose message says it isn't finished — a not-implemented stub wearing an ordinary exception. Implement it or remove it. — sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/DriverWrapper.scala:40
  • A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something. (×18) — common/unsafe/src/test/scala/org/apache/spark/unsafe/types/UTF8StringPropertyCheckSuite.scala:225, core/src/test/scala/org/apache/spark/DriverSuite.scala:33, core/src/test/scala/org/apache/spark/deploy/SparkSubmitSuite.scala:604, …
  • A bare `// scalastyle:off`, `// scalafix:off` or `@nowarn` (or Wartremover's `warts.All`) switches every rule or warning off — hidden debt. Suppress the specific rule on the specific line, with a justification, instead. (×21) — core/src/main/scala/org/apache/spark/InternalAccumulator.scala:46, core/src/main/scala/org/apache/spark/rdd/CheckpointRDD.scala:42, core/src/main/scala/org/apache/spark/serializer/KryoSerializer.scala:181, …

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 `ignore`d and `pending` tests, decide whether each empty method or UnsupportedOperationException is deliberate (and say so in a comment), and replace a bare `// scalastyle:off` or `@nowarn` with targeted, justified suppressions.
M1 · Documentation (README)7.7 / 10Strong✓ Tool-verified

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.

M2 · Architecture documentation5.0 / 10Adequate✓ Tool-verified

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.
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

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.

P1 · CI/CD gates10.0 / 10Exemplary○ Nothing flagged

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.

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.

P2 · Observability7.7 / 10Strong✓ Tool-verified

Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.

Method: Filesystem/Roslyn scan: structured-logging frameworks (Serilog, NLog), OpenTelemetry, and health-check endpoint patterns. Exhaustive, deterministic.

  • Only 13/23 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `.`, `.`, `.`, `dev` and 5 more.

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.
P3 · Security & performance tooling3.0 / 10Weak✓ Tool-verified

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.

  • `REDACTED` 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`. — REDACTED:280

What to do

  • Your ecosystem's static analyzer is declared as a dependency but is not wired into CI — run it as a required step on push/PR (e.g. `composer phpstan` / `mix sobelow` / `bundle exec brakeman` / the spotbugs Gradle task / `sbt scalafixAll --check` / `golangci-lint run` / `rebar3 lint`) so a regression fails the build instead of relying on someone running it locally.
  • Enable Dependabot/Renovate or a dependency-review gate.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback5.0 / 10Adequate✓ Tool-verified

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.

What to do

  • Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.
P6 · Release Hygiene5.0 / 10Adequate✓ Tool-verified

Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.

Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.

  • No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)

What to do

  • Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
P7 · Outbound HTTP resilience3.0 / 10Weak✓ Tool-verified

Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.

Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.

  • `.openConnection(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×4) — core/src/main/scala/org/apache/spark/TestUtils.scala:229, core/src/main/scala/org/apache/spark/deploy/rest/RestSubmissionClient.scala:191, core/src/main/scala/org/apache/spark/deploy/rest/RestSubmissionClient.scala:199, …
  • `HttpClient(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — core/src/main/scala/org/apache/spark/ui/JettyUtils.scala:206
  • `urllib2.urlopen(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×3) — dev/github_jira_sync.py:57, dev/github_jira_sync.py:129, dev/merge_spark_pr.py:75

What to do

  • Set connect and read timeouts on every client (`RestTemplateBuilder.connectTimeout/readTimeout`, WebClient `responseTimeout`, `HttpRequest.Builder.timeout`, `HttpURLConnection.setReadTimeout`, Feign `connectTimeout`/`readTimeout` in configuration), and wrap calls to dependencies in resilience4j `@Retry`/`@CircuitBreaker`/`@TimeLimiter` (or Spring Retry).
  • Pass `timeout=` on every `requests`/`httpx` call (requests has no default and will wait forever), mount an `HTTPAdapter(max_retries=Retry(...))` on shared sessions, and wrap calls to flaky dependencies in `tenacity` retries or a `pybreaker` circuit breaker.
PF3 · Async & latency hygiene10.0 / 10Exemplary✓ Tool-verified

Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.

Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from each language's code model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.

R1 · Type Safety0.0 / 10Critical✓ Tool-verified

React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.

Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.

  • 0 typed · 17 plain JS — the untyped files are core/src/main/resources/org/apache/spark/ui/static/additional-metrics.js, core/src/main/resources/org/apache/spark/ui/static/bootstrap-tooltip.js, core/src/main/resources/org/apache/spark/ui/static/dataTables.rowsGroup.js, core/src/main/resources/org/apache/spark/ui/static/executorspage.js, core/src/main/resources/org/apache/spark/ui/static/historypage-common.js, REDACTED (+11 more).

What to do

  • Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
R10 · Code Duplication4.8 / 10Weak✓ Tool-verified

React / JS · Code Health — The share of the scored frontend lines inside a near-exact copy-pasted block of substantial extent (the D4 clone algorithm over JS/TS tokens, D-386; each line once, 10 at none and 0 at a quarter of the lines, as D4): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.

Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Scored on the share of the scored frontend lines inside a reported copy, on the same curve as D4. Deterministic.

  • core/src/main/resources/org/apache/spark/ui/static/timeline-view.js:18 · core/src/main/resources/org/apache/spark/ui/static/timeline-view.js:94 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — core/src/main/resources/org/apache/spark/ui/static/timeline-view.js:18
  • core/src/main/resources/org/apache/spark/ui/static/executorspage.js:387 · core/src/main/resources/org/apache/spark/ui/static/executorspage.js:483 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — core/src/main/resources/org/apache/spark/ui/static/executorspage.js:387
  • core/src/main/resources/org/apache/spark/ui/static/stagepage.js:681 · core/src/main/resources/org/apache/spark/ui/static/stagepage.js:731 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — core/src/main/resources/org/apache/spark/ui/static/stagepage.js:681
  • streaming/src/main/resources/org/apache/spark/streaming/ui/static/streaming-page.js:90 · streaming/src/main/resources/org/apache/spark/streaming/ui/static/streaming-page.js:227 — the two spans are one implementation copied and then locally edited — 287 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — streaming/src/main/resources/org/apache/spark/streaming/ui/static/streaming-page.js:90
  • REDACTED:273 · REDACTED:288 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — REDACTED:273
  • core/src/main/resources/org/apache/spark/ui/static/stagepage.js:763 · core/src/main/resources/org/apache/spark/ui/static/stagepage.js:777 · core/src/main/resources/org/apache/spark/ui/static/stagepage.js:801 — all 3 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — core/src/main/resources/org/apache/spark/ui/static/stagepage.js:763
  • core/src/main/resources/org/apache/spark/ui/static/executorspage.js:42 · REDACTED:58 · REDACTED:73 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — core/src/main/resources/org/apache/spark/ui/static/executorspage.js:42
  • core/src/main/resources/org/apache/spark/ui/static/executorspage.js:361 · core/src/main/resources/org/apache/spark/ui/static/executorspage.js:373 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — core/src/main/resources/org/apache/spark/ui/static/executorspage.js:361
  • core/src/main/resources/org/apache/spark/ui/static/executorspage.js:457 · core/src/main/resources/org/apache/spark/ui/static/executorspage.js:469 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — core/src/main/resources/org/apache/spark/ui/static/executorspage.js:457
  • core/src/main/resources/org/apache/spark/ui/static/stagepage.js:750 · core/src/main/resources/org/apache/spark/ui/static/stagepage.js:838 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — core/src/main/resources/org/apache/spark/ui/static/stagepage.js:750
  • core/src/main/resources/org/apache/spark/ui/static/stagepage.js:702 · core/src/main/resources/org/apache/spark/ui/static/stagepage.js:712 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — core/src/main/resources/org/apache/spark/ui/static/stagepage.js:702
  • core/src/main/resources/org/apache/spark/ui/static/stagepage.js:830 · core/src/main/resources/org/apache/spark/ui/static/stagepage.js:840 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — core/src/main/resources/org/apache/spark/ui/static/stagepage.js:830
  • core/src/main/resources/org/apache/spark/ui/static/utils.js:139 · core/src/main/resources/org/apache/spark/ui/static/utils.js:167 — the two spans are one implementation copied and then locally edited — 74 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — core/src/main/resources/org/apache/spark/ui/static/utils.js:139
  • REDACTED:65 · REDACTED:80 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:65
  • core/src/main/resources/org/apache/spark/ui/static/executorspage.js:71 · core/src/main/resources/org/apache/spark/ui/static/executorspage.js:81 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — core/src/main/resources/org/apache/spark/ui/static/executorspage.js:71
  • core/src/main/resources/org/apache/spark/ui/static/stagepage.js:302 · core/src/main/resources/org/apache/spark/ui/static/stagepage.js:311 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — core/src/main/resources/org/apache/spark/ui/static/stagepage.js:302
  • core/src/main/resources/org/apache/spark/ui/static/stagepage.js:440 · core/src/main/resources/org/apache/spark/ui/static/stagepage.js:447 · core/src/main/resources/org/apache/spark/ui/static/stagepage.js:454 · core/src/main/resources/org/apache/spark/ui/static/stagepage.js:461 — 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. — core/src/main/resources/org/apache/spark/ui/static/stagepage.js:440
  • core/src/main/resources/org/apache/spark/ui/static/additional-metrics.js:27 · core/src/main/resources/org/apache/spark/ui/static/timeline-view.js:76 · core/src/main/resources/org/apache/spark/ui/static/timeline-view.js:152 · core/src/main/resources/org/apache/spark/ui/static/timeline-view.js:219 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — core/src/main/resources/org/apache/spark/ui/static/additional-metrics.js:27

What to do

  • Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
R2 · Cyclomatic Complexity9.0 / 10Exemplary✓ Tool-verified

React / JS · Code Health — Per-function cyclomatic/cognitive complexity from the token-level function scanner (D-386) — real branching, not a regex heuristic.

Method: Per-function cyclomatic/cognitive complexity from a token-level function scanner (real branching, not a regex heuristic), computed over every frontend function. Deterministic.

  • (anonymous) has cyclomatic complexity 19 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — core/src/main/resources/org/apache/spark/ui/static/stagepage.js:501
  • getInnerText has cyclomatic complexity 17 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:199
  • makeSortable has cyclomatic complexity 14 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:42
  • show has cyclomatic complexity 11 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — core/src/main/resources/org/apache/spark/ui/static/bootstrap-tooltip.js:114
R3 · Large Files0.6 / 10Critical✓ Tool-verified

React / JS · Code Health — How many source files exceed the large-file threshold.

Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.

  • core/src/main/resources/org/apache/spark/ui/static/stagepage.js has 896 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — core/src/main/resources/org/apache/spark/ui/static/stagepage.js:1
  • core/src/main/resources/org/apache/spark/ui/static/spark-dag-viz.js has 506 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — core/src/main/resources/org/apache/spark/ui/static/spark-dag-viz.js:1
  • core/src/main/resources/org/apache/spark/ui/static/executorspage.js has 498 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — core/src/main/resources/org/apache/spark/ui/static/executorspage.js:1
  • REDACTED has 446 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1

What to do

  • Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
R7 · Dead Code9.9 / 10Exemplary✓ Tool-verified

React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).

Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.

  • Unreachable from the 16 application, 0 tooling and 0 test entry point(s) detected in this repo. This repository declares no build, type-check or test script, so nothing here would fail on a wrong deletion — confirm by hand that nothing loads each file (including by a path built at runtime) before removing it. An undetected custom entry would make these reachable.
  • no import path from any entry point (16 application, 0 tooling, 0 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make — index.js

What to do

  • Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
R9 · Circular Imports10.0 / 10Exemplary✓ Tool-verified

React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.

Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.

X1 · Async correctness10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.

Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.

X12 · Unreachable branch10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.

Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.

X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.

Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.

X15 · Unvalidated length from an untrusted reader1.7 / 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.

  • `length` is read from the bytes being parsed at line 86 (`getInt`), then used to size a `ByteBuffer.allocate` at line 87 — 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. — streaming/src/main/scala/org/apache/spark/streaming/dstream/RawInputDStream.scala:87
  • `length` is read from the bytes being parsed at line 107 (`readInt`), then used to size a `new Array[Byte]` at line 108 — 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. — streaming/src/main/scala/org/apache/spark/streaming/api/python/PythonDStream.scala:108
  • `functionInBytesLength` is read from the bytes being parsed at line 230 (`readInt`), then used to size a `new Array[Byte]` at line 231 — and nowhere in its scope is `functionInBytesLength` 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 `functionInBytesLength` against the bytes actually remaining and a maximum the format allows before allocating. — sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveShim.scala:231
  • `keySize` is read from the bytes being parsed at line 435 (`readInt`), then used to size a `new Array[Byte]` at line 442 — and nowhere in its scope is `keySize` 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 `keySize` against the bytes actually remaining and a maximum the format allows before allocating. — sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/HDFSBackedStateStoreProvider.scala:442
  • `valueSize` is read from the bytes being parsed at line 448 (`readInt`), then used to size a `new Array[Byte]` at line 452 — and nowhere in its scope is `valueSize` 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 `valueSize` against the bytes actually remaining and a maximum the format allows before allocating. — sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/HDFSBackedStateStoreProvider.scala:452
  • `keySize` is read from the bytes being parsed at line 528 (`readInt`), then used to size a `new Array[Byte]` at line 535 — and nowhere in its scope is `keySize` 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 `keySize` against the bytes actually remaining and a maximum the format allows before allocating. — sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/HDFSBackedStateStoreProvider.scala:535
  • `valueSize` is read from the bytes being parsed at line 541 (`readInt`), then used to size a `new Array[Byte]` at line 546 — and nowhere in its scope is `valueSize` 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 `valueSize` against the bytes actually remaining and a maximum the format allows before allocating. — sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/HDFSBackedStateStoreProvider.scala:546
  • `size` is read from the bytes being parsed at line 144 (`readInt`), then used to size a `new Array[Byte]` at line 145 — and nowhere in its scope is `size` 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 `size` against the bytes actually remaining and a maximum the format allows before allocating. — sql/core/src/main/scala/org/apache/spark/sql/execution/python/RowQueue.scala:145
  • `length` is read from the bytes being parsed at line 522 (`getInt`), then used to size a `new Array[Byte]` at line 523 — 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. — sql/core/src/main/scala/org/apache/spark/sql/execution/columnar/ColumnType.scala:523
  • `len` is read from the bytes being parsed at line 103 (`readInt`), then used to size a `new Array[Byte]` at line 104 — 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. — core/src/main/scala/org/apache/spark/security/SocketAuthHelper.scala:104
  • `len` is read from the bytes being parsed at line 129 (`readInt`), then used to size a `new Array[Byte]` at line 130 — 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. — core/src/main/scala/org/apache/spark/scheduler/MapStatus.scala:130
  • `valueLength` is read from the bytes being parsed at line 175 (`readInt`), then used to size a `new Array[Byte]` at line 176 — and nowhere in its scope is `valueLength` 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 `valueLength` against the bytes actually remaining and a maximum the format allows before allocating. — core/src/main/scala/org/apache/spark/scheduler/TaskDescription.scala:176
  • `blen` is read from the bytes being parsed at line 56 (`readInt`), then used to size a `new Array[Byte]` at line 57 — and nowhere in its scope is `blen` 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 `blen` against the bytes actually remaining and a maximum the format allows before allocating. — core/src/main/scala/org/apache/spark/scheduler/TaskResult.scala:57
  • `contentPairsLength` is read from the bytes being parsed at line 65 (`readInt`), then used to size a `new Array[Byte]` at line 66 — and nowhere in its scope is `contentPairsLength` 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 `contentPairsLength` against the bytes actually remaining and a maximum the format allows before allocating. — core/src/main/scala/org/apache/spark/api/r/RRunner.scala:66
  • `exLength` is read from the bytes being parsed at line 459 (`readInt`), then used to size a `new Array[Byte]` at line 460 — and nowhere in its scope is `exLength` 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 `exLength` against the bytes actually remaining and a maximum the format allows before allocating. — core/src/main/scala/org/apache/spark/api/python/PythonRunner.scala:460
  • `updateLen` is read from the bytes being parsed at line 471 (`readInt`), then used to size a `new Array[Byte]` at line 472 — and nowhere in its scope is `updateLen` 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 `updateLen` against the bytes actually remaining and a maximum the format allows before allocating. — core/src/main/scala/org/apache/spark/api/python/PythonRunner.scala:472
  • `length` is read from the bytes being parsed at line 236 (`readInt`), then used to size a `new Array[Byte]` at line 237 — 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. — core/src/main/scala/org/apache/spark/api/java/JavaRDD.scala:237
  • `numWords` is read from the bytes being parsed at line 96 (`readInt`), then used to size a `new long[]` at line 97 — and nowhere in its scope is `numWords` 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 `numWords` against the bytes actually remaining and a maximum the format allows before allocating. — common/sketch/src/main/java/org/apache/spark/util/sketch/BitArray.java:97
  • `reduceIdsSize` is read from the bytes being parsed at line 123 (`readInt`), then used to size a `new int[]` at line 124 — and nowhere in its scope is `reduceIdsSize` 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 `reduceIdsSize` against the bytes actually remaining and a maximum the format allows before allocating. — common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/protocol/FetchShuffleBlocks.java:124
  • `length` is read from the bytes being parsed at line 40 (`readInt`), then used to size a `new byte[]` at line 41 — 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. — common/network-common/src/main/java/org/apache/spark/network/protocol/Encoders.java:41
  • `length` is read from the bytes being parsed at line 59 (`readInt`), then used to size a `new byte[]` at line 60 — 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. — common/network-common/src/main/java/org/apache/spark/network/protocol/Encoders.java:60
  • `numStrings` is read from the bytes being parsed at line 84 (`readInt`), then used to size a `new String[]` at line 85 — and nowhere in its scope is `numStrings` 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 `numStrings` against the bytes actually remaining and a maximum the format allows before allocating. — common/network-common/src/main/java/org/apache/spark/network/protocol/Encoders.java:85
  • `numInts` is read from the bytes being parsed at line 107 (`readInt`), then used to size a `new int[]` at line 108 — and nowhere in its scope is `numInts` 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 `numInts` against the bytes actually remaining and a maximum the format allows before allocating. — common/network-common/src/main/java/org/apache/spark/network/protocol/Encoders.java:108

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.
X16 · Unfloored truncation loop10.0 / 10Exemplary○ Nothing flagged

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.

X18 · Disposal-pattern correctness7.4 / 10Strong✓ Tool-verified

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.

  • `File.open` is called here without a block, so it hands back an open descriptor the caller must close — and its first and only use reads `.read` through it and drops it. Nothing closes it: it stays open until the garbage collector happens to finalize it, which is one leaked descriptor per call (a child process too, for `IO.popen`), `Errno::EMFILE` under load, and for a written file data that is not flushed when the program next reads it. Use the block form, which closes on every path including a raise (`File.open(…) { |io| … }`), or the one-call reader/writer (`File.read`, `File.write`, `File.foreach`). — docs/_plugins/include_example.rb:49
  • `new ServerSocket(…)` opens something that has to be given back — a file descriptor, a socket, a directory handle — and it is held in `serverSocket`, and every later use of `serverSocket` in its block reads a member through it — it is never returned, passed, stored, captured by a lambda, reassigned or released, so this expression both creates the value and is the last place that can release it, and does not. Every call leaks one more open handle until the collector happens to reach it: `Too many open files` under load, and on Windows a file that cannot be replaced or deleted while it is held. Open it with `scala.util.Using.resource(new ServerSocket(…)) { r => … }`, which releases it on every path including a throw, or hold it and call `.close()` in a `finally`. — streaming/src/main/scala/org/apache/spark/streaming/util/RawTextSender.scala:63

What to do

  • Each finding names the value and the span that decides who owns it — the `new` that created it, or the constructor parameter that handed it over. Confirm ownership from that span, then make the disposal match it: release what this type created, leave what it was injected with to whoever created THAT, and drop a finalizer whose type holds nothing unmanaged to release.
X19 · Unrestored process-global state10.0 / 10Exemplary○ Nothing flagged

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.

X20 · Mistyped argument guard10.0 / 10Exemplary○ Nothing flagged

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.

X21 · Side-effecting pattern guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.

Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.

X23 · Unguarded diagnostic materialisation10.0 / 10Exemplary○ Nothing flagged

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.

X24 · Document value interpolated into markup unescaped4.8 / 10Weak✓ Tool-verified

Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.

Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.

  • `"Showing "+curLogLength+" Bytes: "+startByte+" - "+endByte+" of "+totalLogLength` is text this program did not author, and it is written into the text of an element through the DOM library's `.html()` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — core/src/main/resources/org/apache/spark/ui/static/log-view.js:38
  • `arr[0]` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — core/src/main/resources/org/apache/spark/ui/static/spark-dag-viz.js:379
  • `arr[1]` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — core/src/main/resources/org/apache/spark/ui/static/spark-dag-viz.js:380
  • `responseBody.numCompleteTasks` is text this program did not author, and it is written into the text of an element through the DOM library's `.html()` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — core/src/main/resources/org/apache/spark/ui/static/stagepage.js:929
  • `"Tasks ("+totalTasksToShow+")"` is text this program did not author, and it is written into the text of an element through the DOM library's `.html()` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — core/src/main/resources/org/apache/spark/ui/static/stagepage.js:930
  • `threadId` is text this program did not author, and it is written into a quoted attribute value through the DOM library's `.after()` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — core/src/main/resources/org/apache/spark/ui/static/table.js:39
  • `stackTraceText` is text this program did not author, and it is written into the text of an element through the DOM library's `.after()` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — core/src/main/resources/org/apache/spark/ui/static/table.js:40

What to do

  • Each finding names the expression, the attribute it lands in and the line. Confirm the value's origin from the read this analyzer traced, then escape it at the sink or validate it against the shape the attribute accepts before interpolating.
X25 · Inert configuration knob10.0 / 10Exemplary○ Nothing flagged

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.

X26 · Unsynchronised callback handoff10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.

Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.

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 `RefCell` it is walking alone — safe Rust rejects a body that changes the collection its loop borrows at compile time, except through interior mutability: a `RefCell` borrowed in the loop's header stays borrowed until the loop ends, so a `borrow_mut()` of it inside the body panics with `already borrowed: BorrowMutError` and the remaining elements are never seen. Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen. Whether a walk over a `Hash` or `Set` (`each`, `each_pair`, `map`, `for … in` and the other block walks) leaves it alone — Ruby refuses `rehash`, `replace`, `compare_by_identity` and `transform_keys!` on a Hash, and `reset`, `replace`, `compare_by_identity` and `map!` on a Set, while it is being iterated: the call raises `RuntimeError` at once and the remaining entries are never seen. Whether a `for` comprehension or `foreach` leaves the mutable collection it is walking alone — an `ArrayBuffer` or `ListBuffer` counts its changes and its iterator checks the count, an `ArrayDeque` (and `mutable.Queue`/`mutable.Stack`) is walked by index up to its starting length, and a `java.util` collection walked through `asScala` is fail-fast, so a body that adds to or removes from the very collection the loop is walking makes a later step throw `ConcurrentModificationException` (`IndexOutOfBoundsException` for a deque) and the remaining elements are never seen. Whether a `for (x in c)` or `c.forEach { … }` leaves the collection it is walking alone — a `mutableListOf`/`ArrayList`, `mutableMapOf`/`HashMap` or `mutableSetOf`/`HashSet` is a `java.util` collection on the JVM and is walked by its own fail-fast iterator, so a body that adds to or removes from the very collection the loop is walking makes the next step throw `ConcurrentModificationException` and the remaining elements are never seen. Whether a `foreach` leaves the array or collection it is walking alone — PHP raises nothing, but the loop's view and the collection part: an array walked by value (and a Doctrine or Laravel collection) is walked as the snapshot taken when the loop began, so an element added in the body is never visited and one removed is visited anyway; an array walked by reference (`as &$v`) and an SPL container (`SplObjectStorage`, `ArrayObject`, `SplQueue`) are walked live, so an added element is walked too and a removal skips the next one; and after an `array_splice`, `array_shift` or sort every later key names a different element. Whether a `for … range` leaves the slice or map it is walking alone — Go raises nothing, but the walk and the collection part: a range evaluates its slice once, so an element appended in the body is never visited and a removal by reslicing (`s = append(s[:i], s[i+1:]...)`, `slices.Delete`) shifts the next element under the index, which is then skipped while the last is read twice; a reslice, a reassignment or a sort leaves every later `s[i]` naming another element; and a map's order is unspecified, so deleting another key (or clearing the map) changes from run to run which entries the loop still sees.

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.

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.

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.

X3 · Exception handling7.5 / 10Strong✓ Tool-verified

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. (×6) — streaming/src/main/scala/org/apache/spark/streaming/Checkpoint.scala:389, python/pyspark/daemon.py:80, python/pyspark/daemon.py:179, …
  • `case NonFatal(_)` 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. (×12) — sql/core/src/main/scala/org/apache/spark/sql/internal/CatalogImpl.scala:116, sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeUtils.scala:336, sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeUtils.scala:414, …
  • `case NonFatal(e)` 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. — sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/sources/memory.scala:103
  • `case _: 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. — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/trees/TreeNode.scala:750
  • `case _: 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. — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/ExternalCatalogUtils.scala:92
  • `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. (×3) — REDACTED:351, REDACTED:365, python/pyspark/sql/session.py:722
  • `case e: 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. — core/src/main/scala/org/apache/spark/api/r/RUtils.scala:106
  • `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. (×2) — common/unsafe/src/main/java/org/apache/spark/unsafe/Platform.java:279, common/sketch/src/main/java/org/apache/spark/util/sketch/Platform.java:155
  • `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. (×2) — common/network-common/src/main/java/org/apache/spark/network/util/NettyMemoryMetrics.java:124, common/network-common/src/main/java/org/apache/spark/network/util/NettyMemoryMetrics.java:133

What to do

  • Swallowed exception (empty catch)
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.

X4 · Structured logging4.0 / 10Weak✓ Tool-verified

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.

  • `info` 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.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. — sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/AbstractService.java:89
  • `info` at line 104 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. (×2) — sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/AbstractService.java:104, sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/CompositeService.java:104
  • `info` at line 125 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. — sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/AbstractService.java:125
  • `error` 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.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. — sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/CompositeService.java:74
  • `info` 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.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. — sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/CompositeService.java:127
  • `debug` at line 62 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. — sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/CookieSigner.java:62
  • `debug` at line 82 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. — sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/CookieSigner.java:82
  • `warn` at line 133 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. — sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/ServiceOperations.java:133
  • `debug` at line 63 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. — sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/ServiceUtils.java:63
  • `warn` at line 147 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. — sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/server/HiveServer2.java:147
  • `error` 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.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. — sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/server/HiveServer2.java:177
  • `debug` at line 58 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. — sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/server/ThreadWithGarbageCleanup.java:58
  • `debug` at line 72 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. — sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/server/ThreadWithGarbageCleanup.java:72
  • `info` at line 100 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. — sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java:100
  • `debug` at line 176 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. — sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java:176
  • `debug` at line 189 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. — sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java:189
  • `debug` at line 196 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. — sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java:196
  • `debug` at line 205 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. — sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java:205
  • `debug` at line 216 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. — sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java:216
  • `debug` at line 228 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. — sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java:228
  • `debug` at line 239 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. — sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java:239
  • `debug` at line 250 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. — sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java:250
  • `debug` at line 266 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. — sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java:266
  • `debug` at line 281 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. — sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java:281
  • `debug` at line 296 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. — sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java:296
  • `debug` at line 311 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. — sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java:311
  • `debug` at line 324 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. — sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java:324
  • `debug` at line 336 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. — sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java:336
  • `debug` at line 349 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. — sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java:349
  • `debug` at line 362 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. — sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java:362
  • `debug` at line 374 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. — sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java:374
  • `debug` at line 387 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. — sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java:387
  • `debug` at line 400 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. — sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java:400
  • `debug` at line 412 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. — sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java:412
  • `debug` at line 427 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. — sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java:427
  • `trace` at line 452 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. — sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java:452
  • `trace` at line 455 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. — sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java:455
  • `warn` at line 458 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. — sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java:458
  • `debug` at line 465 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. — sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java:465

What to do

  • Interpolated log message defeats structured logging
X5 · Nullable reference types2.0 / 10Critical✓ Tool-verified

Other · Code Health — Whether Scala's null is held to the type system and not undermined by assertions — a file compiled with `-Yexplicit-nulls` is one where `String` excludes null and `String | Null` admits it, a file under WartRemover's `Null` wart or Scalafix's `DisableSyntax.noNulls` is one whose code cannot write `null` and must say `Option`, and each `.nn`, `import scala.language.unsafeNulls` or null-lint suppression is the author overruling that.

Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.

  • No build over this repository's 1854 Scala product file(s) passes `-Yexplicit-nulls`, enables WartRemover's `Null` wart or runs Scalafix's `DisableSyntax.noNulls`, so every reference type admits null and nothing reports a `null` written into the code or returned from a Java API — the first one to reach a method call is a `NullPointerException`. `Option` by convention is a habit no tool here holds the code to.

What to do

  • On Scala 3, add `-Yexplicit-nulls` to `scalacOptions` so `String` and `String | Null` mean different things, and type each Java API's result as nullable where it can return null; on Scala 2 (or as a first step), enable WartRemover's `Null` wart (`wartremoverErrors += Wart.Null`) or Scalafix's `DisableSyntax.noNulls = true` so the code holds absence in `Option`. Then pay the assertions down rather than adding to them: each `.nn` is a null the compiler could not rule out — wrap the Java value in `Option(…)` at the boundary, pattern-match on `null` once there, or change the API so the null cannot arrive; an `unsafeNulls` import switches the checking off for everything after it.

WCAG coverage — what static analysis assessed

Statically assessed 10 of 55 WCAG 2.2 Level A/AA success criteria (18%; ≈20% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 45 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).

DimensionWCAG 2.2 A/AA criteriaCoverage
AC2 · Forms & labels1.3.1, 3.3.2, 4.1.2Partial signal
AC3 · Page structure1.4.4, 2.2.1, 2.4.1, 2.4.2, 3.1.1, 4.1.2Partial signal
AC6 · Visual & motion safety1.4.3, 2.4.7Partial — literal CSS only

Not statically assessed — these 45 Level A/AA criteria need runtime or manual evaluation (WCAG-EM): 1.1.1, 1.2.1, 1.2.2, 1.2.3, 1.2.4, 1.2.5, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.4.1, 1.4.2, 1.4.5, 1.4.10, 1.4.11, 1.4.12, 1.4.13, 2.1.1, 2.1.2, 2.1.4, 2.2.2, 2.3.1, 2.4.3, 2.4.4, 2.4.5, 2.4.6, 2.4.11, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.5.7, 2.5.8, 3.1.2, 3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.6, 3.3.1, 3.3.3, 3.3.4, 3.3.7, 3.3.8, 4.1.3.

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.

LensScoreRatingImpact
Code Health29.7Weak — gated by R1, R3, X4, X5Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture94.9ExemplarySolid.
Maturity63.3Adequate — gated by D34Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness50.3Adequate — gated by P3, P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security66.5Checked 5 of 11Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Accessibility46.7Weak — gated by AC6Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance100.0ExemplaryStrongest area.
Unscored — 3 check(s) recorded observations but carry no score

These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.

  • D11 Test Reliability — 1 observation(s) recorded · This repository declares 1 of its own test(s) unreliable. The built-in reliability runner does not support this repository's ecosystem (.scala, .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.
  • X10 Duplicated predicate — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 2 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 4 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.
  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 51 check(s) not relevant to this codebase

These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.

  • AC1 Text alternatives — No image/media element found in the parsed markup — AC1 not applicable here.
  • AC4 Keyboard semantics — No interactive element found in the parsed markup — AC4 not applicable here.
  • AC5 ARIA correctness — No ARIA usage found in the parsed markup — AC5 not applicable here.
  • 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 Go request handler (a net/http, Gin, Echo, Fiber or fasthttp handler, or a gRPC service method) is declared as a method or function, and no handler function literal writes a value captured from outside it, so no state is shared between request goroutines. No class in this Java code is a Spring, JSR-330 or CDI singleton bean. No class in this Kotlin 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. No class in this Ruby code is a Rails controller, a Sinatra, Grape or Roda app, a Hanami action or a Rack app (an instance `call(env)`), so no request handler shares state between request threads. No class in this Scala code is a Play controller, a Cask routes object, a Scalatra servlet, a Finatra controller, an Akka/Pekko HTTP routes holder or a JSR-330/Spring singleton, so no instance is shared between request threads. No Swift request handler (a Vapor, Hummingbird, Kitura, Swifter or Perfect route handler, as a method or a registered closure) is declared, so no state is shared between request threads. PHP builds its object graph per request and shares none of it between requests. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — no test/production split to check
  • AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXR1 Runtime accessibility — docker build failed (exit 1) — ------ > [internal] load metadata for docker.io/library/openjdk:8-alpine: ------ REDACTED:18 -------------------- 16 | # 17 | 18 | >>> FROM openjdk:8-alpine 19 | 20 | ARG spark_uid=185 -------------------- ERROR: failed to solve: openjdk:8-alpine: failed to resolve source metadata for docker.io/library/openjdk:8-alpine: docker.io/library/openjdk:8-alpine: not found; likely cause (our sandbox): an image the REDACTED builds FROM could not be fetched: our sandbox reaches registries only through its pull-through mirror, and the mirror did not serve it. This is a limit of our sandbox, not of your repository; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
  • C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • D10 Test Quality — ~360260 lines of test source are present (.scala, .java, .py) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • D12 Dependency Hygiene — Dependency currency not established — repository.apache.org did not answer
  • D16 Bus Factor — dormant codebase — no living knowledge left to concentrate
  • 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.
  • 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"]`.
  • D25 ADR Conformance — no ADRs to check
  • D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.scala), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D32 Data Compliance (PII/GDPR) — 36 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
  • 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.
  • 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 (4 signals for this style, 2 needed — the count is met but a required primary signal is absent): 4 aggregate root(s) (types guarding their own state behind command methods — this language has no AggregateRoot base to inherit); 880 value object(s); 13 domain event(s); its 4 aggregate(s) are ORM models only — persistence, not behaviour: a CRUD model, measured, not claimed as DDD; its domain events are published by services or handlers — no domain entity raises one; a Domain/Aggregates/ValueObjects layer; a domain structure with no aggregate, domain event or strongly-typed id in it: a CRUD / clean-architecture model, measured but not claimed as DDD; a top-level examples/ tree: a library or framework whose examples are its consumers — these types are building blocks, not a domain
  • ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and this analysis resolves a call's owner only where the receiver's type is written down in the source. Reported as guidance rather than measured
  • ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
  • ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
  • M4 Documentation accuracy — Not applicable: the 104 current-state document(s) make no claim of a kind M4 checks. 81 claim(s) of kinds M4 does not check were not checked (path 32, command argument 4, environment variable 45); M4 checks only links and versions and artefact counts.
  • 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'.
  • 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
  • PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for `@Benchmark` in a Java, Kotlin or Scala file importing JMH or kotlinx-benchmark, Jetpack Benchmark's `measureRepeated` in a file importing androidx.benchmark, or JMH/kotlinx-benchmark/androidx.benchmark in a REDACTED, Gradle or sbt build, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
  • 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.
  • R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
  • R4 Test Coverage — the JS/TS workspace (17 production file(s)) has no JavaScript/TypeScript test, but it is 0.98% of this repository's production source and the other 99.02% carries 360,260 line(s) of test code this pass cannot read — an incidental frontend's reachability is not the repository's test posture, so it is not scored as one
  • R5 Dependency Freshness — no package-lock.json — dependency freshness not measured (would require an npm lockfile); JS/npm CVEs are scored in D30 (Dependency Vulnerabilities), which answers every ecosystem
  • R6 Tooling — no package.json in the repository — test/lint/typecheck wiring is read from package.json scripts (corroborated against CI), so this project's own toolchain isn't measured here
  • R8 Dependency Hygiene — Not measured — no package.json declares any dependency, so there is nothing to check imports against (imports may resolve through a host runtime rather than node).
  • 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.
  • X14 Bypassable address classification — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • 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 — 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
  • 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
  • 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.

Critical — 91 finding(s)
D30 · Dependency Vulnerabilities · High CVE · ×39
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 14 more in this group — see findings.md.
D30 · Dependency Vulnerabilities · Critical CVE · ×29
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 4 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D28 · Secrets (history) · REDACTED · ×2
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D31 · IaC & Container Security · High IaC · ×2
  • REDACTED
  • REDACTED
AC3 · Page structure · <html> without a lang · ×1
  • <html> without a lang licenses-binary/LICENSE-javassist.html:1 — The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
D11 · Test Reliability · Test declared unreliable · ×1
  • Test declared unreliable: test_trainOn_predictOn python/pyspark/mllib/tests/test_streaming_algorithms.py:188 — This test is disabled or skipped with a reason naming unreliability — the repository's own words: "SPARK-10086: Flaky StreamingKMeans test in PySpark". 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.)
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
Serious — 2888 finding(s)
D17 · Explicit Debt · TodoComment · ×577
  • TodoComment streaming/src/main/scala/org/apache/spark/streaming/scheduler/StreamingListenerBus.scala:98 — // events (SPARK-12140). TODO Once SPARK-12140 is resolved we should set it to true.
  • TodoComment streaming/src/main/scala/org/apache/spark/streaming/dstream/DStream.scala:404 — // TODO: merge callsites with scopes so we can just reuse the code there — 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 sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/FetchOrientation.java:47 — // TODO: Should this really default to FETCH_NEXT? — 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 sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/FetchOrientation.java:47 — // TODO: Should this really default to FETCH_NEXT? — 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 sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/HiveSQLException.java:105 — // TODO: set correct vendorCode field — 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 sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/HiveSQLException.java:105 — // TODO: set correct vendorCode field — 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 sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/HiveSQLException.java:117 — // TODO: convert sqlState, etc. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/HiveSQLException.java:117 — // TODO: convert sqlState, etc. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/OperationType.java:46 — // TODO: replace this with a Map? — 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 sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/OperationType.java:46 — // TODO: replace this with a Map? — 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 sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/TableSchema.java:41 — // TODO: remove this constructor — 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 sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/TableSchema.java:40 — // TODO: remove this constructor — 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 sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:249 — // TODO: set real configuration map — 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 sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:248 — // TODO: set real configuration map — 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 sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:404 — // TODO: set the correct default fetch size — 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 sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:393 — // TODO: set the correct default fetch size — 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 sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftHttpCLIService.java:144 — // TODO: check defaults: maxTimeout, keepalive, maxBodySize, bodyRecieveDuration, etc. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftHttpCLIService.java:143 — // TODO: check defaults: maxTimeout, keepalive, maxBodySize, bodyRecieveDuration, etc. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/HiveCommandOperation.java:73 — // TODO: for hadoop jobs, progress is printed out to session.err, — 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 sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/HiveCommandOperation.java:73 — // TODO: for hadoop jobs, progress is printed out to session.err, — 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 sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/Operation.java:292 — // TODO: make this abstract and implement in subclasses. — 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 sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/Operation.java:274 — // TODO: make this abstract and implement in subclasses. — 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 sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/OperationManager.java:73 — // TODO — 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 sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/OperationManager.java:78 — // TODO — 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 sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/OperationManager.java:74 — // TODO — 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.
  • + 552 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×76
  • FileTooLong: REDACTED REDACTED — FileTooLong — 2909 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2409 over it, 5.82× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: internal/SQLConf.scala sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala — FileTooLong — 1830 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1330 over it, 3.66× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: util/Utils.scala core/src/main/scala/org/apache/spark/util/Utils.scala — FileTooLong — 1610 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1110 over it, 3.22× 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: analysis/Analyzer.scala sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala — FileTooLong — 1559 significant lines (blank, comment-only and punctuation-only lines excluded), about 89% of them inside a single declaration: Analyzer (97-2609). The bar is 500 significant lines; this is 1059 over it, 3.12× 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: ml/feature.py python/pyspark/ml/feature.py — FileTooLong — 1517 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1017 over it, 3.03× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 1508 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1008 over it, 3.02× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: sql/functions.py python/pyspark/sql/functions.py — FileTooLong — 1367 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 867 over it, 2.73× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: spark/SparkContext.scala core/src/main/scala/org/apache/spark/SparkContext.scala — FileTooLong — 1318 significant lines (blank, comment-only and punctuation-only lines excluded), about 74% of them inside a single declaration: SparkContext (77-2414). The bar is 500 significant lines; this is 818 over it, 2.64× 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: parser/AstBuilder.scala sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala — FileTooLong — 1237 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: AstBuilder (52-2452). The bar is 500 significant lines; this is 737 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: scheduler/DAGScheduler.scala core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala — FileTooLong — 1172 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 672 over it, 2.34× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: config/package.scala core/src/main/scala/org/apache/spark/internal/config/package.scala — FileTooLong — 1094 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 594 over it, 2.19× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: expressions/Cast.scala sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala — FileTooLong — 1069 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 569 over it, 2.14× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: storage/BlockManager.scala core/src/main/scala/org/apache/spark/storage/BlockManager.scala — FileTooLong — 1045 significant lines (blank, comment-only and punctuation-only lines excluded), about 86% of them inside a single declaration: master (125-1770). The bar is 500 significant lines; this is 545 over it, 2.09× 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: expressions/datetimeExpressions.scala sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala — FileTooLong — 1038 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 538 over it, 2.08× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: objects/objects.scala sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/objects/objects.scala — FileTooLong — 1036 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 536 over it, 2.07× 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: pyspark/rdd.py python/pyspark/rdd.py — FileTooLong — 1003 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 503 over it, 2.01× 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: sql/types.py python/pyspark/sql/types.py — FileTooLong — 999 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 499 over it, 2.00× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: sql/Dataset.scala sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala — FileTooLong — 995 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: Dataset (179-3445). The bar is 500 significant lines; this is 495 over it, 1.99× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: client/HiveShim.scala sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveShim.scala — FileTooLong — 981 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 481 over it, 1.96× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: python/PythonMLLibAPI.scala mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala — FileTooLong — 968 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 468 over it, 1.94× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: expressions/ScalaUDF.scala sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/ScalaUDF.scala — FileTooLong — 939 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 439 over it, 1.88× 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: optimizer/Optimizer.scala sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala — FileTooLong — 895 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 395 over it, 1.79× 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: yarn/Client.scala resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala — FileTooLong — 893 significant lines (blank, comment-only and punctuation-only lines excluded), about 76% of them inside a single declaration: args (64-1212). The bar is 500 significant lines; this is 393 over it, 1.79× 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: ml/classification.py python/pyspark/ml/classification.py — FileTooLong — 871 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 371 over it, 1.74× 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: recommendation/ALS.scala mllib/src/main/scala/org/apache/spark/ml/recommendation/ALS.scala — FileTooLong — 856 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 356 over it, 1.71× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • + 51 more in this group — see findings.md.
D3 · God Classes · TooManyMethods · ×67
  • TooManyMethods: functions sql/core/src/main/scala/org/apache/spark/sql/functions.scala:71 — TooManyMethods — 360 methods. The bar is 30 methods; this is 330 over it, 12.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Dataset sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala:178 — TooManyMethods — 175 methods. The bar is 30 methods; this is 145 over it, 5.83× 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: Utils core/src/main/scala/org/apache/spark/util/Utils.scala:85 — TooManyMethods — 156 methods. The bar is 30 methods; this is 126 over it, 5.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: SparkContext core/src/main/scala/org/apache/spark/SparkContext.scala:77 — TooManyMethods — 144 methods. The bar is 30 methods; this is 114 over it, 4.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: RDD core/src/main/scala/org/apache/spark/rdd/RDD.scala:80 — TooManyMethods — 116 methods. The bar is 30 methods; this is 86 over it, 3.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: RDD python/pyspark/rdd.py:245 — TooManyMethods — 111 methods. The bar is 30 methods; this is 81 over it, 3.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: JavaPairRDD core/src/main/scala/org/apache/spark/api/java/JavaPairRDD.scala:46 — 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: SessionCatalog sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala:57 — 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: WritableColumnVector sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/WritableColumnVector.java:47 — TooManyMethods — 84 methods. The bar is 30 methods; this is 54 over it, 2.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: JsonProtocol core/src/main/scala/org/apache/spark/util/JsonProtocol.scala:55 — 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: DataFrame python/pyspark/sql/dataframe.py:47 — TooManyMethods — 79 methods. The bar is 30 methods; this is 49 over it, 2.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: JavaRDDLike core/src/main/scala/org/apache/spark/api/java/JavaRDDLike.scala:53 — TooManyMethods — 77 methods. The bar is 30 methods; this is 47 over it, 2.57× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Column sql/core/src/main/scala/org/apache/spark/sql/Column.scala:133 — TooManyMethods — 75 methods. The bar is 30 methods; this is 45 over it, 2.50× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PythonMLLibAPI mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala:62 — TooManyMethods — 74 methods. The bar is 30 methods; this is 44 over it, 2.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PairRDDFunctions core/src/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala:50 — TooManyMethods — 72 methods. The bar is 30 methods; this is 42 over it, 2.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: DAGScheduler core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala:113 — TooManyMethods — 70 methods. The bar is 30 methods; this is 40 over it, 2.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: UTF8String common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java:50 — TooManyMethods — 69 methods. The bar is 30 methods; this is 39 over it, 2.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: JavaSparkContext core/src/main/scala/org/apache/spark/api/java/JavaSparkContext.scala:46 — TooManyMethods — 67 methods. The bar is 30 methods; this is 37 over it, 2.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: JavaPairDStream streaming/src/main/scala/org/apache/spark/streaming/api/java/JavaPairDStream.scala:48 — TooManyMethods — 58 methods. The bar is 30 methods; this is 28 over it, 1.93× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: RandomRDDs mllib/src/main/scala/org/apache/spark/mllib/random/RandomRDDs.scala:34 — TooManyMethods — 57 methods. The bar is 30 methods; this is 27 over it, 1.90× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: UnsafeArrayData sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeArrayData.java:66 — TooManyMethods — 57 methods. The bar is 30 methods; this is 27 over it, 1.90× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: UnsafeRow sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeRow.java:62 — TooManyMethods — 57 methods. The bar is 30 methods; this is 27 over it, 1.90× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: HiveSessionImpl sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:86 — TooManyMethods — 57 methods. The bar is 30 methods; this is 27 over it, 1.90× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: SparkConf core/src/main/scala/org/apache/spark/SparkConf.scala:54 — TooManyMethods — 56 methods. The bar is 30 methods; this is 26 over it, 1.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: DStream streaming/src/main/scala/org/apache/spark/streaming/dstream/DStream.scala:62 — TooManyMethods — 56 methods. The bar is 30 methods; this is 26 over it, 1.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.
  • + 42 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×66
  • Duplicated block (7 lines × 2) core/src/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala:162 — core/src/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala:162-168 | core/src/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala:212-219 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala:162` 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) core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala:473 — core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala:473-481 | core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala:508-514 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala:473` 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) mllib/src/main/scala/org/apache/spark/ml/regression/GBTRegressor.scala:372 — mllib/src/main/scala/org/apache/spark/ml/regression/GBTRegressor.scala:372-378 | mllib/src/main/scala/org/apache/spark/ml/regression/RandomForestRegressor.scala:297-303 — before extracting anything, compare `mllib/src/main/scala/org/apache/spark/ml/regression/GBTRegressor.scala` and `mllib/src/main/scala/org/apache/spark/ml/regression/RandomForestRegressor.scala` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 2) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala:549 — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala:549-555 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala:565-571 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala:549` 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) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Expression.scala:678 — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Expression.scala:678-684 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Expression.scala:776-782 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Expression.scala:678` 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) REDACTED:3153 — REDACTED:3153-3159 | REDACTED:3822-3828 — both copies are in the same file, so extract the block into 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) sql/core/src/main/scala/org/apache/spark/sql/SparkSession.scala:916 — sql/core/src/main/scala/org/apache/spark/sql/SparkSession.scala:916-922 | sql/core/src/main/scala/org/apache/spark/sql/SparkSession.scala:928-934 — both copies are in the same file, so extract the block into 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) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFileFormat.scala:124 — sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFileFormat.scala:124-130 | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/parquet/ParquetWriteBuilder.scala:87-93 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) sql/core/src/main/scala/org/apache/spark/sql/execution/joins/BroadcastNestedLoopJoinExec.scala:67 — sql/core/src/main/scala/org/apache/spark/sql/execution/joins/BroadcastNestedLoopJoinExec.scala:67-73 | sql/core/src/main/scala/org/apache/spark/sql/execution/joins/SortMergeJoinExec.scala:50-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 `sql/core/src/main/scala/org/apache/spark/sql/execution/joins/BroadcastNestedLoopJoinExec.scala:67` 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) core/src/main/scala/org/apache/spark/rdd/BinaryFileRDD.scala:52 — core/src/main/scala/org/apache/spark/rdd/BinaryFileRDD.scala:52-58 | core/src/main/scala/org/apache/spark/rdd/WholeTextFileRDD.scala:55-61 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `core/src/main/scala/org/apache/spark/rdd/BinaryFileRDD.scala:52` 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) mllib/src/main/scala/org/apache/spark/ml/linalg/JsonVectorConverter.scala:30 — mllib/src/main/scala/org/apache/spark/ml/linalg/JsonVectorConverter.scala:30-36 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala:378-384 — 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 `mllib/src/main/scala/org/apache/spark/ml/linalg/JsonVectorConverter.scala:30` 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) mllib/src/main/scala/org/apache/spark/ml/tuning/CrossValidator.scala:174 — mllib/src/main/scala/org/apache/spark/ml/tuning/CrossValidator.scala:174-180 | mllib/src/main/scala/org/apache/spark/ml/tuning/TrainValidationSplit.scala:170-176 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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, `mllib/src/main/scala/org/apache/spark/ml/tuning/CrossValidator.scala:172` calls `$` and `mllib/src/main/scala/org/apache/spark/ml/tuning/TrainValidationSplit.scala:168` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 2) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:55 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:55-61 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala:56-62 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 394 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 2) REDACTED:170 — REDACTED:170-176 | sql/core/src/main/scala/org/apache/spark/sql/jdbc/OracleDialect.scala:84-95 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) core/src/main/scala/org/apache/spark/deploy/worker/ui/LogPage.scala:37 — core/src/main/scala/org/apache/spark/deploy/worker/ui/LogPage.scala:37-43 | core/src/main/scala/org/apache/spark/deploy/worker/ui/LogPage.scala:60-66 — both copies are in the same file, so extract the block into 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) common/sketch/src/main/java/org/apache/spark/util/sketch/CountMinSketchImpl.java:248 — common/sketch/src/main/java/org/apache/spark/util/sketch/CountMinSketchImpl.java:248-254 | common/sketch/src/main/java/org/apache/spark/util/sketch/CountMinSketchImpl.java:257-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. 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 `item` to `String` 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 (7 lines × 2) common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java:865 — common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java:865-871 | common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java:897-903 — both copies are in the same file, so extract the 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, `common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java:905` calls `copyMemory`, `numBytes` and `common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java:873` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 2) sql/core/src/main/java/org/apache/spark/sql/execution/RecordBinaryComparator.java:41 — sql/core/src/main/java/org/apache/spark/sql/execution/RecordBinaryComparator.java:41-47 | sql/core/src/main/java/org/apache/spark/sql/execution/RecordBinaryComparator.java:63-69 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sql/core/src/main/java/org/apache/spark/sql/execution/RecordBinaryComparator.java:41` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/OffHeapColumnVector.java:289 — sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/OffHeapColumnVector.java:289-295 | sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/OffHeapColumnVector.java:361-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 `sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/OffHeapColumnVector.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 (7 lines × 2) sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/OffHeapColumnVector.java:416 — sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/OffHeapColumnVector.java:416-422 | sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/OffHeapColumnVector.java:471-477 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/OffHeapColumnVector.java:416` 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) REDACTED:95 — REDACTED:95-101 | REDACTED:95-101 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 75 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 (7 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/TypeDescriptor.java:44 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/TypeDescriptor.java:44-50 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/TypeDescriptor.java:45-51 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/TypeDescriptor.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/TypeDescriptor.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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: `TPrimitiveTypeEntry` names `org.apache.hive.service.cli.thrift.TPrimitiveTypeEntry` in one and `org.apache.hive.service.rpc.thrift.TPrimitiveTypeEntry` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, 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) common/kvstore/src/main/java/org/apache/spark/util/kvstore/InMemoryStore.java:382 — common/kvstore/src/main/java/org/apache/spark/util/kvstore/InMemoryStore.java:382-388 | common/kvstore/src/main/java/org/apache/spark/util/kvstore/LevelDBIterator.java:152-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. 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) common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/protocol/OpenBlocks.java:51 — common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/protocol/OpenBlocks.java:51-57 | common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/protocol/RemoveBlocks.java:50-56 — before extracting anything, compare `common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/protocol/OpenBlocks.java` and `common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/protocol/RemoveBlocks.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 4 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. 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) sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeArrayData.java:209 — sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeArrayData.java:209-215 | sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeRow.java:369-375 — before extracting anything, compare `sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeArrayData.java` and `sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeRow.java` as WHOLE FILES: this scan already matched 5 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.
  • + 41 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×59
  • Duplicated block (6 lines × 2) core/src/main/scala/org/apache/spark/api/python/PythonRDD.scala:313 — core/src/main/scala/org/apache/spark/api/python/PythonRDD.scala:313-318 | core/src/main/scala/org/apache/spark/api/python/PythonRDD.scala:382-387 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/main/scala/org/apache/spark/api/python/PythonRDD.scala: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.
  • Duplicated block (6 lines × 2) core/src/main/scala/org/apache/spark/api/python/PythonRDD.scala:339 — core/src/main/scala/org/apache/spark/api/python/PythonRDD.scala:339-344 | core/src/main/scala/org/apache/spark/api/python/PythonRDD.scala:408-413 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/main/scala/org/apache/spark/api/python/PythonRDD.scala:339` 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) graphx/src/main/scala/org/apache/spark/graphx/impl/ReplicatedVertexView.scala:70 — graphx/src/main/scala/org/apache/spark/graphx/impl/ReplicatedVertexView.scala:70-75 | graphx/src/main/scala/org/apache/spark/graphx/impl/ReplicatedVertexView.scala:112-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 (6 lines × 2) mllib/src/main/scala/org/apache/spark/mllib/clustering/BisectingKMeansModel.scala:226 — mllib/src/main/scala/org/apache/spark/mllib/clustering/BisectingKMeansModel.scala:226-231 | mllib/src/main/scala/org/apache/spark/mllib/clustering/BisectingKMeansModel.scala:264-269 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala:879 — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala:879-884 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala:939-944 — both copies are in the same file, so extract the block into 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) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/json/JsonInferSchema.scala:175 — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/json/JsonInferSchema.scala:175-180 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/json/JsonInferSchema.scala:182-187 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) sql/core/src/main/scala/org/apache/spark/sql/DataFrameReader.scala:209 — sql/core/src/main/scala/org/apache/spark/sql/DataFrameReader.scala:209-214 | sql/core/src/main/scala/org/apache/spark/sql/DataFrameWriter.scala:255-260 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) sql/core/src/main/scala/org/apache/spark/sql/DataFrameReader.scala:229 — sql/core/src/main/scala/org/apache/spark/sql/DataFrameReader.scala:229-234 | sql/core/src/main/scala/org/apache/spark/sql/streaming/DataStreamReader.scala:190-195 — 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 `sql/core/src/main/scala/org/apache/spark/sql/DataFrameReader.scala:229` 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) sql/core/src/main/scala/org/apache/spark/sql/execution/columnar/compression/compressionSchemes.scala:622 — sql/core/src/main/scala/org/apache/spark/sql/execution/columnar/compression/compressionSchemes.scala:622-627 | sql/core/src/main/scala/org/apache/spark/sql/execution/columnar/compression/compressionSchemes.scala:732-737 — both copies are in the same file, so extract the block into 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) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/text/TextFileFormat.scala:118 — sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/text/TextFileFormat.scala:118-123 | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/text/TextPartitionReaderFactory.scala:50-55 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) core/src/main/scala/org/apache/spark/deploy/rest/StandaloneRestServer.scala:161 — core/src/main/scala/org/apache/spark/deploy/rest/StandaloneRestServer.scala:161-166 | resource-managers/mesos/src/main/scala/org/apache/spark/deploy/rest/mesos/MesosRestServer.scala:111-116 — 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 `core/src/main/scala/org/apache/spark/deploy/rest/StandaloneRestServer.scala: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 (6 lines × 2) mllib/src/main/scala/org/apache/spark/mllib/clustering/KMeansModel.scala:157 — mllib/src/main/scala/org/apache/spark/mllib/clustering/KMeansModel.scala:157-162 | mllib/src/main/scala/org/apache/spark/mllib/clustering/KMeansModel.scala:191-196 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mllib/src/main/scala/org/apache/spark/mllib/clustering/KMeansModel.scala:157` 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) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala:318 — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala:318-323 | sql/core/src/main/scala/org/apache/spark/sql/execution/joins/BroadcastNestedLoopJoinExec.scala:69-74 — 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 `sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala:318` 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) streaming/src/main/scala/org/apache/spark/streaming/api/java/JavaStreamingContext.scala:471 — streaming/src/main/scala/org/apache/spark/streaming/api/java/JavaStreamingContext.scala:471-476 | streaming/src/main/scala/org/apache/spark/streaming/api/java/JavaStreamingContext.scala:496-501 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `streaming/src/main/scala/org/apache/spark/streaming/api/java/JavaStreamingContext.scala:471` 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) mllib/src/main/scala/org/apache/spark/ml/clustering/BisectingKMeans.scala:109 — mllib/src/main/scala/org/apache/spark/ml/clustering/BisectingKMeans.scala:109-114 | mllib/src/main/scala/org/apache/spark/ml/clustering/KMeans.scala:126-133 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) mllib/src/main/scala/org/apache/spark/ml/regression/GBTRegressor.scala:327 — mllib/src/main/scala/org/apache/spark/ml/regression/GBTRegressor.scala:327-332 | mllib/src/main/scala/org/apache/spark/ml/regression/RandomForestRegressor.scala:255-260 — before extracting anything, compare `mllib/src/main/scala/org/apache/spark/ml/regression/GBTRegressor.scala` and `mllib/src/main/scala/org/apache/spark/ml/regression/RandomForestRegressor.scala` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:575 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:575-580 | mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala:556-561 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 476 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (6 lines × 2) sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala:86 — sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala:86-91 | sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala:96-101 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala:86` 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) common/unsafe/src/main/java/org/apache/spark/unsafe/types/CalendarInterval.java:140 — common/unsafe/src/main/java/org/apache/spark/unsafe/types/CalendarInterval.java:140-145 | common/unsafe/src/main/java/org/apache/spark/unsafe/types/CalendarInterval.java:169-174 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `common/unsafe/src/main/java/org/apache/spark/unsafe/types/CalendarInterval.java:140` 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) common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java:259 — common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java:259-264 | common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java:273-278 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java:259` 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) core/src/main/java/org/apache/spark/util/collection/unsafe/sort/RadixSort.java:121 — core/src/main/java/org/apache/spark/util/collection/unsafe/sort/RadixSort.java:121-127 | core/src/main/java/org/apache/spark/util/collection/unsafe/sort/RadixSort.java:224-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 `core/src/main/java/org/apache/spark/util/collection/unsafe/sort/RadixSort.java:121` 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) sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/FixedLengthRowBasedKeyValueBatch.java:107 — sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/FixedLengthRowBasedKeyValueBatch.java:107-112 | sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/VariableLengthRowBasedKeyValueBatch.java:114-119 — before extracting anything, compare `sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/FixedLengthRowBasedKeyValueBatch.java` and `sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/VariableLengthRowBasedKeyValueBatch.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/FixedLengthRowBasedKeyValueBatch.java:107` 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 × 2) sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeArrayData.java:221 — sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeArrayData.java:221-226 | sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeRow.java:383-394 — before extracting anything, compare `sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeArrayData.java` and `sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeRow.java` as WHOLE FILES: this scan already matched 5 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 `sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeArrayData.java:221` 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/HandleIdentifier.java:73 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/HandleIdentifier.java:73-78 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/HandleIdentifier.java:73-78 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/HandleIdentifier.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/HandleIdentifier.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (6 lines × 2) sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeArrayData.java:231 — sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeArrayData.java:231-236 | sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeRow.java:402-407 — before extracting anything, compare `sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeArrayData.java` and `sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeRow.java` as WHOLE FILES: this scan already matched 5 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 `sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeArrayData.java:231` 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.
  • + 34 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×55
  • Duplicated block (10 lines × 2) core/src/main/scala/org/apache/spark/rdd/CoGroupedRDD.scala:117 — core/src/main/scala/org/apache/spark/rdd/CoGroupedRDD.scala:117-126 | core/src/main/scala/org/apache/spark/rdd/SubtractedRDD.scala:76-85 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/main/scala/org/apache/spark/rdd/CoGroupedRDD.scala:117` 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) core/src/main/scala/org/apache/spark/ui/jobs/JobPage.scala:398 — core/src/main/scala/org/apache/spark/ui/jobs/JobPage.scala:398-407 | core/src/main/scala/org/apache/spark/ui/jobs/PoolPage.scala:54-64 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `core/src/main/scala/org/apache/spark/ui/jobs/JobPage.scala:398` 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) mllib/src/main/scala/org/apache/spark/ml/r/AFTSurvivalRegressionWrapper.scala:125 — mllib/src/main/scala/org/apache/spark/ml/r/AFTSurvivalRegressionWrapper.scala:125-134 | mllib/src/main/scala/org/apache/spark/ml/r/IsotonicRegressionWrapper.scala:95-104 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 (10 lines × 2) mllib/src/main/scala/org/apache/spark/mllib/util/MLUtils.scala:321 — mllib/src/main/scala/org/apache/spark/mllib/util/MLUtils.scala:321-330 | mllib/src/main/scala/org/apache/spark/mllib/util/MLUtils.scala:423-432 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mllib/src/main/scala/org/apache/spark/mllib/util/MLUtils.scala:321` 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) mllib/src/main/scala/org/apache/spark/mllib/util/MLUtils.scala:373 — mllib/src/main/scala/org/apache/spark/mllib/util/MLUtils.scala:373-382 | mllib/src/main/scala/org/apache/spark/mllib/util/MLUtils.scala:473-482 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mllib/src/main/scala/org/apache/spark/mllib/util/MLUtils.scala:373` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) REDACTED:3338 — REDACTED:3338-3347 | REDACTED:3582-3591 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:3338` 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) REDACTED:531 — REDACTED:531-540 | REDACTED:947-956 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:531` 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) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala:2240 — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala:2240-2249 | sql/core/src/main/scala/org/apache/spark/sql/execution/SparkSqlParser.scala:403-412 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `sql/core/src/main/scala/org/apache/spark/sql/execution/SparkSqlParser.scala:401` calls `visitCreateTable` and `sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala:2239` 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) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/statsEstimation/FilterEstimation.scala:555 — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/statsEstimation/FilterEstimation.scala:555-564 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/statsEstimation/FilterEstimation.scala:586-595 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/statsEstimation/FilterEstimation.scala:555` 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) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/statsEstimation/JoinEstimation.scala:233 — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/statsEstimation/JoinEstimation.scala:233-242 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/statsEstimation/JoinEstimation.scala:279-288 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/statsEstimation/JoinEstimation.scala:227` calls `max`, `BigDecimal`, `Some` and `sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/statsEstimation/JoinEstimation.scala:278` 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) sql/core/v1.2.1/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilters.scala:138 — sql/core/v1.2.1/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilters.scala:138-147 | sql/core/v2.3.5/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilters.scala:138-147 — before extracting anything, compare `sql/core/v1.2.1/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilters.scala` and `sql/core/v2.3.5/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilters.scala` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 159 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 2) sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerPage.scala:58 — sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerPage.scala:58-67 | sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerSessionPage.scala:65-74 — before extracting anything, compare `sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerPage.scala` and `sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerSessionPage.scala` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 66 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (10 lines × 2) streaming/src/main/scala/org/apache/spark/streaming/ui/BatchPage.scala:120 — streaming/src/main/scala/org/apache/spark/streaming/ui/BatchPage.scala:120-131 | streaming/src/main/scala/org/apache/spark/streaming/ui/BatchPage.scala:177-186 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `streaming/src/main/scala/org/apache/spark/streaming/ui/BatchPage.scala:120` 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) core/src/main/scala/org/apache/spark/util/Utils.scala:230 — core/src/main/scala/org/apache/spark/util/Utils.scala:230-239 | core/src/main/scala/org/apache/spark/util/Utils.scala:245-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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (10 lines × 2) streaming/src/main/scala/org/apache/spark/streaming/rdd/MapWithStateRDD.scala:196 — streaming/src/main/scala/org/apache/spark/streaming/rdd/MapWithStateRDD.scala:196-205 | streaming/src/main/scala/org/apache/spark/streaming/rdd/MapWithStateRDD.scala:218-227 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `streaming/src/main/scala/org/apache/spark/streaming/rdd/MapWithStateRDD.scala:196` 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) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:993 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:993-1002 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala:928-937 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 394 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (10 lines × 2) mllib/src/main/scala/org/apache/spark/ml/linalg/MatrixUDT.scala:37 — mllib/src/main/scala/org/apache/spark/ml/linalg/MatrixUDT.scala:37-46 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala:189-198 — before extracting anything, compare `mllib/src/main/scala/org/apache/spark/ml/linalg/MatrixUDT.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (10 lines × 2) examples/src/main/scala/org/apache/spark/examples/streaming/StreamingExamples.scala:28 — examples/src/main/scala/org/apache/spark/examples/streaming/StreamingExamples.scala:28-37 | external/kinesis-asl/src/main/scala/org/apache/spark/examples/streaming/KinesisWordCountASL.scala:272-281 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (10 lines × 2) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:468 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:468-477 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala:638-647 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 357 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala:637` calls `Since` and `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:466` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 2) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:589 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:589-598 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala:770-779 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 357 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 2) mllib/src/main/scala/org/apache/spark/ml/classification/DecisionTreeClassifier.scala:217 — mllib/src/main/scala/org/apache/spark/ml/classification/DecisionTreeClassifier.scala:217-226 | mllib/src/main/scala/org/apache/spark/ml/classification/RandomForestClassifier.scala:238-247 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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) external/avro/src/main/scala/org/apache/spark/sql/avro/AvroDeserializer.scala:340 — external/avro/src/main/scala/org/apache/spark/sql/avro/AvroDeserializer.scala:340-349 | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcDeserializer.scala:196-205 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (10 lines × 2) common/kvstore/src/main/java/org/apache/spark/util/kvstore/ArrayWrappers.java:83 — common/kvstore/src/main/java/org/apache/spark/util/kvstore/ArrayWrappers.java:83-92 | common/kvstore/src/main/java/org/apache/spark/util/kvstore/ArrayWrappers.java:161-170 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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 `other` to `ComparableIntArray` in one and `ComparableByteArray` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (10 lines × 2) core/src/main/java/org/apache/spark/shuffle/sort/BypassMergeSortShuffleWriter.java:163 — core/src/main/java/org/apache/spark/shuffle/sort/BypassMergeSortShuffleWriter.java:163-172 | core/src/main/java/org/apache/spark/shuffle/sort/UnsafeShuffleWriter.java:246-255 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `core/src/main/java/org/apache/spark/shuffle/sort/BypassMergeSortShuffleWriter.java:163` 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) core/src/main/java/org/apache/spark/util/collection/TimSort.java:595 — core/src/main/java/org/apache/spark/util/collection/TimSort.java:595-604 | core/src/main/java/org/apache/spark/util/collection/TimSort.java:667-676 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/main/java/org/apache/spark/util/collection/TimSort.java:595` 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.
  • + 30 more in this group — see findings.md.
D30 · Dependency Vulnerabilities · Medium CVE · ×50
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 25 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×47
  • Duplicated block (9 lines × 2) mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:219 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:219-227 | mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala:221-229 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 476 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (9 lines × 2) mllib/src/main/scala/org/apache/spark/ml/optim/aggregator/HingeAggregator.scala:70 — mllib/src/main/scala/org/apache/spark/ml/optim/aggregator/HingeAggregator.scala:70-78 | mllib/src/main/scala/org/apache/spark/ml/optim/aggregator/LogisticAggregator.scala:226-234 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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) mllib/src/main/scala/org/apache/spark/ml/r/GBTRegressionWrapper.scala:95 — mllib/src/main/scala/org/apache/spark/ml/r/GBTRegressionWrapper.scala:95-103 | mllib/src/main/scala/org/apache/spark/ml/r/RandomForestRegressionWrapper.scala:95-103 — before extracting anything, compare `mllib/src/main/scala/org/apache/spark/ml/r/GBTRegressionWrapper.scala` and `mllib/src/main/scala/org/apache/spark/ml/r/RandomForestRegressionWrapper.scala` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `mllib/src/main/scala/org/apache/spark/ml/r/GBTRegressionWrapper.scala:95` 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 (9 lines × 2) mllib/src/main/scala/org/apache/spark/ml/tuning/CrossValidator.scala:360 — mllib/src/main/scala/org/apache/spark/ml/tuning/CrossValidator.scala:360-368 | mllib/src/main/scala/org/apache/spark/ml/tuning/TrainValidationSplit.scala:351-359 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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) mllib/src/main/scala/org/apache/spark/ml/tuning/CrossValidator.scala:370 — mllib/src/main/scala/org/apache/spark/ml/tuning/CrossValidator.scala:370-378 | mllib/src/main/scala/org/apache/spark/ml/tuning/TrainValidationSplit.scala:361-369 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `mllib/src/main/scala/org/apache/spark/ml/tuning/CrossValidator.scala:370` 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, `mllib/src/main/scala/org/apache/spark/ml/tuning/CrossValidator.scala:380` calls `Path` and `mllib/src/main/scala/org/apache/spark/ml/tuning/TrainValidationSplit.scala:370` 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) resource-managers/yarn/src/main/scala/org/apache/spark/scheduler/cluster/YarnSchedulerBackend.scala:290 — resource-managers/yarn/src/main/scala/org/apache/spark/scheduler/cluster/YarnSchedulerBackend.scala:290-298 | resource-managers/yarn/src/main/scala/org/apache/spark/scheduler/cluster/YarnSchedulerBackend.scala:304-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 `resource-managers/yarn/src/main/scala/org/apache/spark/scheduler/cluster/YarnSchedulerBackend.scala:290` 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 (9 lines × 2) REDACTED:1862 — REDACTED:1862-1870 | REDACTED:2898-2906 — both copies are in the same file, so extract the 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) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcUtils.scala:50 — sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcUtils.scala:50-58 | sql/hive/src/main/scala/org/apache/spark/sql/hive/orc/OrcFileOperator.scala:130-138 — 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) sql/core/src/main/scala/org/apache/spark/sql/execution/joins/BroadcastHashJoinExec.scala:184 — sql/core/src/main/scala/org/apache/spark/sql/execution/joins/BroadcastHashJoinExec.scala:184-192 | sql/core/src/main/scala/org/apache/spark/sql/execution/joins/BroadcastHashJoinExec.scala:448-456 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sql/core/src/main/scala/org/apache/spark/sql/execution/joins/BroadcastHashJoinExec.scala:184` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) sql/core/v1.2.1/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilters.scala:155 — sql/core/v1.2.1/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilters.scala:155-163 | sql/core/v2.3.5/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilters.scala:155-163 — before extracting anything, compare `sql/core/v1.2.1/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilters.scala` and `sql/core/v2.3.5/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilters.scala` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 159 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Note first that the copies are not typed on the same thing: `HiveDecimalWritable` names `org.apache.hadoop.hive.serde2.io.HiveDecimalWritable` in one and `org.apache.orc.storage.serde2.io.HiveDecimalWritable` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, 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 × 2) sql/core/src/main/scala/org/apache/spark/sql/KeyValueGroupedDataset.scala:244 — sql/core/src/main/scala/org/apache/spark/sql/KeyValueGroupedDataset.scala:244-252 | sql/core/src/main/scala/org/apache/spark/sql/KeyValueGroupedDataset.scala:280-288 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sql/core/src/main/scala/org/apache/spark/sql/KeyValueGroupedDataset.scala:244` 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) core/src/main/scala/org/apache/spark/api/python/PythonRunner.scala:423 — core/src/main/scala/org/apache/spark/api/python/PythonRunner.scala:423-431 | core/src/main/scala/org/apache/spark/api/r/BaseRRunner.scala:125-133 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (9 lines × 2) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:514 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:514-522 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala:484-492 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 394 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:673 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:673-681 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala:653-661 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 394 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala:663` calls `Since` and `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:683` 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) common/network-common/src/main/java/org/apache/spark/network/server/TransportRequestHandler.java:153 — common/network-common/src/main/java/org/apache/spark/network/server/TransportRequestHandler.java:153-161 | common/network-common/src/main/java/org/apache/spark/network/server/TransportRequestHandler.java:178-186 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `req` to `RpcRequest` in one and `UploadStream` 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 × 2) common/sketch/src/main/java/org/apache/spark/util/sketch/Murmur3_x86_32.java:91 — common/sketch/src/main/java/org/apache/spark/util/sketch/Murmur3_x86_32.java:91-99 | common/unsafe/src/main/java/org/apache/spark/unsafe/hash/Murmur3_x86_32.java:91-99 — before extracting anything, compare `common/sketch/src/main/java/org/apache/spark/util/sketch/Murmur3_x86_32.java` and `common/unsafe/src/main/java/org/apache/spark/unsafe/hash/Murmur3_x86_32.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (9 lines × 2) sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeRow.java:358 — sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeRow.java:358-366 | sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/WritableColumnVector.java:354-362 — 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 `sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeRow.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.
  • Duplicated block (9 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/CompositeService.java:99 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/CompositeService.java:99-107 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/CompositeService.java:99-107 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/CompositeService.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/CompositeService.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (9 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/PlainSaslHelper.java:57 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/PlainSaslHelper.java:57-65 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/auth/PlainSaslHelper.java:57-65 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/PlainSaslHelper.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/auth/PlainSaslHelper.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (9 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetTablesOperation.java:63 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetTablesOperation.java:63-71 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/GetTablesOperation.java:71-79 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetTablesOperation.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/GetTablesOperation.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 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. 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 `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetTablesOperation.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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:449 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:449-457 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:451-459 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 436 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:463 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:463-471 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:465-473 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 436 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:508 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:508-516 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:510-518 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 436 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/server/ThreadWithGarbageCleanup.java:55 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/server/ThreadWithGarbageCleanup.java:55-63 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/server/ThreadWithGarbageCleanup.java:55-63 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/server/ThreadWithGarbageCleanup.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/server/ThreadWithGarbageCleanup.java` as WHOLE FILES: 91% 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 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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) common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java:392 — common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java:392-400 | common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java:422-430 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java:392` 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.
  • + 22 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×43
  • Duplicated block (8 lines × 2) core/src/main/scala/org/apache/spark/partial/MeanEvaluator.scala:48 — core/src/main/scala/org/apache/spark/partial/MeanEvaluator.scala:48-57 | core/src/main/scala/org/apache/spark/partial/SumEvaluator.scala:73-80 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) external/kinesis-asl/src/main/scala/org/apache/spark/examples/streaming/KinesisExampleUtils.scala:27 — external/kinesis-asl/src/main/scala/org/apache/spark/examples/streaming/KinesisExampleUtils.scala:27-34 | external/kinesis-asl/src/main/scala/org/apache/spark/streaming/kinesis/KinesisTestUtils.scala:208-215 — before extracting anything, compare `external/kinesis-asl/src/main/scala/org/apache/spark/examples/streaming/KinesisExampleUtils.scala` and `external/kinesis-asl/src/main/scala/org/apache/spark/streaming/kinesis/KinesisTestUtils.scala` as WHOLE FILES: 82% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:664 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:664-671 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala:644-651 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 394 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (8 lines × 2) mllib/src/main/scala/org/apache/spark/ml/r/LinearSVCWrapper.scala:150 — mllib/src/main/scala/org/apache/spark/ml/r/LinearSVCWrapper.scala:150-157 | mllib/src/main/scala/org/apache/spark/ml/r/LogisticRegressionWrapper.scala:205-212 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) mllib/src/main/scala/org/apache/spark/ml/stat/Summarizer.scala:394 — mllib/src/main/scala/org/apache/spark/ml/stat/Summarizer.scala:394-401 | mllib/src/main/scala/org/apache/spark/mllib/stat/MultivariateOnlineSummarizer.scala:134-141 — before extracting anything, compare `mllib/src/main/scala/org/apache/spark/ml/stat/Summarizer.scala` and `mllib/src/main/scala/org/apache/spark/mllib/stat/MultivariateOnlineSummarizer.scala` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 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 `mllib/src/main/scala/org/apache/spark/ml/stat/Summarizer.scala:394` 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) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala:2310 — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala:2310-2317 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala:2320-2327 — both copies are in the same file, so extract the block into 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) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala:972 — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala:972-979 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala:993-1000 — both copies are in the same file, so extract the block into 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) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala:469 — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala:469-476 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala:488-495 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala:469` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) REDACTED:1873 — REDACTED:1873-1880 | REDACTED:2909-2916 — both copies are in the same file, so extract the 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) sql/core/src/main/scala/org/apache/spark/sql/execution/Columnar.scala:145 — sql/core/src/main/scala/org/apache/spark/sql/execution/Columnar.scala:145-152 | sql/core/src/main/scala/org/apache/spark/sql/execution/ColumnarBatchScan.scala:88-95 — before extracting anything, compare `sql/core/src/main/scala/org/apache/spark/sql/execution/Columnar.scala` and `sql/core/src/main/scala/org/apache/spark/sql/execution/ColumnarBatchScan.scala` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 82 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIDriver.scala:99 — sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIDriver.scala:99-106 | sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIDriver.scala:169-176 — both copies are in the same file, so extract the block into 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) sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveShim.scala:168 — sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveShim.scala:168-175 | sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveShim.scala:190-197 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveShim.scala:168` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) core/src/main/scala/org/apache/spark/serializer/KryoSerializer.scala:390 — core/src/main/scala/org/apache/spark/serializer/KryoSerializer.scala:390-397 | core/src/main/scala/org/apache/spark/serializer/KryoSerializer.scala:407-414 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/main/scala/org/apache/spark/serializer/KryoSerializer.scala:390` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `core/src/main/scala/org/apache/spark/serializer/KryoSerializer.scala:415` calls `setClassLoader` and `core/src/main/scala/org/apache/spark/serializer/KryoSerializer.scala:398` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) mllib/src/main/scala/org/apache/spark/mllib/clustering/KMeansModel.scala:167 — mllib/src/main/scala/org/apache/spark/mllib/clustering/KMeansModel.scala:167-174 | mllib/src/main/scala/org/apache/spark/mllib/clustering/KMeansModel.scala:201-208 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/mathExpressions.scala:248 — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/mathExpressions.scala:248-255 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/mathExpressions.scala:379-386 — both copies are in the same file, so extract the 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 `child` to `Expression) extends UnaryMathExpression(math.ceil` in one and `Expression) extends UnaryMathExpression(math.floor` 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) graphx/src/main/scala/org/apache/spark/graphx/impl/EdgeRDDImpl.scala:32 — graphx/src/main/scala/org/apache/spark/graphx/impl/EdgeRDDImpl.scala:32-39 | graphx/src/main/scala/org/apache/spark/graphx/impl/VertexRDDImpl.scala:42-49 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:338 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:338-345 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala:320-327 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 394 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala:331` calls `Since` and `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:349` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:649 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:649-656 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala:628-635 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 394 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) core/src/main/java/org/apache/spark/util/collection/unsafe/sort/RadixSort.java:85 — core/src/main/java/org/apache/spark/util/collection/unsafe/sort/RadixSort.java:85-92 | core/src/main/java/org/apache/spark/util/collection/unsafe/sort/RadixSort.java:245-252 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/main/java/org/apache/spark/util/collection/unsafe/sort/RadixSort.java:85` 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:227 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:227-234 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:233-240 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 187 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (8 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:239 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:239-246 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:245-252 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 187 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (8 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/TypeDescriptor.java:53 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/TypeDescriptor.java:53-60 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/TypeDescriptor.java:54-61 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/TypeDescriptor.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/TypeDescriptor.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/ExecuteStatementOperation.java:49 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/ExecuteStatementOperation.java:49-56 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/ExecuteStatementOperation.java:46-53 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/ExecuteStatementOperation.java:49` 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:718 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:718-725 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:732-739 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 435 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (8 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftBinaryCLIService.java:67 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftBinaryCLIService.java:67-74 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftBinaryCLIService.java:68-75 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftBinaryCLIService.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftBinaryCLIService.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftBinaryCLIService.java:67` 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.
  • + 18 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×40
  • Duplicated block (5 lines × 2) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala:438 — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala:438-442 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala:453-457 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala:438` 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 (5 lines × 2) sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerPage.scala:188 — sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerPage.scala:188-192 | sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerSessionPage.scala:159-163 — before extracting anything, compare `sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerPage.scala` and `sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerSessionPage.scala` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 66 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (5 lines × 2) streaming/src/main/scala/org/apache/spark/streaming/dstream/PairDStreamFunctions.scala:460 — streaming/src/main/scala/org/apache/spark/streaming/dstream/PairDStreamFunctions.scala:460-464 | streaming/src/main/scala/org/apache/spark/streaming/dstream/PairDStreamFunctions.scala:511-515 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `streaming/src/main/scala/org/apache/spark/streaming/dstream/PairDStreamFunctions.scala:460` 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) mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:94 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:94-98 | mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala:96-100 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 476 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 2) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:104 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:104-108 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala:105-109 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 394 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 2) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:122 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:122-126 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala:123-127 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 394 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 2) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:351 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:351-355 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala:334-338 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 394 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala:331` calls `Since` and `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:347` 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) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:236 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:236-240 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala:348-352 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 357 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 2) mllib/src/main/scala/org/apache/spark/ml/feature/CountVectorizer.scala:95 — mllib/src/main/scala/org/apache/spark/ml/feature/CountVectorizer.scala:95-99 | mllib/src/main/scala/org/apache/spark/ml/feature/Word2Vec.scala:115-119 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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) mllib/src/main/scala/org/apache/spark/ml/tree/Node.scala:371 — mllib/src/main/scala/org/apache/spark/ml/tree/Node.scala:371-375 | mllib/src/main/scala/org/apache/spark/mllib/tree/model/Node.scala:205-209 — 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) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/csvExpressions.scala:168 — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/csvExpressions.scala:168-172 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/jsonExpressions.scala:773-777 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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) mllib/src/main/scala/org/apache/spark/ml/attribute/attributes.scala:252 — mllib/src/main/scala/org/apache/spark/ml/attribute/attributes.scala:252-256 | mllib/src/main/scala/org/apache/spark/ml/attribute/attributes.scala:431-435 — both copies are in the same file, so extract the block into 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) mllib/src/main/scala/org/apache/spark/ml/clustering/GaussianMixture.scala:373 — mllib/src/main/scala/org/apache/spark/ml/clustering/GaussianMixture.scala:373-377 | mllib/src/main/scala/org/apache/spark/ml/regression/AFTSurvivalRegression.scala:629-633 — 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 `mllib/src/main/scala/org/apache/spark/ml/clustering/GaussianMixture.scala:373` 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) mllib/src/main/scala/org/apache/spark/mllib/classification/NaiveBayes.scala:215 — mllib/src/main/scala/org/apache/spark/mllib/classification/NaiveBayes.scala:215-219 | mllib/src/main/scala/org/apache/spark/mllib/classification/NaiveBayes.scala:259-263 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) resource-managers/mesos/src/main/scala/org/apache/spark/deploy/mesos/ui/MesosClusterPage.scala:69 — resource-managers/mesos/src/main/scala/org/apache/spark/deploy/mesos/ui/MesosClusterPage.scala:69-73 | resource-managers/mesos/src/main/scala/org/apache/spark/deploy/mesos/ui/MesosClusterPage.scala:113-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 (5 lines × 2) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/objects/objects.scala:892 — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/objects/objects.scala:892-896 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/objects/objects.scala:1104-1108 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/objects/objects.scala:892` 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 (5 lines × 2) sql/core/src/main/scala/org/apache/spark/sql/execution/SparkSqlParser.scala:954 — sql/core/src/main/scala/org/apache/spark/sql/execution/SparkSqlParser.scala:954-958 | sql/core/src/main/scala/org/apache/spark/sql/execution/SparkSqlParser.scala:1425-1429 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sql/core/src/main/scala/org/apache/spark/sql/execution/SparkSqlParser.scala:954` 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) streaming/src/main/scala/org/apache/spark/streaming/dstream/PairDStreamFunctions.scala:435 — streaming/src/main/scala/org/apache/spark/streaming/dstream/PairDStreamFunctions.scala:435-439 | streaming/src/main/scala/org/apache/spark/streaming/dstream/PairDStreamFunctions.scala:484-488 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `streaming/src/main/scala/org/apache/spark/streaming/dstream/PairDStreamFunctions.scala:435` 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 (5 lines × 2) core/src/main/java/org/apache/spark/util/collection/TimSort.java:766 — core/src/main/java/org/apache/spark/util/collection/TimSort.java:766-770 | core/src/main/java/org/apache/spark/util/collection/TimSort.java:779-783 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/main/java/org/apache/spark/util/collection/TimSort.java:766` 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) sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/OnHeapColumnVector.java:516 — sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/OnHeapColumnVector.java:516-520 | sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/OnHeapColumnVector.java:522-526 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/protocol/OpenBlocks.java:71 — common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/protocol/OpenBlocks.java:71-75 | common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/protocol/RemoveBlocks.java:70-74 — before extracting anything, compare `common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/protocol/OpenBlocks.java` and `common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/protocol/RemoveBlocks.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 4 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/protocol/OpenBlocks.java:78 — common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/protocol/OpenBlocks.java:78-82 | common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/protocol/RemoveBlocks.java:77-81 — before extracting anything, compare `common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/protocol/OpenBlocks.java` and `common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/protocol/RemoveBlocks.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 4 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 (5 lines × 2) sql/core/v1.2.1/src/main/java/org/apache/spark/sql/execution/datasources/orc/OrcColumnVector.java:156 — sql/core/v1.2.1/src/main/java/org/apache/spark/sql/execution/datasources/orc/OrcColumnVector.java:156-160 | sql/core/v2.3.5/src/main/java/org/apache/spark/sql/execution/datasources/orc/OrcColumnVector.java:156-160 — before extracting anything, compare `sql/core/v1.2.1/src/main/java/org/apache/spark/sql/execution/datasources/orc/OrcColumnVector.java` and `sql/core/v2.3.5/src/main/java/org/apache/spark/sql/execution/datasources/orc/OrcColumnVector.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 (5 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/CLIService.java:173 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/CLIService.java:173-177 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java:174-178 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/CLIService.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 195 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 `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/CLIService.java:173` 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. Note first that the copies are not typed on the same thing: `TProtocolVersion` names `org.apache.hive.service.cli.thrift.TProtocolVersion` in one and `org.apache.hive.service.rpc.thrift.TProtocolVersion` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/CLIService.java:193 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/CLIService.java:193-197 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java:194-198 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/CLIService.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 195 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 `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/CLIService.java:193` 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. Note first that the copies are not typed on the same thing: `TProtocolVersion` names `org.apache.hive.service.cli.thrift.TProtocolVersion` in one and `org.apache.hive.service.rpc.thrift.TProtocolVersion` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • + 15 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×39
  • Duplicated block (11 lines × 2) core/src/main/scala/org/apache/spark/util/collection/OpenHashMap.scala:107 — core/src/main/scala/org/apache/spark/util/collection/OpenHashMap.scala:107-117 | core/src/main/scala/org/apache/spark/util/collection/PrimitiveKeyOpenHashMap.scala:83-93 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `core/src/main/scala/org/apache/spark/util/collection/OpenHashMap.scala:107` 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) mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:376 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:376-386 | mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala:358-368 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 476 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 `mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:376` 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) mllib/src/main/scala/org/apache/spark/ml/python/MLSerDe.scala:54 — mllib/src/main/scala/org/apache/spark/ml/python/MLSerDe.scala:54-64 | mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala:1393-1403 — before extracting anything, compare `mllib/src/main/scala/org/apache/spark/ml/python/MLSerDe.scala` and `mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 133 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 `mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala:1393` 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, `mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala:1392` calls `require` and `mllib/src/main/scala/org/apache/spark/ml/python/MLSerDe.scala:53` 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 (11 lines × 2) mllib/src/main/scala/org/apache/spark/ml/r/BisectingKMeansWrapper.scala:114 — mllib/src/main/scala/org/apache/spark/ml/r/BisectingKMeansWrapper.scala:114-124 | mllib/src/main/scala/org/apache/spark/ml/r/KMeansWrapper.scala:117-127 — before extracting anything, compare `mllib/src/main/scala/org/apache/spark/ml/r/BisectingKMeansWrapper.scala` and `mllib/src/main/scala/org/apache/spark/ml/r/KMeansWrapper.scala` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (11 lines × 2) mllib/src/main/scala/org/apache/spark/ml/r/LinearSVCWrapper.scala:132 — mllib/src/main/scala/org/apache/spark/ml/r/LinearSVCWrapper.scala:132-142 | mllib/src/main/scala/org/apache/spark/ml/r/LogisticRegressionWrapper.scala:187-197 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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) mllib/src/main/scala/org/apache/spark/mllib/util/LinearDataGenerator.scala:193 — mllib/src/main/scala/org/apache/spark/mllib/util/LinearDataGenerator.scala:193-203 | mllib/src/main/scala/org/apache/spark/mllib/util/SVMDataGenerator.scala:41-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 both call sites, so a change lands once.
  • Duplicated block (11 lines × 2) sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/AggUtils.scala:281 — sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/AggUtils.scala:281-291 | sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/AggUtils.scala:299-309 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/AggUtils.scala:281` 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, `sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/AggUtils.scala:295` calls `StateStoreRestoreExec` and `sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/AggUtils.scala:278` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 2) mllib/src/main/scala/org/apache/spark/ml/evaluation/MultilabelClassificationEvaluator.scala:88 — mllib/src/main/scala/org/apache/spark/ml/evaluation/MultilabelClassificationEvaluator.scala:88-98 | mllib/src/main/scala/org/apache/spark/ml/evaluation/RankingEvaluator.scala:84-94 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (11 lines × 2) mllib/src/main/scala/org/apache/spark/ml/python/MLSerDe.scala:91 — mllib/src/main/scala/org/apache/spark/ml/python/MLSerDe.scala:91-101 | mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala:1430-1440 — before extracting anything, compare `mllib/src/main/scala/org/apache/spark/ml/python/MLSerDe.scala` and `mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 133 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 2) mllib/src/main/scala/org/apache/spark/ml/tree/impl/GradientBoostedTrees.scala:225 — mllib/src/main/scala/org/apache/spark/ml/tree/impl/GradientBoostedTrees.scala:225-235 | mllib/src/main/scala/org/apache/spark/mllib/tree/model/treeEnsembleModels.scala:158-168 — 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 `mllib/src/main/scala/org/apache/spark/ml/tree/impl/GradientBoostedTrees.scala:225` 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) mllib/src/main/scala/org/apache/spark/mllib/classification/NaiveBayes.scala:195 — mllib/src/main/scala/org/apache/spark/mllib/classification/NaiveBayes.scala:195-205 | mllib/src/main/scala/org/apache/spark/mllib/classification/NaiveBayes.scala:240-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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `mllib/src/main/scala/org/apache/spark/mllib/classification/NaiveBayes.scala:207` calls `Since` and `mllib/src/main/scala/org/apache/spark/mllib/classification/NaiveBayes.scala:252` 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 (11 lines × 2) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:559 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:559-569 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala:529-539 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 394 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 2) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:606 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:606-616 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala:789-799 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 357 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala:788` calls `Since` and `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:604` 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 (11 lines × 2) sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/memory.scala:228 — sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/memory.scala:228-238 | sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/sources/TextSocketMicroBatchStream.scala:152-163 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (11 lines × 2) sql/core/v1.2.1/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilters.scala:66 — sql/core/v1.2.1/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilters.scala:66-76 | sql/core/v2.3.5/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilters.scala:66-76 — before extracting anything, compare `sql/core/v1.2.1/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilters.scala` and `sql/core/v2.3.5/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilters.scala` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 159 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 2) common/sketch/src/main/java/org/apache/spark/util/sketch/Murmur3_x86_32.java:106 — common/sketch/src/main/java/org/apache/spark/util/sketch/Murmur3_x86_32.java:106-116 | common/unsafe/src/main/java/org/apache/spark/unsafe/hash/Murmur3_x86_32.java:106-116 — before extracting anything, compare `common/sketch/src/main/java/org/apache/spark/util/sketch/Murmur3_x86_32.java` and `common/unsafe/src/main/java/org/apache/spark/unsafe/hash/Murmur3_x86_32.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 2) common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java:852 — common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java:852-862 | common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java:884-894 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java:852` 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) launcher/src/main/java/org/apache/spark/launcher/CommandBuilderUtils.java:41 — launcher/src/main/java/org/apache/spark/launcher/CommandBuilderUtils.java:41-51 | launcher/src/main/java/org/apache/spark/launcher/CommandBuilderUtils.java:55-65 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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 `elements` to `String...` in one and `Iterable<String>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (11 lines × 2) sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeArrayData.java:426 — sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeArrayData.java:426-436 | sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeArrayData.java:448-458 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/CookieSigner.java:97 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/CookieSigner.java:97-107 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/CookieSigner.java:97-107 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/CookieSigner.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/CookieSigner.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. 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/MetadataOperation.java:122 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/MetadataOperation.java:122-132 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/MetadataOperation.java:122-132 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/MetadataOperation.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/MetadataOperation.java` as WHOLE FILES: this scan already matched 5 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:364 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:364-374 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:365-375 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 436 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:605 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:605-615 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:607-617 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 436 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:357 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:357-367 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:368-378 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 224 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/server/HiveServer2.java:192 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/server/HiveServer2.java:192-202 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/server/HiveServer2.java:197-207 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/server/HiveServer2.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/server/HiveServer2.java` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 130 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.
  • + 14 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×38
  • Duplicated block (12 lines × 2) core/src/main/scala/org/apache/spark/rdd/BinaryFileRDD.scala:39 — core/src/main/scala/org/apache/spark/rdd/BinaryFileRDD.scala:39-50 | core/src/main/scala/org/apache/spark/rdd/WholeTextFileRDD.scala:42-53 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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) mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:306 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:306-317 | mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala:289-300 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 476 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (12 lines × 2) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:457 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:457-468 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala:427-438 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 394 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (12 lines × 2) mllib/src/main/scala/org/apache/spark/ml/classification/DecisionTreeClassifier.scala:116 — mllib/src/main/scala/org/apache/spark/ml/classification/DecisionTreeClassifier.scala:116-127 | mllib/src/main/scala/org/apache/spark/ml/classification/RandomForestClassifier.scala:121-132 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `mllib/src/main/scala/org/apache/spark/ml/classification/DecisionTreeClassifier.scala:116` 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) mllib/src/main/scala/org/apache/spark/ml/python/MLSerDe.scala:40 — mllib/src/main/scala/org/apache/spark/ml/python/MLSerDe.scala:40-51 | mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala:1378-1389 — before extracting anything, compare `mllib/src/main/scala/org/apache/spark/ml/python/MLSerDe.scala` and `mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 133 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala:1392` calls `require` and `mllib/src/main/scala/org/apache/spark/ml/python/MLSerDe.scala:54` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) mllib/src/main/scala/org/apache/spark/ml/r/GBTClassificationWrapper.scala:96 — mllib/src/main/scala/org/apache/spark/ml/r/GBTClassificationWrapper.scala:96-107 | mllib/src/main/scala/org/apache/spark/ml/r/GBTRegressionWrapper.scala:87-98 — before extracting anything, compare `mllib/src/main/scala/org/apache/spark/ml/r/GBTClassificationWrapper.scala` and `mllib/src/main/scala/org/apache/spark/ml/r/GBTRegressionWrapper.scala` as WHOLE FILES: this scan already matched 4 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. If that is what happened, the fix is to keep one copy and have the 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 `mllib/src/main/scala/org/apache/spark/ml/r/GBTClassificationWrapper.scala:96` 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) mllib/src/main/scala/org/apache/spark/ml/r/RandomForestClassificationWrapper.scala:96 — mllib/src/main/scala/org/apache/spark/ml/r/RandomForestClassificationWrapper.scala:96-107 | mllib/src/main/scala/org/apache/spark/ml/r/RandomForestRegressionWrapper.scala:87-98 — before extracting anything, compare `mllib/src/main/scala/org/apache/spark/ml/r/RandomForestClassificationWrapper.scala` and `mllib/src/main/scala/org/apache/spark/ml/r/RandomForestRegressionWrapper.scala` as WHOLE FILES: this scan already matched 4 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. If that is what happened, the fix is to keep one copy and have the 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 `mllib/src/main/scala/org/apache/spark/ml/r/RandomForestClassificationWrapper.scala:96` 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) mllib/src/main/scala/org/apache/spark/ml/stat/Summarizer.scala:471 — mllib/src/main/scala/org/apache/spark/ml/stat/Summarizer.scala:471-482 | mllib/src/main/scala/org/apache/spark/mllib/stat/MultivariateOnlineSummarizer.scala:204-215 — before extracting anything, compare `mllib/src/main/scala/org/apache/spark/ml/stat/Summarizer.scala` and `mllib/src/main/scala/org/apache/spark/mllib/stat/MultivariateOnlineSummarizer.scala` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 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 `mllib/src/main/scala/org/apache/spark/ml/stat/Summarizer.scala:471` 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) mllib/src/main/scala/org/apache/spark/ml/stat/Summarizer.scala:543 — mllib/src/main/scala/org/apache/spark/ml/stat/Summarizer.scala:543-554 | mllib/src/main/scala/org/apache/spark/mllib/stat/MultivariateOnlineSummarizer.scala:286-297 — before extracting anything, compare `mllib/src/main/scala/org/apache/spark/ml/stat/Summarizer.scala` and `mllib/src/main/scala/org/apache/spark/mllib/stat/MultivariateOnlineSummarizer.scala` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 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 `mllib/src/main/scala/org/apache/spark/ml/stat/Summarizer.scala:543` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/text/TextFileFormat.scala:125 — sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/text/TextFileFormat.scala:125-136 | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/text/TextPartitionReaderFactory.scala:57-68 — 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 `sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/text/TextFileFormat.scala:125` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/text/TextPartitionReaderFactory.scala:70` calls `PartitionReaderWithPartitionValues` and `sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/text/TextFileFormat.scala:137` 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) sql/core/src/main/scala/org/apache/spark/sql/execution/ui/SQLAppStatusListener.scala:271 — sql/core/src/main/scala/org/apache/spark/sql/execution/ui/SQLAppStatusListener.scala:271-282 | sql/core/src/main/scala/org/apache/spark/sql/execution/ui/SQLAppStatusListener.scala:295-306 — both copies are in the same file, so extract the block into 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) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala:241 — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala:241-252 | sql/core/src/main/scala/org/apache/spark/sql/execution/basicPhysicalOperators.scala:606-617 — 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 (12 lines × 2) mllib/src/main/scala/org/apache/spark/mllib/tree/impurity/Entropy.scala:158 — mllib/src/main/scala/org/apache/spark/mllib/tree/impurity/Entropy.scala:158-169 | mllib/src/main/scala/org/apache/spark/mllib/tree/impurity/Gini.scala:155-166 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (12 lines × 2) streaming/src/main/scala/org/apache/spark/streaming/ui/BatchPage.scala:271 — streaming/src/main/scala/org/apache/spark/streaming/ui/BatchPage.scala:271-282 | streaming/src/main/scala/org/apache/spark/streaming/ui/UIUtils.scala:134-146 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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) common/sketch/src/main/java/org/apache/spark/util/sketch/BloomFilterImpl.java:90 — common/sketch/src/main/java/org/apache/spark/util/sketch/BloomFilterImpl.java:90-101 | common/sketch/src/main/java/org/apache/spark/util/sketch/BloomFilterImpl.java:137-148 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `common/sketch/src/main/java/org/apache/spark/util/sketch/BloomFilterImpl.java:90` 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 × 2) core/src/main/java/org/apache/spark/memory/TaskMemoryManager.java:191 — core/src/main/java/org/apache/spark/memory/TaskMemoryManager.java:191-202 | core/src/main/java/org/apache/spark/memory/TaskMemoryManager.java:214-225 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/main/java/org/apache/spark/memory/TaskMemoryManager.java:191` 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) core/src/main/java/org/apache/spark/util/collection/TimSort.java:788 — core/src/main/java/org/apache/spark/util/collection/TimSort.java:788-799 | core/src/main/java/org/apache/spark/util/collection/TimSort.java:910-921 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/main/java/org/apache/spark/util/collection/TimSort.java:788` 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:323 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:323-334 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:331-342 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 187 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 `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:323` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/PlainSaslHelper.java:125 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/PlainSaslHelper.java:125-136 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/auth/PlainSaslHelper.java:125-136 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/PlainSaslHelper.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/auth/PlainSaslHelper.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (12 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetTablesOperation.java:79 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetTablesOperation.java:79-90 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/GetTablesOperation.java:92-103 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetTablesOperation.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/GetTablesOperation.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 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. 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 `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetTablesOperation.java:79` 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImplwithUGI.java:51 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImplwithUGI.java:51-62 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImplwithUGI.java:51-62 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImplwithUGI.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImplwithUGI.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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: `TProtocolVersion` names `org.apache.hive.service.cli.thrift.TProtocolVersion` in one and `org.apache.hive.service.rpc.thrift.TProtocolVersion` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:477 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:477-488 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:479-490 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 436 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (12 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:98 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:98-109 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:99-110 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 224 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (12 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:193 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:193-204 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:204-215 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 224 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 `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:193` 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:280 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:280-291 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:291-302 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 224 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 `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:280` 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.
  • + 13 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×28
  • Duplicated block (17 lines × 2) core/src/main/scala/org/apache/spark/status/LiveEntity.scala:145 — core/src/main/scala/org/apache/spark/status/LiveEntity.scala:145-161 | core/src/main/scala/org/apache/spark/status/LiveEntity.scala:206-222 — both copies are in the same file, so extract the block into 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) external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaMicroBatchStream.scala:374 — external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaMicroBatchStream.scala:374-390 | external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaSourceRDD.scala: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 `external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaMicroBatchStream.scala:374` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:43 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:43-59 | mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala:45-61 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 476 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (17 lines × 2) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:74 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:74-90 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala:85-101 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 357 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (17 lines × 2) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:257 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:257-273 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala:409-425 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 357 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (17 lines × 2) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:621 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:621-637 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala:804-820 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 357 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (17 lines × 2) mllib/src/main/scala/org/apache/spark/ml/linalg/VectorUDT.scala:33 — mllib/src/main/scala/org/apache/spark/ml/linalg/VectorUDT.scala:33-49 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala:231-247 — before extracting anything, compare `mllib/src/main/scala/org/apache/spark/ml/linalg/VectorUDT.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala` as WHOLE FILES: 89% 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 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (17 lines × 2) mllib/src/main/scala/org/apache/spark/ml/linalg/VectorUDT.scala:52 — mllib/src/main/scala/org/apache/spark/ml/linalg/VectorUDT.scala:52-68 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala:250-266 — before extracting anything, compare `mllib/src/main/scala/org/apache/spark/ml/linalg/VectorUDT.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala` as WHOLE FILES: 89% 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 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (17 lines × 2) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/CSVFileFormat.scala:78 — sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/CSVFileFormat.scala:78-94 | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/csv/CSVWriteBuilder.scala:46-62 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/CSVFileFormat.scala:78` 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) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/json/JsonFileFormat.scala:74 — sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/json/JsonFileFormat.scala:74-90 | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/json/JsonWriteBuilder.scala:46-62 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/json/JsonFileFormat.scala:74` 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/CookieSigner.java:73 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/CookieSigner.java:73-89 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/CookieSigner.java:73-89 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/CookieSigner.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/CookieSigner.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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (17 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/CLIService.java:463 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/CLIService.java:463-479 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java:529-545 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/CLIService.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 195 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (17 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetSchemasOperation.java:56 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetSchemasOperation.java:56-72 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/GetSchemasOperation.java:56-72 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetSchemasOperation.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/GetSchemasOperation.java` as WHOLE FILES: 98% 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 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (17 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:590 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:590-606 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:604-620 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 435 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 `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:590` 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftBinaryCLIService.java:49 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftBinaryCLIService.java:49-65 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftBinaryCLIService.java:50-66 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftBinaryCLIService.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftBinaryCLIService.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftBinaryCLIService.java:49` 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:185 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:185-201 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:186-202 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 436 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (17 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:343 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:343-359 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:344-360 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 436 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (17 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:300 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:300-316 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:311-327 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 224 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (17 lines × 2) REDACTED:347 — REDACTED:347-363 | REDACTED:368-384 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 325 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (17 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/HiveSQLException.java:171 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/HiveSQLException.java:171-187 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/HiveSQLException.java:171-187 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/HiveSQLException.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/HiveSQLException.java` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 105 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (17 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/FetchOrientation.java:37 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/FetchOrientation.java:37-53 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/FetchOrientation.java:37-53 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/FetchOrientation.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/FetchOrientation.java` as WHOLE FILES: 97% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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: `TFetchOrientation` names `org.apache.hive.service.cli.thrift.TFetchOrientation` in one and `org.apache.hive.service.rpc.thrift.TFetchOrientation` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (17 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/OperationType.java:41 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/OperationType.java:41-57 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/OperationType.java:41-57 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/OperationType.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/OperationType.java` as WHOLE FILES: 97% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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: `TOperationType` names `org.apache.hive.service.cli.thrift.TOperationType` in one and `org.apache.hive.service.rpc.thrift.TOperationType` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (17 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImplwithUGI.java:103 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImplwithUGI.java:103-119 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImplwithUGI.java:103-119 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImplwithUGI.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImplwithUGI.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (17 lines × 2) python/pyspark/heapq3.py:540 — python/pyspark/heapq3.py:540-556 | python/pyspark/heapq3.py:576-592 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (17 lines × 2) python/pyspark/ml/tuning.py:321 — python/pyspark/ml/tuning.py:321-337 | python/pyspark/ml/tuning.py:599-615 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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.
  • + 3 more in this group — see findings.md.
D6 · Cohesion (LCOM4) · Low cohesion · ×28
  • Low cohesion: SparkContext (LCOM4 11) core/src/main/scala/org/apache/spark/SparkContext.scala:77 — SparkContext's methods fall into 11 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 11 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: SparkHadoopUtil (LCOM4 11) core/src/main/scala/org/apache/spark/deploy/SparkHadoopUtil.scala:47 — SparkHadoopUtil's methods fall into 11 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 11 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: InMemoryCatalog (LCOM4 10) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/InMemoryCatalog.scala:45 — InMemoryCatalog's methods fall into 10 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 10 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: SpecificInternalRow (LCOM4 8) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/SpecificInternalRow.scala:193 — SpecificInternalRow'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: GraphOps (LCOM4 7) graphx/src/main/scala/org/apache/spark/graphx/GraphOps.scala:35 — GraphOps'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: SQLShuffleReadMetricsReporter (LCOM4 7) sql/core/src/main/scala/org/apache/spark/sql/execution/metric/SQLShuffleMetricsReporter.scala:30 — SQLShuffleReadMetricsReporter'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: StreamingJobProgressListener (LCOM4 7) streaming/src/main/scala/org/apache/spark/streaming/ui/StreamingJobProgressListener.scala:30 — StreamingJobProgressListener'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: MasterPage (LCOM4 5) core/src/main/scala/org/apache/spark/deploy/master/ui/MasterPage.scala:32 — MasterPage'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: HadoopMapRedWriteConfigUtil (LCOM4 5) core/src/main/scala/org/apache/spark/internal/io/SparkHadoopWriter.scala:165 — HadoopMapRedWriteConfigUtil'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: LDA (LCOM4 5) mllib/src/main/scala/org/apache/spark/mllib/clustering/LDA.scala:47 — LDA'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: YarnSchedulerBackend (LCOM4 5) resource-managers/yarn/src/main/scala/org/apache/spark/scheduler/cluster/YarnSchedulerBackend.scala:46 — YarnSchedulerBackend'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: SparkSession (LCOM4 5) sql/core/src/main/scala/org/apache/spark/sql/SparkSession.scala:79 — SparkSession'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: SparkPlan (LCOM4 5) sql/core/src/main/scala/org/apache/spark/sql/execution/SparkPlan.scala:56 — SparkPlan'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: Shim_v0_13 (LCOM4 5) sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveShim.scala:461 — Shim_v0_13'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: ClientEndpoint (LCOM4 4) core/src/main/scala/org/apache/spark/deploy/Client.scala:41 — ClientEndpoint'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: NewHadoopRDD (LCOM4 4) core/src/main/scala/org/apache/spark/rdd/NewHadoopRDD.scala:69 — NewHadoopRDD'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: TaskSetManager (LCOM4 4) core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala:54 — TaskSetManager'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: TaskPagedTable (LCOM4 4) core/src/main/scala/org/apache/spark/ui/jobs/StagePage.scala:480 — TaskPagedTable'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: BlockPagedTable (LCOM4 4) core/src/main/scala/org/apache/spark/ui/storage/RDDPage.scala:217 — BlockPagedTable'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: BitSet (LCOM4 4) core/src/main/scala/org/apache/spark/util/collection/BitSet.scala:26 — BitSet'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: KafkaRDD (LCOM4 4) external/kafka-0-10/src/main/scala/org/apache/spark/streaming/kafka010/KafkaRDD.scala:49 — KafkaRDD'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: EdgePartition (LCOM4 4) graphx/src/main/scala/org/apache/spark/graphx/impl/EdgePartition.scala:54 — EdgePartition'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: MesosCoarseGrainedSchedulerBackend (LCOM4 4) resource-managers/mesos/src/main/scala/org/apache/spark/scheduler/cluster/mesos/MesosCoarseGrainedSchedulerBackend.scala:56 — MesosCoarseGrainedSchedulerBackend'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: YarnSchedulerEndpoint (LCOM4 4) resource-managers/yarn/src/main/scala/org/apache/spark/scheduler/cluster/YarnSchedulerBackend.scala:242 — YarnSchedulerEndpoint'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: Analyzer (LCOM4 4) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala:97 — Analyzer'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.
  • + 3 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×27
  • Duplicated block (16 lines × 2) core/src/main/scala/org/apache/spark/rdd/JdbcRDD.scala:113 — core/src/main/scala/org/apache/spark/rdd/JdbcRDD.scala:113-128 | REDACTED:236-251 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/main/scala/org/apache/spark/rdd/JdbcRDD.scala:113` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) core/src/main/scala/org/apache/spark/ui/jobs/AllJobsPage.scala:186 — core/src/main/scala/org/apache/spark/ui/jobs/AllJobsPage.scala:186-201 | core/src/main/scala/org/apache/spark/ui/jobs/JobPage.scala:168-183 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/main/scala/org/apache/spark/ui/jobs/AllJobsPage.scala:186` 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) mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:104 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:104-119 | mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala:106-121 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 476 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 (16 lines × 2) mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:270 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:270-285 | mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala:254-269 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 476 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 `mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:270` 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, `mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:286` calls `indices` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala:270` 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 (16 lines × 2) mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:320 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:320-335 | mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala:303-318 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 476 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 (16 lines × 2) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:482 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:482-497 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala:652-667 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 357 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 (16 lines × 2) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:527 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:527-542 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala:700-715 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 357 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala:698` calls `Since` and `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:524` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (16 lines × 2) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:652 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:652-667 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala:837-852 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 357 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala:854` calls `Since` and `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:669` 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 (16 lines × 2) mllib/src/main/scala/org/apache/spark/ml/python/MLSerDe.scala:183 — mllib/src/main/scala/org/apache/spark/ml/python/MLSerDe.scala:183-198 | mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala:1522-1537 — before extracting anything, compare `mllib/src/main/scala/org/apache/spark/ml/python/MLSerDe.scala` and `mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 133 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 (16 lines × 2) mllib/src/main/scala/org/apache/spark/ml/r/GBTClassificationWrapper.scala:104 — mllib/src/main/scala/org/apache/spark/ml/r/GBTClassificationWrapper.scala:104-119 | mllib/src/main/scala/org/apache/spark/ml/r/RandomForestClassificationWrapper.scala:104-119 — before extracting anything, compare `mllib/src/main/scala/org/apache/spark/ml/r/GBTClassificationWrapper.scala` and `mllib/src/main/scala/org/apache/spark/ml/r/RandomForestClassificationWrapper.scala` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `mllib/src/main/scala/org/apache/spark/ml/r/GBTClassificationWrapper.scala:104` 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 (16 lines × 2) common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java:1080 — common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java:1080-1095 | common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java:1171-1186 — both copies are in the same file, so extract the block into 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) sql/core/v1.2.1/src/main/java/org/apache/spark/sql/execution/datasources/orc/OrcColumnVector.java:88 — sql/core/v1.2.1/src/main/java/org/apache/spark/sql/execution/datasources/orc/OrcColumnVector.java:88-103 | sql/core/v2.3.5/src/main/java/org/apache/spark/sql/execution/datasources/orc/OrcColumnVector.java:88-103 — before extracting anything, compare `sql/core/v1.2.1/src/main/java/org/apache/spark/sql/execution/datasources/orc/OrcColumnVector.java` and `sql/core/v2.3.5/src/main/java/org/apache/spark/sql/execution/datasources/orc/OrcColumnVector.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 (16 lines × 2) REDACTED:125 — REDACTED:125-140 | REDACTED:125-140 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 75 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 (16 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java:91 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java:91-106 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java:91-106 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 274 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 `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java:91` 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, `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java:108` calls `VariableSubstitution`, `substitute` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java:108` 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 (16 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java:444 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java:444-459 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java:443-458 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 274 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 (16 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:213 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:213-228 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:215-230 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 435 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:236` calls `VariableSubstitution`, `getHiveVariables` and `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:234` 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 (16 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:527 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:527-542 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:541-556 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 435 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 (16 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/SessionManager.java:189 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/SessionManager.java:189-204 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/SessionManager.java:189-204 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/SessionManager.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/SessionManager.java` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 167 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 (16 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:394 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:394-409 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:395-410 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 436 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 (16 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:522 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:522-537 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:524-539 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 436 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 (16 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:619 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:619-634 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:621-636 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 436 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 (16 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftHttpCLIService.java:166 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftHttpCLIService.java:166-181 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftHttpCLIService.java:167-182 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftHttpCLIService.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftHttpCLIService.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 97 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 (16 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/HiveSQLException.java:153 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/HiveSQLException.java:153-168 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/HiveSQLException.java:153-168 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/HiveSQLException.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/HiveSQLException.java` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 105 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 (16 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/GetInfoType.java:79 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/GetInfoType.java:79-94 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/GetInfoType.java:79-94 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/GetInfoType.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/GetInfoType.java` as WHOLE FILES: 98% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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: `TGetInfoType` names `org.apache.hive.service.cli.thrift.TGetInfoType` in one and `org.apache.hive.service.rpc.thrift.TGetInfoType` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (16 lines × 2) python/pyspark/ml/linalg/__init__.py:997 — python/pyspark/ml/linalg/__init__.py:997-1012 | python/pyspark/mllib/linalg/__init__.py:1152-1167 — before extracting anything, compare `python/pyspark/ml/linalg/__init__.py` and `python/pyspark/mllib/linalg/__init__.py` as WHOLE FILES: this scan already matched 34 separate duplicated blocks between them, totalling at least 667 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.
  • + 2 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×25
  • Duplicated block (13 lines × 2) core/src/main/scala/org/apache/spark/ui/jobs/AllJobsPage.scala:567 — core/src/main/scala/org/apache/spark/ui/jobs/AllJobsPage.scala:567-579 | sql/core/src/main/scala/org/apache/spark/sql/execution/ui/AllExecutionsPage.scala:310-322 — 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 `core/src/main/scala/org/apache/spark/ui/jobs/AllJobsPage.scala:567` 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 (13 lines × 2) mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:133 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:133-145 | mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala:135-147 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 476 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (13 lines × 2) mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:399 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:399-411 | mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala:381-393 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 476 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 `mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:399` 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) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:726 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:726-738 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala:912-924 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 357 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (13 lines × 2) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/encoders/RowEncoder.scala:81 — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/encoders/RowEncoder.scala:81-93 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/encoders/RowEncoder.scala:254-266 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/encoders/RowEncoder.scala:81` 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 (13 lines × 2) sql/core/src/main/scala/org/apache/spark/sql/execution/python/AggregateInPandasExec.scala:89 — sql/core/src/main/scala/org/apache/spark/sql/execution/python/AggregateInPandasExec.scala:89-101 | sql/core/src/main/scala/org/apache/spark/sql/execution/python/EvalPythonExec.scala:104-116 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `sql/core/src/main/scala/org/apache/spark/sql/execution/python/EvalPythonExec.scala:117` calls `newMutableProjection` and `sql/core/src/main/scala/org/apache/spark/sql/execution/python/AggregateInPandasExec.scala:104` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (13 lines × 2) sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/HDFSBackedStateStoreProvider.scala:451 — sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/HDFSBackedStateStoreProvider.scala:451-463 | sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/HDFSBackedStateStoreProvider.scala:545-557 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/HDFSBackedStateStoreProvider.scala:451` 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 (13 lines × 2) core/src/main/scala/org/apache/spark/SparkContext.scala:777 — core/src/main/scala/org/apache/spark/SparkContext.scala:777-789 | sql/core/src/main/scala/org/apache/spark/sql/execution/basicPhysicalOperators.scala:541-553 — 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 `core/src/main/scala/org/apache/spark/SparkContext.scala:777` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) sql/core/src/main/scala/org/apache/spark/sql/execution/HiveResult.scala:85 — sql/core/src/main/scala/org/apache/spark/sql/execution/HiveResult.scala:85-97 | sql/core/src/main/scala/org/apache/spark/sql/execution/HiveResult.scala:105-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. Read the line range as the matched WINDOW rather than a finished unit: at `sql/core/src/main/scala/org/apache/spark/sql/execution/HiveResult.scala:85` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) common/network-common/src/main/java/org/apache/spark/network/sasl/SparkSaslClient.java:129 — common/network-common/src/main/java/org/apache/spark/network/sasl/SparkSaslClient.java:129-141 | common/network-common/src/main/java/org/apache/spark/network/sasl/SparkSaslServer.java:158-170 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `common/network-common/src/main/java/org/apache/spark/network/sasl/SparkSaslClient.java:129` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) common/sketch/src/main/java/org/apache/spark/util/sketch/BloomFilterImpl.java:113 — common/sketch/src/main/java/org/apache/spark/util/sketch/BloomFilterImpl.java:113-125 | common/sketch/src/main/java/org/apache/spark/util/sketch/BloomFilterImpl.java:155-167 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `common/sketch/src/main/java/org/apache/spark/util/sketch/BloomFilterImpl.java:113` 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/TSetIpAddressProcessor.java:79 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/TSetIpAddressProcessor.java:79-91 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/auth/TSetIpAddressProcessor.java:79-91 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/TSetIpAddressProcessor.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/auth/TSetIpAddressProcessor.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (13 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:146 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:146-158 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:148-160 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 435 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 `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:146` 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 (13 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:549 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:549-561 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:563-575 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 435 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 `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.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 (13 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:413 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:413-425 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:414-426 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 436 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (13 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:492 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:492-504 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:494-506 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 436 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (13 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:541 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:541-553 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:543-555 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 436 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (13 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:215 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:215-227 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:226-238 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 224 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 `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:215` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) REDACTED:261 — REDACTED:261-273 | REDACTED:272-284 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 325 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (13 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetCatalogsOperation.java:47 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetCatalogsOperation.java:47-59 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/GetCatalogsOperation.java:47-59 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetCatalogsOperation.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/GetCatalogsOperation.java` as WHOLE FILES: 98% 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 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 2) python/pyspark/ml/linalg/__init__.py:69 — python/pyspark/ml/linalg/__init__.py:69-81 | python/pyspark/mllib/linalg/__init__.py:71-83 — before extracting anything, compare `python/pyspark/ml/linalg/__init__.py` and `python/pyspark/mllib/linalg/__init__.py` as WHOLE FILES: this scan already matched 34 separate duplicated blocks between them, totalling at least 667 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 (13 lines × 2) python/pyspark/ml/linalg/__init__.py:954 — python/pyspark/ml/linalg/__init__.py:954-966 | python/pyspark/mllib/linalg/__init__.py:1098-1110 — before extracting anything, compare `python/pyspark/ml/linalg/__init__.py` and `python/pyspark/mllib/linalg/__init__.py` as WHOLE FILES: this scan already matched 34 separate duplicated blocks between them, totalling at least 667 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 `python/pyspark/ml/linalg/__init__.py:954` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) python/pyspark/ml/linalg/__init__.py:939 — python/pyspark/ml/linalg/__init__.py:939-951 | python/pyspark/mllib/linalg/__init__.py:1083-1095 — before extracting anything, compare `python/pyspark/ml/linalg/__init__.py` and `python/pyspark/mllib/linalg/__init__.py` as WHOLE FILES: this scan already matched 34 separate duplicated blocks between them, totalling at least 667 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 (13 lines × 2) python/pyspark/sql/readwriter.py:656 — python/pyspark/sql/readwriter.py:656-668 | python/pyspark/sql/streaming.py:801-814 — before extracting anything, compare `python/pyspark/sql/readwriter.py` and `python/pyspark/sql/streaming.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 177 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (13 lines × 2) examples/src/main/java/org/apache/spark/examples/sql/streaming/JavaStructuredNetworkWordCountWindowed.java:70 — examples/src/main/java/org/apache/spark/examples/sql/streaming/JavaStructuredNetworkWordCountWindowed.java:70-82 | examples/src/main/java/org/apache/spark/examples/sql/streaming/JavaStructuredSessionization.java:55-67 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 · Duplicated block (18 lines × 2) · ×24
  • Duplicated block (18 lines × 2) core/src/main/scala/org/apache/spark/SparkContext.scala:795 — core/src/main/scala/org/apache/spark/SparkContext.scala:795-812 | sql/core/src/main/scala/org/apache/spark/sql/execution/basicPhysicalOperators.scala:563-580 — 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 `core/src/main/scala/org/apache/spark/SparkContext.scala:795` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) core/src/main/scala/org/apache/spark/util/collection/OpenHashMap.scala:133 — core/src/main/scala/org/apache/spark/util/collection/OpenHashMap.scala:133-150 | core/src/main/scala/org/apache/spark/util/collection/PrimitiveKeyOpenHashMap.scala:101-118 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `core/src/main/scala/org/apache/spark/util/collection/OpenHashMap.scala: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.
  • Duplicated block (18 lines × 2) external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaMicroBatchStream.scala:216 — external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaMicroBatchStream.scala:216-233 | external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaSource.scala:175-192 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaMicroBatchStream.scala:216` 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, `external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaSource.scala:193` calls `logDebug` and `external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaMicroBatchStream.scala:235` 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 (18 lines × 2) mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:338 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:338-355 | mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala:321-338 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 476 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 (18 lines × 2) mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:546 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:546-563 | mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala:527-544 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 476 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 `mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:546` 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 (18 lines × 2) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:425 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:425-442 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala:577-594 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 357 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 (18 lines × 2) mllib/src/main/scala/org/apache/spark/mllib/tree/model/DecisionTreeModel.scala:204 — mllib/src/main/scala/org/apache/spark/mllib/tree/model/DecisionTreeModel.scala:204-221 | mllib/src/main/scala/org/apache/spark/mllib/tree/model/treeEnsembleModels.scala:406-423 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `mllib/src/main/scala/org/apache/spark/mllib/tree/model/treeEnsembleModels.scala:427` calls `Metadata`, `trees` and `mllib/src/main/scala/org/apache/spark/mllib/tree/model/DecisionTreeModel.scala: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 (18 lines × 2) REDACTED:1732 — REDACTED:1732-1749 | REDACTED:1797-1814 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (18 lines × 2) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/rows.scala:141 — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/rows.scala:141-158 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/GenericArrayData.scala:145-162 — 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 `sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/rows.scala:141` 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 (18 lines × 2) sql/core/src/main/scala/org/apache/spark/sql/execution/python/ArrowPythonRunner.scala:92 — sql/core/src/main/scala/org/apache/spark/sql/execution/python/ArrowPythonRunner.scala:92-120 | sql/core/src/main/scala/org/apache/spark/sql/execution/r/ArrowRRunner.scala:100-117 — 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 `sql/core/src/main/scala/org/apache/spark/sql/execution/python/ArrowPythonRunner.scala:92` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/HDFSBackedStateStoreProvider.scala:432 — sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/HDFSBackedStateStoreProvider.scala:432-449 | sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/HDFSBackedStateStoreProvider.scala:525-542 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/HDFSBackedStateStoreProvider.scala:432` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) mllib/src/main/scala/org/apache/spark/ml/python/MLSerDe.scala:71 — mllib/src/main/scala/org/apache/spark/ml/python/MLSerDe.scala:71-88 | mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala:1410-1427 — before extracting anything, compare `mllib/src/main/scala/org/apache/spark/ml/python/MLSerDe.scala` and `mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 133 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 (18 lines × 2) mllib/src/main/scala/org/apache/spark/ml/python/MLSerDe.scala:163 — mllib/src/main/scala/org/apache/spark/ml/python/MLSerDe.scala:163-180 | mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala:1502-1519 — before extracting anything, compare `mllib/src/main/scala/org/apache/spark/ml/python/MLSerDe.scala` and `mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 133 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 (18 lines × 2) mllib/src/main/scala/org/apache/spark/ml/python/MLSerDe.scala:139 — mllib/src/main/scala/org/apache/spark/ml/python/MLSerDe.scala:139-156 | mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala:1478-1495 — before extracting anything, compare `mllib/src/main/scala/org/apache/spark/ml/python/MLSerDe.scala` and `mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 133 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 (18 lines × 2) sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/FixedLengthRowBasedKeyValueBatch.java:114 — sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/FixedLengthRowBasedKeyValueBatch.java:114-131 | sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/VariableLengthRowBasedKeyValueBatch.java:125-142 — before extracting anything, compare `sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/FixedLengthRowBasedKeyValueBatch.java` and `sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/VariableLengthRowBasedKeyValueBatch.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/FixedLengthRowBasedKeyValueBatch.java:114` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/CompositeService.java:66 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/CompositeService.java:66-83 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/CompositeService.java:66-83 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/CompositeService.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/CompositeService.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 (18 lines × 2) REDACTED:68 — REDACTED:68-85 | REDACTED:68-85 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 75 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 (18 lines × 2) REDACTED:170 — REDACTED:170-187 | REDACTED:170-187 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 75 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 (18 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/KerberosSaslHelper.java:45 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/KerberosSaslHelper.java:45-62 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/auth/KerberosSaslHelper.java:45-62 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/KerberosSaslHelper.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/auth/KerberosSaslHelper.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 (18 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/TypeDescriptor.java:104 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/TypeDescriptor.java:104-121 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/TypeDescriptor.java:105-122 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/TypeDescriptor.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/TypeDescriptor.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java:277 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java:277-294 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java:276-293 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 274 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 (18 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:557 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:557-574 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:559-576 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 436 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 (18 lines × 2) REDACTED:93 — REDACTED:93-110 | REDACTED:98-115 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 325 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 `REDACTED:93` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) examples/src/main/scala/org/apache/spark/examples/mllib/BinaryClassification.scala:105 — examples/src/main/scala/org/apache/spark/examples/mllib/BinaryClassification.scala:105-122 | examples/src/main/scala/org/apache/spark/examples/mllib/LinearRegression.scala:92-109 — before extracting anything, compare `examples/src/main/scala/org/apache/spark/examples/mllib/BinaryClassification.scala` and `examples/src/main/scala/org/apache/spark/examples/mllib/LinearRegression.scala` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `examples/src/main/scala/org/apache/spark/examples/mllib/BinaryClassification.scala:105` 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, `examples/src/main/scala/org/apache/spark/examples/mllib/LinearRegression.scala:110` calls `SimpleUpdater` and `examples/src/main/scala/org/apache/spark/examples/mllib/BinaryClassification.scala:123` 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.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×24
  • Duplicated block (14 lines × 2) core/src/main/scala/org/apache/spark/deploy/master/MasterArguments.scala:62 — core/src/main/scala/org/apache/spark/deploy/master/MasterArguments.scala:62-75 | core/src/main/scala/org/apache/spark/deploy/worker/WorkerArguments.scala:68-81 — 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 `core/src/main/scala/org/apache/spark/deploy/master/MasterArguments.scala: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.
  • Duplicated block (14 lines × 2) core/src/main/scala/org/apache/spark/rdd/HadoopRDD.scala:314 — core/src/main/scala/org/apache/spark/rdd/HadoopRDD.scala:314-327 | core/src/main/scala/org/apache/spark/rdd/NewHadoopRDD.scala:269-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. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/main/scala/org/apache/spark/rdd/HadoopRDD.scala:314` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/FileScanRDD.scala:177 — sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/FileScanRDD.scala:177-190 | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/FilePartitionReader.scala:71-84 — 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 `sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/FileScanRDD.scala:177` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) sql/core/src/main/scala/org/apache/spark/sql/execution/joins/SortMergeJoinExec.scala:260 — sql/core/src/main/scala/org/apache/spark/sql/execution/joins/SortMergeJoinExec.scala:260-273 | sql/core/src/main/scala/org/apache/spark/sql/execution/joins/SortMergeJoinExec.scala:295-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. Read the line range as the matched WINDOW rather than a finished unit: at `sql/core/src/main/scala/org/apache/spark/sql/execution/joins/SortMergeJoinExec.scala:260` 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) sql/core/src/main/scala/org/apache/spark/sql/execution/joins/SortMergeJoinExec.scala:298 — sql/core/src/main/scala/org/apache/spark/sql/execution/joins/SortMergeJoinExec.scala:298-311 | sql/core/src/main/scala/org/apache/spark/sql/execution/joins/SortMergeJoinExec.scala:340-353 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sql/core/src/main/scala/org/apache/spark/sql/execution/joins/SortMergeJoinExec.scala:298` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `sql/core/src/main/scala/org/apache/spark/sql/execution/joins/SortMergeJoinExec.scala:338` calls `GenericInternalRow` and `sql/core/src/main/scala/org/apache/spark/sql/execution/joins/SortMergeJoinExec.scala:296` 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 (14 lines × 2) sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerPage.scala:93 — sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerPage.scala:93-106 | sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerSessionPage.scala:102-115 — before extracting anything, compare `sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerPage.scala` and `sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerSessionPage.scala` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 66 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerPage.scala:93` 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) sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveInspectors.scala:710 — sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveInspectors.scala:710-723 | sql/hive/src/main/scala/org/apache/spark/sql/hive/TableReader.scala:426-439 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveInspectors.scala:710` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) common/network-yarn/src/main/java/org/apache/spark/network/yarn/YarnShuffleServiceMetrics.java:66 — common/network-yarn/src/main/java/org/apache/spark/network/yarn/YarnShuffleServiceMetrics.java:66-79 | common/network-yarn/src/main/java/org/apache/spark/network/yarn/YarnShuffleServiceMetrics.java:82-95 — both copies are in the same file, so extract the block into 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) core/src/main/java/org/apache/spark/shuffle/sort/ShuffleExternalSorter.java:351 — core/src/main/java/org/apache/spark/shuffle/sort/ShuffleExternalSorter.java:351-364 | core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeExternalSorter.java:347-360 — 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 `core/src/main/java/org/apache/spark/shuffle/sort/ShuffleExternalSorter.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 (14 lines × 2) core/src/main/java/org/apache/spark/util/collection/TimSort.java:730 — core/src/main/java/org/apache/spark/util/collection/TimSort.java:730-743 | core/src/main/java/org/apache/spark/util/collection/TimSort.java:852-865 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/main/java/org/apache/spark/util/collection/TimSort.java:730` 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, `core/src/main/java/org/apache/spark/util/collection/TimSort.java:727` calls `newKey` and `core/src/main/java/org/apache/spark/util/collection/TimSort.java:850` 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 (14 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/ServiceUtils.java:30 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/ServiceUtils.java:30-43 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/ServiceUtils.java:34-47 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/ServiceUtils.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/ServiceUtils.java` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/TypeQualifiers.java:102 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/TypeQualifiers.java:102-115 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/TypeQualifiers.java:102-115 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/TypeQualifiers.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/TypeQualifiers.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 61 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 (14 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetTableTypesOperation.java:56 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetTableTypesOperation.java:56-69 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/GetTableTypesOperation.java:56-69 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetTableTypesOperation.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/GetTableTypesOperation.java` as WHOLE FILES: 98% 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 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:615 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:615-628 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:629-642 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 435 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 `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:615` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:671 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:671-684 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:685-698 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 435 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 (14 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:733 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:733-746 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:747-760 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 435 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 (14 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImplwithUGI.java:66 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImplwithUGI.java:66-79 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImplwithUGI.java:66-79 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImplwithUGI.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImplwithUGI.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:377 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:377-390 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:378-391 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 436 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 (14 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:52 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:52-65 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:53-66 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 224 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 (14 lines × 2) REDACTED:431 — REDACTED:431-444 | REDACTED:452-465 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 325 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 (14 lines × 2) python/pyspark/ml/common.py:125 — python/pyspark/ml/common.py:125-138 | python/pyspark/mllib/common.py:150-163 — `python/pyspark/ml/common.py` and `python/pyspark/mllib/common.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 2 separate duplicated blocks between them, totalling at least 29 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (14 lines × 2) examples/src/main/scala/org/apache/spark/examples/mllib/RandomForestClassificationExample.scala:34 — examples/src/main/scala/org/apache/spark/examples/mllib/RandomForestClassificationExample.scala:34-47 | examples/src/main/scala/org/apache/spark/examples/mllib/RandomForestRegressionExample.scala:34-47 — before extracting anything, compare `examples/src/main/scala/org/apache/spark/examples/mllib/RandomForestClassificationExample.scala` and `examples/src/main/scala/org/apache/spark/examples/mllib/RandomForestRegressionExample.scala` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (14 lines × 2) examples/src/main/scala/org/apache/spark/examples/mllib/TallSkinnyPCA.scala:39 — examples/src/main/scala/org/apache/spark/examples/mllib/TallSkinnyPCA.scala:39-52 | examples/src/main/scala/org/apache/spark/examples/mllib/TallSkinnySVD.scala:39-52 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (14 lines × 2) examples/src/main/java/org/apache/spark/examples/ml/JavaVectorAssemblerExample.java:37 — examples/src/main/java/org/apache/spark/examples/ml/JavaVectorAssemblerExample.java:37-50 | examples/src/main/java/org/apache/spark/examples/ml/JavaVectorSizeHintExample.java:39-52 — before extracting anything, compare `examples/src/main/java/org/apache/spark/examples/ml/JavaVectorAssemblerExample.java` and `examples/src/main/java/org/apache/spark/examples/ml/JavaVectorSizeHintExample.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 2 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.
D4 · Code Duplication · Edited copy of a member (8 corresponding lines) · ×23
  • Edited copy of a member (8 corresponding lines) sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeArrayData.java:229 — sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeArrayData.java:229-236 | sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeRow.java:398-408 — 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) mllib/src/main/scala/org/apache/spark/ml/classification/DecisionTreeClassifier.scala:282 — mllib/src/main/scala/org/apache/spark/ml/classification/DecisionTreeClassifier.scala:282-290 | mllib/src/main/scala/org/apache/spark/ml/regression/DecisionTreeRegressor.scala:284-291 — 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) REDACTED:94 — REDACTED:94-101 | REDACTED:94-101 — 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) graphx/src/main/scala/org/apache/spark/graphx/Edge.scala:60 — graphx/src/main/scala/org/apache/spark/graphx/Edge.scala:60-69 | graphx/src/main/scala/org/apache/spark/graphx/impl/EdgePartitionBuilder.scala:133-140 — 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/TypeDescriptor.java:43 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/TypeDescriptor.java:43-50 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/TypeDescriptor.java:44-51 — 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) core/src/main/scala/org/apache/spark/status/AppStatusStore.scala:47 — core/src/main/scala/org/apache/spark/status/AppStatusStore.scala:47-54 | core/src/main/scala/org/apache/spark/status/AppStatusStore.scala:89-96 — 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) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/conditionalExpressions.scala:296 — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/conditionalExpressions.scala:296-303 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/conditionalExpressions.scala:311-318 — 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) common/sketch/src/main/java/org/apache/spark/util/sketch/CountMinSketchImpl.java:247 — common/sketch/src/main/java/org/apache/spark/util/sketch/CountMinSketchImpl.java:247-254 | common/sketch/src/main/java/org/apache/spark/util/sketch/CountMinSketchImpl.java:256-263 — 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) sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeArrayData.java:509 — sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeArrayData.java:509-516 | sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeArrayData.java:527-534 — 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) streaming/src/main/scala/org/apache/spark/streaming/api/java/JavaDStreamLike.scala:312 — streaming/src/main/scala/org/apache/spark/streaming/api/java/JavaDStreamLike.scala:312-319 | streaming/src/main/scala/org/apache/spark/streaming/api/java/JavaDStreamLike.scala:326-333 — 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/Operation.java:63 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/Operation.java:63-70 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/Operation.java:79-88 — 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) external/kinesis-asl/src/main/scala/org/apache/spark/streaming/kinesis/KinesisUtils.scala:399 — external/kinesis-asl/src/main/scala/org/apache/spark/streaming/kinesis/KinesisUtils.scala:399-406 | external/kinesis-asl/src/main/scala/org/apache/spark/streaming/kinesis/KinesisUtils.scala:462-469 — 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) mllib/src/main/scala/org/apache/spark/ml/regression/AFTSurvivalRegression.scala:400 — mllib/src/main/scala/org/apache/spark/ml/regression/AFTSurvivalRegression.scala:400-407 | mllib/src/main/scala/org/apache/spark/ml/regression/LinearRegression.scala:726-735 — 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) python/pyspark/shuffle.py:535 — python/pyspark/shuffle.py:535-542 | python/pyspark/shuffle.py:554-563 — 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) sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/OffHeapColumnVector.java:159 — sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/OffHeapColumnVector.java:159-166 | sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/OnHeapColumnVector.java:156-163 — 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetTableTypesOperation.java:45 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetTableTypesOperation.java:45-52 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/GetTableTypesOperation.java:45-52 — 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetColumnsOperation.java:115 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetColumnsOperation.java:115-122 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/GetColumnsOperation.java:122-129 — 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) python/pyspark/ml/clustering.py:222 — python/pyspark/ml/clustering.py:222-231 | python/pyspark/ml/feature.py:1514-1521 — 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) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/FileFormat.scala:176 — sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/FileFormat.scala:176-183 | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/TextBasedFileScan.scala:38-45 — 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) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/CSVFileFormat.scala:59 — sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/CSVFileFormat.scala:59-66 | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/csv/CSVTable.scala:43-50 — 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) sql/core/src/main/scala/org/apache/spark/sql/execution/command/AnalyzeColumnCommand.scala:139 — sql/core/src/main/scala/org/apache/spark/sql/execution/command/AnalyzeColumnCommand.scala:139-148 | sql/core/src/main/scala/org/apache/spark/sql/execution/command/CommandUtils.scala:238-245 — 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) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/json/JsonFileFormat.scala:55 — sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/json/JsonFileFormat.scala:55-62 | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/json/JsonTable.scala:43-50 — 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) examples/src/main/scala/org/apache/spark/examples/LocalLR.scala:40 — examples/src/main/scala/org/apache/spark/examples/LocalLR.scala:40-47 | examples/src/main/scala/org/apache/spark/examples/SparkLR.scala:45-52 — 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.
X15 · Unvalidated length from an untrusted reader · Length read from the parsed input is spent without ever being bounded · ×23
  • Length read from the parsed input is spent without ever being bounded streaming/src/main/scala/org/apache/spark/streaming/dstream/RawInputDStream.scala:87 — `length` is read from the bytes being parsed at line 86 (`getInt`), then used to size a `ByteBuffer.allocate` at line 87 — 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 streaming/src/main/scala/org/apache/spark/streaming/api/python/PythonDStream.scala:108 — `length` is read from the bytes being parsed at line 107 (`readInt`), then used to size a `new Array[Byte]` at line 108 — 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 sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveShim.scala:231 — `functionInBytesLength` is read from the bytes being parsed at line 230 (`readInt`), then used to size a `new Array[Byte]` at line 231 — and nowhere in its scope is `functionInBytesLength` 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 `functionInBytesLength` 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 sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/HDFSBackedStateStoreProvider.scala:442 — `keySize` is read from the bytes being parsed at line 435 (`readInt`), then used to size a `new Array[Byte]` at line 442 — and nowhere in its scope is `keySize` 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 `keySize` 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 sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/HDFSBackedStateStoreProvider.scala:452 — `valueSize` is read from the bytes being parsed at line 448 (`readInt`), then used to size a `new Array[Byte]` at line 452 — and nowhere in its scope is `valueSize` 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 `valueSize` 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 sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/HDFSBackedStateStoreProvider.scala:535 — `keySize` is read from the bytes being parsed at line 528 (`readInt`), then used to size a `new Array[Byte]` at line 535 — and nowhere in its scope is `keySize` 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 `keySize` 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 sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/HDFSBackedStateStoreProvider.scala:546 — `valueSize` is read from the bytes being parsed at line 541 (`readInt`), then used to size a `new Array[Byte]` at line 546 — and nowhere in its scope is `valueSize` 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 `valueSize` 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 sql/core/src/main/scala/org/apache/spark/sql/execution/python/RowQueue.scala:145 — `size` is read from the bytes being parsed at line 144 (`readInt`), then used to size a `new Array[Byte]` at line 145 — and nowhere in its scope is `size` 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 `size` 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 sql/core/src/main/scala/org/apache/spark/sql/execution/columnar/ColumnType.scala:523 — `length` is read from the bytes being parsed at line 522 (`getInt`), then used to size a `new Array[Byte]` at line 523 — 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 core/src/main/scala/org/apache/spark/security/SocketAuthHelper.scala:104 — `len` is read from the bytes being parsed at line 103 (`readInt`), then used to size a `new Array[Byte]` at line 104 — 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 core/src/main/scala/org/apache/spark/scheduler/MapStatus.scala:130 — `len` is read from the bytes being parsed at line 129 (`readInt`), then used to size a `new Array[Byte]` at line 130 — 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 core/src/main/scala/org/apache/spark/scheduler/TaskDescription.scala:176 — `valueLength` is read from the bytes being parsed at line 175 (`readInt`), then used to size a `new Array[Byte]` at line 176 — and nowhere in its scope is `valueLength` 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 `valueLength` 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 core/src/main/scala/org/apache/spark/scheduler/TaskResult.scala:57 — `blen` is read from the bytes being parsed at line 56 (`readInt`), then used to size a `new Array[Byte]` at line 57 — and nowhere in its scope is `blen` 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 `blen` 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 core/src/main/scala/org/apache/spark/api/r/RRunner.scala:66 — `contentPairsLength` is read from the bytes being parsed at line 65 (`readInt`), then used to size a `new Array[Byte]` at line 66 — and nowhere in its scope is `contentPairsLength` 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 `contentPairsLength` 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 core/src/main/scala/org/apache/spark/api/python/PythonRunner.scala:460 — `exLength` is read from the bytes being parsed at line 459 (`readInt`), then used to size a `new Array[Byte]` at line 460 — and nowhere in its scope is `exLength` 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 `exLength` 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 core/src/main/scala/org/apache/spark/api/python/PythonRunner.scala:472 — `updateLen` is read from the bytes being parsed at line 471 (`readInt`), then used to size a `new Array[Byte]` at line 472 — and nowhere in its scope is `updateLen` 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 `updateLen` 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 core/src/main/scala/org/apache/spark/api/java/JavaRDD.scala:237 — `length` is read from the bytes being parsed at line 236 (`readInt`), then used to size a `new Array[Byte]` at line 237 — 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 common/sketch/src/main/java/org/apache/spark/util/sketch/BitArray.java:97 — `numWords` is read from the bytes being parsed at line 96 (`readInt`), then used to size a `new long[]` at line 97 — and nowhere in its scope is `numWords` 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 `numWords` 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 common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/protocol/FetchShuffleBlocks.java:124 — `reduceIdsSize` is read from the bytes being parsed at line 123 (`readInt`), then used to size a `new int[]` at line 124 — and nowhere in its scope is `reduceIdsSize` 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 `reduceIdsSize` 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 common/network-common/src/main/java/org/apache/spark/network/protocol/Encoders.java:41 — `length` is read from the bytes being parsed at line 40 (`readInt`), then used to size a `new byte[]` at line 41 — 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 common/network-common/src/main/java/org/apache/spark/network/protocol/Encoders.java:60 — `length` is read from the bytes being parsed at line 59 (`readInt`), then used to size a `new byte[]` at line 60 — 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 common/network-common/src/main/java/org/apache/spark/network/protocol/Encoders.java:85 — `numStrings` is read from the bytes being parsed at line 84 (`readInt`), then used to size a `new String[]` at line 85 — and nowhere in its scope is `numStrings` 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 `numStrings` 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 common/network-common/src/main/java/org/apache/spark/network/protocol/Encoders.java:108 — `numInts` is read from the bytes being parsed at line 107 (`readInt`), then used to size a `new int[]` at line 108 — and nowhere in its scope is `numInts` 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 `numInts` against the bytes actually remaining and a maximum the format allows before allocating.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×23
  • Swallowed exception (caught, then discarded) sql/core/src/main/scala/org/apache/spark/sql/internal/CatalogImpl.scala:116 — `case NonFatal(_)` 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) sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/sources/memory.scala:103 — `case NonFatal(e)` 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) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeUtils.scala:336 — `case NonFatal(_)` 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) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeUtils.scala:414 — `case NonFatal(_)` 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) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/trees/TreeNode.scala:750 — `case _: 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) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala:647 — `case NonFatal(_)` 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) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala:668 — `case NonFatal(_)` 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) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala:681 — `case NonFatal(_)` 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) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala:805 — `case NonFatal(_)` 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) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala:820 — `case NonFatal(_)` 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) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala:832 — `case NonFatal(_)` 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) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/ExternalCatalogUtils.scala:92 — `case _: 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) REDACTED:351 — `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.
  • Swallowed exception (caught, then discarded) REDACTED:365 — `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.
  • Swallowed exception (caught, then discarded) python/pyspark/sql/session.py:722 — `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.
  • Swallowed exception (caught, then discarded) external/kafka-0-10-token-provider/src/main/scala/org/apache/spark/kafka010/KafkaTokenUtil.scala:145 — `case NonFatal(_)` 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) core/src/main/scala/org/apache/spark/serializer/KryoSerializer.scala:526 — `case NonFatal(_)` 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) core/src/main/scala/org/apache/spark/metrics/source/JVMCPUSource.scala:44 — `case NonFatal(_)` 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) core/src/main/scala/org/apache/spark/api/r/RUtils.scala:106 — `case e: 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) common/unsafe/src/main/java/org/apache/spark/unsafe/Platform.java:279 — `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) common/sketch/src/main/java/org/apache/spark/util/sketch/Platform.java:155 — `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) common/network-common/src/main/java/org/apache/spark/network/util/NettyMemoryMetrics.java:124 — `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) common/network-common/src/main/java/org/apache/spark/network/util/NettyMemoryMetrics.java:133 — `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.
D17 · Explicit Debt · HackComment · ×21
  • HackComment sql/hive/src/test/scala/org/apache/spark/sql/hive/test/TestHive.scala:528 — // HACK: Hive is too noisy by default. — 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 sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveComparisonTest.scala:171 — // Hack: Hive simply prints the result of a SET command to screen, — 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 sql/hive/src/test/scala/org/apache/spark/sql/hive/client/VersionsSuite.scala:115 — // Hack to avoid SEGV on some JVM versions. — 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 REDACTED:482 — // !! HACK ALERT !! — 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 sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/SchemaMergeUtils.scala:40 — // !! HACK ALERT !! — 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 sql/core/src/main/scala/org/apache/spark/sql/execution/WholeStageCodegenExec.scala:527 — // Hack because of type erasure — 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 sql/core/src/main/scala/org/apache/spark/sql/execution/columnar/InMemoryTableScanExec.scala:115 — // HACK ALERT: This is actually an RDD[ColumnarBatch]. — 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 REDACTED:963 — # hack for __import__ not working as desired — 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 REDACTED:574 — # Hack namedtuple, make it picklable — 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 REDACTED:645 — # hack the cls already generated by namedtuple. — 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 REDACTED:652 — # hack inplace — 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 python/pyspark/mllib/common.py:32 — # Hack for support float('inf') in Py4j — 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 python/pyspark/ml/common.py:32 — # Hack for support float('inf') in Py4j — 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 project/SparkBuild.scala:568 — // Hack: this variable is used to control whether to build docker images. It's updated by — 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 mllib/src/main/scala/org/apache/spark/ml/tree/impl/DecisionTreeMetadata.scala:162 — // Hack: If a categorical feature has only 1 category, we treat it as continuous. — 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 core/src/test/scala/org/apache/spark/storage/BlockInfoManagerSuite.scala:122 — // Hack to try to ensure that both future tasks are waiting — 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 core/src/test/scala/org/apache/spark/storage/BlockInfoManagerSuite.scala:147 — // Hack to try to ensure that both future tasks are waiting — 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 core/src/test/scala/org/apache/spark/storage/BlockInfoManagerSuite.scala:260 — // Hack to try to ensure that both future tasks are waiting — 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 core/src/test/scala/org/apache/spark/storage/BlockInfoManagerSuite.scala:285 — // Hack to try to ensure that both future tasks are waiting — 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 core/src/test/scala/org/apache/spark/storage/BlockInfoManagerSuite.scala:343 — // Hack to try to ensure that both future tasks are waiting — 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 common/unsafe/src/main/java/org/apache/spark/unsafe/Platform.java:85 — // hack below. It doesn't break, just means the user might run into the default JVM limit — 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 (7 corresponding lines) · ×21
  • Edited copy of a member (7 corresponding lines) streaming/src/main/scala/org/apache/spark/streaming/api/java/JavaStreamingContext.scala:314 — streaming/src/main/scala/org/apache/spark/streaming/api/java/JavaStreamingContext.scala:314-320 | streaming/src/main/scala/org/apache/spark/streaming/api/java/JavaStreamingContext.scala:345-351 — 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) mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:574 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:574-580 | mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala:555-561 — 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) sql/core/v1.2.1/src/main/java/org/apache/spark/sql/execution/datasources/orc/OrcColumnVector.java:171 — sql/core/v1.2.1/src/main/java/org/apache/spark/sql/execution/datasources/orc/OrcColumnVector.java:171-177 | sql/core/v2.3.5/src/main/java/org/apache/spark/sql/execution/datasources/orc/OrcColumnVector.java:171-177 — 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:167 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:167-173 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:173-179 — 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) mllib/src/main/scala/org/apache/spark/ml/classification/GBTClassifier.scala:371 — mllib/src/main/scala/org/apache/spark/ml/classification/GBTClassifier.scala:371-378 | mllib/src/main/scala/org/apache/spark/ml/regression/GBTRegressor.scala:303-309 — 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) mllib/src/main/scala/org/apache/spark/mllib/tree/GradientBoostedTrees.scala:68 — mllib/src/main/scala/org/apache/spark/mllib/tree/GradientBoostedTrees.scala:68-74 | mllib/src/main/scala/org/apache/spark/mllib/tree/GradientBoostedTrees.scala:98-106 — 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) streaming/src/main/scala/org/apache/spark/streaming/dstream/PairDStreamFunctions.scala:460 — streaming/src/main/scala/org/apache/spark/streaming/dstream/PairDStreamFunctions.scala:460-466 | streaming/src/main/scala/org/apache/spark/streaming/dstream/PairDStreamFunctions.scala:511-517 — 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/HandleIdentifier.java:72 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/HandleIdentifier.java:72-78 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/HandleIdentifier.java:72-78 — 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) sql/catalyst/src/main/scala/org/apache/spark/sql/types/Decimal.scala:375 — sql/catalyst/src/main/scala/org/apache/spark/sql/types/Decimal.scala:375-381 | sql/catalyst/src/main/scala/org/apache/spark/sql/types/Decimal.scala:383-389 — 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) common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/ExternalShuffleBlockResolver.java:370 — common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/ExternalShuffleBlockResolver.java:370-376 | common/network-yarn/src/main/java/org/apache/spark/network/yarn/YarnShuffleService.java:415-421 — 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/HiveTableTypeMapping.java:44 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/HiveTableTypeMapping.java:44-50 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/HiveTableTypeMapping.java:44-50 — 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) common/network-common/src/main/java/org/apache/spark/network/protocol/Encoders.java:106 — common/network-common/src/main/java/org/apache/spark/network/protocol/Encoders.java:106-113 | sql/catalyst/src/main/java/org/apache/spark/sql/vectorized/ColumnVector.java:146-152 — 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) common/sketch/src/main/java/org/apache/spark/util/sketch/BitArray.java:95 — common/sketch/src/main/java/org/apache/spark/util/sketch/BitArray.java:95-102 | sql/catalyst/src/main/java/org/apache/spark/sql/vectorized/ColumnVector.java:164-170 — 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) core/src/main/scala/org/apache/spark/rdd/RDD.scala:813 — core/src/main/scala/org/apache/spark/rdd/RDD.scala:813-819 | core/src/main/scala/org/apache/spark/rdd/RDDBarrier.scala:47-55 — 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) mllib/src/main/scala/org/apache/spark/ml/attribute/AttributeGroup.scala:179 — mllib/src/main/scala/org/apache/spark/ml/attribute/AttributeGroup.scala:179-185 | mllib/src/main/scala/org/apache/spark/ml/attribute/attributes.scala:559-565 — 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) python/pyspark/ml/common.py:61 — python/pyspark/ml/common.py:61-67 | python/pyspark/mllib/common.py:63-69 — 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) sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala:2038 — sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala:2038-2044 | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/PartitioningUtils.scala:599-605 — 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) sql/core/src/main/scala/org/apache/spark/sql/execution/columnar/InMemoryTableScanExec.scala:56 — sql/core/src/main/scala/org/apache/spark/sql/execution/columnar/InMemoryTableScanExec.scala:56-62 | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFileFormat.scala:180-188 — 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) REDACTED:3099 — REDACTED:3099-3105 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/complexTypeExtractors.scala:375-381 — 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) sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/OffHeapColumnVector.java:191 — sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/OffHeapColumnVector.java:191-197 | sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/OnHeapColumnVector.java:189-195 — 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) sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/OffHeapColumnVector.java:242 — sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/OffHeapColumnVector.java:242-248 | sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/OnHeapColumnVector.java:238-244 — 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.
D4 · Code Duplication · Edited copy of a member (6 corresponding lines) · ×21
  • Edited copy of a member (6 corresponding lines) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala:1492 — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala:1492-1497 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala:1513-1518 — 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) python/pyspark/ml/pipeline.py:205 — python/pyspark/ml/pipeline.py:205-210 | python/pyspark/ml/pipeline.py:240-245 — 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/HandleIdentifier.java:44 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/HandleIdentifier.java:44-49 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/HandleIdentifier.java:44-49 — 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) core/src/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala:755 — core/src/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala:755-760 | core/src/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala:766-773 — 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) python/pyspark/mllib/classification.py:638 — python/pyspark/mllib/classification.py:638-647 | python/pyspark/mllib/regression.py:665-670 — 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) REDACTED:303 — REDACTED:303-308 | REDACTED:314-319 — 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) core/src/main/scala/org/apache/spark/api/java/JavaRDDLike.scala:173 — core/src/main/scala/org/apache/spark/api/java/JavaRDDLike.scala:173-178 | core/src/main/scala/org/apache/spark/api/java/JavaRDDLike.scala:195-201 — 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) sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerPage.scala:187 — sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerPage.scala:187-192 | sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerSessionPage.scala:158-163 — 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) external/kafka-0-10/src/main/scala/org/apache/spark/streaming/kafka010/ConsumerStrategy.scala:240 — external/kafka-0-10/src/main/scala/org/apache/spark/streaming/kafka010/ConsumerStrategy.scala:240-245 | external/kafka-0-10/src/main/scala/org/apache/spark/streaming/kafka010/ConsumerStrategy.scala:403-408 — 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) core/src/main/scala/org/apache/spark/api/java/JavaSparkContext.scala:387 — core/src/main/scala/org/apache/spark/api/java/JavaSparkContext.scala:387-392 | core/src/main/scala/org/apache/spark/api/java/JavaSparkContext.scala:437-442 — 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) mllib/src/main/scala/org/apache/spark/ml/feature/ChiSqSelector.scala:318 — mllib/src/main/scala/org/apache/spark/ml/feature/ChiSqSelector.scala:318-323 | mllib/src/main/scala/org/apache/spark/ml/feature/RFormula.scala:497-504 — 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) external/kinesis-asl/src/main/scala/org/apache/spark/streaming/kinesis/KinesisBackedBlockRDD.scala:96 — external/kinesis-asl/src/main/scala/org/apache/spark/streaming/kinesis/KinesisBackedBlockRDD.scala:96-101 | streaming/src/main/scala/org/apache/spark/streaming/rdd/WriteAheadLogBackedBlockRDD.scala:101-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) external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaSource.scala:343 — external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaSource.scala:343-349 | external/kafka-0-10/src/main/scala/org/apache/spark/streaming/kafka010/KafkaRDD.scala:143-148 — 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) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFileFormat.scala:135 — sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFileFormat.scala:135-140 | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFileFormat.scala:170-175 — 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) core/src/main/scala/org/apache/spark/api/java/JavaPairRDD.scala:523 — core/src/main/scala/org/apache/spark/api/java/JavaPairRDD.scala:523-528 | streaming/src/main/scala/org/apache/spark/streaming/api/java/JavaPairDStream.scala:753-759 — 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) core/src/main/scala/org/apache/spark/api/java/JavaPairRDD.scala:649 — core/src/main/scala/org/apache/spark/api/java/JavaPairRDD.scala:649-654 | streaming/src/main/scala/org/apache/spark/streaming/api/java/JavaPairDStream.scala:737-743 — 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) sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/OffHeapColumnVector.java:148 — sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/OffHeapColumnVector.java:148-153 | sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/OnHeapColumnVector.java:143-148 — 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) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/CostBasedJoinReorder.scala:186 — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/CostBasedJoinReorder.scala:186-191 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlan.scala:140-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) core/src/main/scala/org/apache/spark/api/java/JavaPairRDD.scala:633 — core/src/main/scala/org/apache/spark/api/java/JavaPairRDD.scala:633-638 | streaming/src/main/scala/org/apache/spark/streaming/api/java/JavaPairDStream.scala:721-727 — 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetSchemasOperation.java:47 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetSchemasOperation.java:47-52 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/GetSchemasOperation.java:47-52 — 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) python/pyspark/sql/column.py:91 — python/pyspark/sql/column.py:91-96 | python/pyspark/sql/functions.py:59-69 — 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.
D4 · Code Duplication · Edited copy of a member (13 corresponding lines) · ×20
  • Edited copy of a member (13 corresponding lines) mllib/src/main/scala/org/apache/spark/mllib/clustering/KMeansModel.scala:164 — mllib/src/main/scala/org/apache/spark/mllib/clustering/KMeansModel.scala:164-176 | mllib/src/main/scala/org/apache/spark/mllib/clustering/KMeansModel.scala:198-212 — 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) mllib/src/main/scala/org/apache/spark/mllib/clustering/GaussianMixtureModel.scala:143 — mllib/src/main/scala/org/apache/spark/mllib/clustering/GaussianMixtureModel.scala:143-156 | mllib/src/main/scala/org/apache/spark/mllib/feature/ChiSqSelector.scala:135-147 — 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) sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/OffHeapColumnVector.java:288 — sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/OffHeapColumnVector.java:288-300 | sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/OffHeapColumnVector.java:360-372 — 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) mllib/src/main/scala/org/apache/spark/mllib/classification/impl/GLMClassificationModel.scala:53 — mllib/src/main/scala/org/apache/spark/mllib/classification/impl/GLMClassificationModel.scala:53-65 | mllib/src/main/scala/org/apache/spark/mllib/regression/impl/GLMRegressionModel.scala:49-61 — 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/ExecuteStatementOperation.java:48 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/ExecuteStatementOperation.java:48-60 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/ExecuteStatementOperation.java:45-58 — 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) sql/core/src/main/scala/org/apache/spark/sql/KeyValueGroupedDataset.scala:243 — sql/core/src/main/scala/org/apache/spark/sql/KeyValueGroupedDataset.scala:243-255 | sql/core/src/main/scala/org/apache/spark/sql/KeyValueGroupedDataset.scala:279-291 — 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) mllib/src/main/scala/org/apache/spark/ml/r/LDAWrapper.scala:209 — mllib/src/main/scala/org/apache/spark/ml/r/LDAWrapper.scala:209-222 | mllib/src/main/scala/org/apache/spark/ml/r/NaiveBayesWrapper.scala:112-124 — 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) sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeRow.java:354 — sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeRow.java:354-366 | sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/WritableColumnVector.java:349-362 — 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) graphx/src/main/scala/org/apache/spark/graphx/impl/ReplicatedVertexView.scala:87 — graphx/src/main/scala/org/apache/spark/graphx/impl/ReplicatedVertexView.scala:87-99 | graphx/src/main/scala/org/apache/spark/graphx/impl/ReplicatedVertexView.scala:106-119 — 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/HiveCommandOperation.java:151 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/HiveCommandOperation.java:151-163 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/HiveCommandOperation.java:151-163 — 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) external/kinesis-asl/src/main/scala/org/apache/spark/streaming/kinesis/KinesisUtils.scala:125 — external/kinesis-asl/src/main/scala/org/apache/spark/streaming/kinesis/KinesisUtils.scala:125-137 | external/kinesis-asl/src/main/scala/org/apache/spark/streaming/kinesis/KinesisUtils.scala:191-207 — 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) common/network-common/src/main/java/org/apache/spark/network/client/TransportClient.java:187 — common/network-common/src/main/java/org/apache/spark/network/client/TransportClient.java:187-200 | common/network-common/src/main/java/org/apache/spark/network/client/TransportClient.java:216-228 — 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) common/network-common/src/main/java/org/apache/spark/network/crypto/ClientChallenge.java:84 — common/network-common/src/main/java/org/apache/spark/network/crypto/ClientChallenge.java:84-99 | common/network-common/src/main/java/org/apache/spark/network/crypto/ServerResponse.java:71-83 — 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) core/src/main/java/org/apache/spark/shuffle/sort/ShuffleInMemorySorter.java:114 — core/src/main/java/org/apache/spark/shuffle/sort/ShuffleInMemorySorter.java:114-126 | core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeInMemorySorter.java:215-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) core/src/main/scala/org/apache/spark/api/python/PythonRunner.scala:557 — core/src/main/scala/org/apache/spark/api/python/PythonRunner.scala:557-571 | sql/core/src/main/scala/org/apache/spark/sql/execution/python/PythonUDFRunner.scala:42-54 — 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) mllib/src/main/scala/org/apache/spark/ml/stat/Summarizer.scala:541 — mllib/src/main/scala/org/apache/spark/ml/stat/Summarizer.scala:541-554 | mllib/src/main/scala/org/apache/spark/mllib/stat/MultivariateOnlineSummarizer.scala:285-297 — 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) mllib/src/main/scala/org/apache/spark/ml/tree/Node.scala:399 — mllib/src/main/scala/org/apache/spark/ml/tree/Node.scala:399-411 | mllib/src/main/scala/org/apache/spark/mllib/tree/model/Node.scala:233-245 — 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) mllib/src/main/scala/org/apache/spark/mllib/tree/impurity/Impurity.scala:120 — mllib/src/main/scala/org/apache/spark/mllib/tree/impurity/Impurity.scala:120-132 | mllib/src/main/scala/org/apache/spark/mllib/tree/impurity/Impurity.scala:138-150 — 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) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Expression.scala:538 — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Expression.scala:538-550 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/higherOrderFunctions.scala:705-717 — 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) python/pyspark/mllib/stat/_statistics.py:247 — python/pyspark/mllib/stat/_statistics.py:247-301 | python/pyspark/mllib/clustering.py:977-989 — 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.
D4 · Code Duplication · Edited copy of a member (10 corresponding lines) · ×20
  • Edited copy of a member (10 corresponding lines) mllib/src/main/scala/org/apache/spark/ml/attribute/attributes.scala:311 — mllib/src/main/scala/org/apache/spark/ml/attribute/attributes.scala:311-320 | mllib/src/main/scala/org/apache/spark/ml/attribute/attributes.scala:476-486 — 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) mllib/src/main/scala/org/apache/spark/mllib/clustering/KMeansModel.scala:153 — mllib/src/main/scala/org/apache/spark/mllib/clustering/KMeansModel.scala:153-162 | mllib/src/main/scala/org/apache/spark/mllib/clustering/KMeansModel.scala:185-196 — 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) core/src/main/scala/org/apache/spark/api/python/PythonRDD.scala:565 — core/src/main/scala/org/apache/spark/api/python/PythonRDD.scala:565-575 | core/src/main/scala/org/apache/spark/api/python/PythonRDD.scala:595-604 — 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) core/src/main/scala/org/apache/spark/executor/CoarseGrainedExecutorBackend.scala:235 — core/src/main/scala/org/apache/spark/executor/CoarseGrainedExecutorBackend.scala:235-244 | resource-managers/yarn/src/main/scala/org/apache/spark/executor/YarnCoarseGrainedExecutorBackend.scala:67-78 — 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) core/src/main/scala/org/apache/spark/api/python/PythonRDD.scala:352 — core/src/main/scala/org/apache/spark/api/python/PythonRDD.scala:352-361 | core/src/main/scala/org/apache/spark/api/python/PythonRDD.scala:421-430 — 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) core/src/main/scala/org/apache/spark/deploy/JsonProtocol.scala:78 — core/src/main/scala/org/apache/spark/deploy/JsonProtocol.scala:78-88 | core/src/main/scala/org/apache/spark/deploy/JsonProtocol.scala:141-150 — 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) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcUtils.scala:49 — sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcUtils.scala:49-58 | sql/hive/src/main/scala/org/apache/spark/sql/hive/orc/OrcFileOperator.scala:128-138 — 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) REDACTED:50 — REDACTED:50-59 | REDACTED:1127-1137 — 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) streaming/src/main/scala/org/apache/spark/streaming/dstream/PairDStreamFunctions.scala:759 — streaming/src/main/scala/org/apache/spark/streaming/dstream/PairDStreamFunctions.scala:759-768 | streaming/src/main/scala/org/apache/spark/streaming/dstream/PairDStreamFunctions.scala:793-802 — 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) graphx/src/main/scala/org/apache/spark/graphx/impl/VertexPartitionBaseOps.scala:56 — graphx/src/main/scala/org/apache/spark/graphx/impl/VertexPartitionBaseOps.scala:56-65 | graphx/src/main/scala/org/apache/spark/graphx/impl/VertexPartitionBaseOps.scala:76-88 — 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) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/arithmetic.scala:574 — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/arithmetic.scala:574-583 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/arithmetic.scala:647-656 — 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) mllib/src/main/scala/org/apache/spark/ml/tuning/CrossValidator.scala:189 — mllib/src/main/scala/org/apache/spark/ml/tuning/CrossValidator.scala:189-198 | mllib/src/main/scala/org/apache/spark/ml/tuning/TrainValidationSplit.scala:185-194 — 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) graphx/src/main/scala/org/apache/spark/graphx/impl/VertexRDDImpl.scala:153 — graphx/src/main/scala/org/apache/spark/graphx/impl/VertexRDDImpl.scala:153-162 | graphx/src/main/scala/org/apache/spark/graphx/impl/VertexRDDImpl.scala:184-193 — 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) sql/core/src/main/scala/org/apache/spark/sql/Column.scala:492 — sql/core/src/main/scala/org/apache/spark/sql/Column.scala:492-501 | sql/core/src/main/scala/org/apache/spark/sql/Column.scala:524-533 — 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) sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/server/SparkSQLOperationManager.scala:84 — sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/server/SparkSQLOperationManager.scala:84-93 | sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/server/SparkSQLOperationManager.scala:100-109 — 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) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/JavaTypeInference.scala:198 — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/JavaTypeInference.scala:198-208 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/ScalaReflection.scala:161-170 — 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) sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/WritableColumnVector.java:68 — sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/WritableColumnVector.java:68-81 | sql/catalyst/src/main/java/org/apache/spark/sql/vectorized/ArrowColumnVector.java:51-60 — 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) mllib/src/main/scala/org/apache/spark/ml/clustering/GaussianMixture.scala:244 — mllib/src/main/scala/org/apache/spark/ml/clustering/GaussianMixture.scala:244-255 | mllib/src/main/scala/org/apache/spark/mllib/clustering/GaussianMixtureModel.scala:116-125 — 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) sql/catalyst/src/main/java/org/apache/spark/sql/catalog/v2/IdentifierImpl.java:70 — sql/catalyst/src/main/java/org/apache/spark/sql/catalog/v2/IdentifierImpl.java:70-81 | sql/catalyst/src/main/java/org/apache/spark/sql/util/CaseInsensitiveStringMap.java:184-193 — 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) examples/src/main/scala/org/apache/spark/examples/streaming/RecoverableNetworkWordCount.scala:59 — examples/src/main/scala/org/apache/spark/examples/streaming/RecoverableNetworkWordCount.scala:59-68 | resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/SparkRackResolver.scala:108-117 — 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.
D4 · Code Duplication · Edited copy of a member (11 corresponding lines) · ×20
  • Edited copy of a member (11 corresponding lines) mllib/src/main/scala/org/apache/spark/ml/attribute/attributes.scala:251 — mllib/src/main/scala/org/apache/spark/ml/attribute/attributes.scala:251-262 | mllib/src/main/scala/org/apache/spark/ml/attribute/attributes.scala:430-440 — 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/ColumnBasedSet.java:85 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/ColumnBasedSet.java:85-95 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/ColumnBasedSet.java:134-144 — 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) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala:1087 — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala:1087-1097 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala:1125-1142 — 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) core/src/main/scala/org/apache/spark/deploy/JsonProtocol.scala:48 — core/src/main/scala/org/apache/spark/deploy/JsonProtocol.scala:48-61 | core/src/main/scala/org/apache/spark/deploy/JsonProtocol.scala:208-218 — 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) sql/core/src/main/scala/org/apache/spark/sql/execution/joins/HashJoin.scala:150 — sql/core/src/main/scala/org/apache/spark/sql/execution/joins/HashJoin.scala:150-160 | sql/core/src/main/scala/org/apache/spark/sql/execution/joins/HashJoin.scala:164-177 — 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) sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveShim.scala:1290 — sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveShim.scala:1290-1300 | sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveShim.scala:1309-1320 — 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) sql/core/src/main/scala/org/apache/spark/sql/execution/joins/HashedRelation.scala:678 — sql/core/src/main/scala/org/apache/spark/sql/execution/joins/HashedRelation.scala:678-688 | sql/core/src/main/scala/org/apache/spark/sql/execution/joins/HashedRelation.scala:717-729 — 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) python/pyspark/mllib/recommendation.py:320 — python/pyspark/mllib/recommendation.py:320-330 | python/pyspark/sql/types.py:1854-1864 — 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) streaming/src/main/scala/org/apache/spark/streaming/dstream/DStream.scala:674 — streaming/src/main/scala/org/apache/spark/streaming/dstream/DStream.scala:674-684 | streaming/src/main/scala/org/apache/spark/streaming/dstream/DStream.scala:706-718 — 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) streaming/src/main/scala/org/apache/spark/streaming/util/StateMap.scala:125 — streaming/src/main/scala/org/apache/spark/streaming/util/StateMap.scala:125-136 | streaming/src/main/scala/org/apache/spark/streaming/util/StateMap.scala:139-149 — 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) core/src/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala:260 — core/src/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala:260-270 | core/src/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala:290-300 — 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) core/src/main/scala/org/apache/spark/util/ClosureCleaner.scala:37 — core/src/main/scala/org/apache/spark/util/ClosureCleaner.scala:37-48 | graphx/src/main/scala/org/apache/spark/graphx/util/BytecodeUtils.scala:81-91 — 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) mllib/src/main/scala/org/apache/spark/ml/stat/Summarizer.scala:453 — mllib/src/main/scala/org/apache/spark/ml/stat/Summarizer.scala:453-464 | mllib/src/main/scala/org/apache/spark/mllib/stat/MultivariateOnlineSummarizer.scala:186-196 — 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) mllib/src/main/scala/org/apache/spark/ml/tree/impl/GradientBoostedTrees.scala:136 — mllib/src/main/scala/org/apache/spark/ml/tree/impl/GradientBoostedTrees.scala:136-146 | mllib/src/main/scala/org/apache/spark/mllib/tree/model/treeEnsembleModels.scala:220-230 — 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/CompositeService.java:97 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/CompositeService.java:97-107 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/CompositeService.java:97-107 — 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) core/src/main/scala/org/apache/spark/util/io/ChunkedByteBuffer.scala:233 — core/src/main/scala/org/apache/spark/util/io/ChunkedByteBuffer.scala:233-243 | core/src/main/scala/org/apache/spark/util/io/ChunkedByteBuffer.scala:245-257 — 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:174 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:174-184 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:176-186 — 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) sql/core/src/main/scala/org/apache/spark/sql/execution/DataSourceScanExec.scala:90 — sql/core/src/main/scala/org/apache/spark/sql/execution/DataSourceScanExec.scala:90-101 | sql/core/src/main/scala/org/apache/spark/sql/execution/ExistingRDD.scala:147-157 — 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) sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/VariableLengthRowBasedKeyValueBatch.java:77 — sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/VariableLengthRowBasedKeyValueBatch.java:77-88 | sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/FixedLengthRowBasedKeyValueBatch.java:74-84 — 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) python/pyspark/ml/classification.py:2047 — python/pyspark/ml/classification.py:2047-2059 | python/pyspark/ml/pipeline.py:119-129 — 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.
D4 · Code Duplication · Edited copy of a member (5 corresponding lines) · ×20
  • Edited copy of a member (5 corresponding lines) core/src/main/scala/org/apache/spark/api/java/JavaRDDLike.scala:142 — core/src/main/scala/org/apache/spark/api/java/JavaRDDLike.scala:142-146 | streaming/src/main/scala/org/apache/spark/streaming/api/java/JavaDStreamLike.scala:179-183 — 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) core/src/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala:448 — core/src/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala:448-453 | core/src/main/scala/org/apache/spark/rdd/RDD.scala:1300-1304 — 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) mllib/src/main/scala/org/apache/spark/ml/Predictor.scala:151 — mllib/src/main/scala/org/apache/spark/ml/Predictor.scala:151-155 | mllib/src/main/scala/org/apache/spark/ml/classification/Classifier.scala:79-86 — 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) core/src/main/scala/org/apache/spark/rdd/ShuffledRDD.scala:96 — core/src/main/scala/org/apache/spark/rdd/ShuffledRDD.scala:96-100 | sql/core/src/main/scala/org/apache/spark/sql/execution/ShuffledRowRDD.scala:151-155 — 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) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:532 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:532-536 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala:502-506 — 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) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:546 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:546-550 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala:516-520 — 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) mllib/src/main/scala/org/apache/spark/ml/Transformer.scala:119 — mllib/src/main/scala/org/apache/spark/ml/Transformer.scala:119-123 | mllib/src/main/scala/org/apache/spark/ml/feature/LSH.scala: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) mllib/src/main/scala/org/apache/spark/mllib/evaluation/MulticlassMetrics.scala:147 — mllib/src/main/scala/org/apache/spark/mllib/evaluation/MulticlassMetrics.scala:147-151 | mllib/src/main/scala/org/apache/spark/mllib/evaluation/MultilabelMetrics.scala:99-103 — 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) core/src/main/scala/org/apache/spark/ExecutorAllocationManager.scala:706 — core/src/main/scala/org/apache/spark/ExecutorAllocationManager.scala:706-710 | streaming/src/main/scala/org/apache/spark/streaming/StreamingSource.scala:40-44 — 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) mllib/src/main/scala/org/apache/spark/mllib/clustering/StreamingKMeans.scala:323 — mllib/src/main/scala/org/apache/spark/mllib/clustering/StreamingKMeans.scala:323-327 | mllib/src/main/scala/org/apache/spark/mllib/regression/StreamingLinearAlgorithm.scala:156-160 — 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) mllib/src/main/scala/org/apache/spark/mllib/tree/DecisionTree.scala:230 — mllib/src/main/scala/org/apache/spark/mllib/tree/DecisionTree.scala:230-234 | mllib/src/main/scala/org/apache/spark/mllib/tree/RandomForest.scala:188-192 — 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) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:502 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:502-506 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala:472-476 — 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) common/network-common/src/main/java/org/apache/spark/network/protocol/StreamFailure.java:49 — common/network-common/src/main/java/org/apache/spark/network/protocol/StreamFailure.java:49-53 | common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/protocol/RegisterExecutor.java:88-93 — 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) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:489 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:489-493 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala:459-463 — 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) mllib/src/main/scala/org/apache/spark/mllib/tree/DecisionTree.scala:273 — mllib/src/main/scala/org/apache/spark/mllib/tree/DecisionTree.scala:273-277 | mllib/src/main/scala/org/apache/spark/mllib/tree/RandomForest.scala:274-278 — 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) sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeArrayData.java:501 — sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeArrayData.java:501-506 | sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeMapData.java:139-143 — 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) sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeArrayData.java:519 — sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeArrayData.java:519-524 | sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeMapData.java:155-159 — 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) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/orc/OrcPartitionReaderFactory.scala:62 — sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/orc/OrcPartitionReaderFactory.scala:62-66 | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/parquet/ParquetPartitionReaderFactory.scala:78-82 — 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) common/network-common/src/main/java/org/apache/spark/network/protocol/StreamResponse.java:62 — common/network-common/src/main/java/org/apache/spark/network/protocol/StreamResponse.java:62-66 | common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/protocol/mesos/RegisterDriver.java:72-76 — 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) mllib/src/main/scala/org/apache/spark/ml/feature/RFormulaParser.scala:303 — mllib/src/main/scala/org/apache/spark/ml/feature/RFormulaParser.scala:303-307 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/LegacyTypeStringParser.scala:87-91 — 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.
D4 · Code Duplication · Edited copy of a member (15 corresponding lines) · ×19
  • Edited copy of a member (15 corresponding lines) streaming/src/main/scala/org/apache/spark/streaming/rdd/MapWithStateRDD.scala:191 — streaming/src/main/scala/org/apache/spark/streaming/rdd/MapWithStateRDD.scala:191-205 | streaming/src/main/scala/org/apache/spark/streaming/rdd/MapWithStateRDD.scala:210-227 — 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) mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:397 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:397-411 | mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala:379-393 — 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) mllib/src/main/scala/org/apache/spark/mllib/classification/impl/GLMClassificationModel.scala:74 — mllib/src/main/scala/org/apache/spark/mllib/classification/impl/GLMClassificationModel.scala:74-92 | mllib/src/main/scala/org/apache/spark/mllib/regression/impl/GLMRegressionModel.scala:69-83 — 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) mllib/src/main/scala/org/apache/spark/mllib/tree/model/treeEnsembleModels.scala:81 — mllib/src/main/scala/org/apache/spark/mllib/tree/model/treeEnsembleModels.scala:81-95 | mllib/src/main/scala/org/apache/spark/mllib/tree/model/treeEnsembleModels.scala:238-252 — 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) graphx/src/main/scala/org/apache/spark/graphx/impl/VertexPartitionBaseOps.scala:129 — graphx/src/main/scala/org/apache/spark/graphx/impl/VertexPartitionBaseOps.scala:129-144 | graphx/src/main/scala/org/apache/spark/graphx/impl/VertexPartitionBaseOps.scala:156-170 — 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) core/src/main/scala/org/apache/spark/rdd/CoGroupedRDD.scala:111 — core/src/main/scala/org/apache/spark/rdd/CoGroupedRDD.scala:111-126 | core/src/main/scala/org/apache/spark/rdd/SubtractedRDD.scala:71-85 — 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) mllib/src/main/scala/org/apache/spark/ml/tree/impl/GradientBoostedTrees.scala:46 — mllib/src/main/scala/org/apache/spark/ml/tree/impl/GradientBoostedTrees.scala:46-60 | mllib/src/main/scala/org/apache/spark/ml/tree/impl/GradientBoostedTrees.scala:79-96 — 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) common/network-common/src/main/java/org/apache/spark/network/sasl/SparkSaslClient.java:52 — common/network-common/src/main/java/org/apache/spark/network/sasl/SparkSaslClient.java:52-66 | common/network-common/src/main/java/org/apache/spark/network/sasl/SparkSaslServer.java:80-98 — 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) mllib/src/main/scala/org/apache/spark/mllib/regression/IsotonicRegression.scala:212 — mllib/src/main/scala/org/apache/spark/mllib/regression/IsotonicRegression.scala:212-227 | mllib/src/main/scala/org/apache/spark/mllib/tree/model/DecisionTreeModel.scala:314-328 — 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) core/src/main/scala/org/apache/spark/ui/jobs/JobsTab.scala:47 — core/src/main/scala/org/apache/spark/ui/jobs/JobsTab.scala:47-61 | core/src/main/scala/org/apache/spark/ui/jobs/StagesTab.scala:47-62 — 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) mllib/src/main/scala/org/apache/spark/ml/optim/WeightedLeastSquares.scala:476 — mllib/src/main/scala/org/apache/spark/ml/optim/WeightedLeastSquares.scala:476-490 | mllib/src/main/scala/org/apache/spark/ml/optim/WeightedLeastSquares.scala:495-509 — 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) graphx/src/main/scala/org/apache/spark/graphx/impl/VertexRDDImpl.scala:167 — graphx/src/main/scala/org/apache/spark/graphx/impl/VertexRDDImpl.scala:167-181 | graphx/src/main/scala/org/apache/spark/graphx/impl/VertexRDDImpl.scala:196-210 — 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) core/src/main/scala/org/apache/spark/storage/DiskStore.scala:172 — core/src/main/scala/org/apache/spark/storage/DiskStore.scala:172-186 | core/src/main/scala/org/apache/spark/storage/DiskStore.scala:222-240 — 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) REDACTED:259 — REDACTED:259-273 | REDACTED:270-284 — 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) python/pyspark/rdd.py:2386 — python/pyspark/rdd.py:2386-2400 | python/pyspark/rdd.py:2403-2417 — 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) resource-managers/mesos/src/main/scala/org/apache/spark/scheduler/cluster/mesos/MesosClusterScheduler.scala:446 — resource-managers/mesos/src/main/scala/org/apache/spark/scheduler/cluster/mesos/MesosClusterScheduler.scala:446-461 | resource-managers/mesos/src/main/scala/org/apache/spark/scheduler/cluster/mesos/MesosCoarseGrainedSchedulerBackend.scala:447-461 — 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) sql/core/src/main/scala/org/apache/spark/sql/execution/columnar/compression/compressionSchemes.scala:675 — sql/core/src/main/scala/org/apache/spark/sql/execution/columnar/compression/compressionSchemes.scala:675-689 | sql/core/src/main/scala/org/apache/spark/sql/execution/columnar/compression/compressionSchemes.scala:781-795 — 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) core/src/main/scala/org/apache/spark/SparkContext.scala:1856 — core/src/main/scala/org/apache/spark/SparkContext.scala:1856-1870 | sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/continuous/ContinuousExecution.scala:405-419 — 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) examples/src/main/java/org/apache/spark/examples/sql/JavaSQLDataSourceExample.java:93 — examples/src/main/java/org/apache/spark/examples/sql/JavaSQLDataSourceExample.java:93-107 | examples/src/main/java/org/apache/spark/examples/sql/JavaSparkSQLExample.java:88-103 — 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 (9 corresponding lines) · ×19
  • Edited copy of a member (9 corresponding lines) streaming/src/main/scala/org/apache/spark/streaming/api/java/JavaStreamingContext.scala:468 — streaming/src/main/scala/org/apache/spark/streaming/api/java/JavaStreamingContext.scala:468-476 | streaming/src/main/scala/org/apache/spark/streaming/api/java/JavaStreamingContext.scala:491-501 — 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) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/mathExpressions.scala:247 — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/mathExpressions.scala:247-255 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/mathExpressions.scala:378-386 — 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) resource-managers/mesos/src/main/scala/org/apache/spark/deploy/mesos/ui/MesosClusterPage.scala:68 — resource-managers/mesos/src/main/scala/org/apache/spark/deploy/mesos/ui/MesosClusterPage.scala:68-76 | resource-managers/mesos/src/main/scala/org/apache/spark/deploy/mesos/ui/MesosClusterPage.scala:112-122 — 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) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:663 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:663-671 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala:643-651 — 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) python/pyspark/join.py:45 — python/pyspark/join.py:45-53 | python/pyspark/join.py:85-97 — 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) sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/OnHeapColumnVector.java:283 — sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/OnHeapColumnVector.java:283-291 | sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/OnHeapColumnVector.java:349-357 — 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) core/src/main/scala/org/apache/spark/util/Utils.scala:1724 — core/src/main/scala/org/apache/spark/util/Utils.scala:1724-1732 | core/src/main/scala/org/apache/spark/util/Utils.scala:1738-1746 — 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) core/src/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala:560 — core/src/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala:560-568 | core/src/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala:577-585 — 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/server/ThreadWithGarbageCleanup.java:68 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/server/ThreadWithGarbageCleanup.java:68-76 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/server/ThreadWithGarbageCleanup.java:68-76 — 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) mllib/src/main/scala/org/apache/spark/ml/classification/DecisionTreeClassifier.scala:299 — mllib/src/main/scala/org/apache/spark/ml/classification/DecisionTreeClassifier.scala:299-308 | mllib/src/main/scala/org/apache/spark/ml/regression/DecisionTreeRegressor.scala:300-308 — 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/TypeDescriptor.java:52 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/TypeDescriptor.java:52-60 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/TypeDescriptor.java:53-61 — 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:717 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:717-725 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:731-739 — 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) external/kinesis-asl/src/main/scala/org/apache/spark/examples/streaming/KinesisExampleUtils.scala:26 — external/kinesis-asl/src/main/scala/org/apache/spark/examples/streaming/KinesisExampleUtils.scala:26-34 | external/kinesis-asl/src/main/scala/org/apache/spark/streaming/kinesis/KinesisTestUtils.scala:207-215 — 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) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/interface.scala:455 — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/interface.scala:455-463 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/Statistics.scala:115-123 — 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) sql/core/src/main/scala/org/apache/spark/sql/execution/joins/SortMergeJoinExec.scala:68 — sql/core/src/main/scala/org/apache/spark/sql/execution/joins/SortMergeJoinExec.scala:68-79 | sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/StreamingSymmetricHashJoinExec.scala:180-188 — 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) python/pyspark/ml/linalg/__init__.py:1162 — python/pyspark/ml/linalg/__init__.py:1162-1170 | python/pyspark/mllib/linalg/__init__.py:1374-1383 — 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) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/CSVUtils.scala:107 — sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/CSVUtils.scala:107-115 | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/json/JsonUtils.scala:29-37 — 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) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/CSVUtils.scala:120 — sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/CSVUtils.scala:120-128 | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/json/JsonUtils.scala:42-50 — 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) sql/catalyst/src/main/scala/org/apache/spark/sql/Row.scala:383 — sql/catalyst/src/main/scala/org/apache/spark/sql/Row.scala:383-391 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/InternalRow.scala:67-75 — 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.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×19
  • Duplicated block (15 lines × 2) sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerPage.scala:77 — sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerPage.scala:77-91 | sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerSessionPage.scala:86-100 — before extracting anything, compare `sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerPage.scala` and `sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerSessionPage.scala` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 66 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerPage.scala:77` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:51 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:51-65 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala:62-76 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 357 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (15 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:404 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:404-418 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:426-440 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 187 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (15 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/CLIService.java:147 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/CLIService.java:147-161 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java:148-162 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/CLIService.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 195 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (15 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/OperationHandle.java:81 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/OperationHandle.java:81-95 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/OperationHandle.java:81-95 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/OperationHandle.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/OperationHandle.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (15 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetColumnsOperation.java:159 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetColumnsOperation.java:159-173 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/GetColumnsOperation.java:175-189 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetColumnsOperation.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/GetColumnsOperation.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetColumnsOperation.java:159` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/OperationManager.java:183 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/OperationManager.java:183-197 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/OperationManager.java:207-221 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/OperationManager.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/OperationManager.java` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 81 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (15 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:373 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:373-387 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:376-390 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 435 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (15 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:487 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:487-501 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:501-515 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 435 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 (15 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:507 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:507-521 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:521-535 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 435 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 (15 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:570 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:570-584 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:584-598 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 435 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 (15 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:256 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:256-270 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:267-281 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 224 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 `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.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. 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:372 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:372-386 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:383-397 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 224 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (15 lines × 2) REDACTED:282 — REDACTED:282-296 | REDACTED:293-307 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 325 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (15 lines × 2) REDACTED:318 — REDACTED:318-332 | REDACTED:329-343 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 325 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (15 lines × 2) REDACTED:527 — REDACTED:527-541 | REDACTED:548-562 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 325 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (15 lines × 2) python/pyspark/ml/common.py:71 — python/pyspark/ml/common.py:71-85 | python/pyspark/mllib/common.py:73-87 — `python/pyspark/ml/common.py` and `python/pyspark/mllib/common.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 2 separate duplicated blocks between them, totalling at least 29 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (15 lines × 2) examples/src/main/scala/org/apache/spark/examples/ml/LinearRegressionExample.scala:54 — examples/src/main/scala/org/apache/spark/examples/ml/LinearRegressionExample.scala:54-68 | examples/src/main/scala/org/apache/spark/examples/ml/LogisticRegressionExample.scala:59-73 — before extracting anything, compare `examples/src/main/scala/org/apache/spark/examples/ml/LinearRegressionExample.scala` and `examples/src/main/scala/org/apache/spark/examples/ml/LogisticRegressionExample.scala` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `examples/src/main/scala/org/apache/spark/examples/ml/LinearRegressionExample.scala:54` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) examples/src/main/java/org/apache/spark/examples/mllib/JavaPCAExample.java:41 — examples/src/main/java/org/apache/spark/examples/mllib/JavaPCAExample.java:41-55 | examples/src/main/java/org/apache/spark/examples/mllib/JavaSVDExample.java:42-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.
D4 · Code Duplication · Edited copy of a member (12 corresponding lines) · ×17
  • Edited copy of a member (12 corresponding lines) mllib/src/main/scala/org/apache/spark/mllib/classification/NaiveBayes.scala:208 — mllib/src/main/scala/org/apache/spark/mllib/classification/NaiveBayes.scala:208-222 | mllib/src/main/scala/org/apache/spark/mllib/classification/NaiveBayes.scala:252-265 — 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) common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/ExternalShuffleBlockHandler.java:271 — common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/ExternalShuffleBlockHandler.java:271-282 | common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/ExternalShuffleBlockHandler.java:284-299 — 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) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/higherOrderFunctions.scala:579 — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/higherOrderFunctions.scala:579-591 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/higherOrderFunctions.scala:626-637 — 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) mllib/src/main/scala/org/apache/spark/ml/python/MLSerDe.scala:53 — mllib/src/main/scala/org/apache/spark/ml/python/MLSerDe.scala:53-64 | mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala:1391-1403 — 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) graphx/src/main/scala/org/apache/spark/graphx/impl/VertexPartitionBaseOps.scala:185 — graphx/src/main/scala/org/apache/spark/graphx/impl/VertexPartitionBaseOps.scala:185-196 | graphx/src/main/scala/org/apache/spark/graphx/impl/VertexPartitionBaseOps.scala:202-214 — 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) common/network-common/src/main/java/org/apache/spark/network/server/ChunkFetchRequestHandler.java:125 — common/network-common/src/main/java/org/apache/spark/network/server/ChunkFetchRequestHandler.java:125-136 | common/network-common/src/main/java/org/apache/spark/network/server/TransportRequestHandler.java:258-269 — 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) mllib/src/main/scala/org/apache/spark/ml/tuning/CrossValidator.scala:229 — mllib/src/main/scala/org/apache/spark/ml/tuning/CrossValidator.scala:229-240 | mllib/src/main/scala/org/apache/spark/ml/tuning/TrainValidationSplit.scala:223-234 — 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) python/pyspark/mllib/classification.py:739 — python/pyspark/mllib/classification.py:739-750 | python/pyspark/mllib/regression.py:815-826 — 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) core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala:103 — core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala:103-114 | core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala:119-130 — 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) python/pyspark/ml/param/__init__.py:432 — python/pyspark/ml/param/__init__.py:432-443 | python/pyspark/ml/param/__init__.py:453-465 — 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) mllib/src/main/scala/org/apache/spark/ml/attribute/attributes.scala:275 — mllib/src/main/scala/org/apache/spark/ml/attribute/attributes.scala:275-287 | mllib/src/main/scala/org/apache/spark/ml/attribute/attributes.scala:442-453 — 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) mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala:1586 — mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala:1586-1599 | mllib/src/main/scala/org/apache/spark/ml/python/MLSerDe.scala:204-215 — 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) sql/core/src/main/scala/org/apache/spark/sql/execution/columnar/ColumnType.scala:606 — sql/core/src/main/scala/org/apache/spark/sql/execution/columnar/ColumnType.scala:606-617 | sql/core/src/main/scala/org/apache/spark/sql/execution/columnar/ColumnType.scala:645-656 — 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:363 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:363-374 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:385-396 — 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) common/sketch/src/main/java/org/apache/spark/util/sketch/BloomFilterImpl.java:40 — common/sketch/src/main/java/org/apache/spark/util/sketch/BloomFilterImpl.java:40-52 | common/sketch/src/main/java/org/apache/spark/util/sketch/BloomFilterImpl.java:181-192 — 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:337 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:337-348 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:345-356 — 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:350 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:350-361 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:358-369 — 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.
D4 · Code Duplication · Edited copy of a member (4 corresponding lines) · ×17
  • Edited copy of a member (4 corresponding lines) python/pyspark/rdd.py:2502 — python/pyspark/rdd.py:2502-2507 | python/pyspark/sql/udf.py:34-37 — 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) core/src/main/scala/org/apache/spark/api/java/JavaRDDLike.scala:124 — core/src/main/scala/org/apache/spark/api/java/JavaRDDLike.scala:124-127 | streaming/src/main/scala/org/apache/spark/streaming/api/java/JavaDStreamLike.scala:170-173 — 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) python/pyspark/mllib/classification.py:477 — python/pyspark/mllib/classification.py:477-482 | python/pyspark/mllib/regression.py:187-190 — 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) core/src/main/scala/org/apache/spark/api/java/JavaRDDLike.scala:115 — core/src/main/scala/org/apache/spark/api/java/JavaRDDLike.scala:115-118 | streaming/src/main/scala/org/apache/spark/streaming/api/java/JavaDStreamLike.scala:161-164 — 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) python/pyspark/ml/linalg/__init__.py:1093 — python/pyspark/ml/linalg/__init__.py:1093-1096 | python/pyspark/mllib/linalg/__init__.py:1248-1251 — 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:398 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:398-401 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:420-423 — 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) python/pyspark/ml/linalg/__init__.py:884 — python/pyspark/ml/linalg/__init__.py:884-887 | python/pyspark/mllib/linalg/__init__.py:1028-1031 — 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) core/src/main/scala/org/apache/spark/scheduler/cluster/ExecutorInfo.scala:48 — core/src/main/scala/org/apache/spark/scheduler/cluster/ExecutorInfo.scala:48-51 | mllib/src/main/scala/org/apache/spark/ml/tree/Split.scala:183-186 — 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/PlainSaslHelper.java:68 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/PlainSaslHelper.java:68-71 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/auth/PlainSaslHelper.java:68-71 — 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) mllib/src/main/scala/org/apache/spark/ml/classification/GBTClassifier.scala:352 — mllib/src/main/scala/org/apache/spark/ml/classification/GBTClassifier.scala:352-355 | mllib/src/main/scala/org/apache/spark/ml/regression/GBTRegressor.scala:256-261 — 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) python/pyspark/ml/linalg/__init__.py:120 — python/pyspark/ml/linalg/__init__.py:120-123 | python/pyspark/mllib/linalg/__init__.py:122-125 — 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) python/pyspark/ml/linalg/__init__.py:131 — python/pyspark/ml/linalg/__init__.py:131-134 | python/pyspark/mllib/linalg/__init__.py:133-136 — 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/TableSchema.java:98 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/TableSchema.java:98-101 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/TableSchema.java:100-103 — 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:809 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:809-812 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:823-826 — 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) core/src/main/scala/org/apache/spark/api/java/JavaPairRDD.scala:861 — core/src/main/scala/org/apache/spark/api/java/JavaPairRDD.scala:861-864 | core/src/main/scala/org/apache/spark/api/java/JavaRDDLike.scala:628-631 — 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) mllib/src/main/scala/org/apache/spark/ml/clustering/BisectingKMeans.scala:95 — mllib/src/main/scala/org/apache/spark/ml/clustering/BisectingKMeans.scala:95-98 | mllib/src/main/scala/org/apache/spark/ml/clustering/KMeans.scala:112-115 — 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) examples/src/main/scala/org/apache/spark/examples/mllib/DecisionTreeRunner.scala:352 — examples/src/main/scala/org/apache/spark/examples/mllib/DecisionTreeRunner.scala:352-355 | examples/src/main/scala/org/apache/spark/examples/mllib/GradientBoostedTreesRunner.scala:151-154 — 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.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D3 · God Classes · MethodTooLong · ×16
  • MethodTooLong: LogisticRegression.train mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala:492 — MethodTooLong — train runs 256 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 156 over it, 2.56× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: DAGScheduler.handleTaskCompletion core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala:1341 — MethodTooLong — handleTaskCompletion runs 240 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 140 over it, 2.40× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: HiveInspectors.unwrapperFor sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveInspectors.scala:444 — MethodTooLong — unwrapperFor runs 205 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 105 over it, 2.05× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: LinearRegression.setSolver mllib/src/main/scala/org/apache/spark/ml/regression/LinearRegression.scala:284 — MethodTooLong — setSolver runs 192 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 92 over it, 1.92× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: LinearRegression.setAggregationDepth mllib/src/main/scala/org/apache/spark/ml/regression/LinearRegression.scala:296 — MethodTooLong — setAggregationDepth runs 189 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 89 over it, 1.89× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: LinearRegression.setLoss mllib/src/main/scala/org/apache/spark/ml/regression/LinearRegression.scala:306 — MethodTooLong — setLoss runs 186 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 86 over it, 1.86× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: LinearRegression.setEpsilon mllib/src/main/scala/org/apache/spark/ml/regression/LinearRegression.scala:316 — MethodTooLong — setEpsilon runs 183 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 83 over it, 1.83× 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: LinearRegression.train mllib/src/main/scala/org/apache/spark/ml/regression/LinearRegression.scala:320 — MethodTooLong — train runs 180 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 80 over it, 1.80× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: BasePythonRunner.newWriterThread core/src/main/scala/org/apache/spark/api/python/PythonRunner.scala:147 — MethodTooLong — newWriterThread runs 167 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 67 over it, 1.67× 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: BasePythonRunner.newReaderIterator core/src/main/scala/org/apache/spark/api/python/PythonRunner.scala:154 — MethodTooLong — newReaderIterator runs 161 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 61 over it, 1.61× 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: AvroDeserializer.deserialize external/avro/src/main/scala/org/apache/spark/sql/avro/AvroDeserializer.scala:70 — MethodTooLong — deserialize runs 159 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 59 over it, 1.59× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: AvroDeserializer.newWriter external/avro/src/main/scala/org/apache/spark/sql/avro/AvroDeserializer.scala:76 — MethodTooLong — newWriter runs 158 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 58 over it, 1.58× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: HiveInspectors.wrapperFor sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveInspectors.scala:267 — MethodTooLong — wrapperFor runs 134 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 34 over it, 1.34× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: SparkSQLCLIDriver.main sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIDriver.scala:80 — MethodTooLong — main 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: ParquetFileFormat.buildReaderWithPartitionValues sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFileFormat.scala:197 — MethodTooLong — buildReaderWithPartitionValues runs 116 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 16 over it, 1.16× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: InterpretedUnsafeProjection.generateFieldWriter sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/InterpretedUnsafeProjection.scala:130 — MethodTooLong — generateFieldWriter runs 111 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 11 over it, 1.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D29 · Static Analysis (SAST) · REDACTED · ×14
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D3 · God Classes · ClassTooLong · ×14
  • ClassTooLong: Analyzer sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala:97 — ClassTooLong — 1383 significant lines (blank, comment-only and punctuation-only lines excluded), 8 methods. The bar is 400 significant lines; this is 983 over it, 3.46× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: AstBuilder sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala:52 — ClassTooLong — 1212 significant lines (blank, comment-only and punctuation-only lines excluded), 36 methods. The bar is 400 significant lines; this is 812 over it, 3.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: UTF8String common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java:50 — ClassTooLong — 749 significant lines (blank, comment-only and punctuation-only lines excluded), 69 methods. The bar is 400 significant lines; this is 349 over it, 1.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.
  • ClassTooLong: SparkSqlAstBuilder sql/core/src/main/scala/org/apache/spark/sql/execution/SparkSqlParser.scala:55 — ClassTooLong — 653 significant lines (blank, comment-only and punctuation-only lines excluded), 5 methods. The bar is 400 significant lines; this is 253 over it, 1.63× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: HiveSessionImpl sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:86 — ClassTooLong — 575 significant lines (blank, comment-only and punctuation-only lines excluded), 57 methods. The bar is 400 significant lines; this is 175 over it, 1.44× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: HiveSessionImpl sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:84 — ClassTooLong — 530 significant lines (blank, comment-only and punctuation-only lines excluded), 53 methods. The bar is 400 significant lines; this is 130 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ThriftCLIService sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:53 — ClassTooLong — 470 significant lines (blank, comment-only and punctuation-only lines excluded), 37 methods. The bar is 400 significant lines; this is 70 over it, 1.18× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ThriftCLIService sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:52 — ClassTooLong — 440 significant lines (blank, comment-only and punctuation-only lines excluded), 35 methods. The bar is 400 significant lines; this is 40 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ParquetFilters sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFilters.scala:43 — ClassTooLong — 431 significant lines (blank, comment-only and punctuation-only lines excluded), 11 methods. The bar is 400 significant lines; this is 31 over it, 1.08× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: BytesToBytesMap core/src/main/java/org/apache/spark/unsafe/map/BytesToBytesMap.java:67 — ClassTooLong — 426 significant lines (blank, comment-only and punctuation-only lines excluded), 23 methods. The bar is 400 significant lines; this is 26 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: PairRDDFunctions core/src/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala:50 — ClassTooLong — 417 significant lines (blank, comment-only and punctuation-only lines excluded), 72 methods. The bar is 400 significant lines; this is 17 over it, 1.04× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: TimSort core/src/main/java/org/apache/spark/util/collection/TimSort.java:59 — ClassTooLong — 417 significant lines (blank, comment-only and punctuation-only lines excluded), 6 methods. The bar is 400 significant lines; this is 17 over it, 1.04× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: VectorizedRleValuesReader sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedRleValuesReader.java:44 — ClassTooLong — 414 significant lines (blank, comment-only and punctuation-only lines excluded), 32 methods. The bar is 400 significant lines; this is 14 over it, 1.04× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: SparkStrategies sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala:66 — ClassTooLong — 402 significant lines (blank, comment-only and punctuation-only lines excluded), 0 methods. The bar is 400 significant lines; this is 2 over it, 1.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.
D4 · Code Duplication · Edited copy of a member (17 corresponding lines) · ×13
  • Edited copy of a member (17 corresponding lines) mllib/src/main/scala/org/apache/spark/ml/feature/FeatureHasher.scala:236 — mllib/src/main/scala/org/apache/spark/ml/feature/FeatureHasher.scala:236-252 | mllib/src/main/scala/org/apache/spark/mllib/feature/HashingTF.scala: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) python/pyspark/ml/common.py:71 — python/pyspark/ml/common.py:71-87 | python/pyspark/mllib/common.py:73-89 — 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) REDACTED:83 — REDACTED:83-149 | REDACTED:299-315 — 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) sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeArrayData.java:425 — sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeArrayData.java:425-445 | sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeArrayData.java:447-463 — 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) core/src/main/scala/org/apache/spark/scheduler/ResultTask.scala:75 — core/src/main/scala/org/apache/spark/scheduler/ResultTask.scala:75-91 | core/src/main/scala/org/apache/spark/scheduler/ShuffleMapTask.scala:77-95 — 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) mllib/src/main/scala/org/apache/spark/ml/linalg/MatrixUDT.scala:30 — mllib/src/main/scala/org/apache/spark/ml/linalg/MatrixUDT.scala:30-46 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala:182-198 — 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) python/pyspark/ml/tuning.py:445 — python/pyspark/ml/tuning.py:445-461 | python/pyspark/ml/tuning.py:721-739 — 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) python/pyspark/ml/tuning.py:370 — python/pyspark/ml/tuning.py:370-387 | python/pyspark/ml/tuning.py:648-664 — 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) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/CSVDataSource.scala:226 — sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/CSVDataSource.scala:226-244 | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/json/JsonDataSource.scala:175-191 — 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) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/ApproximatePercentile.scala:103 — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/ApproximatePercentile.scala:103-119 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/Percentile.scala:123-139 — 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) external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaSourceProvider.scala:522 — external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaSourceProvider.scala:522-539 | external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaSourceProvider.scala:544-560 — 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) python/pyspark/sql/utils.py:131 — python/pyspark/sql/utils.py:131-147 | python/pyspark/sql/utils.py: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) examples/src/main/java/org/apache/spark/examples/ml/JavaBinarizerExample.java:37 — examples/src/main/java/org/apache/spark/examples/ml/JavaBinarizerExample.java:37-67 | examples/src/main/java/org/apache/spark/examples/ml/JavaQuantileDiscretizerExample.java:36-72 — 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 (16 corresponding lines) · ×12
  • Edited copy of a member (16 corresponding lines) mllib/src/main/scala/org/apache/spark/ml/linalg/JsonVectorConverter.scala:29 — mllib/src/main/scala/org/apache/spark/ml/linalg/JsonVectorConverter.scala:29-44 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala:377-392 — 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) mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:370 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:370-386 | mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala:353-368 — 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) core/src/main/scala/org/apache/spark/scheduler/InputFormatInfo.scala:96 — core/src/main/scala/org/apache/spark/scheduler/InputFormatInfo.scala:96-113 | core/src/main/scala/org/apache/spark/scheduler/InputFormatInfo.scala:116-131 — 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) sql/catalyst/src/main/scala/org/apache/spark/sql/types/StructType.scala:403 — sql/catalyst/src/main/scala/org/apache/spark/sql/types/StructType.scala:403-418 | sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala:383-403 — 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) graphx/src/main/scala/org/apache/spark/graphx/impl/GraphImpl.scala:123 — graphx/src/main/scala/org/apache/spark/graphx/impl/GraphImpl.scala:123-138 | graphx/src/main/scala/org/apache/spark/graphx/impl/GraphImpl.scala:249-265 — 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) core/src/main/scala/org/apache/spark/util/collection/OpenHashSet.scala:139 — core/src/main/scala/org/apache/spark/util/collection/OpenHashSet.scala:139-159 | core/src/main/scala/org/apache/spark/util/collection/OpenHashSet.scala:178-193 — 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) mllib/src/main/scala/org/apache/spark/ml/tree/impl/BaggedPoint.scala:82 — mllib/src/main/scala/org/apache/spark/ml/tree/impl/BaggedPoint.scala:82-99 | mllib/src/main/scala/org/apache/spark/ml/tree/impl/BaggedPoint.scala:105-120 — 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) core/src/main/scala/org/apache/spark/deploy/client/StandaloneAppClient.scala:98 — core/src/main/scala/org/apache/spark/deploy/client/StandaloneAppClient.scala:98-114 | core/src/main/scala/org/apache/spark/deploy/worker/Worker.scala:262-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) python/pyspark/ml/pipeline.py:160 — python/pyspark/ml/pipeline.py:160-175 | python/pyspark/ml/pipeline.py:306-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) python/pyspark/ml/base.py:160 — python/pyspark/ml/base.py:160-175 | python/pyspark/ml/evaluation.py:57-74 — 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) sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/VectorizedHashMapGenerator.scala:102 — sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/VectorizedHashMapGenerator.scala:102-117 | sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/RowBasedHashMapGenerator.scala:99-114 — 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) core/src/main/java/org/apache/spark/shuffle/sort/ShuffleInMemorySorter.java:97 — core/src/main/java/org/apache/spark/shuffle/sort/ShuffleInMemorySorter.java:97-112 | core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeInMemorySorter.java:174-191 — 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.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×12
  • Duplicated block (19 lines × 2) mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:73 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:73-91 | mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala:75-93 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 476 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (19 lines × 2) mllib/src/main/scala/org/apache/spark/ml/linalg/MatrixUDT.scala:73 — mllib/src/main/scala/org/apache/spark/ml/linalg/MatrixUDT.scala:73-91 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala:225-243 — before extracting anything, compare `mllib/src/main/scala/org/apache/spark/ml/linalg/MatrixUDT.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (19 lines × 2) sql/core/src/main/scala/org/apache/spark/sql/execution/Columnar.scala:109 — sql/core/src/main/scala/org/apache/spark/sql/execution/Columnar.scala:109-127 | sql/core/src/main/scala/org/apache/spark/sql/execution/ColumnarBatchScan.scala:49-67 — before extracting anything, compare `sql/core/src/main/scala/org/apache/spark/sql/execution/Columnar.scala` and `sql/core/src/main/scala/org/apache/spark/sql/execution/ColumnarBatchScan.scala` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 82 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (19 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:378 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:378-396 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:400-418 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 187 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (19 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/ColumnValue.java:288 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/ColumnValue.java:288-306 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/ColumnValue.java:294-312 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/ColumnValue.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/ColumnValue.java` as WHOLE FILES: this scan already matched 11 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. Note first that the copies are not typed on the same thing: `TColumnValue` names `org.apache.hive.service.cli.thrift.TColumnValue` in one and `org.apache.hive.service.rpc.thrift.TColumnValue` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (19 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/Handle.java:55 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/Handle.java:55-73 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/Handle.java:55-73 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/Handle.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/Handle.java` as WHOLE FILES: 98% 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 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/TypeDescriptor.java:140 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/TypeDescriptor.java:140-158 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/TypeDescriptor.java:141-159 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/TypeDescriptor.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/TypeDescriptor.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:104 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:104-122 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:106-124 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 435 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Note first that the copies are not typed on the same thing: `TProtocolVersion` names `org.apache.hive.service.cli.thrift.TProtocolVersion` in one and `org.apache.hive.service.rpc.thrift.TProtocolVersion` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (19 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:243 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:243-261 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:244-262 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 436 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (19 lines × 2) python/pyspark/ml/linalg/__init__.py:716 — python/pyspark/ml/linalg/__init__.py:716-734 | python/pyspark/mllib/linalg/__init__.py:805-823 — before extracting anything, compare `python/pyspark/ml/linalg/__init__.py` and `python/pyspark/mllib/linalg/__init__.py` as WHOLE FILES: this scan already matched 34 separate duplicated blocks between them, totalling at least 667 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 (19 lines × 2) python/pyspark/ml/linalg/__init__.py:895 — python/pyspark/ml/linalg/__init__.py:895-913 | python/pyspark/mllib/linalg/__init__.py:1039-1057 — before extracting anything, compare `python/pyspark/ml/linalg/__init__.py` and `python/pyspark/mllib/linalg/__init__.py` as WHOLE FILES: this scan already matched 34 separate duplicated blocks between them, totalling at least 667 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (19 lines × 2) examples/src/main/java/org/apache/spark/examples/sql/streaming/JavaStructuredNetworkWordCount.java:41 — examples/src/main/java/org/apache/spark/examples/sql/streaming/JavaStructuredNetworkWordCount.java:41-59 | examples/src/main/java/org/apache/spark/examples/sql/streaming/JavaStructuredSessionization.java:47-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.
D29 · Static Analysis (SAST) · REDACTED · ×10
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
AC6 · Visual & motion safety · Animation without a prefers-reduced-motion guard · ×9
  • Animation without a prefers-reduced-motion guard docs/css/bootstrap.css:2873 — `.collapse` moves (`transition: height 0.35s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard docs/css/bootstrap.css:2975 — `.btn:hover` moves (`transition: background-position 0.1s linear`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard docs/css/bootstrap.css:4776 — `.modal.fade` moves (`transition: opacity 0.3s linear, top 0.3s ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard docs/css/bootstrap.css:5309 — `.progress .bar` moves (`transition: width 0.6s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard docs/css/bootstrap.css:5336 — `.progress.active .bar` moves (`animation: progress-bar-stripes 2s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard docs/css/bootstrap.css:5475 — `.carousel .item` moves (`transition: 0.6s ease-in-out left`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard docs/css/main.css:256 — `.nav-trigger + label` moves (`transition: left 0.4s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard core/src/main/resources/org/apache/spark/ui/static/webui.css:121 — `.stage-details` moves (`transition: max-height 0.25s ease-out, padding 0.25s ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard core/src/main/resources/org/apache/spark/ui/static/webui.css:152 — `.stacktrace-details` moves (`transition: max-height 0.25s ease-out, padding 0.25s ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
D4 · Code Duplication · Edited copy of a member (23 corresponding lines) · ×9
  • Edited copy of a member (23 corresponding lines) core/src/main/java/org/apache/spark/util/collection/unsafe/sort/RadixSort.java:111 — core/src/main/java/org/apache/spark/util/collection/unsafe/sort/RadixSort.java:111-136 | core/src/main/java/org/apache/spark/util/collection/unsafe/sort/RadixSort.java:215-237 — 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) mllib/src/main/scala/org/apache/spark/mllib/fpm/FPGrowth.scala:103 — mllib/src/main/scala/org/apache/spark/mllib/fpm/FPGrowth.scala:103-125 | mllib/src/main/scala/org/apache/spark/mllib/fpm/PrefixSpan.scala:647-669 — 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) python/pyspark/sql/context.py:517 — python/pyspark/sql/context.py:517-550 | python/pyspark/sql/session.py:887-909 — 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) REDACTED:88 — REDACTED:88-110 | REDACTED:92-115 — 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) mllib/src/main/scala/org/apache/spark/mllib/util/LinearDataGenerator.scala:192 — mllib/src/main/scala/org/apache/spark/mllib/util/LinearDataGenerator.scala:192-214 | mllib/src/main/scala/org/apache/spark/mllib/util/LogisticRegressionDataGenerator.scala:68-90 — 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) external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaMicroBatchStream.scala:373 — external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaMicroBatchStream.scala:373-395 | external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaSourceRDD.scala:137-160 — 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) python/pyspark/ml/tuning.py:464 — python/pyspark/ml/tuning.py:464-486 | python/pyspark/ml/tuning.py:742-764 — 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) examples/src/main/scala/org/apache/spark/examples/mllib/TallSkinnyPCA.scala:38 — examples/src/main/scala/org/apache/spark/examples/mllib/TallSkinnyPCA.scala:38-60 | examples/src/main/scala/org/apache/spark/examples/mllib/TallSkinnySVD.scala:38-60 — 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) examples/src/main/scala/org/apache/spark/examples/ml/BinarizerExample.scala:27 — examples/src/main/scala/org/apache/spark/examples/ml/BinarizerExample.scala:27-49 | examples/src/main/scala/org/apache/spark/examples/ml/QuantileDiscretizerExample.scala:26-52 — 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 (21 corresponding lines) · ×9
  • Edited copy of a member (21 corresponding lines) mllib/src/main/scala/org/apache/spark/ml/evaluation/MultilabelClassificationEvaluator.scala:87 — mllib/src/main/scala/org/apache/spark/ml/evaluation/MultilabelClassificationEvaluator.scala:87-114 | mllib/src/main/scala/org/apache/spark/ml/evaluation/RankingEvaluator.scala:83-103 — 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) sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveShim.scala:160 — sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveShim.scala:160-180 | sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveShim.scala:182-202 — 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) core/src/main/scala/org/apache/spark/rdd/BinaryFileRDD.scala:38 — core/src/main/scala/org/apache/spark/rdd/BinaryFileRDD.scala:38-58 | core/src/main/scala/org/apache/spark/rdd/WholeTextFileRDD.scala:41-61 — 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) mllib-local/src/main/scala/org/apache/spark/ml/stat/distribution/MultivariateGaussian.scala:116 — mllib-local/src/main/scala/org/apache/spark/ml/stat/distribution/MultivariateGaussian.scala:116-136 | mllib/src/main/scala/org/apache/spark/mllib/stat/distribution/MultivariateGaussian.scala:121-141 — 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) mllib/src/main/scala/org/apache/spark/ml/stat/Summarizer.scala:469 — mllib/src/main/scala/org/apache/spark/ml/stat/Summarizer.scala:469-490 | mllib/src/main/scala/org/apache/spark/mllib/stat/MultivariateOnlineSummarizer.scala:203-223 — 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) mllib/src/main/scala/org/apache/spark/mllib/clustering/LDAModel.scala:363 — mllib/src/main/scala/org/apache/spark/mllib/clustering/LDAModel.scala:363-387 | mllib/src/main/scala/org/apache/spark/mllib/clustering/LDAModel.scala:392-412 — 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) mllib/src/main/scala/org/apache/spark/ml/feature/PolynomialExpansion.scala:106 — mllib/src/main/scala/org/apache/spark/ml/feature/PolynomialExpansion.scala:106-126 | mllib/src/main/scala/org/apache/spark/ml/feature/PolynomialExpansion.scala:137-161 — 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) streaming/src/main/scala/org/apache/spark/streaming/dstream/DStream.scala:512 — streaming/src/main/scala/org/apache/spark/streaming/dstream/DStream.scala:512-532 | streaming/src/main/scala/org/apache/spark/streaming/dstream/DStreamCheckpointData.scala:127-147 — 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) examples/src/main/scala/org/apache/spark/examples/LocalFileLR.scala:50 — examples/src/main/scala/org/apache/spark/examples/LocalFileLR.scala:50-75 | examples/src/main/scala/org/apache/spark/examples/LocalLR.scala:57-77 — 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.
D4 · Code Duplication · Edited copy of a member (28 corresponding lines) · ×8
  • Edited copy of a member (28 corresponding lines) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:232 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:232-260 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.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) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/rows.scala:131 — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/rows.scala:131-158 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/GenericArrayData.scala:135-162 — 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) mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:269 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:269-297 | mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala:253-280 — 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) external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaSourceProvider.scala:395 — external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaSourceProvider.scala:395-422 | external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaSourceProvider.scala:424-456 — 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) examples/src/main/java/org/apache/spark/examples/ml/JavaCorrelationExample.java:44 — examples/src/main/java/org/apache/spark/examples/ml/JavaCorrelationExample.java:44-71 | examples/src/main/java/org/apache/spark/examples/ml/JavaPCAExample.java:39-68 — 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) examples/src/main/java/org/apache/spark/examples/ml/JavaDCTExample.java:38 — examples/src/main/java/org/apache/spark/examples/ml/JavaDCTExample.java:38-66 | examples/src/main/java/org/apache/spark/examples/ml/JavaPolynomialExpansionExample.java:38-65 — 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) examples/src/main/scala/org/apache/spark/examples/SparkHdfsLR.scala:60 — examples/src/main/scala/org/apache/spark/examples/SparkHdfsLR.scala:60-94 | examples/src/main/scala/org/apache/spark/examples/SparkLR.scala:62-89 — 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) examples/src/main/scala/org/apache/spark/examples/mllib/PCAOnRowMatrixExample.scala:31 — examples/src/main/scala/org/apache/spark/examples/mllib/PCAOnRowMatrixExample.scala:31-58 | examples/src/main/scala/org/apache/spark/examples/mllib/SVDExample.scala:36-64 — 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.
D4 · Code Duplication · Edited copy of a member (30 corresponding lines) · ×8
  • Edited copy of a member (30 corresponding lines) mllib/src/main/scala/org/apache/spark/ml/tuning/CrossValidator.scala:395 — mllib/src/main/scala/org/apache/spark/ml/tuning/CrossValidator.scala:395-429 | mllib/src/main/scala/org/apache/spark/ml/tuning/TrainValidationSplit.scala:383-412 — 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetTablesOperation.java:78 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetTablesOperation.java:78-112 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/GetTablesOperation.java:91-120 — 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) core/src/main/scala/org/apache/spark/util/collection/AppendOnlyMap.scala:93 — core/src/main/scala/org/apache/spark/util/collection/AppendOnlyMap.scala:93-122 | core/src/main/scala/org/apache/spark/util/collection/AppendOnlyMap.scala:128-160 — 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) external/kafka-0-10/src/main/scala/org/apache/spark/streaming/kafka010/ConsumerStrategy.scala:90 — external/kafka-0-10/src/main/scala/org/apache/spark/streaming/kafka010/ConsumerStrategy.scala:90-122 | external/kafka-0-10/src/main/scala/org/apache/spark/streaming/kafka010/ConsumerStrategy.scala:147-176 — 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) core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala:552 — core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala:552-582 | core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala:1996-2025 — 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) core/src/main/scala/org/apache/spark/util/collection/ExternalAppendOnlyMap.scala:474 — core/src/main/scala/org/apache/spark/util/collection/ExternalAppendOnlyMap.scala:474-503 | core/src/main/scala/org/apache/spark/util/collection/ExternalSorter.scala:498-528 — 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) examples/src/main/java/org/apache/spark/examples/ml/JavaImputerExample.java:41 — examples/src/main/java/org/apache/spark/examples/ml/JavaImputerExample.java:41-70 | examples/src/main/java/org/apache/spark/examples/ml/JavaOneHotEncoderExample.java:38-72 — 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) examples/src/main/scala/org/apache/spark/examples/ml/BisectingKMeansExample.scala:37 — examples/src/main/scala/org/apache/spark/examples/ml/BisectingKMeansExample.scala:37-68 | examples/src/main/scala/org/apache/spark/examples/ml/KMeansExample.scala:37-66 — 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 (22 corresponding lines) · ×8
  • Edited copy of a member (22 corresponding lines) core/src/main/java/org/apache/spark/util/collection/unsafe/sort/RadixSort.java:46 — core/src/main/java/org/apache/spark/util/collection/unsafe/sort/RadixSort.java:46-67 | core/src/main/java/org/apache/spark/util/collection/unsafe/sort/RadixSort.java:186-208 — 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) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:415 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:415-439 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala:402-423 — 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) mllib/src/main/scala/org/apache/spark/mllib/classification/LogisticRegression.scala:175 — mllib/src/main/scala/org/apache/spark/mllib/classification/LogisticRegression.scala:175-196 | mllib/src/main/scala/org/apache/spark/mllib/classification/SVM.scala:97-120 — 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) sql/core/v1.2.1/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilters.scala:176 — sql/core/v1.2.1/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilters.scala:176-199 | sql/hive/src/main/scala/org/apache/spark/sql/hive/orc/OrcFilters.scala:156-177 — 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) python/pyspark/shuffle.py:232 — python/pyspark/shuffle.py:232-253 | python/pyspark/shuffle.py:266-289 — 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) REDACTED:410 — REDACTED:410-431 | REDACTED:787-817 — 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) python/pyspark/sql/readwriter.py:672 — python/pyspark/sql/readwriter.py:672-700 | python/pyspark/sql/readwriter.py:704-725 — 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) REDACTED:872 — REDACTED:872-894 | REDACTED:902-923 — 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 copy of a member (19 corresponding lines) · ×8
  • Edited copy of a member (19 corresponding lines) sql/catalyst/src/main/scala/org/apache/spark/sql/types/DataType.scala:264 — sql/catalyst/src/main/scala/org/apache/spark/sql/types/DataType.scala:264-284 | sql/catalyst/src/main/scala/org/apache/spark/sql/types/DataType.scala:290-308 — 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) python/pyspark/sql/session.py:415 — python/pyspark/sql/session.py:415-433 | python/pyspark/sql/session.py:436-459 — 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) sql/core/src/main/scala/org/apache/spark/sql/execution/joins/HashedRelation.scala:472 — sql/core/src/main/scala/org/apache/spark/sql/execution/joins/HashedRelation.scala:472-490 | sql/core/src/main/scala/org/apache/spark/sql/execution/joins/HashedRelation.scala:512-530 — 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) common/unsafe/src/main/java/org/apache/spark/unsafe/UTF8StringBuilder.java:51 — common/unsafe/src/main/java/org/apache/spark/unsafe/UTF8StringBuilder.java:51-69 | sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/codegen/BufferHolder.java:65-90 — 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) core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala:506 — core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala:506-524 | core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala:530-550 — 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) REDACTED:345 — REDACTED:345-363 | REDACTED:366-384 — 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) core/src/main/scala/org/apache/spark/scheduler/cluster/CoarseGrainedSchedulerBackend.scala:266 — core/src/main/scala/org/apache/spark/scheduler/cluster/CoarseGrainedSchedulerBackend.scala:266-284 | core/src/main/scala/org/apache/spark/scheduler/cluster/CoarseGrainedSchedulerBackend.scala:295-315 — 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) core/src/main/scala/org/apache/spark/storage/BlockInfoManager.scala:188 — core/src/main/scala/org/apache/spark/storage/BlockInfoManager.scala:188-206 | core/src/main/scala/org/apache/spark/storage/BlockInfoManager.scala:222-240 — 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.
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×8
  • Outbound HTTP without resilience core/src/main/scala/org/apache/spark/TestUtils.scala:229 — `.openConnection(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience core/src/main/scala/org/apache/spark/deploy/rest/RestSubmissionClient.scala:191 — `.openConnection(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience core/src/main/scala/org/apache/spark/deploy/rest/RestSubmissionClient.scala:199 — `.openConnection(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience core/src/main/scala/org/apache/spark/deploy/rest/RestSubmissionClient.scala:207 — `.openConnection(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience core/src/main/scala/org/apache/spark/ui/JettyUtils.scala:206 — `HttpClient(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience dev/github_jira_sync.py:57 — `urllib2.urlopen(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience dev/github_jira_sync.py:129 — `urllib2.urlopen(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience dev/merge_spark_pr.py:75 — `urllib2.urlopen(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
D31 · IaC & Container Security · Medium IaC · ×7
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (27 corresponding lines) · ×7
  • Edited copy of a member (27 corresponding lines) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:264 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:264-292 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:265-295 — 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) mllib/src/main/scala/org/apache/spark/ml/tree/impl/GradientBoostedTrees.scala:204 — mllib/src/main/scala/org/apache/spark/ml/tree/impl/GradientBoostedTrees.scala:204-235 | mllib/src/main/scala/org/apache/spark/mllib/tree/model/treeEnsembleModels.scala:142-168 — 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) graphx/src/main/scala/org/apache/spark/graphx/Edge.scala:71 — graphx/src/main/scala/org/apache/spark/graphx/Edge.scala:71-97 | graphx/src/main/scala/org/apache/spark/graphx/impl/EdgePartitionBuilder.scala:142-170 — 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) sql/core/src/main/scala/org/apache/spark/sql/DataFrameStatFunctions.scala:503 — sql/core/src/main/scala/org/apache/spark/sql/DataFrameStatFunctions.scala:503-529 | sql/core/src/main/scala/org/apache/spark/sql/DataFrameStatFunctions.scala:579-608 — 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) common/network-common/src/main/java/org/apache/spark/network/util/JavaUtils.java:228 — common/network-common/src/main/java/org/apache/spark/network/util/JavaUtils.java:228-254 | common/network-common/src/main/java/org/apache/spark/network/util/JavaUtils.java:276-308 — 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) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/csv/CSVScan.scala:53 — sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/csv/CSVScan.scala:53-80 | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/json/JsonScan.scala:53-79 — 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) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/complexTypeCreator.scala:369 — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/complexTypeCreator.scala:369-395 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/objects/objects.scala:1409-1438 — 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 (24 corresponding lines) · ×7
  • Edited copy of a member (24 corresponding lines) sql/core/v1.2.1/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilters.scala:176 — sql/core/v1.2.1/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilters.scala:176-199 | sql/core/v2.3.5/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilters.scala:176-199 — 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) common/sketch/src/main/java/org/apache/spark/util/sketch/Platform.java:111 — common/sketch/src/main/java/org/apache/spark/util/sketch/Platform.java:111-134 | common/unsafe/src/main/java/org/apache/spark/unsafe/Platform.java:235-258 — 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:103 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:103-127 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:105-128 — 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) common/unsafe/src/main/java/org/apache/spark/unsafe/types/ByteArray.java:80 — common/unsafe/src/main/java/org/apache/spark/unsafe/types/ByteArray.java:80-103 | common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java:914-937 — 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) sql/core/src/main/scala/org/apache/spark/sql/internal/BaseSessionStateBuilder.scala:168 — sql/core/src/main/scala/org/apache/spark/sql/internal/BaseSessionStateBuilder.scala:168-191 | sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveSessionStateBuilder.scala:71-97 — 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) sql/core/src/main/scala/org/apache/spark/sql/execution/columnar/compression/compressionSchemes.scala:691 — sql/core/src/main/scala/org/apache/spark/sql/execution/columnar/compression/compressionSchemes.scala:691-714 | sql/core/src/main/scala/org/apache/spark/sql/execution/columnar/compression/compressionSchemes.scala:797-820 — 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) core/src/main/scala/org/apache/spark/ui/jobs/StagePage.scala:710 — core/src/main/scala/org/apache/spark/ui/jobs/StagePage.scala:710-733 | core/src/main/scala/org/apache/spark/ui/jobs/StageTable.scala:308-332 — 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 (18 corresponding lines) · ×7
  • Edited copy of a member (18 corresponding lines) sql/core/src/main/scala/org/apache/spark/sql/execution/HiveResult.scala:85 — sql/core/src/main/scala/org/apache/spark/sql/execution/HiveResult.scala:85-102 | sql/core/src/main/scala/org/apache/spark/sql/execution/HiveResult.scala:105-126 — 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:428 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:428-445 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:429-447 — 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) python/pyspark/heapq3.py:540 — python/pyspark/heapq3.py:540-557 | python/pyspark/heapq3.py:575-593 — 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) core/src/main/scala/org/apache/spark/rpc/netty/NettyRpcEnv.scala:688 — core/src/main/scala/org/apache/spark/rpc/netty/NettyRpcEnv.scala:688-705 | core/src/main/scala/org/apache/spark/rpc/netty/NettyRpcEnv.scala:714-731 — 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) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/package.scala:48 — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/package.scala:48-65 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/package.scala:69-86 — 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) python/pyspark/sql/column.py:615 — python/pyspark/sql/column.py:615-637 | python/pyspark/sql/functions.py:757-774 — 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) examples/src/main/scala/org/apache/spark/examples/LocalALS.scala:77 — examples/src/main/scala/org/apache/spark/examples/LocalALS.scala:77-94 | examples/src/main/scala/org/apache/spark/examples/SparkALS.scala:60-79 — 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 (14 corresponding lines) · ×7
  • Edited copy of a member (14 corresponding lines) core/src/main/java/org/apache/spark/util/collection/unsafe/sort/RadixSort.java:84 — core/src/main/java/org/apache/spark/util/collection/unsafe/sort/RadixSort.java:84-97 | core/src/main/java/org/apache/spark/util/collection/unsafe/sort/RadixSort.java:244-260 — 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) core/src/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala:162 — core/src/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala:162-175 | core/src/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala:212-225 — 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) core/src/main/scala/org/apache/spark/serializer/KryoSerializer.scala:387 — core/src/main/scala/org/apache/spark/serializer/KryoSerializer.scala:387-400 | core/src/main/scala/org/apache/spark/serializer/KryoSerializer.scala:402-418 — 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) core/src/main/scala/org/apache/spark/internal/io/HadoopMapReduceCommitProtocol.scala:147 — core/src/main/scala/org/apache/spark/internal/io/HadoopMapReduceCommitProtocol.scala:147-163 | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/FileWriterFactory.scala:43-56 — 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) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Expression.scala:677 — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Expression.scala:677-690 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Expression.scala:775-791 — 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) mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala:476 — mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala:476-489 | mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala:505-520 — 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) mllib/src/main/scala/org/apache/spark/mllib/tree/impurity/Entropy.scala:39 — mllib/src/main/scala/org/apache/spark/mllib/tree/impurity/Entropy.scala:39-55 | mllib/src/main/scala/org/apache/spark/mllib/tree/impurity/Gini.scala:39-52 — 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.
D4 · Code Duplication · Edited copy of a member (20 corresponding lines) · ×7
  • Edited copy of a member (20 corresponding lines) python/pyspark/sql/column.py:699 — python/pyspark/sql/column.py:699-718 | python/pyspark/sql/functions.py:3299-3320 — 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) core/src/main/scala/org/apache/spark/rpc/RpcEndpointAddress.scala:53 — core/src/main/scala/org/apache/spark/rpc/RpcEndpointAddress.scala:53-73 | core/src/main/scala/org/apache/spark/util/Utils.scala:2386-2405 — 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:315 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:315-334 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:322-342 — 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:139 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:139-158 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:140-160 — 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) sql/core/src/main/scala/org/apache/spark/sql/execution/ui/SQLAppStatusListener.scala:267 — sql/core/src/main/scala/org/apache/spark/sql/execution/ui/SQLAppStatusListener.scala:267-289 | sql/core/src/main/scala/org/apache/spark/sql/execution/ui/SQLAppStatusListener.scala:291-310 — 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) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:71 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:71-90 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala:82-101 — 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) core/src/main/scala/org/apache/spark/api/python/SerDeUtil.scala:183 — core/src/main/scala/org/apache/spark/api/python/SerDeUtil.scala:183-202 | mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala:1344-1364 — 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.
D4 · Code Duplication · Duplicated block (25 lines × 2) · ×7
  • Duplicated block (25 lines × 2) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:704 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:704-728 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala:686-710 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 394 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 (25 lines × 2) sql/core/v1.2.1/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcShimUtils.scala:41 — sql/core/v1.2.1/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcShimUtils.scala:41-65 | sql/core/v2.3.5/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcShimUtils.scala:41-65 — before extracting anything, compare `sql/core/v1.2.1/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcShimUtils.scala` and `sql/core/v2.3.5/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcShimUtils.scala` as WHOLE FILES: 90% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (25 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/ColumnBasedSet.java:117 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/ColumnBasedSet.java:117-141 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/ColumnBasedSet.java:172-196 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/ColumnBasedSet.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/ColumnBasedSet.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. 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 (25 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java:366 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java:366-390 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java:365-389 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 274 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 (25 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:296 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:296-320 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:299-323 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 435 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 (25 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/SessionManager.java:87 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/SessionManager.java:87-111 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/SessionManager.java:87-111 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/SessionManager.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/SessionManager.java` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 167 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 (25 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/server/HiveServer2.java:128 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/server/HiveServer2.java:128-152 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/server/HiveServer2.java:133-157 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/server/HiveServer2.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/server/HiveServer2.java` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 130 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 `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/server/HiveServer2.java:128` 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.
D4 · Code Duplication · Duplicated block (22 lines × 2) · ×7
  • Duplicated block (22 lines × 2) mllib/src/main/scala/org/apache/spark/ml/linalg/MatrixUDT.scala:49 — mllib/src/main/scala/org/apache/spark/ml/linalg/MatrixUDT.scala:49-70 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala:201-222 — before extracting anything, compare `mllib/src/main/scala/org/apache/spark/ml/linalg/MatrixUDT.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (22 lines × 2) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/text/TextFileFormat.scala:70 — sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/text/TextFileFormat.scala:70-91 | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/text/TextWriteBuilder.scala:48-69 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (22 lines × 2) sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerPage.scala:118 — sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerPage.scala:118-139 | sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerSessionPage.scala:127-148 — before extracting anything, compare `sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerPage.scala` and `sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerSessionPage.scala` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 66 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (22 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/HiveCommandOperation.java:68 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/HiveCommandOperation.java:68-89 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/HiveCommandOperation.java:68-89 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/HiveCommandOperation.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/HiveCommandOperation.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (22 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:176 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:176-197 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:182-203 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 187 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (22 lines × 2) python/pyspark/ml/linalg/__init__.py:827 — python/pyspark/ml/linalg/__init__.py:827-848 | python/pyspark/mllib/linalg/__init__.py:964-985 — before extracting anything, compare `python/pyspark/ml/linalg/__init__.py` and `python/pyspark/mllib/linalg/__init__.py` as WHOLE FILES: this scan already matched 34 separate duplicated blocks between them, totalling at least 667 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 (22 lines × 2) python/pyspark/ml/linalg/__init__.py:1099 — python/pyspark/ml/linalg/__init__.py:1099-1120 | python/pyspark/mllib/linalg/__init__.py:1254-1275 — before extracting anything, compare `python/pyspark/ml/linalg/__init__.py` and `python/pyspark/mllib/linalg/__init__.py` as WHOLE FILES: this scan already matched 34 separate duplicated blocks between them, totalling at least 667 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.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×7
  • Duplicated block (21 lines × 2) core/src/main/scala/org/apache/spark/api/r/RRunner.scala:101 — core/src/main/scala/org/apache/spark/api/r/RRunner.scala:101-121 | sql/core/src/main/scala/org/apache/spark/sql/execution/r/ArrowRRunner.scala:155-175 — 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 `core/src/main/scala/org/apache/spark/api/r/RRunner.scala:101` 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 (21 lines × 2) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:418 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:418-438 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala:403-423 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 394 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 `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:418` 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 (21 lines × 2) sql/core/src/main/scala/org/apache/spark/sql/execution/joins/BroadcastHashJoinExec.scala:215 — sql/core/src/main/scala/org/apache/spark/sql/execution/joins/BroadcastHashJoinExec.scala:215-235 | sql/core/src/main/scala/org/apache/spark/sql/execution/joins/BroadcastHashJoinExec.scala:285-307 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sql/core/src/main/scala/org/apache/spark/sql/execution/joins/BroadcastHashJoinExec.scala:215` 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, `sql/core/src/main/scala/org/apache/spark/sql/execution/joins/BroadcastHashJoinExec.scala:308` calls `freshName` and `sql/core/src/main/scala/org/apache/spark/sql/execution/joins/BroadcastHashJoinExec.scala:236` 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 (21 lines × 2) common/sketch/src/main/java/org/apache/spark/util/sketch/Platform.java:114 — common/sketch/src/main/java/org/apache/spark/util/sketch/Platform.java:114-134 | common/unsafe/src/main/java/org/apache/spark/unsafe/Platform.java:238-258 — before extracting anything, compare `common/sketch/src/main/java/org/apache/spark/util/sketch/Platform.java` and `common/unsafe/src/main/java/org/apache/spark/unsafe/Platform.java` as WHOLE FILES: 82% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (21 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftBinaryCLIService.java:76 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftBinaryCLIService.java:76-96 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftBinaryCLIService.java:77-97 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftBinaryCLIService.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftBinaryCLIService.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftBinaryCLIService.java:76` 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 (21 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/server/HiveServer2.java:155 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/server/HiveServer2.java:155-175 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/server/HiveServer2.java:160-180 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/server/HiveServer2.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/server/HiveServer2.java` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 130 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (21 lines × 2) python/pyspark/ml/linalg/__init__.py:916 — python/pyspark/ml/linalg/__init__.py:916-936 | python/pyspark/mllib/linalg/__init__.py:1060-1080 — before extracting anything, compare `python/pyspark/ml/linalg/__init__.py` and `python/pyspark/mllib/linalg/__init__.py` as WHOLE FILES: this scan already matched 34 separate duplicated blocks between them, totalling at least 667 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.
X24 · Document value interpolated into markup unescaped · Untrusted text written into markup unescaped · ×7
  • Untrusted text written into markup unescaped core/src/main/resources/org/apache/spark/ui/static/log-view.js:38 — `"Showing "+curLogLength+" Bytes: "+startByte+" - "+endByte+" of "+totalLogLength` is text this program did not author, and it is written into the text of an element through the DOM library's `.html()` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped core/src/main/resources/org/apache/spark/ui/static/spark-dag-viz.js:379 — `arr[0]` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped core/src/main/resources/org/apache/spark/ui/static/spark-dag-viz.js:380 — `arr[1]` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped core/src/main/resources/org/apache/spark/ui/static/stagepage.js:929 — `responseBody.numCompleteTasks` is text this program did not author, and it is written into the text of an element through the DOM library's `.html()` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped core/src/main/resources/org/apache/spark/ui/static/stagepage.js:930 — `"Tasks ("+totalTasksToShow+")"` is text this program did not author, and it is written into the text of an element through the DOM library's `.html()` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped core/src/main/resources/org/apache/spark/ui/static/table.js:39 — `threadId` is text this program did not author, and it is written into a quoted attribute value through the DOM library's `.after()` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped core/src/main/resources/org/apache/spark/ui/static/table.js:40 — `stackTraceText` is text this program did not author, and it is written into the text of an element through the DOM library's `.after()` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
D4 · Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) · ×6
  • Members sharing a duplicated core (6 members, 50+ identical tokens) mllib/src/main/scala/org/apache/spark/ml/r/DecisionTreeClassificationWrapper.scala:124 — mllib/src/main/scala/org/apache/spark/ml/r/DecisionTreeClassificationWrapper.scala:124-135 | mllib/src/main/scala/org/apache/spark/ml/r/DecisionTreeRegressionWrapper.scala:107-118 | mllib/src/main/scala/org/apache/spark/ml/r/GBTClassificationWrapper.scala:131-142 | mllib/src/main/scala/org/apache/spark/ml/r/GBTRegressionWrapper.scala:115-126 | mllib/src/main/scala/org/apache/spark/ml/r/RandomForestClassificationWrapper.scala:132-143 | mllib/src/main/scala/org/apache/spark/ml/r/RandomForestRegressionWrapper.scala:115-126 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
  • Members sharing a duplicated core (6 members, 50+ identical tokens) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:486 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:486-502 | sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:506-522 | sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:569-585 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:500-516 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:520-536 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:583-599 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
  • Members sharing a duplicated core (6 members, 50+ identical tokens) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:448 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:448-459 | sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:462-473 | sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:507-518 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:450-461 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:464-475 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:509-520 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
  • Members sharing a duplicated core (6 members, 50+ identical tokens) examples/src/main/scala/org/apache/spark/examples/mllib/BinaryClassification.scala:61 — examples/src/main/scala/org/apache/spark/examples/mllib/BinaryClassification.scala:61-102 | examples/src/main/scala/org/apache/spark/examples/mllib/Correlations.scala:40-63 | examples/src/main/scala/org/apache/spark/examples/mllib/LinearRegression.scala:54-89 | examples/src/main/scala/org/apache/spark/examples/mllib/MovieLensALS.scala:51-96 | examples/src/main/scala/org/apache/spark/examples/mllib/MultivariateSummarizer.scala:41-64 | examples/src/main/scala/org/apache/spark/examples/mllib/SampledRDDs.scala:38-59 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
  • Members sharing a duplicated core (6 members, 50+ identical tokens) examples/src/main/scala/org/apache/spark/examples/mllib/DecisionTreeClassificationExample.scala:30 — examples/src/main/scala/org/apache/spark/examples/mllib/DecisionTreeClassificationExample.scala:30-67 | examples/src/main/scala/org/apache/spark/examples/mllib/DecisionTreeRegressionExample.scala:30-66 | examples/src/main/scala/org/apache/spark/examples/mllib/GradientBoostingClassificationExample.scala:30-67 | examples/src/main/scala/org/apache/spark/examples/mllib/GradientBoostingRegressionExample.scala:30-66 | examples/src/main/scala/org/apache/spark/examples/mllib/RandomForestClassificationExample.scala:29-67 | examples/src/main/scala/org/apache/spark/examples/mllib/RandomForestRegressionExample.scala:29-67 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
  • Members sharing a duplicated core (6 members, 50+ identical tokens) examples/src/main/java/org/apache/spark/examples/ml/JavaDecisionTreeClassificationExample.java:33 — examples/src/main/java/org/apache/spark/examples/ml/JavaDecisionTreeClassificationExample.java:33-103 | examples/src/main/java/org/apache/spark/examples/ml/JavaDecisionTreeRegressionExample.java:34-88 | examples/src/main/java/org/apache/spark/examples/ml/JavaGradientBoostedTreeClassifierExample.java:34-104 | examples/src/main/java/org/apache/spark/examples/ml/JavaGradientBoostedTreeRegressorExample.java:35-89 | examples/src/main/java/org/apache/spark/examples/ml/JavaRandomForestClassifierExample.java:34-100 | examples/src/main/java/org/apache/spark/examples/ml/JavaRandomForestRegressorExample.java:35-89 — 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 · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×6
  • Members sharing a duplicated core (4 members, 50+ identical tokens) mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:638 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:638-694 | mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:705-744 | mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala:619-675 | mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala:686-725 — 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) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:512 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:512-524 | mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:651-667 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala:684-696 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala:836-852 — 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) mllib/src/main/scala/org/apache/spark/ml/classification/GBTClassifier.scala:289 — mllib/src/main/scala/org/apache/spark/ml/classification/GBTClassifier.scala:289-295 | mllib/src/main/scala/org/apache/spark/ml/classification/RandomForestClassifier.scala:211-217 | mllib/src/main/scala/org/apache/spark/ml/regression/GBTRegressor.scala:248-254 | mllib/src/main/scala/org/apache/spark/ml/regression/RandomForestRegressor.scala:194-200 — 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) mllib/src/main/scala/org/apache/spark/ml/r/AFTSurvivalRegressionWrapper.scala:139 — mllib/src/main/scala/org/apache/spark/ml/r/AFTSurvivalRegressionWrapper.scala:139-150 | mllib/src/main/scala/org/apache/spark/ml/r/IsotonicRegressionWrapper.scala:109-120 | mllib/src/main/scala/org/apache/spark/ml/r/LinearSVCWrapper.scala:147-159 | mllib/src/main/scala/org/apache/spark/ml/r/LogisticRegressionWrapper.scala:202-214 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) examples/src/main/scala/org/apache/spark/examples/streaming/CustomReceiver.scala:40 — examples/src/main/scala/org/apache/spark/examples/streaming/CustomReceiver.scala:40-60 | examples/src/main/scala/org/apache/spark/examples/streaming/HdfsWordCount.scala:36-55 | examples/src/main/scala/org/apache/spark/examples/streaming/NetworkWordCount.scala:37-59 | examples/src/main/scala/org/apache/spark/examples/streaming/SqlNetworkWordCount.scala:41-81 — 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) REDACTED:57 — REDACTED:57-80 | examples/src/main/java/org/apache/spark/examples/streaming/JavaDirectKafkaWordCount.java:55-97 | examples/src/main/java/org/apache/spark/examples/streaming/JavaNetworkWordCount.java:47-72 | examples/src/main/java/org/apache/spark/examples/streaming/JavaRecoverableNetworkWordCount.java:114-159 — 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) · ×6
  • Edited copy of a member (25 corresponding lines) python/pyspark/ml/common.py:91 — python/pyspark/ml/common.py:91-115 | python/pyspark/mllib/common.py:93-117 — 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) mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:538 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:538-563 | mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala:520-544 — 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) common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java:851 — common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java:851-875 | common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java:883-909 — 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) mllib/src/main/scala/org/apache/spark/mllib/clustering/LDAModel.scala:607 — mllib/src/main/scala/org/apache/spark/mllib/clustering/LDAModel.scala:607-636 | mllib/src/main/scala/org/apache/spark/mllib/clustering/LDAModel.scala:647-671 — 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) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/text/TextFileFormat.scala:114 — sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/text/TextFileFormat.scala:114-138 | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/text/TextPartitionReaderFactory.scala:48-72 — 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/OperationManager.java:225 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/OperationManager.java:225-249 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/OperationManager.java:249-274 — 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.
D4 · Code Duplication · Duplicated block (27 lines × 2) · ×6
  • Duplicated block (27 lines × 2) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFileFormat.scala:107 — sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFileFormat.scala:107-133 | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/orc/OrcWriteBuilder.scala:45-71 — 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 `sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFileFormat.scala:107` 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 (27 lines × 2) sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/FixedLengthRowBasedKeyValueBatch.java:137 — sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/FixedLengthRowBasedKeyValueBatch.java:137-163 | sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/VariableLengthRowBasedKeyValueBatch.java:152-178 — before extracting anything, compare `sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/FixedLengthRowBasedKeyValueBatch.java` and `sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/VariableLengthRowBasedKeyValueBatch.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/FixedLengthRowBasedKeyValueBatch.java:137` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (27 lines × 2) sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedRleValuesReader.java:178 — sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedRleValuesReader.java:178-204 | sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedRleValuesReader.java:458-484 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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 (27 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/TypeQualifiers.java:51 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/TypeQualifiers.java:51-77 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/TypeQualifiers.java:51-77 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/TypeQualifiers.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/TypeQualifiers.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 61 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. Note first that the copies are not typed on the same thing: `TCLIServiceConstants` names `org.apache.hive.service.cli.thrift.TCLIServiceConstants` in one and `org.apache.hive.service.rpc.thrift.TCLIServiceConstants` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (27 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetColumnsOperation.java:126 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetColumnsOperation.java:126-152 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/GetColumnsOperation.java:133-159 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetColumnsOperation.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/GetColumnsOperation.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetColumnsOperation.java:126` 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, `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/GetColumnsOperation.java:161` calls `get`, `getConf`, `getIntVar` and `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetColumnsOperation.java:154` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (27 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java:148 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java:148-174 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java:147-173 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 274 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.
D4 · Code Duplication · Duplicated block (26 lines × 2) · ×6
  • Duplicated block (26 lines × 2) core/src/main/scala/org/apache/spark/api/python/PythonRunner.scala:581 — core/src/main/scala/org/apache/spark/api/python/PythonRunner.scala:581-606 | sql/core/src/main/scala/org/apache/spark/sql/execution/python/PythonUDFRunner.scala:64-89 — 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 (26 lines × 2) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:379 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:379-404 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala:364-389 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 394 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 (26 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/HandleIdentifier.java:82 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/HandleIdentifier.java:82-107 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/HandleIdentifier.java:82-107 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/HandleIdentifier.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/HandleIdentifier.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (26 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/RowBasedSet.java:105 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/RowBasedSet.java:105-130 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/RowBasedSet.java:105-130 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/RowBasedSet.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/RowBasedSet.java` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: `TColumnValue` names `org.apache.hive.service.cli.thrift.TColumnValue` in one and `org.apache.hive.service.rpc.thrift.TColumnValue` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (26 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:267 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:267-292 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:270-295 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 435 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 `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:267` 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 (26 lines × 2) examples/src/main/scala/org/apache/spark/examples/ml/GBTExample.scala:215 — examples/src/main/scala/org/apache/spark/examples/ml/GBTExample.scala:215-240 | examples/src/main/scala/org/apache/spark/examples/ml/RandomForestExample.scala:223-248 — before extracting anything, compare `examples/src/main/scala/org/apache/spark/examples/ml/GBTExample.scala` and `examples/src/main/scala/org/apache/spark/examples/ml/RandomForestExample.scala` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 153 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `examples/src/main/scala/org/apache/spark/examples/ml/GBTExample.scala:215` 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.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×6
  • Duplicated block (8 lines × 3) mllib/src/main/scala/org/apache/spark/ml/classification/GBTClassifier.scala:421 — mllib/src/main/scala/org/apache/spark/ml/classification/GBTClassifier.scala:421-429 | mllib/src/main/scala/org/apache/spark/ml/regression/GBTRegressor.scala:349-358 | mllib/src/main/scala/org/apache/spark/ml/regression/RandomForestRegressor.scala:276-283 — before extracting anything, compare `mllib/src/main/scala/org/apache/spark/ml/regression/GBTRegressor.scala` and `mllib/src/main/scala/org/apache/spark/ml/regression/RandomForestRegressor.scala` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 3) REDACTED:3337 — REDACTED:3337-3344 | REDACTED:3581-3588 | REDACTED:3813-3820 — 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 `REDACTED:3337` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) mllib/src/main/scala/org/apache/spark/ml/feature/FeatureHasher.scala:238 — mllib/src/main/scala/org/apache/spark/ml/feature/FeatureHasher.scala:238-245 | mllib/src/main/scala/org/apache/spark/mllib/feature/HashingTF.scala:153-160 | REDACTED:482-489 — 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 `mllib/src/main/scala/org/apache/spark/ml/feature/FeatureHasher.scala:238` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) python/pyspark/mllib/evaluation.py:56 — python/pyspark/mllib/evaluation.py:56-63 | python/pyspark/mllib/evaluation.py:123-130 | python/pyspark/mllib/evaluation.py:247-254 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (8 lines × 3) examples/src/main/java/org/apache/spark/examples/ml/JavaMaxAbsScalerExample.java:41 — examples/src/main/java/org/apache/spark/examples/ml/JavaMaxAbsScalerExample.java:41-48 | examples/src/main/java/org/apache/spark/examples/ml/JavaMinMaxScalerExample.java:41-48 | examples/src/main/java/org/apache/spark/examples/ml/JavaNormalizerExample.java:40-47 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 `examples/src/main/java/org/apache/spark/examples/ml/JavaMaxAbsScalerExample.java:41` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) examples/src/main/java/org/apache/spark/examples/mllib/JavaGaussianMixtureExample.java:34 — examples/src/main/java/org/apache/spark/examples/mllib/JavaGaussianMixtureExample.java:34-41 | examples/src/main/java/org/apache/spark/examples/mllib/JavaKMeansExample.java:34-41 | examples/src/main/java/org/apache/spark/examples/mllib/JavaLatentDirichletAllocationExample.java:39-46 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `examples/src/main/java/org/apache/spark/examples/mllib/JavaGaussianMixtureExample.java:34` 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.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×6
  • Duplicated block (7 lines × 3) mllib/src/main/scala/org/apache/spark/mllib/evaluation/BinaryClassificationMetrics.scala:72 — mllib/src/main/scala/org/apache/spark/mllib/evaluation/BinaryClassificationMetrics.scala:72-78 | mllib/src/main/scala/org/apache/spark/mllib/evaluation/MulticlassMetrics.scala:43-49 | mllib/src/main/scala/org/apache/spark/mllib/evaluation/RegressionMetrics.scala:51-57 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `mllib/src/main/scala/org/apache/spark/mllib/evaluation/BinaryClassificationMetrics.scala:72` 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 × 3) mllib/src/main/scala/org/apache/spark/mllib/regression/Lasso.scala:61 — mllib/src/main/scala/org/apache/spark/mllib/regression/Lasso.scala:61-67 | mllib/src/main/scala/org/apache/spark/mllib/regression/LinearRegression.scala:61-67 | mllib/src/main/scala/org/apache/spark/mllib/regression/RidgeRegression.scala: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 all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `mllib/src/main/scala/org/apache/spark/mllib/regression/Lasso.scala:61` 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) mllib/src/main/scala/org/apache/spark/ml/feature/MaxAbsScaler.scala:41 — mllib/src/main/scala/org/apache/spark/ml/feature/MaxAbsScaler.scala:41-47 | mllib/src/main/scala/org/apache/spark/ml/feature/PCA.scala:55-61 | mllib/src/main/scala/org/apache/spark/ml/feature/StandardScaler.scala:66-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 all 3 call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `mllib/src/main/scala/org/apache/spark/ml/feature/StandardScaler.scala:74` calls `setDefault` and `mllib/src/main/scala/org/apache/spark/ml/feature/MaxAbsScaler.scala:48` 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) sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/HashAggregateExec.scala:82 — sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/HashAggregateExec.scala:82-88 | sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/ObjectHashAggregateExec.scala:92-98 | sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/SortAggregateExec.scala:57-63 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/SortAggregateExec.scala:52` calls `Map`, `createMetric` and `sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/HashAggregateExec.scala:80` 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) mllib/src/main/scala/org/apache/spark/mllib/clustering/BisectingKMeansModel.scala:181 — mllib/src/main/scala/org/apache/spark/mllib/clustering/BisectingKMeansModel.scala:181-187 | mllib/src/main/scala/org/apache/spark/mllib/clustering/BisectingKMeansModel.scala:217-223 | mllib/src/main/scala/org/apache/spark/mllib/clustering/BisectingKMeansModel.scala:255-261 — 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 `mllib/src/main/scala/org/apache/spark/mllib/clustering/BisectingKMeansModel.scala:181` 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 × 3) sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeArrayData.java:350 — sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeArrayData.java:350-356 | sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeMapData.java:120-126 | sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeRow.java:574-580 — before extracting anything, compare `sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeArrayData.java` and `sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeRow.java` as WHOLE FILES: this scan already matched 5 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.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×6
  • Duplicated block (6 lines × 3) sql/core/src/main/scala/org/apache/spark/sql/execution/joins/BroadcastNestedLoopJoinExec.scala:66 — sql/core/src/main/scala/org/apache/spark/sql/execution/joins/BroadcastNestedLoopJoinExec.scala:66-71 | sql/core/src/main/scala/org/apache/spark/sql/execution/joins/HashJoin.scala:41-46 | sql/core/src/main/scala/org/apache/spark/sql/execution/joins/SortMergeJoinExec.scala:49-54 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 `sql/core/src/main/scala/org/apache/spark/sql/execution/joins/BroadcastNestedLoopJoinExec.scala:66` 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, `sql/core/src/main/scala/org/apache/spark/sql/execution/joins/BroadcastNestedLoopJoinExec.scala:74` calls `withNullability` and `sql/core/src/main/scala/org/apache/spark/sql/execution/joins/HashJoin.scala:48` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 3) mllib/src/main/scala/org/apache/spark/mllib/clustering/BisectingKMeansModel.scala:195 — mllib/src/main/scala/org/apache/spark/mllib/clustering/BisectingKMeansModel.scala:195-200 | mllib/src/main/scala/org/apache/spark/mllib/clustering/BisectingKMeansModel.scala:232-237 | mllib/src/main/scala/org/apache/spark/mllib/clustering/BisectingKMeansModel.scala:271-276 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (6 lines × 3) common/network-common/src/main/java/org/apache/spark/network/protocol/RpcRequest.java:80 — common/network-common/src/main/java/org/apache/spark/network/protocol/RpcRequest.java:80-85 | common/network-common/src/main/java/org/apache/spark/network/protocol/RpcResponse.java:80-85 | common/network-common/src/main/java/org/apache/spark/network/protocol/UploadStream.java:101-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 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 (6 lines × 3) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/RowSetFactory.java:28 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/RowSetFactory.java:28-33 | sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/RowSetFactory.java:35-40 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/RowSetFactory.java:36-41 — 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: `TProtocolVersion` names `org.apache.hive.service.cli.thrift.TProtocolVersion` in one and `org.apache.hive.service.rpc.thrift.TProtocolVersion` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, 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) examples/src/main/java/org/apache/spark/examples/ml/JavaBucketizerExample.java:89 — examples/src/main/java/org/apache/spark/examples/ml/JavaBucketizerExample.java:89-94 | examples/src/main/java/org/apache/spark/examples/ml/JavaOneHotEncoderExample.java:50-56 | examples/src/main/java/org/apache/spark/examples/ml/JavaTfIdfExample.java:47-52 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 `examples/src/main/java/org/apache/spark/examples/ml/JavaBucketizerExample.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 (6 lines × 3) examples/src/main/java/org/apache/spark/examples/mllib/JavaGaussianMixtureExample.java:43 — examples/src/main/java/org/apache/spark/examples/mllib/JavaGaussianMixtureExample.java:43-48 | examples/src/main/java/org/apache/spark/examples/mllib/JavaKMeansExample.java:43-48 | examples/src/main/java/org/apache/spark/examples/mllib/JavaLatentDirichletAllocationExample.java:48-53 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 `examples/src/main/java/org/apache/spark/examples/mllib/JavaGaussianMixtureExample.java:43` 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.
D4 · Code Duplication · Duplicated block (23 lines × 2) · ×6
  • Duplicated block (23 lines × 2) sql/core/v1.2.1/src/main/java/org/apache/spark/sql/execution/datasources/orc/OrcColumnVector.java:48 — sql/core/v1.2.1/src/main/java/org/apache/spark/sql/execution/datasources/orc/OrcColumnVector.java:48-70 | sql/core/v2.3.5/src/main/java/org/apache/spark/sql/execution/datasources/orc/OrcColumnVector.java:48-70 — before extracting anything, compare `sql/core/v1.2.1/src/main/java/org/apache/spark/sql/execution/datasources/orc/OrcColumnVector.java` and `sql/core/v2.3.5/src/main/java/org/apache/spark/sql/execution/datasources/orc/OrcColumnVector.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 (23 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:122 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:122-144 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:124-146 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 187 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 `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.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 after the matched lines, `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:149` calls `HiveDelegationTokenManager` and `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:147` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (23 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java:325 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java:325-347 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java:324-346 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 274 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 `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java:325` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (23 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:188 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:188-210 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:190-212 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 435 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 (23 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:424 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:424-446 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:427-449 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 435 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 (23 lines × 2) REDACTED:498 — REDACTED:498-520 | REDACTED:519-541 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 325 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.
X3 · Exception handling · Swallowed exception (empty catch) · ×6
  • Swallowed exception (empty catch) streaming/src/main/scala/org/apache/spark/streaming/Checkpoint.scala:389 — 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) python/pyspark/daemon.py:80 — 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) python/pyspark/daemon.py:179 — 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) python/pyspark/testing/streamingutils.py:75 — 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) python/pyspark/testing/streamingutils.py:89 — 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) core/src/main/scala/org/apache/spark/serializer/KryoSerializer.scala:219 — 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.
AC6 · Visual & motion safety · Focus outline removed in CSS without a · ×5
  • Focus outline removed in CSS without a :focus replacement docs/css/bootstrap.css:2631 — `.open .dropdown-toggle` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement docs/css/bootstrap.css:2730 — `.dropdown-menu .active > a` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement docs/css/bootstrap.css:2989 — `.btn.active` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement docs/css/bootstrap.css:3422 — `.btn-group.open .dropdown-toggle` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement docs/css/bootstrap.css:4519 — `.navbar-inverse .navbar-search .search-query.focused` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
D4 · Code Duplication · Edited copies of one member (3 members, 15+ corresponding lines) · ×5
  • Edited copies of one member (3 members, 15+ corresponding lines) mllib/src/main/scala/org/apache/spark/mllib/clustering/BisectingKMeansModel.scala:189 — mllib/src/main/scala/org/apache/spark/mllib/clustering/BisectingKMeansModel.scala:189-203 | mllib/src/main/scala/org/apache/spark/mllib/clustering/BisectingKMeansModel.scala:225-240 | mllib/src/main/scala/org/apache/spark/mllib/clustering/BisectingKMeansModel.scala:263-278 — 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) mllib/src/main/scala/org/apache/spark/mllib/regression/Lasso.scala:60 — mllib/src/main/scala/org/apache/spark/mllib/regression/Lasso.scala:60-74 | mllib/src/main/scala/org/apache/spark/mllib/regression/LinearRegression.scala:60-74 | mllib/src/main/scala/org/apache/spark/mllib/regression/RidgeRegression.scala:61-75 — 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) python/pyspark/sql/catalog.py:289 — python/pyspark/sql/catalog.py:289-309 | python/pyspark/sql/conf.py:79-96 | python/pyspark/sql/udf.py:404-418 — 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) python/pyspark/ml/classification.py:1884 — python/pyspark/ml/classification.py:1884-1898 | python/pyspark/ml/tuning.py:352-367 | python/pyspark/ml/tuning.py:630-645 — 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) python/pyspark/ml/feature.py:619 — python/pyspark/ml/feature.py:619-636 | python/pyspark/ml/feature.py:2504-2518 | python/pyspark/ml/feature.py:2524-2538 — 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 copy of a member (43 corresponding lines) · ×5
  • Edited copy of a member (43 corresponding lines) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/OperationState.java:52 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/OperationState.java:52-94 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/OperationState.java:53-99 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (43 corresponding lines) python/pyspark/rdd.py:1884 — python/pyspark/rdd.py:1884-1943 | python/pyspark/rdd.py:1985-2027 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (43 corresponding lines) sql/core/src/main/scala/org/apache/spark/sql/execution/joins/BroadcastHashJoinExec.scala:333 — sql/core/src/main/scala/org/apache/spark/sql/execution/joins/BroadcastHashJoinExec.scala:333-375 | sql/core/src/main/scala/org/apache/spark/sql/execution/joins/BroadcastHashJoinExec.scala:380-437 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (43 corresponding lines) examples/src/main/java/org/apache/spark/examples/mllib/JavaLinearRegressionWithSGDExample.java:38 — examples/src/main/java/org/apache/spark/examples/mllib/JavaLinearRegressionWithSGDExample.java:38-80 | examples/src/main/java/org/apache/spark/examples/mllib/JavaRegressionMetricsExample.java:33-82 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (43 corresponding lines) examples/src/main/java/org/apache/spark/examples/mllib/JavaKMeansExample.java:32 — examples/src/main/java/org/apache/spark/examples/mllib/JavaKMeansExample.java:32-74 | examples/src/main/java/org/apache/spark/examples/mllib/JavaLatentDirichletAllocationExample.java:37-81 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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, 9+ corresponding lines) · ×5
  • Edited copies of one member (3 members, 9+ corresponding lines) core/src/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala:784 — core/src/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala:784-795 | core/src/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala:802-810 | core/src/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala:817-827 — 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) REDACTED:1139 — REDACTED:1139-1149 | REDACTED:1872-1880 | REDACTED:2908-2916 — 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) common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/protocol/OpenBlocks.java:60 — common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/protocol/OpenBlocks.java:60-68 | common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/protocol/RegisterExecutor.java:64-72 | common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/protocol/RemoveBlocks.java:59-67 — 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) mllib/src/main/scala/org/apache/spark/mllib/linalg/distributed/CoordinateMatrix.scala:167 — mllib/src/main/scala/org/apache/spark/mllib/linalg/distributed/CoordinateMatrix.scala:167-175 | mllib/src/main/scala/org/apache/spark/mllib/linalg/distributed/IndexedRowMatrix.scala:264-275 | mllib/src/main/scala/org/apache/spark/mllib/linalg/distributed/RowMatrix.scala:758-770 — 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) python/pyspark/ml/evaluation.py:336 — python/pyspark/ml/evaluation.py:336-345 | python/pyspark/ml/feature.py:1787-1795 | python/pyspark/ml/regression.py:1532-1545 — 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, 7+ corresponding lines) · ×5
  • Edited copies of one member (3 members, 7+ corresponding lines) streaming/src/main/scala/org/apache/spark/streaming/dstream/PairDStreamFunctions.scala:435 — streaming/src/main/scala/org/apache/spark/streaming/dstream/PairDStreamFunctions.scala:435-441 | streaming/src/main/scala/org/apache/spark/streaming/dstream/PairDStreamFunctions.scala:484-490 | streaming/src/main/scala/org/apache/spark/streaming/dstream/PairDStreamFunctions.scala:533-539 — 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) streaming/src/main/scala/org/apache/spark/streaming/api/java/JavaStreamingContext.scala:365 — streaming/src/main/scala/org/apache/spark/streaming/api/java/JavaStreamingContext.scala:365-371 | streaming/src/main/scala/org/apache/spark/streaming/api/java/JavaStreamingContext.scala:389-395 | streaming/src/main/scala/org/apache/spark/streaming/api/java/JavaStreamingContext.scala:414-420 — 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) common/unsafe/src/main/java/org/apache/spark/unsafe/bitset/BitSetMethods.java:40 — common/unsafe/src/main/java/org/apache/spark/unsafe/bitset/BitSetMethods.java:40-46 | common/unsafe/src/main/java/org/apache/spark/unsafe/bitset/BitSetMethods.java:51-57 | common/unsafe/src/main/java/org/apache/spark/unsafe/bitset/BitSetMethods.java:62-68 — 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) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/TimeWindow.scala:104 — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/TimeWindow.scala:104-111 | sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/continuous/ContinuousTrigger.scala:38-44 | sql/core/src/main/scala/org/apache/spark/sql/streaming/ProcessingTime.scala:76-82 — 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) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/InterpretedMutableProjection.scala:104 — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/InterpretedMutableProjection.scala:104-110 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/InterpretedSafeProjection.scala:118-124 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/InterpretedUnsafeProjection.scala:94-100 — 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 · Duplicated block (30 lines × 2) · ×5
  • Duplicated block (30 lines × 2) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:793 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:793-822 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala:729-758 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 394 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 (30 lines × 2) sql/core/src/main/scala/org/apache/spark/sql/execution/python/WindowInPandasExec.scala:328 — sql/core/src/main/scala/org/apache/spark/sql/execution/python/WindowInPandasExec.scala:328-357 | sql/core/src/main/scala/org/apache/spark/sql/execution/window/WindowExec.scala:147-176 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (30 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/ColumnValue.java:166 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/ColumnValue.java:166-195 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/ColumnValue.java:170-199 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/ColumnValue.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/ColumnValue.java` as WHOLE FILES: this scan already matched 11 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 `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/ColumnValue.java:166` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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: `TColumnValue` names `org.apache.hive.service.cli.thrift.TColumnValue` in one and `org.apache.hive.service.rpc.thrift.TColumnValue` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/ColumnValue.java:168` calls `getType` and `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/ColumnValue.java:165` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (30 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/SessionManager.java:244 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/SessionManager.java:244-273 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/SessionManager.java:244-273 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/SessionManager.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/SessionManager.java` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 167 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. Note first that the copies are not typed on the same thing: `TProtocolVersion` names `org.apache.hive.service.cli.thrift.TProtocolVersion` in one and `org.apache.hive.service.rpc.thrift.TProtocolVersion` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (30 lines × 2) python/pyspark/ml/linalg/__init__.py:1061 — python/pyspark/ml/linalg/__init__.py:1061-1090 | python/pyspark/mllib/linalg/__init__.py:1216-1245 — before extracting anything, compare `python/pyspark/ml/linalg/__init__.py` and `python/pyspark/mllib/linalg/__init__.py` as WHOLE FILES: this scan already matched 34 separate duplicated blocks between them, totalling at least 667 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.
D4 · Code Duplication · Duplicated block (24 lines × 2) · ×5
  • Duplicated block (24 lines × 2) mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:151 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:151-174 | mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala:153-176 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 476 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (24 lines × 2) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:392 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:392-415 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala:544-567 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 357 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (24 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/PlainSaslHelper.java:87 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/PlainSaslHelper.java:87-110 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/auth/PlainSaslHelper.java:87-110 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/PlainSaslHelper.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/auth/PlainSaslHelper.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (24 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:296 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:296-319 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:297-320 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 436 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (24 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/server/HiveServer2.java:205 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/server/HiveServer2.java:205-228 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/server/HiveServer2.java:210-233 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/server/HiveServer2.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/server/HiveServer2.java` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 130 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.
D4 · Code Duplication · Duplicated block (10–11 lines × 2) · ×5
  • Duplicated block (10–11 lines × 2) sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/ObjectHashAggregateExec.scala:147 — sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/ObjectHashAggregateExec.scala:147-156 | sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/SortAggregateExec.scala:115-125 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 (10–11 lines × 2) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFileFormat.scala:332 — sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFileFormat.scala:332-341 | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/parquet/ParquetPartitionReaderFactory.scala:192-202 — 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 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) streaming/src/main/scala/org/apache/spark/streaming/ui/BatchPage.scala:77 — streaming/src/main/scala/org/apache/spark/streaming/ui/BatchPage.scala:77-86 | streaming/src/main/scala/org/apache/spark/streaming/ui/BatchPage.scala:189-199 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `streaming/src/main/scala/org/apache/spark/streaming/ui/BatchPage.scala: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 (10–11 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:147 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:147-156 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:150-160 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 187 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 `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:147` 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, `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:149` calls `HiveDelegationTokenManager` and `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:144` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10–11 lines × 2) examples/src/main/java/org/apache/spark/examples/mllib/JavaGradientBoostingClassificationExample.java:57 — examples/src/main/java/org/apache/spark/examples/mllib/JavaGradientBoostingClassificationExample.java:57-67 | examples/src/main/java/org/apache/spark/examples/mllib/JavaGradientBoostingRegressionExample.java:55-64 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `examples/src/main/java/org/apache/spark/examples/mllib/JavaGradientBoostingClassificationExample.java:56` calls `getTreeStrategy`, `setNumClasses` and `examples/src/main/java/org/apache/spark/examples/mllib/JavaGradientBoostingRegressionExample.java:54` 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.
D4 · Code Duplication · Duplicated block (9–10 lines × 2) · ×5
  • Duplicated block (9–10 lines × 2) mllib/src/main/scala/org/apache/spark/ml/classification/GBTClassifier.scala:200 — mllib/src/main/scala/org/apache/spark/ml/classification/GBTClassifier.scala:200-208 | mllib/src/main/scala/org/apache/spark/ml/regression/GBTRegressor.scala:177-186 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `mllib/src/main/scala/org/apache/spark/ml/classification/GBTClassifier.scala:198` calls `logNumClasses` and `mllib/src/main/scala/org/apache/spark/ml/regression/GBTRegressor.scala:175` 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–10 lines × 2) mllib/src/main/scala/org/apache/spark/ml/regression/GBTRegressor.scala:346 — mllib/src/main/scala/org/apache/spark/ml/regression/GBTRegressor.scala:346-355 | mllib/src/main/scala/org/apache/spark/ml/regression/RandomForestRegressor.scala:273-281 — before extracting anything, compare `mllib/src/main/scala/org/apache/spark/ml/regression/GBTRegressor.scala` and `mllib/src/main/scala/org/apache/spark/ml/regression/RandomForestRegressor.scala` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (9–10 lines × 2) mllib/src/main/scala/org/apache/spark/ml/tree/impl/GradientBoostedTrees.scala:209 — mllib/src/main/scala/org/apache/spark/ml/tree/impl/GradientBoostedTrees.scala:209-217 | mllib/src/main/scala/org/apache/spark/mllib/tree/model/treeEnsembleModels.scala:147-156 — 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 `mllib/src/main/scala/org/apache/spark/ml/tree/impl/GradientBoostedTrees.scala:209` 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 (9–10 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:234 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:234-243 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:237-245 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 435 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 `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:234` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:236` calls `VariableSubstitution`, `getHiveVariables` and `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:233` 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–10 lines × 2) examples/src/main/scala/org/apache/spark/examples/mllib/GradientBoostedTreesRunner.scala:114 — examples/src/main/scala/org/apache/spark/examples/mllib/GradientBoostedTreesRunner.scala:114-123 | examples/src/main/scala/org/apache/spark/examples/mllib/GradientBoostedTreesRunner.scala:131-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. Read the line range as the matched WINDOW rather than a finished unit: at `examples/src/main/scala/org/apache/spark/examples/mllib/GradientBoostedTreesRunner.scala:114` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×5
  • Duplicated block (5 lines × 3) mllib/src/main/scala/org/apache/spark/mllib/clustering/KMeansModel.scala:165 — mllib/src/main/scala/org/apache/spark/mllib/clustering/KMeansModel.scala:165-169 | mllib/src/main/scala/org/apache/spark/mllib/clustering/KMeansModel.scala:199-203 | mllib/src/main/scala/org/apache/spark/mllib/clustering/PowerIterationClustering.scala:82-87 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (5 lines × 3) mllib/src/main/scala/org/apache/spark/mllib/feature/ChiSqSelector.scala:136 — mllib/src/main/scala/org/apache/spark/mllib/feature/ChiSqSelector.scala:136-140 | mllib/src/main/scala/org/apache/spark/mllib/fpm/FPGrowth.scala:105-109 | mllib/src/main/scala/org/apache/spark/mllib/fpm/PrefixSpan.scala:649-653 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
  • Duplicated block (5 lines × 3) mllib/src/main/scala/org/apache/spark/mllib/pmml/export/BinaryClassificationPMMLModelExport.scala:70 — mllib/src/main/scala/org/apache/spark/mllib/pmml/export/BinaryClassificationPMMLModelExport.scala:70-74 | mllib/src/main/scala/org/apache/spark/mllib/pmml/export/GeneralizedLinearPMMLModelExport.scala:56-60 | mllib/src/main/scala/org/apache/spark/mllib/pmml/export/KMeansPMMLModelExport.scala:58-62 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
  • Duplicated block (5 lines × 3) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFileFormat.scala:193 — sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFileFormat.scala:193-197 | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/orc/OrcPartitionReaderFactory.scala:89-94 | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/orc/OrcPartitionReaderFactory.scala:134-138 — 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 `sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFileFormat.scala:193` 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 (5 lines × 3) python/pyspark/ml/clustering.py:412 — python/pyspark/ml/clustering.py:412-416 | python/pyspark/ml/feature.py:3695-3699 | python/pyspark/ml/regression.py:1539-1545 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `python/pyspark/ml/clustering.py:418` calls `_create_model`, `KMeansModel` and `python/pyspark/ml/feature.py:3701` 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.
AC6 · Visual & motion safety · Low contrast colour pair in CSS (3.9 · ×4
  • Low contrast colour pair in CSS (3.9:1) docs/css/bootstrap.css:3675 — `.nav-list > .active > a, .nav-list > .active > a:hover` sets color: #ffffff on background-color: #0088cc — 3.9:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
  • Low contrast colour pair in CSS (3.9:1) docs/css/bootstrap.css:3769 — `.nav-pills > .active > a, .nav-pills > .active > a:hover` sets color: #ffffff on background-color: #0088cc — 3.9:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
  • Low contrast colour pair in CSS (3.9:1) core/src/main/resources/org/apache/spark/ui/static/dataTables.bootstrap.css:153 — `.table.dataTable tbody tr.active td, .table.dataTable tbody tr.active th` sets color: white on background-color: #08C — 3.9:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
  • Low contrast colour pair in CSS (3.9:1) core/src/main/resources/org/apache/spark/ui/static/dataTables.bootstrap.css:198 — `ul.DTTT_dropdown.dropdown-menu li:hover a` sets color: white on background-color: #0088cc — 3.9:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
D17 · Explicit Debt · FixmeComment · ×4
  • FixmeComment sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:100 — // FIXME extract the right info type — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:99 — // FIXME extract the right info type — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment core/src/main/scala/org/apache/spark/util/Utils.scala:3006 — // FIXME: We copy the stream on the level of bytes to avoid encoding problems. — 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 core/src/main/scala/org/apache/spark/deploy/client/StandaloneAppClient.scala:157 — // FIXME How to handle the following cases? — 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.
D29 · Static Analysis (SAST) · REDACTED · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Members sharing a duplicated core (7 members, 50+ identical tokens) · ×4
  • Members sharing a duplicated core (7 members, 50+ identical tokens) mllib/src/main/scala/org/apache/spark/ml/r/BisectingKMeansWrapper.scala:74 — mllib/src/main/scala/org/apache/spark/ml/r/BisectingKMeansWrapper.scala:74-105 | mllib/src/main/scala/org/apache/spark/ml/r/DecisionTreeRegressionWrapper.scala:67-98 | mllib/src/main/scala/org/apache/spark/ml/r/GBTRegressionWrapper.scala:72-106 | mllib/src/main/scala/org/apache/spark/ml/r/GaussianMixtureWrapper.scala:70-99 | mllib/src/main/scala/org/apache/spark/ml/r/IsotonicRegressionWrapper.scala:58-86 | mllib/src/main/scala/org/apache/spark/ml/r/KMeansWrapper.scala:76-108 | mllib/src/main/scala/org/apache/spark/ml/r/RandomForestRegressionWrapper.scala:72-106 — These 7 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 7 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 7 times.
  • Members sharing a duplicated core (7 members, 50+ identical tokens) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala:979 — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala:979-1034 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala:1134-1157 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala:1161-1184 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala:1186-1209 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala:1211-1235 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala:1237-1257 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala:1259-1279 — These 7 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 7 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 7 times.
  • Members sharing a duplicated core (7 members, 50+ identical tokens) python/pyspark/mllib/classification.py:754 — python/pyspark/mllib/classification.py:754-766 | python/pyspark/mllib/evaluation.py:600-618 | python/pyspark/mllib/feature.py:823-834 | python/pyspark/mllib/random.py:412-425 | python/pyspark/mllib/regression.py:830-842 | python/pyspark/mllib/stat/_statistics.py:305-322 | python/pyspark/mllib/tree.py:647-658 — These 7 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 7 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 7 times.
  • Members sharing a duplicated core (7 members, 50+ identical tokens) examples/src/main/java/org/apache/spark/examples/mllib/JavaDecisionTreeClassificationExample.java:38 — examples/src/main/java/org/apache/spark/examples/mllib/JavaDecisionTreeClassificationExample.java:38-78 | examples/src/main/java/org/apache/spark/examples/mllib/JavaDecisionTreeRegressionExample.java:38-78 | examples/src/main/java/org/apache/spark/examples/mllib/JavaGradientBoostingClassificationExample.java:38-79 | examples/src/main/java/org/apache/spark/examples/mllib/JavaGradientBoostingRegressionExample.java:38-79 | examples/src/main/java/org/apache/spark/examples/mllib/JavaNaiveBayesExample.java:33-54 | examples/src/main/java/org/apache/spark/examples/mllib/JavaRandomForestClassificationExample.java:37-79 | examples/src/main/java/org/apache/spark/examples/mllib/JavaRandomForestRegressionExample.java:37-79 — These 7 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 7 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 7 times.
D4 · Code Duplication · Edited copy of a member (37 corresponding lines) · ×4
  • Edited copy of a member (37 corresponding lines) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/server/HiveServer2.java:116 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/server/HiveServer2.java:116-152 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/server/HiveServer2.java:116-157 — 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) mllib/src/main/scala/org/apache/spark/ml/clustering/BisectingKMeans.scala:250 — mllib/src/main/scala/org/apache/spark/ml/clustering/BisectingKMeans.scala:250-286 | mllib/src/main/scala/org/apache/spark/ml/clustering/KMeans.scala:308-346 — 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) examples/src/main/scala/org/apache/spark/examples/mllib/LogisticRegressionWithLBFGSExample.scala:31 — examples/src/main/scala/org/apache/spark/examples/mllib/LogisticRegressionWithLBFGSExample.scala:31-67 | examples/src/main/scala/org/apache/spark/examples/mllib/SVMWithSGDExample.scala:30-68 — 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) examples/src/main/scala/org/apache/spark/examples/sql/streaming/StructuredKafkaWordCount.scala:51 — examples/src/main/scala/org/apache/spark/examples/sql/streaming/StructuredKafkaWordCount.scala:51-90 | examples/src/main/scala/org/apache/spark/examples/sql/streaming/StructuredNetworkWordCount.scala:37-73 — 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 copies of one member (3 members, 12+ corresponding lines) · ×4
  • Edited copies of one member (3 members, 12+ corresponding lines) mllib/src/main/scala/org/apache/spark/mllib/clustering/BisectingKMeansModel.scala:176 — mllib/src/main/scala/org/apache/spark/mllib/clustering/BisectingKMeansModel.scala:176-187 | mllib/src/main/scala/org/apache/spark/mllib/clustering/BisectingKMeansModel.scala:212-223 | mllib/src/main/scala/org/apache/spark/mllib/clustering/BisectingKMeansModel.scala:249-261 — 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) python/pyspark/mllib/evaluation.py:56 — python/pyspark/mllib/evaluation.py:56-67 | python/pyspark/mllib/evaluation.py:123-134 | python/pyspark/mllib/evaluation.py:247-258 — 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) mllib/src/main/scala/org/apache/spark/mllib/feature/ChiSqSelector.scala:149 — mllib/src/main/scala/org/apache/spark/mllib/feature/ChiSqSelector.scala:149-167 | mllib/src/main/scala/org/apache/spark/mllib/fpm/FPGrowth.scala:127-138 | mllib/src/main/scala/org/apache/spark/mllib/fpm/PrefixSpan.scala:671-682 — 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) REDACTED:737 — REDACTED:737-748 | REDACTED:838-849 | REDACTED:941-952 — 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 · Duplicated block (41 lines × 2) · ×4
  • Duplicated block (41 lines × 2) core/src/main/scala/org/apache/spark/ui/jobs/AllJobsPage.scala:116 — core/src/main/scala/org/apache/spark/ui/jobs/AllJobsPage.scala:116-156 | core/src/main/scala/org/apache/spark/ui/jobs/JobPage.scala:98-138 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 (41 lines × 2) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:848 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:848-888 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala:783-823 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 394 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 (41 lines × 2) mllib/src/main/scala/org/apache/spark/mllib/classification/StreamingLogisticRegressionWithSGD.scala:61 — mllib/src/main/scala/org/apache/spark/mllib/classification/StreamingLogisticRegressionWithSGD.scala:61-101 | mllib/src/main/scala/org/apache/spark/mllib/regression/StreamingLinearRegressionWithSGD.scala:58-117 — 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 (41 lines × 2) python/pyspark/ml/linalg/__init__.py:307 — python/pyspark/ml/linalg/__init__.py:307-347 | python/pyspark/mllib/linalg/__init__.py:340-380 — before extracting anything, compare `python/pyspark/ml/linalg/__init__.py` and `python/pyspark/mllib/linalg/__init__.py` as WHOLE FILES: this scan already matched 34 separate duplicated blocks between them, totalling at least 667 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.
D4 · Code Duplication · Duplicated block (36 lines × 2) · ×4
  • Duplicated block (36 lines × 2) mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:592 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:592-627 | mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala:573-608 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 476 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 (36 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java:110 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java:110-145 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java:109-144 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 274 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 `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java:110` 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, `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java:108` calls `VariableSubstitution`, `substitute` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java:106` 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 (36 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:91 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:91-126 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:92-127 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 436 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 (36 lines × 2) python/pyspark/ml/linalg/__init__.py:350 — python/pyspark/ml/linalg/__init__.py:350-385 | python/pyspark/mllib/linalg/__init__.py:383-418 — before extracting anything, compare `python/pyspark/ml/linalg/__init__.py` and `python/pyspark/mllib/linalg/__init__.py` as WHOLE FILES: this scan already matched 34 separate duplicated blocks between them, totalling at least 667 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.
D4 · Code Duplication · Duplicated block (34 lines × 2) · ×4
  • Duplicated block (34 lines × 2) mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:180 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:180-213 | mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala:182-215 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 476 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 (34 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetTypeInfoOperation.java:85 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetTypeInfoOperation.java:85-118 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/GetTypeInfoOperation.java:85-118 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetTypeInfoOperation.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/GetTypeInfoOperation.java` as WHOLE FILES: 98% 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 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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: `Type` names `org.apache.hadoop.hive.serde2.thrift.Type` in one and `org.apache.hive.service.cli.Type` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (34 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:635 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:635-668 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:649-682 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 435 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 (34 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/SessionManager.java:152 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/SessionManager.java:152-185 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/SessionManager.java:152-185 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/SessionManager.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/SessionManager.java` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 167 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.
D4 · Code Duplication · Duplicated block (32 lines × 2) · ×4
  • Duplicated block (32 lines × 2) mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:713 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:713-744 | mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala:694-725 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 476 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 `mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:713` 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 (32 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:281 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:281-312 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:287-318 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 187 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 (32 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/SessionHandle.java:35 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/SessionHandle.java:35-66 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/SessionHandle.java:35-71 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/SessionHandle.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/SessionHandle.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. 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. Note first that the copies are not typed on the same thing: `TProtocolVersion` names `org.apache.hive.service.cli.thrift.TProtocolVersion` in one and `org.apache.hive.service.rpc.thrift.TProtocolVersion` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (32 lines × 2) python/pyspark/ml/linalg/__init__.py:85 — python/pyspark/ml/linalg/__init__.py:85-116 | python/pyspark/mllib/linalg/__init__.py:87-118 — before extracting anything, compare `python/pyspark/ml/linalg/__init__.py` and `python/pyspark/mllib/linalg/__init__.py` as WHOLE FILES: this scan already matched 34 separate duplicated blocks between them, totalling at least 667 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.
D4 · Code Duplication · Duplicated block (28 lines × 2) · ×4
  • Duplicated block (28 lines × 2) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/arithmetic.scala:586 — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/arithmetic.scala:586-613 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/arithmetic.scala:659-686 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (28 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/HiveCommandOperation.java:99 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/HiveCommandOperation.java:99-126 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/HiveCommandOperation.java:99-126 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/HiveCommandOperation.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/HiveCommandOperation.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 78 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 (28 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/HiveCommandOperation.java:171 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/HiveCommandOperation.java:171-198 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/HiveCommandOperation.java:171-198 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/HiveCommandOperation.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/HiveCommandOperation.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 78 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 (28 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/SessionManager.java:114 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/SessionManager.java:114-141 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/SessionManager.java:114-141 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/SessionManager.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/SessionManager.java` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 167 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.
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×4
  • Duplicated block (14–15 lines × 2) resource-managers/mesos/src/main/scala/org/apache/spark/scheduler/cluster/mesos/MesosCoarseGrainedSchedulerBackend.scala:234 — resource-managers/mesos/src/main/scala/org/apache/spark/scheduler/cluster/mesos/MesosCoarseGrainedSchedulerBackend.scala:234-248 | resource-managers/mesos/src/main/scala/org/apache/spark/scheduler/cluster/mesos/MesosFineGrainedSchedulerBackend.scala:120-133 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `resource-managers/mesos/src/main/scala/org/apache/spark/scheduler/cluster/mesos/MesosCoarseGrainedSchedulerBackend.scala:234` 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–15 lines × 2) examples/src/main/scala/org/apache/spark/examples/SparkHdfsLR.scala:81 — examples/src/main/scala/org/apache/spark/examples/SparkHdfsLR.scala:81-94 | examples/src/main/scala/org/apache/spark/examples/SparkLR.scala:75-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. Read the line range as the matched WINDOW rather than a finished unit: at `examples/src/main/scala/org/apache/spark/examples/SparkHdfsLR.scala: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 (14–15 lines × 2) examples/src/main/scala/org/apache/spark/examples/graphx/Analytics.scala:76 — examples/src/main/scala/org/apache/spark/examples/graphx/Analytics.scala:76-90 | examples/src/main/scala/org/apache/spark/examples/graphx/Analytics.scala:110-123 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14–15 lines × 2) examples/src/main/scala/org/apache/spark/examples/mllib/BinaryClassificationMetricsExample.scala:33 — examples/src/main/scala/org/apache/spark/examples/mllib/BinaryClassificationMetricsExample.scala:33-46 | examples/src/main/scala/org/apache/spark/examples/mllib/MulticlassMetricsExample.scala:32-46 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×4
  • Duplicated block (11 lines × 3) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFileFormat.scala:116 — sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFileFormat.scala:116-126 | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/orc/OrcWriteBuilder.scala:54-64 | sql/hive/src/main/scala/org/apache/spark/sql/hive/orc/OrcFileFormat.scala:107-117 — 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 `sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFileFormat.scala:116` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 3) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/json/JsonTable.scala:55 — sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/json/JsonTable.scala:55-65 | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/orc/OrcTable.scala:49-59 | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/parquet/ParquetTable.scala:49-59 — 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 `sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/json/JsonTable.scala:55` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 3) python/pyspark/ml/classification.py:549 — python/pyspark/ml/classification.py:549-559 | python/pyspark/ml/regression.py:212-222 | python/pyspark/ml/regression.py:1694-1704 — 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 `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) examples/src/main/java/org/apache/spark/examples/mllib/JavaDecisionTreeRegressionExample.java:64 — examples/src/main/java/org/apache/spark/examples/mllib/JavaDecisionTreeRegressionExample.java:64-74 | examples/src/main/java/org/apache/spark/examples/mllib/JavaGradientBoostingRegressionExample.java:63-73 | examples/src/main/java/org/apache/spark/examples/mllib/JavaRandomForestRegressionExample.java:63-73 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×4
  • Duplicated block (20 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/TypeQualifiers.java:80 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/TypeQualifiers.java:80-99 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/TypeQualifiers.java:80-99 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/TypeQualifiers.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/TypeQualifiers.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 61 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. Note first that the copies are not typed on the same thing: `TCLIServiceConstants` names `org.apache.hive.service.cli.thrift.TCLIServiceConstants` in one and `org.apache.hive.service.rpc.thrift.TCLIServiceConstants` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (20 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:264 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:264-283 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:265-284 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 436 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 (20 lines × 2) REDACTED:115 — REDACTED:115-134 | REDACTED:120-139 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 325 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 `REDACTED:115` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20 lines × 2) examples/src/main/scala/org/apache/spark/examples/sql/streaming/StructuredNetworkWordCount.scala:38 — examples/src/main/scala/org/apache/spark/examples/sql/streaming/StructuredNetworkWordCount.scala:38-57 | examples/src/main/scala/org/apache/spark/examples/sql/streaming/StructuredSessionization.scala:43-62 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
AC3 · Page structure · Page without a main landmark · ×3
  • Page without a main landmark index.html:2 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
  • Page without a main landmark licenses-binary/LICENSE-javassist.html:1 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
  • Page without a main landmark REDACTED:3 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
D29 · Static Analysis (SAST) · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (39 corresponding lines) · ×3
  • Edited copy of a member (39 corresponding lines) sql/catalyst/src/main/java/org/apache/spark/sql/vectorized/ColumnarBatch.java:144 — sql/catalyst/src/main/java/org/apache/spark/sql/vectorized/ColumnarBatch.java:144-182 | sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/MutableColumnarRow.java:51-89 — 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) sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/HashAggregateExec.scala:101 — sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/HashAggregateExec.scala:101-144 | sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/ObjectHashAggregateExec.scala:102-140 — 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) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/regexpExpressions.scala:114 — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/regexpExpressions.scala:114-153 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/regexpExpressions.scala:191-229 — 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 · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×3
  • Members sharing a duplicated core (5 members, 50+ identical tokens) external/avro/src/main/scala/org/apache/spark/sql/avro/AvroFileFormat.scala:253 — external/avro/src/main/scala/org/apache/spark/sql/avro/AvroFileFormat.scala:253-268 | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/json/JsonFileFormat.scala:143-158 | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFileFormat.scala:241-254 | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFileFormat.scala:362-375 | sql/hive/src/main/scala/org/apache/spark/sql/hive/orc/OrcFileFormat.scala:196-209 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) python/pyspark/sql/readwriter.py:187 — python/pyspark/sql/readwriter.py:187-299 | python/pyspark/sql/readwriter.py:365-516 | python/pyspark/sql/readwriter.py:888-955 | python/pyspark/sql/streaming.py:415-509 | python/pyspark/sql/streaming.py:588-711 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) examples/src/main/java/org/apache/spark/examples/ml/JavaBucketedRandomProjectionLSHExample.java:48 — examples/src/main/java/org/apache/spark/examples/ml/JavaBucketedRandomProjectionLSHExample.java:48-109 | examples/src/main/java/org/apache/spark/examples/ml/JavaMaxAbsScalerExample.java:40-71 | examples/src/main/java/org/apache/spark/examples/ml/JavaMinHashLSHExample.java:48-110 | examples/src/main/java/org/apache/spark/examples/ml/JavaMinMaxScalerExample.java:40-73 | examples/src/main/java/org/apache/spark/examples/ml/JavaNormalizerExample.java:39-73 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Edited copy of a member (46 corresponding lines) · ×3
  • Edited copy of a member (46 corresponding lines) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:908 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:908-953 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala:843-888 — 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.
  • Edited copy of a member (46 corresponding lines) sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerPage.scala:70 — sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerPage.scala:70-115 | sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerSessionPage.scala:77-124 — 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.
  • Edited copy of a member (46 corresponding lines) examples/src/main/scala/org/apache/spark/examples/mllib/BinaryClassification.scala:104 — examples/src/main/scala/org/apache/spark/examples/mllib/BinaryClassification.scala:104-154 | examples/src/main/scala/org/apache/spark/examples/mllib/LinearRegression.scala:91-136 — 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 (49 corresponding lines) · ×3
  • Edited copy of a member (49 corresponding lines) python/pyspark/ml/linalg/__init__.py:471 — python/pyspark/ml/linalg/__init__.py:471-534 | python/pyspark/mllib/linalg/__init__.py:515-563 — These two members are one piece of code written twice and then edited apart: 49 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (49 corresponding lines) sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/HDFSBackedStateStoreProvider.scala:420 — sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/HDFSBackedStateStoreProvider.scala:420-468 | sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/HDFSBackedStateStoreProvider.scala:518-566 — These two members are one piece of code written twice and then edited apart: 49 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (49 corresponding lines) core/src/main/scala/org/apache/spark/util/collection/ExternalAppendOnlyMap.scala:215 — core/src/main/scala/org/apache/spark/util/collection/ExternalAppendOnlyMap.scala:215-263 | core/src/main/scala/org/apache/spark/util/collection/ExternalSorter.scala:264-327 — These two members are one piece of code written twice and then edited apart: 49 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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) · ×3
  • Edited copy of a member (34 corresponding lines) python/pyspark/ml/tuning.py:279 — python/pyspark/ml/tuning.py:279-317 | python/pyspark/ml/tuning.py:562-595 — 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) examples/src/main/java/org/apache/spark/examples/mllib/JavaLogisticRegressionWithLBFGSExample.java:39 — examples/src/main/java/org/apache/spark/examples/mllib/JavaLogisticRegressionWithLBFGSExample.java:39-72 | examples/src/main/java/org/apache/spark/examples/mllib/JavaSVMWithSGDExample.java:38-74 — 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) examples/src/main/java/org/apache/spark/examples/ml/JavaLinearRegressionWithElasticNetExample.java:31 — examples/src/main/java/org/apache/spark/examples/ml/JavaLinearRegressionWithElasticNetExample.java:31-64 | examples/src/main/java/org/apache/spark/examples/ml/JavaLogisticRegressionWithElasticNetExample.java:29-68 — 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 copy of a member (36 corresponding lines) · ×3
  • Edited copy of a member (36 corresponding lines) mllib/src/main/scala/org/apache/spark/mllib/pmml/export/BinaryClassificationPMMLModelExport.scala:43 — mllib/src/main/scala/org/apache/spark/mllib/pmml/export/BinaryClassificationPMMLModelExport.scala:43-91 | mllib/src/main/scala/org/apache/spark/mllib/pmml/export/GeneralizedLinearPMMLModelExport.scala:41-76 — 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) external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaMicroBatchStream.scala:214 — external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaMicroBatchStream.scala:214-249 | external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaSource.scala:173-210 — 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) examples/src/main/java/org/apache/spark/examples/ml/JavaFPGrowthExample.java:41 — examples/src/main/java/org/apache/spark/examples/ml/JavaFPGrowthExample.java:41-76 | examples/src/main/java/org/apache/spark/examples/ml/JavaWord2VecExample.java:35-71 — 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 copy of a member (42 corresponding lines) · ×3
  • Edited copy of a member (42 corresponding lines) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/orc/OrcPartitionReaderFactory.scala:68 — sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/orc/OrcPartitionReaderFactory.scala:68-111 | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/orc/OrcPartitionReaderFactory.scala:113-154 — 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) sql/core/src/main/scala/org/apache/spark/sql/execution/python/ArrowPythonRunner.scala:63 — sql/core/src/main/scala/org/apache/spark/sql/execution/python/ArrowPythonRunner.scala:63-120 | sql/core/src/main/scala/org/apache/spark/sql/execution/r/ArrowRRunner.scala:78-119 — 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) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/arithmetic.scala:249 — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/arithmetic.scala:249-290 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/arithmetic.scala:433-503 — 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 (29 corresponding lines) · ×3
  • Edited copy of a member (29 corresponding lines) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java:319 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java:319-347 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java:318-346 — 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) REDACTED:274 — REDACTED:274-302 | REDACTED:650-687 — 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) examples/src/main/java/org/apache/spark/examples/ml/JavaVectorAssemblerExample.java:36 — examples/src/main/java/org/apache/spark/examples/ml/JavaVectorAssemblerExample.java:36-64 | examples/src/main/java/org/apache/spark/examples/ml/JavaVectorSizeHintExample.java:38-77 — 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.
D4 · Code Duplication · Edited copy of a member (31 corresponding lines) · ×3
  • Edited copy of a member (31 corresponding lines) sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/continuous/ContinuousTextSocketSource.scala:163 — sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/continuous/ContinuousTextSocketSource.scala:163-195 | sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/sources/TextSocketMicroBatchStream.scala:70-100 — 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) examples/src/main/java/org/apache/spark/examples/ml/JavaAFTSurvivalRegressionExample.java:46 — examples/src/main/java/org/apache/spark/examples/ml/JavaAFTSurvivalRegressionExample.java:46-81 | examples/src/main/java/org/apache/spark/examples/ml/JavaChiSquareTestExample.java:44-74 — 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) examples/src/main/java/org/apache/spark/examples/mllib/JavaPCAExample.java:40 — examples/src/main/java/org/apache/spark/examples/mllib/JavaPCAExample.java:40-70 | examples/src/main/java/org/apache/spark/examples/mllib/JavaSVDExample.java:41-73 — 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 (4 members, 10+ corresponding lines) · ×3
  • Edited copies of one member (4 members, 10+ corresponding lines) core/src/main/scala/org/apache/spark/api/python/PythonRDD.scala:309 — core/src/main/scala/org/apache/spark/api/python/PythonRDD.scala:309-318 | core/src/main/scala/org/apache/spark/api/python/PythonRDD.scala:335-344 | core/src/main/scala/org/apache/spark/api/python/PythonRDD.scala:378-387 | core/src/main/scala/org/apache/spark/api/python/PythonRDD.scala:404-413 — 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.
  • Edited copies of one member (4 members, 10+ corresponding lines) python/pyspark/ml/classification.py:126 — python/pyspark/ml/classification.py:126-138 | python/pyspark/ml/feature.py:3180-3189 | python/pyspark/ml/feature.py:3689-3699 | python/pyspark/ml/regression.py:1317-1330 — 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.
  • Edited copies of one member (4 members, 10+ corresponding lines) mllib/src/main/scala/org/apache/spark/ml/stat/Summarizer.scala:511 — mllib/src/main/scala/org/apache/spark/ml/stat/Summarizer.scala:511-521 | mllib/src/main/scala/org/apache/spark/ml/stat/Summarizer.scala:526-536 | mllib/src/main/scala/org/apache/spark/mllib/stat/MultivariateOnlineSummarizer.scala:253-262 | mllib/src/main/scala/org/apache/spark/mllib/stat/MultivariateOnlineSummarizer.scala:269-278 — 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 copy of a member (3 corresponding lines) · ×3
  • Edited copy of a member (3 corresponding lines) python/pyspark/ml/linalg/__init__.py:694 — python/pyspark/ml/linalg/__init__.py:694-696 | python/pyspark/mllib/linalg/__init__.py:783-785 — 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) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:896 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:896-898 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala:831-833 — 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) external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaSource.scala:351 — external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaSource.scala:351-353 | external/kafka-0-10/src/main/scala/org/apache/spark/streaming/kafka010/KafkaRDD.scala:153-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.
D4 · Code Duplication · Edited copy of a member (33 corresponding lines) · ×3
  • Edited copy of a member (33 corresponding lines) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/predicates.scala:476 — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/predicates.scala:476-508 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/predicates.scala:546-579 — 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) examples/src/main/java/org/apache/spark/examples/ml/JavaBisectingKMeansExample.java:40 — examples/src/main/java/org/apache/spark/examples/ml/JavaBisectingKMeansExample.java:40-72 | examples/src/main/java/org/apache/spark/examples/ml/JavaKMeansExample.java:40-73 — 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) examples/src/main/scala/org/apache/spark/examples/ml/LinearRegressionWithElasticNetExample.scala:28 — examples/src/main/scala/org/apache/spark/examples/ml/LinearRegressionWithElasticNetExample.scala:28-60 | examples/src/main/scala/org/apache/spark/examples/ml/LogisticRegressionWithElasticNetExample.scala:28-64 — 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 copies of one member (3 members, 4+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 4+ corresponding lines) core/src/main/scala/org/apache/spark/ui/scope/RDDOperationGraph.scala:89 — core/src/main/scala/org/apache/spark/ui/scope/RDDOperationGraph.scala:89-92 | mllib/src/main/scala/org/apache/spark/ml/tree/Split.scala:113-116 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/namedExpressions.scala:199-202 — 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.
  • Edited copies of one member (3 members, 4+ corresponding lines) python/pyspark/mllib/clustering.py:495 — python/pyspark/mllib/clustering.py:495-504 | python/pyspark/mllib/fpm.py:61-66 | python/pyspark/mllib/recommendation.py:209-212 — 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.
  • Edited copies of one member (3 members, 4+ corresponding lines) mllib/src/main/scala/org/apache/spark/mllib/tree/impurity/Entropy.scala:116 — mllib/src/main/scala/org/apache/spark/mllib/tree/impurity/Entropy.scala:116-119 | mllib/src/main/scala/org/apache/spark/mllib/tree/impurity/Gini.scala:113-116 | mllib/src/main/scala/org/apache/spark/mllib/tree/impurity/Variance.scala:102-105 — 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 · Duplicated block (45 lines × 2) · ×3
  • Duplicated block (45 lines × 2) mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:650 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:650-694 | mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala:631-675 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 476 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 `mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:650` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (45 lines × 2) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:670 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:670-714 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala:856-900 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 357 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala:854` calls `Since` and `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:667` 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 (45 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetFunctionsOperation.java:79 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetFunctionsOperation.java:79-123 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/GetFunctionsOperation.java:79-123 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetFunctionsOperation.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/GetFunctionsOperation.java` as WHOLE FILES: 98% 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 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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.
D4 · Code Duplication · Duplicated block (29 lines × 2) · ×3
  • Duplicated block (29 lines × 2) mllib/src/main/scala/org/apache/spark/ml/classification/LinearSVC.scala:179 — mllib/src/main/scala/org/apache/spark/ml/classification/LinearSVC.scala:179-207 | mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala:510-538 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 (29 lines × 2) mllib/src/main/scala/org/apache/spark/ml/python/MLSerDe.scala:108 — mllib/src/main/scala/org/apache/spark/ml/python/MLSerDe.scala:108-136 | mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala:1447-1475 — before extracting anything, compare `mllib/src/main/scala/org/apache/spark/ml/python/MLSerDe.scala` and `mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 133 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 (29 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/server/HiveServer2.java:64 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/server/HiveServer2.java:64-92 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/server/HiveServer2.java:64-92 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/server/HiveServer2.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/server/HiveServer2.java` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 130 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.
D4 · Code Duplication · Duplicated block (16–17 lines × 2) · ×3
  • Duplicated block (16–17 lines × 2) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/orc/OrcPartitionReaderFactory.scala:69 — sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/orc/OrcPartitionReaderFactory.scala:69-84 | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/orc/OrcPartitionReaderFactory.scala:114-130 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/orc/OrcPartitionReaderFactory.scala:69` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (16–17 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/OperationManager.java:227 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/OperationManager.java:227-242 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/OperationManager.java:251-267 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/OperationManager.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/OperationManager.java` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 81 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 `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/OperationManager.java:251` 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 (16–17 lines × 2) python/pyspark/shuffle.py:313 — python/pyspark/shuffle.py:313-329 | python/pyspark/shuffle.py:738-753 — both copies are in the same file, so extract the 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 · Duplicated block (14 lines × 3) · ×3
  • Duplicated block (14 lines × 3) sql/catalyst/src/main/scala/org/apache/spark/sql/Row.scala:411 — sql/catalyst/src/main/scala/org/apache/spark/sql/Row.scala:411-424 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/rows.scala:106-119 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/GenericArrayData.scala:111-124 — 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 `sql/catalyst/src/main/scala/org/apache/spark/sql/Row.scala:411` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 3) REDACTED:751 — REDACTED:751-764 | REDACTED:852-865 | REDACTED:955-968 — 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 `REDACTED:751` 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 × 3) examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeExample.scala:254 — examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeExample.scala:254-267 | examples/src/main/scala/org/apache/spark/examples/ml/GBTExample.scala:193-206 | examples/src/main/scala/org/apache/spark/examples/ml/RandomForestExample.scala:201-214 — before extracting anything, compare `examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeExample.scala` and `examples/src/main/scala/org/apache/spark/examples/ml/GBTExample.scala` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 127 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeExample.scala:254` 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, `examples/src/main/scala/org/apache/spark/examples/ml/GBTExample.scala:192` calls `setMaxIter` and `examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeExample.scala:253` 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.
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×3
  • Duplicated block (7 lines × 4) mllib/src/main/scala/org/apache/spark/ml/r/AFTSurvivalRegressionWrapper.scala:140 — mllib/src/main/scala/org/apache/spark/ml/r/AFTSurvivalRegressionWrapper.scala:140-146 | mllib/src/main/scala/org/apache/spark/ml/r/IsotonicRegressionWrapper.scala:110-116 | mllib/src/main/scala/org/apache/spark/ml/r/LinearSVCWrapper.scala:148-154 | mllib/src/main/scala/org/apache/spark/ml/r/LogisticRegressionWrapper.scala:203-209 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once.
  • Duplicated block (7 lines × 4) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/ColumnValue.java:85 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/ColumnValue.java:85-91 | sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/ColumnValue.java:93-99 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/ColumnValue.java:86-92 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/ColumnValue.java:94-100 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/ColumnValue.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/ColumnValue.java` as WHOLE FILES: this scan already matched 11 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. Note first that the copies are not typed on the same thing: `TColumnValue` names `org.apache.hive.service.cli.thrift.TColumnValue` in one and `org.apache.hive.service.rpc.thrift.TColumnValue` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, 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) examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeExample.scala:89 — examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeExample.scala:89-95 | examples/src/main/scala/org/apache/spark/examples/ml/GBTExample.scala:90-96 | examples/src/main/scala/org/apache/spark/examples/ml/RandomForestExample.scala:96-102 | examples/src/main/scala/org/apache/spark/examples/mllib/DecisionTreeRunner.scala:104-110 — before extracting anything, compare `examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeExample.scala` and `examples/src/main/scala/org/apache/spark/examples/ml/GBTExample.scala` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 127 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (9 lines × 4) · ×3
  • Duplicated block (9 lines × 4) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:366 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:366-374 | mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:690-698 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala:350-358 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala:671-679 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 394 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala:681` calls `Since` and `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:700` 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 × 4) REDACTED:459 — REDACTED:459-467 | REDACTED:470-478 | REDACTED:480-488 | REDACTED:491-499 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 325 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 (9 lines × 4) examples/src/main/scala/org/apache/spark/examples/streaming/CustomReceiver.scala:41 — examples/src/main/scala/org/apache/spark/examples/streaming/CustomReceiver.scala:41-50 | examples/src/main/scala/org/apache/spark/examples/streaming/HdfsWordCount.scala:37-45 | examples/src/main/scala/org/apache/spark/examples/streaming/NetworkWordCount.scala:38-47 | examples/src/main/scala/org/apache/spark/examples/streaming/SqlNetworkWordCount.scala:42-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 4 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (8–9 lines × 2) · ×3
  • Duplicated block (8–9 lines × 2) python/pyspark/sql/readwriter.py:276 — python/pyspark/sql/readwriter.py:276-284 | python/pyspark/sql/readwriter.py:487-494 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `python/pyspark/sql/readwriter.py:276` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8–9 lines × 2) examples/src/main/java/org/apache/spark/examples/ml/JavaBucketizerExample.java:89 — examples/src/main/java/org/apache/spark/examples/ml/JavaBucketizerExample.java:89-96 | examples/src/main/java/org/apache/spark/examples/ml/JavaOneHotEncoderExample.java:50-58 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `examples/src/main/java/org/apache/spark/examples/ml/JavaBucketizerExample.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 (8–9 lines × 2) examples/src/main/java/org/apache/spark/examples/mllib/JavaLinearRegressionWithSGDExample.java:39 — examples/src/main/java/org/apache/spark/examples/mllib/JavaLinearRegressionWithSGDExample.java:39-47 | examples/src/main/java/org/apache/spark/examples/mllib/JavaRegressionMetricsExample.java:34-41 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `examples/src/main/java/org/apache/spark/examples/mllib/JavaLinearRegressionWithSGDExample.java:39` 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.
AC6 · Visual & motion safety · Low contrast colour pair in CSS (3.3 · ×2
  • Low contrast colour pair in CSS (3.3:1) python/docs/_static/pyspark.css:60 — `div.pys-note-experimental` sets color: rgb(255, 255, 255) on background-color: rgb(88, 151, 165) — 3.3:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
  • Low contrast colour pair in CSS (3.3:1) docs/css/bootstrap.css:2719 — `.dropdown-menu .active > a, .dropdown-menu .active > a:hover` sets color: #ffffff on background-color: #0098cc — 3.3:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
AC6 · Visual & motion safety · Low contrast colour pair in CSS (2.8 · ×2
  • Low contrast colour pair in CSS (2.8:1) docs/css/bootstrap.css:3869 — `.nav-tabs .open .dropdown-toggle, .nav-pills .open .dropdown-toggle, .nav > li.dropdown.open.active > a:hover` sets color: #ffffff on background-color: #999999 — 2.8:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
  • Low contrast colour pair in CSS (2.8:1) docs/css/bootstrap.css:4706 — `.pager .disabled a, .pager .disabled a:hover` sets color: #999999 on background-color: #fff — 2.8:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
D1 · Cyclomatic Complexity · BLAS.gemm (cyclomatic 17) · ×2
  • BLAS.gemm (cyclomatic 17) mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:417 — BLAS.gemm 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.
  • BLAS.gemm (cyclomatic 17) mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala:399 — BLAS.gemm 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.
D17 · Explicit Debt · XxxComment · ×2
  • XxxComment streaming/src/test/scala/org/apache/spark/streaming/ReceiverSuite.scala:175 — // XXX Checking every block would require an even distribution of messages across blocks, — 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.
  • XxxComment REDACTED:741 — # XXX Assert it's a sequence — 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.
D2 · Cognitive Complexity · BLAS.gemm (cognitive 58) · ×2
  • BLAS.gemm (cognitive 58) mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:417 — BLAS.gemm has cognitive complexity 58 (threshold 15). Drivers by points: loops 12 (48 pts), if/else 7 (10 pts) (nesting depth added 39). 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.
  • BLAS.gemm (cognitive 58) mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala:399 — BLAS.gemm has cognitive complexity 58 (threshold 15). Drivers by points: loops 12 (48 pts), if/else 7 (10 pts) (nesting depth added 39). 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.
D2 · Cognitive Complexity · BLAS.gemv (cognitive 30) · ×2
  • BLAS.gemv (cognitive 30) mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:633 — BLAS.gemv has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 4 (11 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.
  • BLAS.gemv (cognitive 30) mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala:614 — BLAS.gemv has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 4 (11 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.
D2 · Cognitive Complexity · SparseVector.argmax (cognitive 30) · ×2
  • SparseVector.argmax (cognitive 30) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:669 — SparseVector.argmax has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 3 (11 pts), boolean chains 3 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SparseVector.argmax (cognitive 30) mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala:854 — SparseVector.argmax has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 3 (11 pts), boolean chains 3 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SparseVector.squared_distance (cognitive 19) · ×2
  • SparseVector.squared_distance (cognitive 19) python/pyspark/ml/linalg/__init__.py:615 — SparseVector.squared_distance has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 3 (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.
  • SparseVector.squared_distance (cognitive 19) python/pyspark/mllib/linalg/__init__.py:693 — SparseVector.squared_distance has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 3 (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.
D2 · Cognitive Complexity · BLAS.gemv (cognitive 18) · ×2
  • BLAS.gemv (cognitive 18) mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:700 — BLAS.gemv has cognitive complexity 18 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 7 (8 pts) (nesting depth added 7). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
  • BLAS.gemv (cognitive 18) mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala:681 — BLAS.gemv has cognitive complexity 18 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 7 (8 pts) (nesting depth added 7). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · SparseMatrix.genRandMatrix (cognitive 18) · ×2
  • SparseMatrix.genRandMatrix (cognitive 18) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:904 — SparseMatrix.genRandMatrix has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 3 (7 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.
  • SparseMatrix.genRandMatrix (cognitive 18) mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala:839 — SparseMatrix.genRandMatrix has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 3 (7 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.
D2 · Cognitive Complexity · HiveAuthFactory.<init> (cognitive 18) · ×2
  • HiveAuthFactory.<init> (cognitive 18) sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:123 — HiveAuthFactory.<init> has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 pts), error handling 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.
  • HiveAuthFactory.<init> (cognitive 18) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:121 — HiveAuthFactory.<init> has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 pts), error handling 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.
D2 · Cognitive Complexity · Vectors.norm (cognitive 17) · ×2
  • Vectors.norm (cognitive 17) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:281 — Vectors.norm has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), loops 4 (8 pts), match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Vectors.norm (cognitive 17) mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala:433 — Vectors.norm has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), loops 4 (8 pts), match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorizedRleValuesReader.readIntegers (cognitive 17) · ×2
  • VectorizedRleValuesReader.readIntegers (cognitive 17) sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedRleValuesReader.java:172 — VectorizedRleValuesReader.readIntegers has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 7 other methods here (VectorizedRleValuesReader.readBooleans, VectorizedRleValuesReader.readBytes, VectorizedRleValuesReader.readLongs, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 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.
  • VectorizedRleValuesReader.readIntegers (cognitive 17) sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedRleValuesReader.java:451 — VectorizedRleValuesReader.readIntegers has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 7 other methods here (VectorizedRleValuesReader.readIntegers, VectorizedRleValuesReader.readBooleans, VectorizedRleValuesReader.readBytes, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 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.
D2 · Cognitive Complexity · SparseMatrix.fromCOO (cognitive 16) · ×2
  • SparseMatrix.fromCOO (cognitive 16) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:846 — SparseMatrix.fromCOO has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 2 (5 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SparseMatrix.fromCOO (cognitive 16) mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala:781 — SparseMatrix.fromCOO has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 2 (5 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Vectors.sqdist (cognitive 16) · ×2
  • Vectors.sqdist (cognitive 16) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:334 — Vectors.sqdist has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (6 pts), boolean chains 5, loops 2 (4 pts), match/switch 1 (nesting depth added 4). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • Vectors.sqdist (cognitive 16) mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala:486 — Vectors.sqdist has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (6 pts), boolean chains 5, loops 2 (4 pts), match/switch 1 (nesting depth added 4). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (74 corresponding lines) · ×2
  • Edited copy of a member (74 corresponding lines) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetColumnsOperation.java:125 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetColumnsOperation.java:125-198 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/GetColumnsOperation.java:132-215 — 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.
  • Edited copy of a member (74 corresponding lines) REDACTED:114 — REDACTED:114-187 | REDACTED:119-198 — 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 (59 corresponding lines) · ×2
  • Edited copy of a member (59 corresponding lines) mllib/src/main/scala/org/apache/spark/ml/tuning/CrossValidator.scala:122 — mllib/src/main/scala/org/apache/spark/ml/tuning/CrossValidator.scala:122-183 | mllib/src/main/scala/org/apache/spark/ml/tuning/TrainValidationSplit.scala:121-179 — These two members are one piece of code written twice and then edited apart: 59 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (59 corresponding lines) python/pyspark/heapq3.py:743 — python/pyspark/heapq3.py:743-803 | python/pyspark/heapq3.py:806-864 — These two members are one piece of code written twice and then edited apart: 59 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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) · ×2
  • Edited copy of a member (55 corresponding lines) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java:90 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java:90-145 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java:90-144 — 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.
  • Edited copy of a member (55 corresponding lines) examples/src/main/java/org/apache/spark/examples/mllib/JavaBinaryClassificationMetricsExample.java:34 — examples/src/main/java/org/apache/spark/examples/mllib/JavaBinaryClassificationMetricsExample.java:34-101 | examples/src/main/java/org/apache/spark/examples/mllib/JavaMulticlassClassificationMetricsExample.java:35-89 — 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 (26 corresponding lines) · ×2
  • Edited copy of a member (26 corresponding lines) mllib/src/main/scala/org/apache/spark/ml/tuning/CrossValidator.scala:359 — mllib/src/main/scala/org/apache/spark/ml/tuning/CrossValidator.scala:359-387 | mllib/src/main/scala/org/apache/spark/ml/tuning/TrainValidationSplit.scala:350-375 — 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) examples/src/main/scala/org/apache/spark/examples/mllib/KMeansExample.scala:29 — examples/src/main/scala/org/apache/spark/examples/mllib/KMeansExample.scala:29-54 | examples/src/main/scala/org/apache/spark/examples/mllib/PMMLModelExportExample.scala:29-57 — 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 copies of one member (3 members, 25+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 25+ corresponding lines) sql/core/src/main/scala/org/apache/spark/sql/execution/columnar/compression/compressionSchemes.scala:618 — sql/core/src/main/scala/org/apache/spark/sql/execution/columnar/compression/compressionSchemes.scala:618-648 | sql/core/src/main/scala/org/apache/spark/sql/execution/columnar/compression/compressionSchemes.scala:730-754 | sql/core/src/main/scala/org/apache/spark/sql/execution/columnar/compression/compressionSchemes.scala:836-860 — These 3 members are one piece of code written 3 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 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 25+ corresponding lines) examples/src/main/scala/org/apache/spark/examples/ml/DCTExample.scala:28 — examples/src/main/scala/org/apache/spark/examples/ml/DCTExample.scala:28-52 | examples/src/main/scala/org/apache/spark/examples/ml/PCAExample.scala:28-53 | examples/src/main/scala/org/apache/spark/examples/ml/PolynomialExpansionExample.scala:28-52 — These 3 members are one piece of code written 3 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 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) core/src/main/scala/org/apache/spark/util/collection/OpenHashMap.scala:120 — core/src/main/scala/org/apache/spark/util/collection/OpenHashMap.scala:120-150 | core/src/main/scala/org/apache/spark/util/collection/PrimitiveKeyOpenHashMap.scala:95-118 | graphx/src/main/scala/org/apache/spark/graphx/util/collection/GraphXPrimitiveKeyOpenHashMap.scala:115-138 — 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) examples/src/main/scala/org/apache/spark/examples/mllib/StreamingKMeansExample.scala:55 — examples/src/main/scala/org/apache/spark/examples/mllib/StreamingKMeansExample.scala:55-81 | examples/src/main/scala/org/apache/spark/examples/mllib/StreamingLinearRegressionExample.scala:50-75 | examples/src/main/scala/org/apache/spark/examples/mllib/StreamingLogisticRegression.scala:49-72 — 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, 27+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 27+ corresponding lines) core/src/main/scala/org/apache/spark/deploy/rest/RestSubmissionClient.scala:80 — core/src/main/scala/org/apache/spark/deploy/rest/RestSubmissionClient.scala:80-107 | core/src/main/scala/org/apache/spark/deploy/rest/RestSubmissionClient.scala:110-136 | core/src/main/scala/org/apache/spark/deploy/rest/RestSubmissionClient.scala:141-168 — These 3 members are one piece of code written 3 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 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 27+ corresponding lines) examples/src/main/scala/org/apache/spark/examples/ml/MaxAbsScalerExample.scala:27 — examples/src/main/scala/org/apache/spark/examples/ml/MaxAbsScalerExample.scala:27-53 | examples/src/main/scala/org/apache/spark/examples/ml/MinMaxScalerExample.scala:28-55 | examples/src/main/scala/org/apache/spark/examples/ml/NormalizerExample.scala:28-58 — These 3 members are one piece of code written 3 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 3 times and the copies 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) common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java:391 — common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java:391-412 | common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java:421-442 | common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java:451-475 — 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) python/pyspark/sql/functions.py:2394 — python/pyspark/sql/functions.py:2394-2419 | python/pyspark/sql/functions.py:2425-2446 | python/pyspark/sql/functions.py:2763-2789 — 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, 8+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 8+ corresponding lines) streaming/src/main/scala/org/apache/spark/streaming/api/java/JavaDStreamLike.scala:358 — streaming/src/main/scala/org/apache/spark/streaming/api/java/JavaDStreamLike.scala:358-365 | streaming/src/main/scala/org/apache/spark/streaming/api/java/JavaDStreamLike.scala:374-383 | streaming/src/main/scala/org/apache/spark/streaming/api/java/JavaDStreamLike.scala:392-400 — 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) mllib/src/main/scala/org/apache/spark/mllib/evaluation/BinaryClassificationMetrics.scala:71 — mllib/src/main/scala/org/apache/spark/mllib/evaluation/BinaryClassificationMetrics.scala:71-78 | mllib/src/main/scala/org/apache/spark/mllib/evaluation/MulticlassMetrics.scala:42-49 | mllib/src/main/scala/org/apache/spark/mllib/evaluation/RegressionMetrics.scala:50-57 — 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.
D4 · Code Duplication · Edited copies of one member (4 members, 13+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 13+ corresponding lines) sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedPlainValuesReader.java:70 — sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedPlainValuesReader.java:70-82 | sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedPlainValuesReader.java:85-97 | sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedPlainValuesReader.java:100-112 | sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedPlainValuesReader.java:115-127 — 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.
  • Edited copies of one member (4 members, 13+ corresponding lines) common/sketch/src/main/java/org/apache/spark/util/sketch/Murmur3_x86_32.java:62 — common/sketch/src/main/java/org/apache/spark/util/sketch/Murmur3_x86_32.java:62-74 | common/sketch/src/main/java/org/apache/spark/util/sketch/Murmur3_x86_32.java:76-88 | common/unsafe/src/main/java/org/apache/spark/unsafe/hash/Murmur3_x86_32.java:62-74 | common/unsafe/src/main/java/org/apache/spark/unsafe/hash/Murmur3_x86_32.java:76-88 — 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 (5 members, 10+ corresponding lines) · ×2
  • Edited copies of one member (5 members, 10+ corresponding lines) mllib/src/main/scala/org/apache/spark/ml/feature/ChiSqSelector.scala:330 — mllib/src/main/scala/org/apache/spark/ml/feature/ChiSqSelector.scala:330-339 | mllib/src/main/scala/org/apache/spark/ml/feature/CountVectorizer.scala:361-371 | mllib/src/main/scala/org/apache/spark/ml/feature/MinHashLSH.scala:197-208 | mllib/src/main/scala/org/apache/spark/ml/feature/OneHotEncoder.scala:381-391 | mllib/src/main/scala/org/apache/spark/ml/feature/RFormula.scala:512-522 — These 5 members are one piece of code written 5 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 5 times and the copies will drift further apart.
  • Edited copies of one member (5 members, 10+ corresponding lines) python/pyspark/ml/classification.py:301 — python/pyspark/ml/classification.py:301-317 | python/pyspark/ml/classification.py:1607-1618 | python/pyspark/ml/clustering.py:406-416 | python/pyspark/ml/feature.py:1979-1988 | python/pyspark/ml/fpm.py:291-300 — These 5 members are one piece of code written 5 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 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 8+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 8+ corresponding lines) mllib/src/main/scala/org/apache/spark/ml/feature/IDF.scala:88 — mllib/src/main/scala/org/apache/spark/ml/feature/IDF.scala:88-95 | mllib/src/main/scala/org/apache/spark/ml/feature/MinMaxScaler.scala:118-125 | mllib/src/main/scala/org/apache/spark/ml/feature/PCA.scala:93-101 | mllib/src/main/scala/org/apache/spark/ml/feature/StandardScaler.scala:111-119 — 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) common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java:175 — common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java:175-182 | sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeArrayData.java:349-356 | sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeMapData.java:119-126 | sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeRow.java:573-580 — 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 · Duplicated block (49 lines × 2) · ×2
  • Duplicated block (49 lines × 2) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:1158 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:1158-1206 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala:1110-1158 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 394 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 (49 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/GetInfoValue.java:33 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/GetInfoValue.java:33-81 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/GetInfoValue.java:33-81 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/GetInfoValue.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/GetInfoValue.java` as WHOLE FILES: 98% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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: `TGetInfoValue` names `org.apache.hive.service.cli.thrift.TGetInfoValue` in one and `org.apache.hive.service.rpc.thrift.TGetInfoValue` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (56 lines × 2) · ×2
  • Duplicated block (56 lines × 2) sql/core/v1.2.1/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilters.scala:213 — sql/core/v1.2.1/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilters.scala:213-268 | sql/core/v2.3.5/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilters.scala:213-268 — before extracting anything, compare `sql/core/v1.2.1/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilters.scala` and `sql/core/v2.3.5/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilters.scala` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 159 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 (56 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/ColumnDescriptor.java:36 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/ColumnDescriptor.java:36-98 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/ColumnDescriptor.java:36-91 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/ColumnDescriptor.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/ColumnDescriptor.java` as WHOLE FILES: 96% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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: `TColumnDesc` names `org.apache.hive.service.cli.thrift.TColumnDesc` in one and `org.apache.hive.service.rpc.thrift.TColumnDesc` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (44 lines × 2) · ×2
  • Duplicated block (44 lines × 2) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:283 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:283-326 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala:435-478 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 357 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 (44 lines × 2) python/pyspark/ml/linalg/__init__.py:1015 — python/pyspark/ml/linalg/__init__.py:1015-1058 | python/pyspark/mllib/linalg/__init__.py:1170-1213 — before extracting anything, compare `python/pyspark/ml/linalg/__init__.py` and `python/pyspark/mllib/linalg/__init__.py` as WHOLE FILES: this scan already matched 34 separate duplicated blocks between them, totalling at least 667 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (33 lines × 2) · ×2
  • Duplicated block (33 lines × 2) REDACTED:3596 — REDACTED:3596-3628 | REDACTED:3827-3859 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:3596` 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 (33 lines × 2) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala:1056 — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala:1056-1088 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala:1270-1302 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala:1056` 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.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×2
  • Duplicated block (13–14 lines × 2) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/ScalaReflection.scala:249 — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/ScalaReflection.scala:249-262 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/ScalaReflection.scala:284-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.
  • Duplicated block (13–14 lines × 2) sql/core/src/main/scala/org/apache/spark/sql/execution/python/ArrowPythonRunner.scala:153 — sql/core/src/main/scala/org/apache/spark/sql/execution/python/ArrowPythonRunner.scala:153-166 | sql/core/src/main/scala/org/apache/spark/sql/execution/r/ArrowRRunner.scala:141-153 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `sql/core/src/main/scala/org/apache/spark/sql/execution/python/ArrowPythonRunner.scala:153` 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.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×2
  • Duplicated block (10 lines × 3) sql/core/src/main/scala/org/apache/spark/sql/execution/python/AggregateInPandasExec.scala:65 — sql/core/src/main/scala/org/apache/spark/sql/execution/python/AggregateInPandasExec.scala:65-74 | sql/core/src/main/scala/org/apache/spark/sql/execution/python/EvalPythonExec.scala:69-78 | sql/core/src/main/scala/org/apache/spark/sql/execution/python/WindowInPandasExec.scala:131-140 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 (10 lines × 3) examples/src/main/java/org/apache/spark/examples/streaming/JavaNetworkWordCount.java:48 — examples/src/main/java/org/apache/spark/examples/streaming/JavaNetworkWordCount.java:48-57 | examples/src/main/java/org/apache/spark/examples/streaming/JavaSqlNetworkWordCount.java:50-59 | examples/src/main/java/org/apache/spark/examples/streaming/JavaStatefulNetworkWordCount.java:53-62 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (8 lines × 6) · ×2
  • Duplicated block (8 lines × 6) mllib/src/main/scala/org/apache/spark/ml/r/DecisionTreeClassificationWrapper.scala:142 — mllib/src/main/scala/org/apache/spark/ml/r/DecisionTreeClassificationWrapper.scala:142-149 | mllib/src/main/scala/org/apache/spark/ml/r/DecisionTreeRegressionWrapper.scala:125-132 | mllib/src/main/scala/org/apache/spark/ml/r/GBTClassificationWrapper.scala:149-156 | mllib/src/main/scala/org/apache/spark/ml/r/GBTRegressionWrapper.scala:133-140 | mllib/src/main/scala/org/apache/spark/ml/r/RandomForestClassificationWrapper.scala:150-157 | mllib/src/main/scala/org/apache/spark/ml/r/RandomForestRegressionWrapper.scala:133-140 — before extracting anything, compare `mllib/src/main/scala/org/apache/spark/ml/r/DecisionTreeRegressionWrapper.scala` and `mllib/src/main/scala/org/apache/spark/ml/r/GBTRegressionWrapper.scala` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 6) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:452 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:452-459 | sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:466-473 | sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:511-518 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:454-461 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:468-475 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:513-520 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 436 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 `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:452` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (6 lines × 4) · ×2
  • Duplicated block (6 lines × 4) mllib/src/main/scala/org/apache/spark/ml/classification/GBTClassifier.scala:290 — mllib/src/main/scala/org/apache/spark/ml/classification/GBTClassifier.scala:290-295 | mllib/src/main/scala/org/apache/spark/ml/classification/RandomForestClassifier.scala:212-217 | mllib/src/main/scala/org/apache/spark/ml/regression/GBTRegressor.scala:249-254 | mllib/src/main/scala/org/apache/spark/ml/regression/RandomForestRegressor.scala:195-200 — before extracting anything, compare `mllib/src/main/scala/org/apache/spark/ml/regression/GBTRegressor.scala` and `mllib/src/main/scala/org/apache/spark/ml/regression/RandomForestRegressor.scala` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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 × 4) examples/src/main/java/org/apache/spark/examples/ml/JavaBinarizerExample.java:45 — examples/src/main/java/org/apache/spark/examples/ml/JavaBinarizerExample.java:45-50 | examples/src/main/java/org/apache/spark/examples/ml/JavaIndexToStringExample.java:51-56 | examples/src/main/java/org/apache/spark/examples/ml/JavaQuantileDiscretizerExample.java:46-52 | examples/src/main/java/org/apache/spark/examples/ml/JavaTokenizerExample.java:52-58 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `examples/src/main/java/org/apache/spark/examples/ml/JavaBinarizerExample.java:45` 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, `examples/src/main/java/org/apache/spark/examples/ml/JavaQuantileDiscretizerExample.java:44` calls `create` and `examples/src/main/java/org/apache/spark/examples/ml/JavaBinarizerExample.java:44` 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.
D4 · Code Duplication · Duplicated block (43 lines × 2) · ×2
  • Duplicated block (43 lines × 2) core/src/main/scala/org/apache/spark/metrics/sink/GraphiteSink.scala:42 — core/src/main/scala/org/apache/spark/metrics/sink/GraphiteSink.scala:42-91 | external/spark-ganglia-lgpl/src/main/scala/org/apache/spark/metrics/sink/GangliaSink.scala:52-94 — 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 `prop` to `String): Option[String] = Option(property.getProperty(prop)) if (!propertyToOption(GRAPHITE_KEY_HOST).isDefined` in one and `String): Option[String] = Option(property.getProperty(prop)) if (!propertyToOption(GANGLIA_KEY_HOST).isDefined` 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 (43 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:130 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:130-172 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:131-173 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 436 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.
D4 · Code Duplication · Duplicated block (65 lines × 2) · ×2
  • Duplicated block (65 lines × 2) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/First.scala:50 — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/First.scala:50-116 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/Last.scala:50-114 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 (65 lines × 2) python/pyspark/ml/linalg/__init__.py:616 — python/pyspark/ml/linalg/__init__.py:616-680 | python/pyspark/mllib/linalg/__init__.py:694-758 — before extracting anything, compare `python/pyspark/ml/linalg/__init__.py` and `python/pyspark/mllib/linalg/__init__.py` as WHOLE FILES: this scan already matched 34 separate duplicated blocks between them, totalling at least 667 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.
D4 · Code Duplication · Duplicated block (50 lines × 2) · ×2
  • Duplicated block (50 lines × 2) REDACTED:138 — REDACTED:138-187 | REDACTED:149-198 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 325 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 `REDACTED:138` 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 (50 lines × 2) REDACTED:378 — REDACTED:378-427 | REDACTED:399-448 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 325 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.
D4 · Code Duplication · Duplicated block (39 lines × 2) · ×2
  • Duplicated block (39 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/CLIService.java:81 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/CLIService.java:81-119 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java:82-120 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/CLIService.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 195 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (39 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java:393 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java:393-431 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java:392-430 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 274 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.
D4 · Code Duplication · Duplicated block (7–11 lines × 5) · ×2
  • Duplicated block (7–11 lines × 5) python/pyspark/sql/readwriter.py:272 — python/pyspark/sql/readwriter.py:272-281 | python/pyspark/sql/readwriter.py:481-491 | python/pyspark/sql/readwriter.py:948-954 | python/pyspark/sql/streaming.py:497-505 | python/pyspark/sql/streaming.py:697-707 — before extracting anything, compare `python/pyspark/sql/readwriter.py` and `python/pyspark/sql/streaming.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 177 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (7–11 lines × 5) examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeExample.scala:99 — examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeExample.scala:99-107 | examples/src/main/scala/org/apache/spark/examples/ml/GBTExample.scala:100-110 | examples/src/main/scala/org/apache/spark/examples/ml/RandomForestExample.scala:106-116 | examples/src/main/scala/org/apache/spark/examples/mllib/DecisionTreeRunner.scala:114-122 | examples/src/main/scala/org/apache/spark/examples/mllib/LDAExample.scala:89-95 — before extracting anything, compare `examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeExample.scala` and `examples/src/main/scala/org/apache/spark/examples/ml/GBTExample.scala` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 127 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeExample.scala: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.
D4 · Code Duplication · Duplicated block (23–25 lines × 2) · ×2
  • Duplicated block (23–25 lines × 2) examples/src/main/scala/org/apache/spark/examples/ml/BucketedRandomProjectionLSHExample.scala:67 — examples/src/main/scala/org/apache/spark/examples/ml/BucketedRandomProjectionLSHExample.scala:67-89 | examples/src/main/scala/org/apache/spark/examples/ml/MinHashLSHExample.scala:64-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 both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `examples/src/main/scala/org/apache/spark/examples/ml/BucketedRandomProjectionLSHExample.scala: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 (23–25 lines × 2) examples/src/main/java/org/apache/spark/examples/ml/JavaBucketedRandomProjectionLSHExample.java:87 — examples/src/main/java/org/apache/spark/examples/ml/JavaBucketedRandomProjectionLSHExample.java:87-109 | examples/src/main/java/org/apache/spark/examples/ml/JavaMinHashLSHExample.java:86-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 `examples/src/main/java/org/apache/spark/examples/ml/JavaBucketedRandomProjectionLSHExample.java:87` 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.
D4 · Code Duplication · Duplicated block (19 lines × 3) · ×2
  • Duplicated block (19 lines × 3) examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeRegressionExample.scala:32 — examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeRegressionExample.scala:32-50 | examples/src/main/scala/org/apache/spark/examples/ml/GradientBoostedTreeRegressorExample.scala:31-49 | examples/src/main/scala/org/apache/spark/examples/ml/RandomForestRegressorExample.scala:31-49 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
  • Duplicated block (19 lines × 3) examples/src/main/java/org/apache/spark/examples/ml/JavaDecisionTreeRegressionExample.java:35 — examples/src/main/java/org/apache/spark/examples/ml/JavaDecisionTreeRegressionExample.java:35-53 | examples/src/main/java/org/apache/spark/examples/ml/JavaGradientBoostedTreeRegressorExample.java:36-54 | examples/src/main/java/org/apache/spark/examples/ml/JavaRandomForestRegressorExample.java:36-54 — before extracting anything, compare `examples/src/main/java/org/apache/spark/examples/ml/JavaGradientBoostedTreeRegressorExample.java` and `examples/src/main/java/org/apache/spark/examples/ml/JavaRandomForestRegressorExample.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (15 lines × 3) · ×2
  • Duplicated block (15 lines × 3) examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeClassificationExample.scala:72 — examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeClassificationExample.scala:72-86 | examples/src/main/scala/org/apache/spark/examples/ml/GradientBoostedTreeClassifierExample.scala:75-89 | examples/src/main/scala/org/apache/spark/examples/ml/RandomForestClassifierExample.scala:74-88 — before extracting anything, compare `examples/src/main/scala/org/apache/spark/examples/ml/GradientBoostedTreeClassifierExample.scala` and `examples/src/main/scala/org/apache/spark/examples/ml/RandomForestClassifierExample.scala` as WHOLE FILES: 82% 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 2 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 lines × 3) examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeRegressionExample.scala:62 — examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeRegressionExample.scala:62-76 | examples/src/main/scala/org/apache/spark/examples/ml/GradientBoostedTreeRegressorExample.scala:62-76 | examples/src/main/scala/org/apache/spark/examples/ml/RandomForestRegressorExample.scala:61-75 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `examples/src/main/scala/org/apache/spark/examples/ml/GradientBoostedTreeRegressorExample.scala:55` calls `setMaxIter` and `examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeRegressionExample.scala:55` 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 · Duplicated block (12–13 lines × 3) · ×2
  • Duplicated block (12–13 lines × 3) examples/src/main/scala/org/apache/spark/examples/mllib/DecisionTreeClassificationExample.scala:32 — examples/src/main/scala/org/apache/spark/examples/mllib/DecisionTreeClassificationExample.scala:32-44 | examples/src/main/scala/org/apache/spark/examples/mllib/RandomForestClassificationExample.scala:31-42 | examples/src/main/scala/org/apache/spark/examples/mllib/RandomForestRegressionExample.scala:31-42 — before extracting anything, compare `examples/src/main/scala/org/apache/spark/examples/mllib/RandomForestClassificationExample.scala` and `examples/src/main/scala/org/apache/spark/examples/mllib/RandomForestRegressionExample.scala` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (12–13 lines × 3) examples/src/main/java/org/apache/spark/examples/ml/JavaBinarizerExample.java:38 — examples/src/main/java/org/apache/spark/examples/ml/JavaBinarizerExample.java:38-49 | examples/src/main/java/org/apache/spark/examples/ml/JavaTfIdfExample.java:40-51 | examples/src/main/java/org/apache/spark/examples/ml/JavaTokenizerExample.java:45-57 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `examples/src/main/java/org/apache/spark/examples/ml/JavaBinarizerExample.java:38` 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.
R10 · Code Duplication · Duplicated block (12 lines × 2 locations) · ×2
  • Duplicated block (12 lines × 2 locations) core/src/main/resources/org/apache/spark/ui/static/executorspage.js:361 — core/src/main/resources/org/apache/spark/ui/static/executorspage.js:361 · core/src/main/resources/org/apache/spark/ui/static/executorspage.js:373 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (12 lines × 2 locations) core/src/main/resources/org/apache/spark/ui/static/executorspage.js:457 — core/src/main/resources/org/apache/spark/ui/static/executorspage.js:457 · core/src/main/resources/org/apache/spark/ui/static/executorspage.js:469 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (10 lines × 2 locations) · ×2
  • Duplicated block (10 lines × 2 locations) core/src/main/resources/org/apache/spark/ui/static/stagepage.js:702 — core/src/main/resources/org/apache/spark/ui/static/stagepage.js:702 · core/src/main/resources/org/apache/spark/ui/static/stagepage.js:712 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (10 lines × 2 locations) core/src/main/resources/org/apache/spark/ui/static/stagepage.js:830 — core/src/main/resources/org/apache/spark/ui/static/stagepage.js:830 · core/src/main/resources/org/apache/spark/ui/static/stagepage.js:840 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (7 lines × 2 locations) · ×2
  • Duplicated block (7 lines × 2 locations) core/src/main/resources/org/apache/spark/ui/static/executorspage.js:71 — core/src/main/resources/org/apache/spark/ui/static/executorspage.js:71 · core/src/main/resources/org/apache/spark/ui/static/executorspage.js:81 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (7 lines × 2 locations) core/src/main/resources/org/apache/spark/ui/static/stagepage.js:302 — core/src/main/resources/org/apache/spark/ui/static/stagepage.js:302 · core/src/main/resources/org/apache/spark/ui/static/stagepage.js:311 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
X18 · Disposal-pattern correctness · Disposable created and abandoned in the function that made it · ×2
  • Disposable created and abandoned in the function that made it docs/_plugins/include_example.rb:49 — `File.open` is called here without a block, so it hands back an open descriptor the caller must close — and its first and only use reads `.read` through it and drops it. Nothing closes it: it stays open until the garbage collector happens to finalize it, which is one leaked descriptor per call (a child process too, for `IO.popen`), `Errno::EMFILE` under load, and for a written file data that is not flushed when the program next reads it. Use the block form, which closes on every path including a raise (`File.open(…) { |io| … }`), or the one-call reader/writer (`File.read`, `File.write`, `File.foreach`).
  • Disposable created and abandoned in the function that made it streaming/src/main/scala/org/apache/spark/streaming/util/RawTextSender.scala:63 — `new ServerSocket(…)` opens something that has to be given back — a file descriptor, a socket, a directory handle — and it is held in `serverSocket`, and every later use of `serverSocket` in its block reads a member through it — it is never returned, passed, stored, captured by a lambda, reassigned or released, so this expression both creates the value and is the last place that can release it, and does not. Every call leaks one more open handle until the collector happens to reach it: `Too many open files` under load, and on Windows a file that cannot be replaced or deleted while it is held. Open it with `scala.util.Using.resource(new ServerSocket(…)) { r => … }`, which releases it on every path including a throw, or hold it and call `.close()` in a `finally`.
AC6 · Visual & motion safety · Low contrast colour pair in CSS (4.3 · ×1
  • Low contrast colour pair in CSS (4.3:1) docs/css/bootstrap.css:2704 — `.dropdown-menu li > a:hover, .dropdown-menu li > a:focus, .dropdown-submenu:hover > a` sets color: #ffffff on background-color: #0081c2 — 4.3:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
AC6 · Visual & motion safety · Low contrast colour pair in CSS (2.3 · ×1
  • Low contrast colour pair in CSS (2.3:1) docs/css/bootstrap.css:3117 — `.btn-warning:hover, .btn-warning:active, .btn-warning.active, .btn-warning.disabled, .btn-warning[disabled]` sets color: #ffffff on background-color: #f89406 — 2.3:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
AC6 · Visual & motion safety · Low contrast colour pair in CSS (3.1 · ×1
  • Low contrast colour pair in CSS (3.1:1) docs/css/bootstrap.css:3181 — `.btn-success:hover, .btn-success:active, .btn-success.active, .btn-success.disabled, .btn-success[disabled]` sets color: #ffffff on background-color: #51a351 — 3.1:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
AC6 · Visual & motion safety · Low contrast colour pair in CSS (3.4 · ×1
  • Low contrast colour pair in CSS (3.4:1) docs/css/bootstrap.css:3213 — `.btn-info:hover, .btn-info:active, .btn-info.active, .btn-info.disabled, .btn-info[disabled]` sets color: #ffffff on background-color: #2f96b4 — 3.4:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
AC6 · Visual & motion safety · Low contrast colour pair in CSS (1.3 · ×1
  • Low contrast colour pair in CSS (1.3:1) docs/css/bootstrap.css:4301 — `.navbar .btn-navbar:hover, .navbar .btn-navbar:active, .navbar .btn-navbar.active, .navbar .btn-navbar.disabled, .navbar .btn-navbar[disabled]` sets color: #ffffff on background-color: #e5e5e5 — 1.3:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
D1 · Cyclomatic Complexity · SparkSubmit.prepareSubmitEnvironment (cyclomatic 122) · ×1
  • SparkSubmit.prepareSubmitEnvironment (cyclomatic 122) core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala:219 — SparkSubmit.prepareSubmitEnvironment has cyclomatic complexity 122 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · (anonymous) (cyclomatic 108) · ×1
  • (anonymous) (cyclomatic 108) core/src/main/resources/org/apache/spark/ui/static/stagepage.js:280 — (anonymous) has cyclomatic complexity 108 (threshold 15). Most of this is not in the body itself: 1 of the 108 points is its own statement and the rest belongs to 48 function items inside it that branch (a function literal at line 501, a function literal at line 478, a function literal at line 351, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · UnsupportedOperationChecker.checkForStreaming (cyclomatic 77) · ×1
  • UnsupportedOperationChecker.checkForStreaming (cyclomatic 77) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/UnsupportedOperationChecker.scala:44 — UnsupportedOperationChecker.checkForStreaming has cyclomatic complexity 77 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LogisticRegression.train (cyclomatic 72) · ×1
  • LogisticRegression.train (cyclomatic 72) mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala:492 — LogisticRegression.train has cyclomatic complexity 72 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CheckAnalysis.checkAnalysis (cyclomatic 66) · ×1
  • CheckAnalysis.checkAnalysis (cyclomatic 66) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala:85 — CheckAnalysis.checkAnalysis has cyclomatic complexity 66 (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.
D1 · Cyclomatic Complexity · HiveInspectors.unwrapperFor (cyclomatic 66) · ×1
  • HiveInspectors.unwrapperFor (cyclomatic 66) sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveInspectors.scala:444 — HiveInspectors.unwrapperFor has cyclomatic complexity 66 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DAGScheduler.handleTaskCompletion (cyclomatic 59) · ×1
  • DAGScheduler.handleTaskCompletion (cyclomatic 59) core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala:1341 — DAGScheduler.handleTaskCompletion has cyclomatic complexity 59 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LinearRegression.train (cyclomatic 51) · ×1
  • LinearRegression.train (cyclomatic 51) mllib/src/main/scala/org/apache/spark/ml/regression/LinearRegression.scala:320 — LinearRegression.train has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · EvaluatePython.makeFromJava (cyclomatic 51) · ×1
  • EvaluatePython.makeFromJava (cyclomatic 51) sql/core/src/main/scala/org/apache/spark/sql/execution/python/EvaluatePython.scala:89 — EvaluatePython.makeFromJava has cyclomatic complexity 51 (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.
D1 · Cyclomatic Complexity · FunctionArgumentConversion.coerceTypes (cyclomatic 49) · ×1
  • FunctionArgumentConversion.coerceTypes (cyclomatic 49) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala:555 — FunctionArgumentConversion.coerceTypes has cyclomatic complexity 49 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · BooleanSimplification.apply (cyclomatic 49) · ×1
  • BooleanSimplification.apply (cyclomatic 49) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/expressions.scala:254 — BooleanSimplification.apply has cyclomatic complexity 49 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · Master.receive (cyclomatic 48) · ×1
  • Master.receive (cyclomatic 48) core/src/main/scala/org/apache/spark/deploy/master/Master.scala:222 — Master.receive has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · JdbcUtils.getCatalystType (cyclomatic 47) · ×1
  • JdbcUtils.getCatalystType (cyclomatic 47) REDACTED:198 — JdbcUtils.getCatalystType has cyclomatic complexity 47 (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.
D1 · Cyclomatic Complexity · AvroDeserializer.newWriter (cyclomatic 46) · ×1
  • AvroDeserializer.newWriter (cyclomatic 46) external/avro/src/main/scala/org/apache/spark/sql/avro/AvroDeserializer.scala:76 — AvroDeserializer.newWriter has cyclomatic complexity 46 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · VectorizedColumnReader.decodeDictionaryIds (cyclomatic 46) · ×1
  • VectorizedColumnReader.decodeDictionaryIds (cyclomatic 46) sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedColumnReader.java:256 — VectorizedColumnReader.decodeDictionaryIds has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · JacksonParser.makeConverter (cyclomatic 43) · ×1
  • JacksonParser.makeConverter (cyclomatic 43) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/json/JacksonParser.scala:151 — JacksonParser.makeConverter has cyclomatic complexity 43 (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.
D1 · Cyclomatic Complexity · DateTimeUtils.stringToTimestamp (cyclomatic 39) · ×1
  • DateTimeUtils.stringToTimestamp (cyclomatic 39) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeUtils.scala:210 — DateTimeUtils.stringToTimestamp has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SparkSubmitArguments.handle (cyclomatic 38) · ×1
  • SparkSubmitArguments.handle (cyclomatic 38) core/src/main/scala/org/apache/spark/deploy/SparkSubmitArguments.scala:359 — SparkSubmitArguments.handle has cyclomatic complexity 38 (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.
D1 · Cyclomatic Complexity · WeightedLeastSquares.fit (cyclomatic 37) · ×1
  • WeightedLeastSquares.fit (cyclomatic 37) mllib/src/main/scala/org/apache/spark/ml/optim/WeightedLeastSquares.scala:97 — WeightedLeastSquares.fit has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ScalaReflection.deserializerFor (cyclomatic 36) · ×1
  • ScalaReflection.deserializerFor (cyclomatic 36) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/ScalaReflection.scala:180 — ScalaReflection.deserializerFor has cyclomatic complexity 36 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · OnHeapColumnVector.reserveInternal (cyclomatic 36) · ×1
  • OnHeapColumnVector.reserveInternal (cyclomatic 36) sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/OnHeapColumnVector.java:505 — OnHeapColumnVector.reserveInternal has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FilterEstimation.evaluateBinaryForTwoColumns (cyclomatic 34) · ×1
  • FilterEstimation.evaluateBinaryForTwoColumns (cyclomatic 34) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/statsEstimation/FilterEstimation.scala:651 — FilterEstimation.evaluateBinaryForTwoColumns has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AvroSerializer.newConverter (cyclomatic 33) · ×1
  • AvroSerializer.newConverter (cyclomatic 33) external/avro/src/main/scala/org/apache/spark/sql/avro/AvroSerializer.scala:77 — AvroSerializer.newConverter has cyclomatic complexity 33 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · Cast.canCast (cyclomatic 33) · ×1
  • Cast.canCast (cyclomatic 33) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala:41 — Cast.canCast has cyclomatic complexity 33 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · ParquetToSparkSchemaConverter.convertPrimitiveField (cyclomatic 33) · ×1
  • ParquetToSparkSchemaConverter.convertPrimitiveField (cyclomatic 33) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetSchemaConverter.scala:93 — ParquetToSparkSchemaConverter.convertPrimitiveField has cyclomatic complexity 33 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · ScalaReflection.serializerFor (cyclomatic 32) · ×1
  • ScalaReflection.serializerFor (cyclomatic 32) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/ScalaReflection.scala:406 — ScalaReflection.serializerFor has cyclomatic complexity 32 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: ScalaReflection.schemaFor (cyclomatic 35) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · SerDe.writeObject (cyclomatic 31) · ×1
  • SerDe.writeObject (cyclomatic 31) core/src/main/scala/org/apache/spark/api/r/SerDe.scala:299 — SerDe.writeObject 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.
D1 · Cyclomatic Complexity · Worker.receive (cyclomatic 31) · ×1
  • Worker.receive (cyclomatic 31) core/src/main/scala/org/apache/spark/deploy/worker/Worker.scala:457 — Worker.receive has cyclomatic complexity 31 (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.
D1 · Cyclomatic Complexity · OrcSerializer.newConverter (cyclomatic 31) · ×1
  • OrcSerializer.newConverter (cyclomatic 31) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcSerializer.scala:55 — OrcSerializer.newConverter 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.
D1 · Cyclomatic Complexity · SortMergeJoinExec.doExecute (cyclomatic 31) · ×1
  • SortMergeJoinExec.doExecute (cyclomatic 31) sql/core/src/main/scala/org/apache/spark/sql/execution/joins/SortMergeJoinExec.scala:147 — SortMergeJoinExec.doExecute 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.
D1 · Cyclomatic Complexity · UDFRegistration.registerJava (cyclomatic 30) · ×1
  • UDFRegistration.registerJava (cyclomatic 30) sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:635 — UDFRegistration.registerJava has cyclomatic complexity 30 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · jquery.mustache.parseTemplate (cyclomatic 29) · ×1
  • jquery.mustache.parseTemplate (cyclomatic 29) core/src/main/resources/org/apache/spark/ui/static/jquery.mustache.js:118 — jquery.mustache.parseTemplate has cyclomatic complexity 29 (threshold 15). Of this number, 23 points are the body's own statements and 6 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InterpretedUnsafeProjection.generateFieldWriter (cyclomatic 28) · ×1
  • InterpretedUnsafeProjection.generateFieldWriter (cyclomatic 28) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/InterpretedUnsafeProjection.scala:130 — InterpretedUnsafeProjection.generateFieldWriter 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.
D1 · Cyclomatic Complexity · Shim_v0_13.convertFilters (cyclomatic 28) · ×1
  • Shim_v0_13.convertFilters (cyclomatic 28) sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveShim.scala:601 — Shim_v0_13.convertFilters 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.
D1 · Cyclomatic Complexity · SparkContext._do_init (cyclomatic 28) · ×1
  • SparkContext._do_init (cyclomatic 28) python/pyspark/context.py:136 — SparkContext._do_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.
D1 · Cyclomatic Complexity · TaskRunner.run (cyclomatic 27) · ×1
  • TaskRunner.run (cyclomatic 27) core/src/main/scala/org/apache/spark/executor/Executor.scala:367 — TaskRunner.run 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.
D1 · Cyclomatic Complexity · InterpretedHashFunction.hash (cyclomatic 27) · ×1
  • InterpretedHashFunction.hash (cyclomatic 27) REDACTED:480 — InterpretedHashFunction.hash has cyclomatic complexity 27 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · PropagateEmptyRelation.apply (cyclomatic 27) · ×1
  • PropagateEmptyRelation.apply (cyclomatic 27) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/PropagateEmptyRelation.scala:52 — PropagateEmptyRelation.apply has cyclomatic complexity 27 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · AppStatusListener.onTaskEnd (cyclomatic 26) · ×1
  • AppStatusListener.onTaskEnd (cyclomatic 26) core/src/main/scala/org/apache/spark/status/AppStatusListener.scala:548 — AppStatusListener.onTaskEnd has cyclomatic complexity 26 (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.
D1 · Cyclomatic Complexity · GetJsonObject.evaluatePath (cyclomatic 26) · ×1
  • GetJsonObject.evaluatePath (cyclomatic 26) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/jsonExpressions.scala:210 — GetJsonObject.evaluatePath has cyclomatic complexity 26 (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.
D1 · Cyclomatic Complexity · TreeNode.mapChildren (cyclomatic 26) · ×1
  • TreeNode.mapChildren (cyclomatic 26) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/trees/TreeNode.scala:334 — TreeNode.mapChildren 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. This is NOT this file's highest cyclomatic complexity: TreeNode.parseToJson (cyclomatic 27) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · JdbcUtils.makeGetter (cyclomatic 25) · ×1
  • JdbcUtils.makeGetter (cyclomatic 25) REDACTED:386 — JdbcUtils.makeGetter has cyclomatic complexity 25 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · ParquetFilters.createFilterHelper (cyclomatic 25) · ×1
  • ParquetFilters.createFilterHelper (cyclomatic 25) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFilters.scala:485 — ParquetFilters.createFilterHelper has cyclomatic complexity 25 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · OperationState.validateTransition (cyclomatic 25) · ×1
  • OperationState.validateTransition (cyclomatic 25) sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/OperationState.java:51 — OperationState.validateTransition has cyclomatic complexity 25 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · RowMatrix.computeSVD (cyclomatic 24) · ×1
  • RowMatrix.computeSVD (cyclomatic 24) mllib/src/main/scala/org/apache/spark/mllib/linalg/distributed/RowMatrix.scala:313 — RowMatrix.computeSVD 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.
D1 · Cyclomatic Complexity · ImplicitTypeCasts.implicitCast (cyclomatic 24) · ×1
  • ImplicitTypeCasts.implicitCast (cyclomatic 24) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala:939 — ImplicitTypeCasts.implicitCast has cyclomatic complexity 24 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · ParserUtils.unescapeSQLString (cyclomatic 24) · ×1
  • ParserUtils.unescapeSQLString (cyclomatic 24) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/ParserUtils.scala:115 — ParserUtils.unescapeSQLString 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.
D1 · Cyclomatic Complexity · Decimal.changePrecision (cyclomatic 24) · ×1
  • Decimal.changePrecision (cyclomatic 24) sql/catalyst/src/main/scala/org/apache/spark/sql/types/Decimal.scala:278 — Decimal.changePrecision 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.
D1 · Cyclomatic Complexity · BufferSetterGetterUtils.createGetters (cyclomatic 24) · ×1
  • BufferSetterGetterUtils.createGetters (cyclomatic 24) sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/udaf.scala:36 — BufferSetterGetterUtils.createGetters 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.
D1 · Cyclomatic Complexity · OrcDeserializer.newWriter (cyclomatic 24) · ×1
  • OrcDeserializer.newWriter (cyclomatic 24) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcDeserializer.scala:74 — OrcDeserializer.newWriter has cyclomatic complexity 24 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · worker.main (cyclomatic 24) · ×1
  • worker.main (cyclomatic 24) REDACTED:366 — worker.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.
D1 · Cyclomatic Complexity · makeSortable (cyclomatic 24) · ×1
  • makeSortable (cyclomatic 24) REDACTED:42 — makeSortable has cyclomatic complexity 24 (threshold 15). Of this number, 14 points are the body's own statements and 10 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NewHadoopRDD.compute (cyclomatic 23) · ×1
  • NewHadoopRDD.compute (cyclomatic 23) core/src/main/scala/org/apache/spark/rdd/NewHadoopRDD.scala:150 — NewHadoopRDD.compute has cyclomatic complexity 23 (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.
D1 · Cyclomatic Complexity · JobPage.render (cyclomatic 23) · ×1
  • JobPage.render (cyclomatic 23) core/src/main/scala/org/apache/spark/ui/jobs/JobPage.scala:185 — JobPage.render 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.
D1 · Cyclomatic Complexity · SchemaConverters.toSqlTypeHelper (cyclomatic 23) · ×1
  • SchemaConverters.toSqlTypeHelper (cyclomatic 23) external/avro/src/main/scala/org/apache/spark/sql/avro/SchemaConverters.scala:49 — SchemaConverters.toSqlTypeHelper has cyclomatic complexity 23 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · SummarizerBuffer.merge (cyclomatic 23) · ×1
  • SummarizerBuffer.merge (cyclomatic 23) mllib/src/main/scala/org/apache/spark/ml/stat/Summarizer.scala:393 — SummarizerBuffer.merge 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.
D1 · Cyclomatic Complexity · JsonInferSchema.inferField (cyclomatic 23) · ×1
  • JsonInferSchema.inferField (cyclomatic 23) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/json/JsonInferSchema.scala:105 — JsonInferSchema.inferField has cyclomatic complexity 23 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · JoinSelection.apply (cyclomatic 23) · ×1
  • JoinSelection.apply (cyclomatic 23) sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala:226 — JoinSelection.apply has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: BasicOperators.apply (cyclomatic 42) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · BufferSetterGetterUtils.createSetters (cyclomatic 23) · ×1
  • BufferSetterGetterUtils.createSetters (cyclomatic 23) sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/udaf.scala:99 — BufferSetterGetterUtils.createSetters 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.
D1 · Cyclomatic Complexity · (anonymous) (cyclomatic 23) · ×1
  • (anonymous) (cyclomatic 23) core/src/main/resources/org/apache/spark/ui/static/executorspage.js:108 — (anonymous) has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 1 of the 23 points is its own statement and the rest belongs to 27 function items inside it that branch (a function literal at line 194, (anonymous)::(anonymous)::(anonymous)::data, a function literal at line 183, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · WriterThread.run (cyclomatic 22) · ×1
  • WriterThread.run (cyclomatic 22) core/src/main/scala/org/apache/spark/api/python/PythonRunner.scala:201 — WriterThread.run 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.
D1 · Cyclomatic Complexity · SummarizerBuffer.add (cyclomatic 22) · ×1
  • SummarizerBuffer.add (cyclomatic 22) mllib/src/main/scala/org/apache/spark/ml/stat/Summarizer.scala:311 — SummarizerBuffer.add 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.
D1 · Cyclomatic Complexity · JavaTypeInference.serializerFor (cyclomatic 22) · ×1
  • JavaTypeInference.serializerFor (cyclomatic 22) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/JavaTypeInference.scala:362 — JavaTypeInference.serializerFor has cyclomatic complexity 22 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: JavaTypeInference.inferDataType (cyclomatic 30) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · ResolveReferences.apply (cyclomatic 22) · ×1
  • ResolveReferences.apply (cyclomatic 22) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala:945 — ResolveReferences.apply has cyclomatic complexity 22 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · Canonicalize.expressionReorder (cyclomatic 22) · ×1
  • Canonicalize.expressionReorder (cyclomatic 22) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Canonicalize.scala:64 — Canonicalize.expressionReorder has cyclomatic complexity 22 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · DataType.canWrite (cyclomatic 22) · ×1
  • DataType.canWrite (cyclomatic 22) sql/catalyst/src/main/scala/org/apache/spark/sql/types/DataType.scala:368 — DataType.canWrite 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.
D1 · Cyclomatic Complexity · SparkSQLCLIDriver.main (cyclomatic 22) · ×1
  • SparkSQLCLIDriver.main (cyclomatic 22) sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIDriver.scala:80 — SparkSQLCLIDriver.main has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SortState.mergeHi (cyclomatic 22) · ×1
  • SortState.mergeHi (cyclomatic 22) core/src/main/java/org/apache/spark/util/collection/TimSort.java:823 — SortState.mergeHi has cyclomatic complexity 22 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages. This shape REPEATS in the file: one other method here (SortState.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.
D1 · Cyclomatic Complexity · SortState.mergeLo (cyclomatic 22) · ×1
  • SortState.mergeLo (cyclomatic 22) core/src/main/java/org/apache/spark/util/collection/TimSort.java:703 — SortState.mergeLo has cyclomatic complexity 22 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages. This shape REPEATS in the file: one other method here (SortState.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.
D1 · Cyclomatic Complexity · SpecializedGettersReader.read (cyclomatic 22) · ×1
  • SpecializedGettersReader.read (cyclomatic 22) sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/SpecializedGettersReader.java:25 — SpecializedGettersReader.read 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.
D1 · Cyclomatic Complexity · SparkSubmitArguments.validateSubmitArguments (cyclomatic 21) · ×1
  • SparkSubmitArguments.validateSubmitArguments (cyclomatic 21) core/src/main/scala/org/apache/spark/deploy/SparkSubmitArguments.scala:265 — SparkSubmitArguments.validateSubmitArguments 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.
D1 · Cyclomatic Complexity · TaskSchedulerImpl.resourceOffers (cyclomatic 21) · ×1
  • TaskSchedulerImpl.resourceOffers (cyclomatic 21) core/src/main/scala/org/apache/spark/scheduler/TaskSchedulerImpl.scala:395 — TaskSchedulerImpl.resourceOffers 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.
D1 · Cyclomatic Complexity · GeneralizedLinearAlgorithm.run (cyclomatic 21) · ×1
  • GeneralizedLinearAlgorithm.run (cyclomatic 21) mllib/src/main/scala/org/apache/spark/mllib/regression/GeneralizedLinearAlgorithm.scala:242 — GeneralizedLinearAlgorithm.run 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.
D1 · Cyclomatic Complexity · CheckAnalysis.checkCorrelationsInSubquery (cyclomatic 21) · ×1
  • CheckAnalysis.checkCorrelationsInSubquery (cyclomatic 21) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala:514 — CheckAnalysis.checkCorrelationsInSubquery has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · Cast.castToString (cyclomatic 21) · ×1
  • Cast.castToString (cyclomatic 21) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala:243 — Cast.castToString 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. This is NOT this file's highest cyclomatic complexity: Cast.cast (cyclomatic 22) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · PushDownPredicate.apply (cyclomatic 21) · ×1
  • PushDownPredicate.apply (cyclomatic 21) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala:1007 — PushDownPredicate.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.
D1 · Cyclomatic Complexity · FilterEstimation.evaluateBinaryForNumeric (cyclomatic 21) · ×1
  • FilterEstimation.evaluateBinaryForNumeric (cyclomatic 21) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/statsEstimation/FilterEstimation.scala:452 — FilterEstimation.evaluateBinaryForNumeric 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.
D1 · Cyclomatic Complexity · OperationState.validateTransition (cyclomatic 21) · ×1
  • OperationState.validateTransition (cyclomatic 21) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/OperationState.java:50 — OperationState.validateTransition has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · DataFrame.replace (cyclomatic 21) · ×1
  • DataFrame.replace (cyclomatic 21) python/pyspark/sql/dataframe.py:1668 — DataFrame.replace 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.
D1 · Cyclomatic Complexity · SparkSession.createDataFrame (cyclomatic 21) · ×1
  • SparkSession.createDataFrame (cyclomatic 21) python/pyspark/sql/session.py:619 — SparkSession.createDataFrame 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.
D1 · Cyclomatic Complexity · SparkContext.createTaskScheduler (cyclomatic 20) · ×1
  • SparkContext.createTaskScheduler (cyclomatic 20) core/src/main/scala/org/apache/spark/SparkContext.scala:2675 — SparkContext.createTaskScheduler 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.
D1 · Cyclomatic Complexity · HadoopRDD.compute (cyclomatic 20) · ×1
  • HadoopRDD.compute (cyclomatic 20) core/src/main/scala/org/apache/spark/rdd/HadoopRDD.scala:223 — HadoopRDD.compute 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.
D1 · Cyclomatic Complexity · ShuffleBlockFetcherIterator.next (cyclomatic 20) · ×1
  • ShuffleBlockFetcherIterator.next (cyclomatic 20) core/src/main/scala/org/apache/spark/storage/ShuffleBlockFetcherIterator.scala:401 — ShuffleBlockFetcherIterator.next 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.
D1 · Cyclomatic Complexity · Client.monitorApplication (cyclomatic 20) · ×1
  • Client.monitorApplication (cyclomatic 20) resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala:1039 — Client.monitorApplication 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.
D1 · Cyclomatic Complexity · StreamingJoinHelper.collectTerms (cyclomatic 20) · ×1
  • StreamingJoinHelper.collectTerms (cyclomatic 20) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/StreamingJoinHelper.scala:205 — StreamingJoinHelper.collectTerms has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · MapObjects.doGenCode (cyclomatic 20) · ×1
  • MapObjects.doGenCode (cyclomatic 20) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/objects/objects.scala:808 — MapObjects.doGenCode has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · InsertIntoHadoopFsRelationCommand.run (cyclomatic 20) · ×1
  • InsertIntoHadoopFsRelationCommand.run (cyclomatic 20) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/InsertIntoHadoopFsRelationCommand.scala:63 — InsertIntoHadoopFsRelationCommand.run 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.
D1 · Cyclomatic Complexity · JdbcUtils.savePartition (cyclomatic 20) · ×1
  • JdbcUtils.savePartition (cyclomatic 20) REDACTED:609 — JdbcUtils.savePartition 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.
D1 · Cyclomatic Complexity · InsertIntoHiveTable.processInsert (cyclomatic 20) · ×1
  • InsertIntoHiveTable.processInsert (cyclomatic 20) sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/InsertIntoHiveTable.scala:119 — InsertIntoHiveTable.processInsert 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.
D1 · Cyclomatic Complexity · VectorizedColumnReader.readBatch (cyclomatic 20) · ×1
  • VectorizedColumnReader.readBatch (cyclomatic 20) sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedColumnReader.java:153 — VectorizedColumnReader.readBatch 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.
D1 · Cyclomatic Complexity · daemon.manager (cyclomatic 20) · ×1
  • daemon.manager (cyclomatic 20) python/pyspark/daemon.py:85 — daemon.manager 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.
D1 · Cyclomatic Complexity · RBackendHandler.findMatchedSignature (cyclomatic 19) · ×1
  • RBackendHandler.findMatchedSignature (cyclomatic 19) core/src/main/scala/org/apache/spark/api/r/RBackendHandler.scala:219 — RBackendHandler.findMatchedSignature 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.
D1 · Cyclomatic Complexity · PipedRDD.compute (cyclomatic 19) · ×1
  • PipedRDD.compute (cyclomatic 19) core/src/main/scala/org/apache/spark/rdd/PipedRDD.scala:66 — PipedRDD.compute 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.
D1 · Cyclomatic Complexity · TaskSetManager.handleFailedTask (cyclomatic 19) · ×1
  • TaskSetManager.handleFailedTask (cyclomatic 19) core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala:851 — TaskSetManager.handleFailedTask 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.
D1 · Cyclomatic Complexity · SchemaConverters.toAvroType (cyclomatic 19) · ×1
  • SchemaConverters.toAvroType (cyclomatic 19) external/avro/src/main/scala/org/apache/spark/sql/avro/SchemaConverters.scala:136 — SchemaConverters.toAvroType has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · DecisionTreeMetadata.buildMetadata (cyclomatic 19) · ×1
  • DecisionTreeMetadata.buildMetadata (cyclomatic 19) mllib/src/main/scala/org/apache/spark/ml/tree/impl/DecisionTreeMetadata.scala:113 — DecisionTreeMetadata.buildMetadata 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.
D1 · Cyclomatic Complexity · LogisticGradient.compute (cyclomatic 19) · ×1
  • LogisticGradient.compute (cyclomatic 19) mllib/src/main/scala/org/apache/spark/mllib/optimization/Gradient.scala:170 — LogisticGradient.compute 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.
D1 · Cyclomatic Complexity · Client.prepareLocalResources (cyclomatic 19) · ×1
  • Client.prepareLocalResources (cyclomatic 19) resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala:413 — Client.prepareLocalResources 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.
D1 · Cyclomatic Complexity · Row.equals (cyclomatic 19) · ×1
  • Row.equals (cyclomatic 19) sql/catalyst/src/main/scala/org/apache/spark/sql/Row.scala:393 — Row.equals 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.
D1 · Cyclomatic Complexity · TypeCoercion.findCommonTypeForBinaryComparison (cyclomatic 19) · ×1
  • TypeCoercion.findCommonTypeForBinaryComparison (cyclomatic 19) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala:121 — TypeCoercion.findCommonTypeForBinaryComparison 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.
D1 · Cyclomatic Complexity · ExtractEquiJoinKeys.unapply (cyclomatic 19) · ×1
  • ExtractEquiJoinKeys.unapply (cyclomatic 19) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/planning/patterns.scala:108 — ExtractEquiJoinKeys.unapply 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.
D1 · Cyclomatic Complexity · DataSource.lookupDataSource (cyclomatic 19) · ×1
  • DataSource.lookupDataSource (cyclomatic 19) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DataSource.scala:618 — DataSource.lookupDataSource 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.
D1 · Cyclomatic Complexity · ScriptTransformationExec.doExecute (cyclomatic 19) · ×1
  • ScriptTransformationExec.doExecute (cyclomatic 19) sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/ScriptTransformationExec.scala:67 — ScriptTransformationExec.doExecute 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.
D1 · Cyclomatic Complexity · RDD.histogram (cyclomatic 19) · ×1
  • RDD.histogram (cyclomatic 19) python/pyspark/rdd.py:1138 — RDD.histogram 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.
D1 · Cyclomatic Complexity · SparkConf.validateSettings (cyclomatic 18) · ×1
  • SparkConf.validateSettings (cyclomatic 18) core/src/main/scala/org/apache/spark/SparkConf.scala:507 — SparkConf.validateSettings 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.
D1 · Cyclomatic Complexity · FsHistoryProvider.mergeApplicationListing (cyclomatic 18) · ×1
  • FsHistoryProvider.mergeApplicationListing (cyclomatic 18) core/src/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala:676 — FsHistoryProvider.mergeApplicationListing has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · Inbox.process (cyclomatic 18) · ×1
  • Inbox.process (cyclomatic 18) core/src/main/scala/org/apache/spark/rpc/netty/Inbox.scala:87 — Inbox.process 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.
D1 · Cyclomatic Complexity · DAGScheduler.submitMissingTasks (cyclomatic 18) · ×1
  • DAGScheduler.submitMissingTasks (cyclomatic 18) core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala:1098 — DAGScheduler.submitMissingTasks has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · TaskSetManager.dequeueSpeculativeTask (cyclomatic 18) · ×1
  • TaskSetManager.dequeueSpeculativeTask (cyclomatic 18) core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala:339 — TaskSetManager.dequeueSpeculativeTask 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.
D1 · Cyclomatic Complexity · ClosureCleaner.clean (cyclomatic 18) · ×1
  • ClosureCleaner.clean (cyclomatic 18) core/src/main/scala/org/apache/spark/util/ClosureCleaner.scala:236 — ClosureCleaner.clean 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.
D1 · Cyclomatic Complexity · KafkaSourceProvider.validateGeneralOptions (cyclomatic 18) · ×1
  • KafkaSourceProvider.validateGeneralOptions (cyclomatic 18) external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaSourceProvider.scala:203 — KafkaSourceProvider.validateGeneralOptions 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.
D1 · Cyclomatic Complexity · EdgePartition.aggregateMessagesIndexScan (cyclomatic 18) · ×1
  • EdgePartition.aggregateMessagesIndexScan (cyclomatic 18) graphx/src/main/scala/org/apache/spark/graphx/impl/EdgePartition.scala:428 — EdgePartition.aggregateMessagesIndexScan 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.
D1 · Cyclomatic Complexity · Client.createContainerLaunchContext (cyclomatic 18) · ×1
  • Client.createContainerLaunchContext (cyclomatic 18) resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala:859 — Client.createContainerLaunchContext 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.
D1 · Cyclomatic Complexity · ResolvePivot.apply (cyclomatic 18) · ×1
  • ResolvePivot.apply (cyclomatic 18) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala:539 — ResolvePivot.apply has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · RowEncoder.serializerFor (cyclomatic 18) · ×1
  • RowEncoder.serializerFor (cyclomatic 18) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/encoders/RowEncoder.scala:74 — RowEncoder.serializerFor 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.
D1 · Cyclomatic Complexity · StarSchemaDetection.findStarJoins (cyclomatic 18) · ×1
  • StarSchemaDetection.findStarJoins (cyclomatic 18) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/StarSchemaDetection.scala:75 — StarSchemaDetection.findStarJoins 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.
D1 · Cyclomatic Complexity · JoinEstimation.estimateInnerOuterJoin (cyclomatic 18) · ×1
  • JoinEstimation.estimateInnerOuterJoin (cyclomatic 18) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/statsEstimation/JoinEstimation.scala:55 — JoinEstimation.estimateInnerOuterJoin has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · StructType.merge (cyclomatic 18) · ×1
  • StructType.merge (cyclomatic 18) sql/catalyst/src/main/scala/org/apache/spark/sql/types/StructType.scala:503 — StructType.merge has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · SparkSQLCLIDriver.processCmd (cyclomatic 18) · ×1
  • SparkSQLCLIDriver.processCmd (cyclomatic 18) sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIDriver.scala:330 — SparkSQLCLIDriver.processCmd 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.
D1 · Cyclomatic Complexity · CommandBuilderUtils.parseOptionString (cyclomatic 18) · ×1
  • CommandBuilderUtils.parseOptionString (cyclomatic 18) launcher/src/main/java/org/apache/spark/launcher/CommandBuilderUtils.java:128 — CommandBuilderUtils.parseOptionString 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.
D1 · Cyclomatic Complexity · SparkSubmitCommandBuilder.buildSparkSubmitArgs (cyclomatic 18) · ×1
  • SparkSubmitCommandBuilder.buildSparkSubmitArgs (cyclomatic 18) launcher/src/main/java/org/apache/spark/launcher/SparkSubmitCommandBuilder.java:168 — SparkSubmitCommandBuilder.buildSparkSubmitArgs 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.
D1 · Cyclomatic Complexity · ColumnVectorUtils.populate (cyclomatic 18) · ×1
  • ColumnVectorUtils.populate (cyclomatic 18) sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/ColumnVectorUtils.java:48 — ColumnVectorUtils.populate 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.
D1 · Cyclomatic Complexity · Column.addValue (cyclomatic 18) · ×1
  • Column.addValue (cyclomatic 18) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/Column.java:328 — Column.addValue 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.
D1 · Cyclomatic Complexity · CloudPickler.save_function (cyclomatic 18) · ×1
  • CloudPickler.save_function (cyclomatic 18) REDACTED:319 — CloudPickler.save_function 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.
D1 · Cyclomatic Complexity · streaming-page.drawTimeline (cyclomatic 18) · ×1
  • streaming-page.drawTimeline (cyclomatic 18) streaming/src/main/resources/org/apache/spark/streaming/ui/static/streaming-page.js:90 — streaming-page.drawTimeline has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 3 of the 18 points are its own statements and the rest belongs to 13 function literals inside it that branch (lines 192, 103, 166, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · ParsedRFormula.resolve (cyclomatic 17) · ×1
  • ParsedRFormula.resolve (cyclomatic 17) mllib/src/main/scala/org/apache/spark/ml/feature/RFormulaParser.scala:34 — ParsedRFormula.resolve 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.
D1 · Cyclomatic Complexity · LogisticAggregator.multinomialUpdateInPlace (cyclomatic 17) · ×1
  • LogisticAggregator.multinomialUpdateInPlace (cyclomatic 17) mllib/src/main/scala/org/apache/spark/ml/optim/aggregator/LogisticAggregator.scala:257 — LogisticAggregator.multinomialUpdateInPlace 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.
D1 · Cyclomatic Complexity · Word2Vec.doFit (cyclomatic 17) · ×1
  • Word2Vec.doFit (cyclomatic 17) mllib/src/main/scala/org/apache/spark/mllib/feature/Word2Vec.scala:330 — Word2Vec.doFit 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.
D1 · Cyclomatic Complexity · YarnAllocator.processCompletedContainers (cyclomatic 17) · ×1
  • YarnAllocator.processCompletedContainers (cyclomatic 17) resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/YarnAllocator.scala:594 — YarnAllocator.processCompletedContainers 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.
D1 · Cyclomatic Complexity · HiveHashFunction.hash (cyclomatic 17) · ×1
  • HiveHashFunction.hash (cyclomatic 17) REDACTED:914 — HiveHashFunction.hash 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.
D1 · Cyclomatic Complexity · BaseGenericInternalRow.equals (cyclomatic 17) · ×1
  • BaseGenericInternalRow.equals (cyclomatic 17) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/rows.scala:83 — BaseGenericInternalRow.equals 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.
D1 · Cyclomatic Complexity · GenericArrayData.equals (cyclomatic 17) · ×1
  • GenericArrayData.equals (cyclomatic 17) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/GenericArrayData.scala:88 — GenericArrayData.equals 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.
D1 · Cyclomatic Complexity · DataSourceV2Strategy.apply (cyclomatic 17) · ×1
  • DataSourceV2Strategy.apply (cyclomatic 17) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/DataSourceV2Strategy.scala:115 — DataSourceV2Strategy.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.
D1 · Cyclomatic Complexity · BroadcastNestedLoopJoinExec.defaultJoin (cyclomatic 17) · ×1
  • BroadcastNestedLoopJoinExec.defaultJoin (cyclomatic 17) sql/core/src/main/scala/org/apache/spark/sql/execution/joins/BroadcastNestedLoopJoinExec.scala:233 — BroadcastNestedLoopJoinExec.defaultJoin 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.
D1 · Cyclomatic Complexity · TransportResponseHandler.handle (cyclomatic 17) · ×1
  • TransportResponseHandler.handle (cyclomatic 17) common/network-common/src/main/java/org/apache/spark/network/client/TransportResponseHandler.java:161 — TransportResponseHandler.handle 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.
D1 · Cyclomatic Complexity · heapq3.merge (cyclomatic 17) · ×1
  • heapq3.merge (cyclomatic 17) python/pyspark/heapq3.py:595 — heapq3.merge 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.
D1 · Cyclomatic Complexity · getInnerText (cyclomatic 17) · ×1
  • getInnerText (cyclomatic 17) REDACTED:199 — getInnerText 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.
D1 · Cyclomatic Complexity · SparkEnv.create (cyclomatic 16) · ×1
  • SparkEnv.create (cyclomatic 16) core/src/main/scala/org/apache/spark/SparkEnv.scala:217 — SparkEnv.create 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.
D1 · Cyclomatic Complexity · Master.receiveAndReply (cyclomatic 16) · ×1
  • Master.receiveAndReply (cyclomatic 16) core/src/main/scala/org/apache/spark/deploy/master/Master.scala:424 — Master.receiveAndReply 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.
D1 · Cyclomatic Complexity · RowMatrix.columnSimilaritiesDIMSUM (cyclomatic 16) · ×1
  • RowMatrix.columnSimilaritiesDIMSUM (cyclomatic 16) mllib/src/main/scala/org/apache/spark/mllib/linalg/distributed/RowMatrix.scala:681 — RowMatrix.columnSimilaritiesDIMSUM 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.
D1 · Cyclomatic Complexity · FormatNumber.nullSafeEval (cyclomatic 16) · ×1
  • FormatNumber.nullSafeEval (cyclomatic 16) REDACTED:2099 — FormatNumber.nullSafeEval has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · PushPredicateThroughJoin.apply (cyclomatic 16) · ×1
  • PushPredicateThroughJoin.apply (cyclomatic 16) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala:1224 — PushPredicateThroughJoin.apply has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: ColumnPruning.apply (cyclomatic 20) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · SimplifyConditionals.apply (cyclomatic 16) · ×1
  • SimplifyConditionals.apply (cyclomatic 16) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/expressions.scala:415 — SimplifyConditionals.apply has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions. This is NOT this file's highest cyclomatic complexity: FoldablePropagation.canPropagateFoldables (cyclomatic 17) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · FileScanRDD.compute (cyclomatic 16) · ×1
  • FileScanRDD.compute (cyclomatic 16) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/FileScanRDD.scala:69 — FileScanRDD.compute 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.
D1 · Cyclomatic Complexity · PreprocessTableCreation.apply (cyclomatic 16) · ×1
  • PreprocessTableCreation.apply (cyclomatic 16) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/rules.scala:77 — PreprocessTableCreation.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.
D1 · Cyclomatic Complexity · WindowInPandasExec.doExecute (cyclomatic 16) · ×1
  • WindowInPandasExec.doExecute (cyclomatic 16) sql/core/src/main/scala/org/apache/spark/sql/execution/python/WindowInPandasExec.scala:181 — WindowInPandasExec.doExecute 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.
D1 · Cyclomatic Complexity · TaskMemoryManager.acquireExecutionMemory (cyclomatic 16) · ×1
  • TaskMemoryManager.acquireExecutionMemory (cyclomatic 16) core/src/main/java/org/apache/spark/memory/TaskMemoryManager.java:138 — TaskMemoryManager.acquireExecutionMemory 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.
D1 · Cyclomatic Complexity · SparkLauncher.startApplication (cyclomatic 16) · ×1
  • SparkLauncher.startApplication (cyclomatic 16) launcher/src/main/java/org/apache/spark/launcher/SparkLauncher.java:351 — SparkLauncher.startApplication 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.
D1 · Cyclomatic Complexity · Index.addOrRemove (cyclomatic 16) · ×1
  • Index.addOrRemove (cyclomatic 16) common/kvstore/src/main/java/org/apache/spark/util/kvstore/LevelDBTypeInfo.java:325 — Index.addOrRemove 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.
D1 · Cyclomatic Complexity · UTF8String.toInt (cyclomatic 16) · ×1
  • UTF8String.toInt (cyclomatic 16) common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java:1170 — UTF8String.toInt has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (UTF8String.toLong) 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.
D1 · Cyclomatic Complexity · UTF8String.toLong (cyclomatic 16) · ×1
  • UTF8String.toLong (cyclomatic 16) common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java:1079 — UTF8String.toLong has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (UTF8String.toInt) 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.
D1 · Cyclomatic Complexity · ArrowColumnVector.<init> (cyclomatic 16) · ×1
  • ArrowColumnVector.<init> (cyclomatic 16) sql/catalyst/src/main/java/org/apache/spark/sql/vectorized/ArrowColumnVector.java:134 — ArrowColumnVector.<init> 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.
D1 · Cyclomatic Complexity · ColumnarBatchRow.get (cyclomatic 16) · ×1
  • ColumnarBatchRow.get (cyclomatic 16) sql/catalyst/src/main/java/org/apache/spark/sql/vectorized/ColumnarBatch.java:249 — ColumnarBatchRow.get 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.
D1 · Cyclomatic Complexity · ColumnarRow.get (cyclomatic 16) · ×1
  • ColumnarRow.get (cyclomatic 16) sql/catalyst/src/main/java/org/apache/spark/sql/vectorized/ColumnarRow.java:156 — ColumnarRow.get 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.
D1 · Cyclomatic Complexity · RecordBinaryComparator.compare (cyclomatic 16) · ×1
  • RecordBinaryComparator.compare (cyclomatic 16) sql/core/src/main/java/org/apache/spark/sql/execution/RecordBinaryComparator.java:26 — RecordBinaryComparator.compare 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.
D1 · Cyclomatic Complexity · ColumnVectorUtils.appendValue (cyclomatic 16) · ×1
  • ColumnVectorUtils.appendValue (cyclomatic 16) sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/ColumnVectorUtils.java:127 — ColumnVectorUtils.appendValue 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.
D1 · Cyclomatic Complexity · MutableColumnarRow.get (cyclomatic 16) · ×1
  • MutableColumnarRow.get (cyclomatic 16) sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/MutableColumnarRow.java:156 — MutableColumnarRow.get 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.
D1 · Cyclomatic Complexity · DataFrame.toPandas (cyclomatic 16) · ×1
  • DataFrame.toPandas (cyclomatic 16) python/pyspark/sql/dataframe.py:2081 — DataFrame.toPandas 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.
D2 · Cognitive Complexity · SparkSubmit.prepareSubmitEnvironment (cognitive 181) · ×1
  • SparkSubmit.prepareSubmitEnvironment (cognitive 181) core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala:219 — SparkSubmit.prepareSubmitEnvironment has cognitive complexity 181 (threshold 15). Drivers by points: if/else 87 (140 pts), boolean chains 27, match/switch 6 (8 pts), loops 3 (6 pts) (nesting depth added 58). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DAGScheduler.handleTaskCompletion (cognitive 156) · ×1
  • DAGScheduler.handleTaskCompletion (cognitive 156) core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala:1341 — DAGScheduler.handleTaskCompletion has cognitive complexity 156 (threshold 15). Drivers by points: if/else 41 (109 pts), match/switch 10 (28 pts), error handling 3 (14 pts), boolean chains 5 (nesting depth added 97). 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.
D2 · Cognitive Complexity · LogisticRegression.train (cognitive 148) · ×1
  • LogisticRegression.train (cognitive 148) mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala:492 — LogisticRegression.train has cognitive complexity 148 (threshold 15). Drivers by points: if/else 61 (117 pts), boolean chains 18, loops 3 (8 pts), match/switch 4 (5 pts) (nesting depth added 62). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · (anonymous) (cognitive 145) · ×1
  • (anonymous) (cognitive 145) core/src/main/resources/org/apache/spark/ui/static/stagepage.js:280 — (anonymous) has cognitive complexity 145 (threshold 15). Drivers by points: if/else 74 (91 pts), ternaries 22 (34 pts), boolean chains 19, match/switch 1 (nesting depth added 29). None of this is in the body itself: all 145 points belong to 48 function items inside it that branch (a function literal at line 501, a function literal at line 478, a function literal at line 896, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · VectorizedColumnReader.decodeDictionaryIds (cognitive 113) · ×1
  • VectorizedColumnReader.decodeDictionaryIds (cognitive 113) sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedColumnReader.java:256 — VectorizedColumnReader.decodeDictionaryIds has cognitive complexity 113 (threshold 15). Drivers by points: if/else 28 (72 pts), loops 13 (38 pts), boolean chains 2, match/switch 1 (nesting depth added 69). 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.
D2 · Cognitive Complexity · HiveInspectors.unwrapperFor (cognitive 97) · ×1
  • HiveInspectors.unwrapperFor (cognitive 97) sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveInspectors.scala:444 — HiveInspectors.unwrapperFor has cognitive complexity 97 (threshold 15). Drivers by points: if/else 49 (94 pts), match/switch 2 (3 pts) (nesting depth added 46). 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.
D2 · Cognitive Complexity · UnsupportedOperationChecker.checkForStreaming (cognitive 96) · ×1
  • UnsupportedOperationChecker.checkForStreaming (cognitive 96) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/UnsupportedOperationChecker.scala:44 — UnsupportedOperationChecker.checkForStreaming has cognitive complexity 96 (threshold 15). Drivers by points: if/else 30 (58 pts), match/switch 12 (20 pts), boolean chains 18 (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.
D2 · Cognitive Complexity · CheckAnalysis.checkAnalysis (cognitive 86) · ×1
  • CheckAnalysis.checkAnalysis (cognitive 86) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala:85 — CheckAnalysis.checkAnalysis has cognitive complexity 86 (threshold 15). Drivers by points: match/switch 16 (43 pts), if/else 19 (38 pts), boolean chains 5 (nesting depth added 46). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own 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.
D2 · Cognitive Complexity · Master.receive (cognitive 80) · ×1
  • Master.receive (cognitive 80) core/src/main/scala/org/apache/spark/deploy/master/Master.scala:222 — Master.receive has cognitive complexity 80 (threshold 15). Drivers by points: if/else 22 (52 pts), match/switch 7 (13 pts), loops 4 (12 pts), boolean chains 3 (nesting depth added 44). 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.
D2 · Cognitive Complexity · DateTimeUtils.stringToTimestamp (cognitive 76) · ×1
  • DateTimeUtils.stringToTimestamp (cognitive 76) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeUtils.scala:210 — DateTimeUtils.stringToTimestamp has cognitive complexity 76 (threshold 15). Drivers by points: if/else 32 (60 pts), boolean chains 12, loops 3, error handling 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WeightedLeastSquares.fit (cognitive 75) · ×1
  • WeightedLeastSquares.fit (cognitive 75) mllib/src/main/scala/org/apache/spark/ml/optim/WeightedLeastSquares.scala:97 — WeightedLeastSquares.fit has cognitive complexity 75 (threshold 15). Drivers by points: if/else 36 (58 pts), boolean chains 7, loops 6 (7 pts), error handling 1 (2 pts), 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.
D2 · Cognitive Complexity · LinearRegression.train (cognitive 72) · ×1
  • LinearRegression.train (cognitive 72) mllib/src/main/scala/org/apache/spark/ml/regression/LinearRegression.scala:320 — LinearRegression.train has cognitive complexity 72 (threshold 15). Drivers by points: if/else 35 (50 pts), boolean chains 10, match/switch 9 (10 pts), loops 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · daemon.manager (cognitive 67) · ×1
  • daemon.manager (cognitive 67) python/pyspark/daemon.py:85 — daemon.manager has cognitive complexity 67 (threshold 15). Drivers by points: if/else 11 (31 pts), error handling 7 (24 pts), loops 3 (11 pts), boolean chains 1 (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SortMergeJoinExec.doExecute (cognitive 65) · ×1
  • SortMergeJoinExec.doExecute (cognitive 65) sql/core/src/main/scala/org/apache/spark/sql/execution/joins/SortMergeJoinExec.scala:147 — SortMergeJoinExec.doExecute has cognitive complexity 65 (threshold 15). Drivers by points: if/else 13 (40 pts), loops 7 (19 pts), boolean chains 5, match/switch 1 (nesting depth added 39). 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.
D2 · Cognitive Complexity · AvroDeserializer.newWriter (cognitive 62) · ×1
  • AvroDeserializer.newWriter (cognitive 62) external/avro/src/main/scala/org/apache/spark/sql/avro/AvroDeserializer.scala:76 — AvroDeserializer.newWriter has cognitive complexity 62 (threshold 15). Drivers by points: if/else 17 (30 pts), match/switch 8 (26 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 33). 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.
D2 · Cognitive Complexity · StarSchemaDetection.findStarJoins (cognitive 61) · ×1
  • StarSchemaDetection.findStarJoins (cognitive 61) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/StarSchemaDetection.scala:75 — StarSchemaDetection.findStarJoins has cognitive complexity 61 (threshold 15). Drivers by points: if/else 17 (38 pts), match/switch 6 (21 pts), boolean chains 2 (nesting depth added 36). 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.
D2 · Cognitive Complexity · OnHeapColumnVector.reserveInternal (cognitive 58) · ×1
  • OnHeapColumnVector.reserveInternal (cognitive 58) sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/OnHeapColumnVector.java:505 — OnHeapColumnVector.reserveInternal has cognitive complexity 58 (threshold 15). Drivers by points: if/else 26 (48 pts), boolean chains 10 (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.
D2 · Cognitive Complexity · SummarizerBuffer.merge (cognitive 55) · ×1
  • SummarizerBuffer.merge (cognitive 55) mllib/src/main/scala/org/apache/spark/ml/stat/Summarizer.scala:393 — SummarizerBuffer.merge has cognitive complexity 55 (threshold 15). Drivers by points: if/else 19 (51 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 33). 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.
D2 · Cognitive Complexity · makeSortable (cognitive 54) · ×1
  • makeSortable (cognitive 54) REDACTED:42 — makeSortable has cognitive complexity 54 (threshold 15). Drivers by points: if/else 15 (32 pts), ternaries 3 (11 pts), loops 5 (10 pts), boolean chains 1 (nesting depth added 30). Of this number, 22 points are the body's own statements and 32 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FilterEstimation.evaluateBinaryForTwoColumns (cognitive 53) · ×1
  • FilterEstimation.evaluateBinaryForTwoColumns (cognitive 53) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/statsEstimation/FilterEstimation.scala:651 — FilterEstimation.evaluateBinaryForTwoColumns has cognitive complexity 53 (threshold 15). Drivers by points: if/else 17 (38 pts), boolean chains 10, match/switch 3 (5 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Decimal.changePrecision (cognitive 52) · ×1
  • Decimal.changePrecision (cognitive 52) sql/catalyst/src/main/scala/org/apache/spark/sql/types/Decimal.scala:278 — Decimal.changePrecision has cognitive complexity 52 (threshold 15). Drivers by points: if/else 19 (44 pts), boolean chains 5, match/switch 1 (3 pts) (nesting depth added 27). 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.
D2 · Cognitive Complexity · SparkSQLCLIDriver.processCmd (cognitive 51) · ×1
  • SparkSQLCLIDriver.processCmd (cognitive 51) sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIDriver.scala:330 — SparkSQLCLIDriver.processCmd has cognitive complexity 51 (threshold 15). Drivers by points: if/else 13 (34 pts), match/switch 1 (5 pts), boolean chains 4, error handling 1 (4 pts), loops 1 (4 pts) (nesting depth added 31). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · TaskSetManager.dequeueSpeculativeTask (cognitive 48) · ×1
  • TaskSetManager.dequeueSpeculativeTask (cognitive 48) core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala:339 — TaskSetManager.dequeueSpeculativeTask has cognitive complexity 48 (threshold 15). Drivers by points: if/else 10 (26 pts), loops 6 (18 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Word2Vec.doFit (cognitive 48) · ×1
  • Word2Vec.doFit (cognitive 48) mllib/src/main/scala/org/apache/spark/mllib/feature/Word2Vec.scala:330 — Word2Vec.doFit has cognitive complexity 48 (threshold 15). Drivers by points: if/else 12 (32 pts), loops 5 (14 pts), boolean chains 2 (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.
D2 · Cognitive Complexity · LogisticGradient.compute (cognitive 48) · ×1
  • LogisticGradient.compute (cognitive 48) mllib/src/main/scala/org/apache/spark/mllib/optimization/Gradient.scala:170 — LogisticGradient.compute has cognitive complexity 48 (threshold 15). Drivers by points: if/else 19 (33 pts), loops 3 (8 pts), match/switch 3 (5 pts), boolean chains 2 (nesting depth added 21). 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.
D2 · Cognitive Complexity · BufferSetterGetterUtils.createGetters (cognitive 48) · ×1
  • BufferSetterGetterUtils.createGetters (cognitive 48) sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/udaf.scala:36 — BufferSetterGetterUtils.createGetters has cognitive complexity 48 (threshold 15). Drivers by points: if/else 23 (45 pts), match/switch 1 (2 pts), loops 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.
D2 · Cognitive Complexity · SortState.mergeHi (cognitive 48) · ×1
  • SortState.mergeHi (cognitive 48) core/src/main/java/org/apache/spark/util/collection/TimSort.java:823 — SortState.mergeHi has cognitive complexity 48 (threshold 15). Drivers by points: if/else 16 (39 pts), loops 3 (5 pts), boolean chains 3, ternaries 1 (nesting depth added 25). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages. This shape REPEATS in the file: one other method here (SortState.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.
D2 · Cognitive Complexity · SortState.mergeLo (cognitive 48) · ×1
  • SortState.mergeLo (cognitive 48) core/src/main/java/org/apache/spark/util/collection/TimSort.java:703 — SortState.mergeLo has cognitive complexity 48 (threshold 15). Drivers by points: if/else 16 (39 pts), loops 3 (5 pts), boolean chains 3, ternaries 1 (nesting depth added 25). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages. This shape REPEATS in the file: one other method here (SortState.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.
D2 · Cognitive Complexity · jquery.mustache.parseTemplate (cognitive 48) · ×1
  • jquery.mustache.parseTemplate (cognitive 48) core/src/main/resources/org/apache/spark/ui/static/jquery.mustache.js:118 — jquery.mustache.parseTemplate has cognitive complexity 48 (threshold 15). Drivers by points: if/else 21 (36 pts), boolean chains 6, loops 3 (6 pts) (nesting depth added 18). Of this number, 40 points are the body's own statements and 8 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RBackendHandler.findMatchedSignature (cognitive 45) · ×1
  • RBackendHandler.findMatchedSignature (cognitive 45) core/src/main/scala/org/apache/spark/api/r/RBackendHandler.scala:219 — RBackendHandler.findMatchedSignature has cognitive complexity 45 (threshold 15). Drivers by points: if/else 8 (26 pts), loops 3 (8 pts), match/switch 1 (6 pts), boolean chains 5 (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.
D2 · Cognitive Complexity · TaskSchedulerImpl.resourceOffers (cognitive 44) · ×1
  • TaskSchedulerImpl.resourceOffers (cognitive 44) core/src/main/scala/org/apache/spark/scheduler/TaskSchedulerImpl.scala:395 — TaskSchedulerImpl.resourceOffers has cognitive complexity 44 (threshold 15). Drivers by points: if/else 11 (26 pts), loops 6 (11 pts), match/switch 1 (4 pts), boolean chains 3 (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.
D2 · Cognitive Complexity · BufferSetterGetterUtils.createSetters (cognitive 44) · ×1
  • BufferSetterGetterUtils.createSetters (cognitive 44) sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/udaf.scala:99 — BufferSetterGetterUtils.createSetters has cognitive complexity 44 (threshold 15). Drivers by points: if/else 21 (41 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JoinSelection.apply (cognitive 43) · ×1
  • JoinSelection.apply (cognitive 43) sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala:226 — JoinSelection.apply has cognitive complexity 43 (threshold 15). Drivers by points: if/else 23 (34 pts), boolean chains 8, match/switch 1 (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · WriterThread.run (cognitive 42) · ×1
  • WriterThread.run (cognitive 42) core/src/main/scala/org/apache/spark/api/python/PythonRunner.scala:201 — WriterThread.run has cognitive complexity 42 (threshold 15). Drivers by points: if/else 16 (26 pts), loops 4 (6 pts), error handling 2 (4 pts), boolean chains 3, match/switch 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.
D2 · Cognitive Complexity · ShuffleBlockFetcherIterator.next (cognitive 42) · ×1
  • ShuffleBlockFetcherIterator.next (cognitive 42) core/src/main/scala/org/apache/spark/storage/ShuffleBlockFetcherIterator.scala:401 — ShuffleBlockFetcherIterator.next has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (29 pts), error handling 2 (6 pts), boolean chains 4, match/switch 1 (2 pts), loops 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.
D2 · Cognitive Complexity · SparkContext._do_init (cognitive 42) · ×1
  • SparkContext._do_init (cognitive 42) python/pyspark/context.py:136 — SparkContext._do_init has cognitive complexity 42 (threshold 15). Drivers by points: if/else 19 (26 pts), loops 6 (9 pts), boolean chains 4, error handling 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.
D2 · Cognitive Complexity · JacksonParser.makeConverter (cognitive 41) · ×1
  • JacksonParser.makeConverter (cognitive 41) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/json/JacksonParser.scala:151 — JacksonParser.makeConverter has cognitive complexity 41 (threshold 15). Drivers by points: match/switch 18 (37 pts), if/else 4 (nesting depth added 19). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · OrcSerializer.newConverter (cognitive 41) · ×1
  • OrcSerializer.newConverter (cognitive 41) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcSerializer.scala:55 — OrcSerializer.newConverter has cognitive complexity 41 (threshold 15). Drivers by points: if/else 21 (34 pts), loops 3 (6 pts), match/switch 1 (nesting depth added 16). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · InsertIntoHiveTable.processInsert (cognitive 41) · ×1
  • InsertIntoHiveTable.processInsert (cognitive 41) sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/InsertIntoHiveTable.scala:119 — InsertIntoHiveTable.processInsert has cognitive complexity 41 (threshold 15). Drivers by points: if/else 16 (35 pts), boolean chains 4, match/switch 2 (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.
D2 · Cognitive Complexity · TaskRunner.run (cognitive 40) · ×1
  • TaskRunner.run (cognitive 40) core/src/main/scala/org/apache/spark/executor/Executor.scala:367 — TaskRunner.run has cognitive complexity 40 (threshold 15). Drivers by points: if/else 21 (26 pts), error handling 6 (8 pts), boolean chains 6 (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.
D2 · Cognitive Complexity · SummarizerBuffer.add (cognitive 40) · ×1
  • SummarizerBuffer.add (cognitive 40) mllib/src/main/scala/org/apache/spark/ml/stat/Summarizer.scala:311 — SummarizerBuffer.add has cognitive complexity 40 (threshold 15). Drivers by points: if/else 19 (38 pts), boolean chains 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JdbcUtils.savePartition (cognitive 40) · ×1
  • JdbcUtils.savePartition (cognitive 40) REDACTED:609 — JdbcUtils.savePartition has cognitive complexity 40 (threshold 15). Drivers by points: if/else 17 (27 pts), error handling 4 (9 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TransportResponseHandler.handle (cognitive 40) · ×1
  • TransportResponseHandler.handle (cognitive 40) common/network-common/src/main/java/org/apache/spark/network/client/TransportResponseHandler.java:161 — TransportResponseHandler.handle has cognitive complexity 40 (threshold 15). Drivers by points: if/else 21 (29 pts), error handling 3 (11 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Worker.receive (cognitive 38) · ×1
  • Worker.receive (cognitive 38) core/src/main/scala/org/apache/spark/deploy/worker/Worker.scala:457 — Worker.receive has cognitive complexity 38 (threshold 15). Drivers by points: if/else 10 (22 pts), error handling 3 (8 pts), match/switch 3 (6 pts), boolean chains 2 (nesting depth added 20). 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.
D2 · Cognitive Complexity · StandardScalerModel.transform (cognitive 38) · ×1
  • StandardScalerModel.transform (cognitive 38) mllib/src/main/scala/org/apache/spark/mllib/feature/StandardScaler.scala:134 — StandardScalerModel.transform has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 4 (12 pts), match/switch 2 (4 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.
D2 · Cognitive Complexity · Cast.castToString (cognitive 38) · ×1
  • Cast.castToString (cognitive 38) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala:243 — Cast.castToString has cognitive complexity 38 (threshold 15). Drivers by points: if/else 10 (28 pts), loops 3 (9 pts), match/switch 1 (nesting depth added 24). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · CommandBuilderUtils.parseOptionString (cognitive 38) · ×1
  • CommandBuilderUtils.parseOptionString (cognitive 38) launcher/src/main/java/org/apache/spark/launcher/CommandBuilderUtils.java:128 — CommandBuilderUtils.parseOptionString has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (29 pts), match/switch 2 (6 pts), boolean chains 2, 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.
D2 · Cognitive Complexity · GeneralizedLinearAlgorithm.run (cognitive 37) · ×1
  • GeneralizedLinearAlgorithm.run (cognitive 37) mllib/src/main/scala/org/apache/spark/mllib/regression/GeneralizedLinearAlgorithm.scala:242 — GeneralizedLinearAlgorithm.run has cognitive complexity 37 (threshold 15). Drivers by points: if/else 24 (30 pts), boolean chains 4, loops 1 (3 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.
D2 · Cognitive Complexity · PushDownPredicate.apply (cognitive 37) · ×1
  • PushDownPredicate.apply (cognitive 37) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala:1007 — PushDownPredicate.apply has cognitive complexity 37 (threshold 15). Drivers by points: if/else 16 (28 pts), boolean chains 5, match/switch 2 (4 pts) (nesting depth added 14). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · FilterEstimation.evaluateBinaryForNumeric (cognitive 37) · ×1
  • FilterEstimation.evaluateBinaryForNumeric (cognitive 37) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/statsEstimation/FilterEstimation.scala:452 — FilterEstimation.evaluateBinaryForNumeric has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (29 pts), match/switch 3 (7 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EvaluatePython.makeFromJava (cognitive 37) · ×1
  • EvaluatePython.makeFromJava (cognitive 37) sql/core/src/main/scala/org/apache/spark/sql/execution/python/EvaluatePython.scala:89 — EvaluatePython.makeFromJava has cognitive complexity 37 (threshold 15). Drivers by points: match/switch 15 (29 pts), if/else 2 (4 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 18). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · ScriptTransformationExec.doExecute (cognitive 37) · ×1
  • ScriptTransformationExec.doExecute (cognitive 37) sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/ScriptTransformationExec.scala:67 — ScriptTransformationExec.doExecute has cognitive complexity 37 (threshold 15). Drivers by points: if/else 21 (31 pts), error handling 2 (4 pts), loops 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TaskMemoryManager.acquireExecutionMemory (cognitive 37) · ×1
  • TaskMemoryManager.acquireExecutionMemory (cognitive 37) core/src/main/java/org/apache/spark/memory/TaskMemoryManager.java:138 — TaskMemoryManager.acquireExecutionMemory has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (22 pts), error handling 4 (10 pts), loops 2 (4 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.
D2 · Cognitive Complexity · SparkSession._convert_from_pandas (cognitive 37) · ×1
  • SparkSession._convert_from_pandas (cognitive 37) python/pyspark/sql/session.py:484 — SparkSession._convert_from_pandas has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (31 pts), loops 2 (6 pts) (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.
D2 · Cognitive Complexity · SparkSession.createDataFrame (cognitive 37) · ×1
  • SparkSession.createDataFrame (cognitive 37) python/pyspark/sql/session.py:619 — SparkSession.createDataFrame has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (19 pts), ternaries 5 (12 pts), error handling 2 (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.
D2 · Cognitive Complexity · TreeNode.mapChildren (cognitive 36) · ×1
  • TreeNode.mapChildren (cognitive 36) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/trees/TreeNode.scala:334 — TreeNode.mapChildren has cognitive complexity 36 (threshold 15). Drivers by points: if/else 18 (26 pts), boolean chains 6, match/switch 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.
D2 · Cognitive Complexity · worker.main (cognitive 36) · ×1
  • worker.main (cognitive 36) REDACTED:366 — worker.main has cognitive complexity 36 (threshold 15). Drivers by points: if/else 19 (23 pts), error handling 4 (7 pts), loops 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.
D2 · Cognitive Complexity · NewHadoopRDD.compute (cognitive 35) · ×1
  • NewHadoopRDD.compute (cognitive 35) core/src/main/scala/org/apache/spark/rdd/NewHadoopRDD.scala:150 — NewHadoopRDD.compute has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (16 pts), error handling 8 (14 pts), match/switch 3, 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.
D2 · Cognitive Complexity · Row.equals (cognitive 35) · ×1
  • Row.equals (cognitive 35) sql/catalyst/src/main/scala/org/apache/spark/sql/Row.scala:393 — Row.equals has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (28 pts), boolean chains 3, match/switch 1 (3 pts), loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ResolvePivot.apply (cognitive 35) · ×1
  • ResolvePivot.apply (cognitive 35) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala:539 — ResolvePivot.apply has cognitive complexity 35 (threshold 15). Drivers by points: match/switch 7 (17 pts), if/else 11 (16 pts), boolean chains 2 (nesting depth added 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · LevelDBProvider.initLevelDB (cognitive 35) · ×1
  • LevelDBProvider.initLevelDB (cognitive 35) common/network-common/src/main/java/org/apache/spark/network/util/LevelDBProvider.java:40 — LevelDBProvider.initLevelDB has cognitive complexity 35 (threshold 15). Drivers by points: if/else 6 (19 pts), error handling 3 (10 pts), loops 1 (5 pts), boolean chains 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.
D2 · Cognitive Complexity · ClosureCleaner.clean (cognitive 34) · ×1
  • ClosureCleaner.clean (cognitive 34) core/src/main/scala/org/apache/spark/util/ClosureCleaner.scala:236 — ClosureCleaner.clean has cognitive complexity 34 (threshold 15). Drivers by points: if/else 16 (26 pts), loops 2 (5 pts), boolean chains 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · YarnAllocator.processCompletedContainers (cognitive 34) · ×1
  • YarnAllocator.processCompletedContainers (cognitive 34) resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/YarnAllocator.scala:594 — YarnAllocator.processCompletedContainers has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (20 pts), match/switch 3 (8 pts), loops 3 (6 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FileScanRDD.compute (cognitive 33) · ×1
  • FileScanRDD.compute (cognitive 33) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/FileScanRDD.scala:69 — FileScanRDD.compute has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (16 pts), error handling 6 (14 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.
D2 · Cognitive Complexity · Client.prepareLocalResources (cognitive 32) · ×1
  • Client.prepareLocalResources (cognitive 32) resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala:413 — Client.prepareLocalResources has cognitive complexity 32 (threshold 15). Drivers by points: if/else 21 (28 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SparkSQLCLIDriver.main (cognitive 32) · ×1
  • SparkSQLCLIDriver.main (cognitive 32) sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIDriver.scala:80 — SparkSQLCLIDriver.main has cognitive complexity 32 (threshold 15). Drivers by points: if/else 17 (23 pts), error handling 5 (6 pts), boolean chains 1, loops 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · heapq3.merge (cognitive 32) · ×1
  • heapq3.merge (cognitive 32) python/pyspark/heapq3.py:595 — heapq3.merge has cognitive complexity 32 (threshold 15). Drivers by points: loops 8 (16 pts), error handling 4 (10 pts), if/else 5 (6 pts) (nesting depth added 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.
D2 · Cognitive Complexity · RDD.histogram (cognitive 32) · ×1
  • RDD.histogram (cognitive 32) python/pyspark/rdd.py:1138 — RDD.histogram has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (23 pts), error handling 3 (6 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.
D2 · Cognitive Complexity · BlockManager.doPutIterator (cognitive 31) · ×1
  • BlockManager.doPutIterator (cognitive 31) core/src/main/scala/org/apache/spark/storage/BlockManager.scala:1291 — BlockManager.doPutIterator has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (24 pts), match/switch 2 (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.
D2 · Cognitive Complexity · BasicBlockReplicationPolicy.prioritize (cognitive 31) · ×1
  • BasicBlockReplicationPolicy.prioritize (cognitive 31) core/src/main/scala/org/apache/spark/storage/BlockReplicationPolicy.scala:152 — BasicBlockReplicationPolicy.prioritize has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (27 pts), boolean chains 4 (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.
D2 · Cognitive Complexity · AvroSerializer.newConverter (cognitive 31) · ×1
  • AvroSerializer.newConverter (cognitive 31) external/avro/src/main/scala/org/apache/spark/sql/avro/AvroSerializer.scala:77 — AvroSerializer.newConverter has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 2 (4 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · LogisticRegressionModel.raw2probabilityInPlace (cognitive 31) · ×1
  • LogisticRegressionModel.raw2probabilityInPlace (cognitive 31) mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala:1090 — LogisticRegressionModel.raw2probabilityInPlace has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 3 (11 pts), match/switch 1 (nesting depth added 19). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · Client.monitorApplication (cognitive 31) · ×1
  • Client.monitorApplication (cognitive 31) resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala:1039 — Client.monitorApplication has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 2 (7 pts), error handling 2 (4 pts), boolean chains 3, 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.
D2 · Cognitive Complexity · ResolveAggregateFunctions.apply (cognitive 31) · ×1
  • ResolveAggregateFunctions.apply (cognitive 31) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala:1608 — ResolveAggregateFunctions.apply has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (15 pts), match/switch 4 (10 pts), error handling 2 (4 pts), boolean chains 2 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · ResolveDeserializer.apply (cognitive 31) · ×1
  • ResolveDeserializer.apply (cognitive 31) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala:2461 — ResolveDeserializer.apply has cognitive complexity 31 (threshold 15). Drivers by points: match/switch 7 (24 pts), if/else 5 (7 pts) (nesting depth added 19). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · GetJsonObject.evaluatePath (cognitive 31) · ×1
  • GetJsonObject.evaluatePath (cognitive 31) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/jsonExpressions.scala:210 — GetJsonObject.evaluatePath has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 5 (10 pts), match/switch 2 (3 pts) (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · BaseGenericInternalRow.equals (cognitive 31) · ×1
  • BaseGenericInternalRow.equals (cognitive 31) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/rows.scala:83 — BaseGenericInternalRow.equals has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (24 pts), boolean chains 3, match/switch 1 (3 pts), loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BooleanSimplification.apply (cognitive 31) · ×1
  • BooleanSimplification.apply (cognitive 31) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/expressions.scala:254 — BooleanSimplification.apply has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 10, match/switch 2 (3 pts) (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · GenericArrayData.equals (cognitive 31) · ×1
  • GenericArrayData.equals (cognitive 31) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/GenericArrayData.scala:88 — GenericArrayData.equals has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (24 pts), boolean chains 3, match/switch 1 (3 pts), loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InsertIntoHadoopFsRelationCommand.run (cognitive 31) · ×1
  • InsertIntoHadoopFsRelationCommand.run (cognitive 31) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/InsertIntoHadoopFsRelationCommand.scala:63 — InsertIntoHadoopFsRelationCommand.run has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (25 pts), boolean chains 5, 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.
D2 · Cognitive Complexity · DataFrame.toPandas (cognitive 31) · ×1
  • DataFrame.toPandas (cognitive 31) python/pyspark/sql/dataframe.py:2081 — DataFrame.toPandas has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (20 pts), error handling 2 (5 pts), loops 3 (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.
D2 · Cognitive Complexity · (anonymous) (cognitive 31) · ×1
  • (anonymous) (cognitive 31) core/src/main/resources/org/apache/spark/ui/static/executorspage.js:108 — (anonymous) has cognitive complexity 31 (threshold 15). Drivers by points: if/else 20, ternaries 9 (11 pts) (nesting depth added 2). None of this is in the body itself: all 31 points belong to 27 function items inside it that branch (a function literal at line 194, (anonymous)::(anonymous)::(anonymous)::data, (anonymous)::(anonymous)::(anonymous)::data, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · EdgePartition.aggregateMessagesIndexScan (cognitive 30) · ×1
  • EdgePartition.aggregateMessagesIndexScan (cognitive 30) graphx/src/main/scala/org/apache/spark/graphx/impl/EdgePartition.scala:428 — EdgePartition.aggregateMessagesIndexScan has cognitive complexity 30 (threshold 15). Drivers by points: if/else 18 (26 pts), boolean chains 2, 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.
D2 · Cognitive Complexity · DecisionTreeMetadata.buildMetadata (cognitive 30) · ×1
  • DecisionTreeMetadata.buildMetadata (cognitive 30) mllib/src/main/scala/org/apache/spark/ml/tree/impl/DecisionTreeMetadata.scala:113 — DecisionTreeMetadata.buildMetadata has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (22 pts), match/switch 5 (8 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.
D2 · Cognitive Complexity · RowMatrix.computeSVD (cognitive 30) · ×1
  • RowMatrix.computeSVD (cognitive 30) mllib/src/main/scala/org/apache/spark/mllib/linalg/distributed/RowMatrix.scala:313 — RowMatrix.computeSVD has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (17 pts), loops 3 (6 pts), boolean chains 5, match/switch 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RecordBinaryComparator.compare (cognitive 30) · ×1
  • RecordBinaryComparator.compare (cognitive 30) sql/core/src/main/java/org/apache/spark/sql/execution/RecordBinaryComparator.java:26 — RecordBinaryComparator.compare has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 3 (11 pts), loops 3 (5 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.
D2 · Cognitive Complexity · HadoopRDD.compute (cognitive 29) · ×1
  • HadoopRDD.compute (cognitive 29) core/src/main/scala/org/apache/spark/rdd/HadoopRDD.scala:223 — HadoopRDD.compute has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (15 pts), error handling 8 (11 pts), match/switch 2, 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.
D2 · Cognitive Complexity · DAGScheduler.cleanupStateForJobAndIndependentStages (cognitive 29) · ×1
  • DAGScheduler.cleanupStateForJobAndIndependentStages (cognitive 29) core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala:608 — DAGScheduler.cleanupStateForJobAndIndependentStages has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 2 (7 pts), boolean chains 1, match/switch 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.
D2 · Cognitive Complexity · ImageSchema.decode (cognitive 29) · ×1
  • ImageSchema.decode (cognitive 29) mllib/src/main/scala/org/apache/spark/ml/image/ImageSchema.scala:134 — ImageSchema.decode has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 4 (14 pts), error handling 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.
D2 · Cognitive Complexity · HuberAggregator.add (cognitive 29) · ×1
  • HuberAggregator.add (cognitive 29) mllib/src/main/scala/org/apache/spark/ml/optim/aggregator/HuberAggregator.scala:94 — HuberAggregator.add has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 3, match/switch 1 (nesting depth added 14). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · RowMatrix.columnSimilaritiesDIMSUM (cognitive 29) · ×1
  • RowMatrix.columnSimilaritiesDIMSUM (cognitive 29) mllib/src/main/scala/org/apache/spark/mllib/linalg/distributed/RowMatrix.scala:681 — RowMatrix.columnSimilaritiesDIMSUM has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 4 (10 pts), boolean chains 4, match/switch 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.
D2 · Cognitive Complexity · Client.createContainerLaunchContext (cognitive 29) · ×1
  • Client.createContainerLaunchContext (cognitive 29) resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala:859 — Client.createContainerLaunchContext has cognitive complexity 29 (threshold 15). Drivers by points: if/else 23 (27 pts), boolean chains 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.
D2 · Cognitive Complexity · PreprocessTableCreation.apply (cognitive 29) · ×1
  • PreprocessTableCreation.apply (cognitive 29) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/rules.scala:77 — PreprocessTableCreation.apply has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (25 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · LogisticRegressionModel.predict (cognitive 29) · ×1
  • LogisticRegressionModel.predict (cognitive 29) python/pyspark/mllib/classification.py:195 — LogisticRegressionModel.predict has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 2 (6 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.
D2 · Cognitive Complexity · NNLS.solve (cognitive 28) · ×1
  • NNLS.solve (cognitive 28) mllib/src/main/scala/org/apache/spark/mllib/optimization/NNLS.scala:70 — NNLS.solve has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 4 (7 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.
D2 · Cognitive Complexity · ApplicationMaster.allocationThreadImpl (cognitive 28) · ×1
  • ApplicationMaster.allocationThreadImpl (cognitive 28) resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala:553 — ApplicationMaster.allocationThreadImpl has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (17 pts), error handling 4 (8 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.
D2 · Cognitive Complexity · YarnAllocator.updateResourceRequests (cognitive 28) · ×1
  • YarnAllocator.updateResourceRequests (cognitive 28) resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/YarnAllocator.scala:288 — YarnAllocator.updateResourceRequests has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 1 (3 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionArgumentConversion.coerceTypes (cognitive 28) · ×1
  • FunctionArgumentConversion.coerceTypes (cognitive 28) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala:555 — FunctionArgumentConversion.coerceTypes has cognitive complexity 28 (threshold 15). Drivers by points: match/switch 11 (21 pts), boolean chains 7 (nesting depth added 10). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · UnresolvedAttribute.parseAttributeName (cognitive 28) · ×1
  • UnresolvedAttribute.parseAttributeName (cognitive 28) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/unresolved.scala:156 — UnresolvedAttribute.parseAttributeName has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (25 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.
D2 · Cognitive Complexity · DataType.canWrite (cognitive 28) · ×1
  • DataType.canWrite (cognitive 28) sql/catalyst/src/main/scala/org/apache/spark/sql/types/DataType.scala:368 — DataType.canWrite has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 7, match/switch 1 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · DataSource.lookupDataSource (cognitive 28) · ×1
  • DataSource.lookupDataSource (cognitive 28) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DataSource.scala:618 — DataSource.lookupDataSource has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (18 pts), match/switch 3 (4 pts), boolean chains 3, error handling 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.
D2 · Cognitive Complexity · Shim_v0_13.convertFilters (cognitive 28) · ×1
  • Shim_v0_13.convertFilters (cognitive 28) sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveShim.scala:601 — Shim_v0_13.convertFilters has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (14 pts), match/switch 6, loops 2 (5 pts), boolean chains 3 (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.
D2 · Cognitive Complexity · SparkContext.createTaskScheduler (cognitive 27) · ×1
  • SparkContext.createTaskScheduler (cognitive 27) core/src/main/scala/org/apache/spark/SparkContext.scala:2675 — SparkContext.createTaskScheduler has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (20 pts), error handling 2 (4 pts), match/switch 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TaskReaper.run (cognitive 27) · ×1
  • TaskReaper.run (cognitive 27) core/src/main/scala/org/apache/spark/executor/Executor.scala:681 — TaskReaper.run has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (19 pts), error handling 1 (4 pts), boolean chains 3, 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.
D2 · Cognitive Complexity · AppStatusListener.onTaskEnd (cognitive 27) · ×1
  • AppStatusListener.onTaskEnd (cognitive 27) core/src/main/scala/org/apache/spark/status/AppStatusListener.scala:548 — AppStatusListener.onTaskEnd has cognitive complexity 27 (threshold 15). Drivers by points: if/else 21 (22 pts), boolean chains 3, match/switch 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · JobPage.render (cognitive 27) · ×1
  • JobPage.render (cognitive 27) core/src/main/scala/org/apache/spark/ui/jobs/JobPage.scala:185 — JobPage.render has cognitive complexity 27 (threshold 15). Drivers by points: if/else 19 (22 pts), boolean chains 3, loops 1, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ALS.computeFactors (cognitive 27) · ×1
  • ALS.computeFactors (cognitive 27) mllib/src/main/scala/org/apache/spark/ml/recommendation/ALS.scala:1642 — ALS.computeFactors has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 2 (5 pts), match/switch 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DataFrame.replace (cognitive 27) · ×1
  • DataFrame.replace (cognitive 27) python/pyspark/sql/dataframe.py:1668 — DataFrame.replace has cognitive complexity 27 (threshold 15). Drivers by points: if/else 18 (22 pts), boolean chains 5 (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.
D2 · Cognitive Complexity · FsHistoryProvider.mergeApplicationListing (cognitive 26) · ×1
  • FsHistoryProvider.mergeApplicationListing (cognitive 26) core/src/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala:676 — FsHistoryProvider.mergeApplicationListing has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 8, error handling 1 (3 pts), loops 1 (3 pts), match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Logging.initializeLogging (cognitive 26) · ×1
  • Logging.initializeLogging (cognitive 26) core/src/main/scala/org/apache/spark/internal/Logging.scala:119 — Logging.initializeLogging has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (19 pts), match/switch 2 (7 pts) (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.
D2 · Cognitive Complexity · TaskSetManager.handleFailedTask (cognitive 26) · ×1
  • TaskSetManager.handleFailedTask (cognitive 26) core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala:851 — TaskSetManager.handleFailedTask has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (23 pts), boolean chains 2, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StronglyConnectedComponents.run (cognitive 26) · ×1
  • StronglyConnectedComponents.run (cognitive 26) graphx/src/main/scala/org/apache/spark/graphx/lib/StronglyConnectedComponents.scala:38 — StronglyConnectedComponents.run has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 5, 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.
D2 · Cognitive Complexity · Postfix.project (cognitive 26) · ×1
  • Postfix.project (cognitive 26) mllib/src/main/scala/org/apache/spark/mllib/fpm/PrefixSpan.scala:493 — Postfix.project has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 2 (4 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.
D2 · Cognitive Complexity · GetColumnsOperation.runInternal (cognitive 26) · ×1
  • GetColumnsOperation.runInternal (cognitive 26) sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/GetColumnsOperation.java:132 — GetColumnsOperation.runInternal has cognitive complexity 26 (threshold 15). Drivers by points: loops 5 (10 pts), ternaries 2 (8 pts), if/else 3 (6 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.
D2 · Cognitive Complexity · DefaultPartitionCoalescer.throwBalls (cognitive 25) · ×1
  • DefaultPartitionCoalescer.throwBalls (cognitive 25) core/src/main/scala/org/apache/spark/rdd/CoalescedRDD.scala:328 — DefaultPartitionCoalescer.throwBalls has cognitive complexity 25 (threshold 15). Drivers by points: loops 5 (12 pts), if/else 6 (11 pts), boolean chains 2 (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.
D2 · Cognitive Complexity · Utils.getCallSite (cognitive 25) · ×1
  • Utils.getCallSite (cognitive 25) core/src/main/scala/org/apache/spark/util/Utils.scala:1439 — Utils.getCallSite has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (24 pts), boolean chains 1 (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · LogisticAggregator.multinomialUpdateInPlace (cognitive 25) · ×1
  • LogisticAggregator.multinomialUpdateInPlace (cognitive 25) mllib/src/main/scala/org/apache/spark/ml/optim/aggregator/LogisticAggregator.scala:257 — LogisticAggregator.multinomialUpdateInPlace has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 5 (8 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.
D2 · Cognitive Complexity · TimeWindowing.apply (cognitive 25) · ×1
  • TimeWindowing.apply (cognitive 25) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala:2739 — TimeWindowing.apply has cognitive complexity 25 (threshold 15). Drivers by points: match/switch 5 (14 pts), if/else 6 (9 pts), boolean chains 2 (nesting depth added 12). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · BroadcastNestedLoopJoinExec.defaultJoin (cognitive 25) · ×1
  • BroadcastNestedLoopJoinExec.defaultJoin (cognitive 25) sql/core/src/main/scala/org/apache/spark/sql/execution/joins/BroadcastNestedLoopJoinExec.scala:233 — BroadcastNestedLoopJoinExec.defaultJoin has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 6 (9 pts), boolean chains 1, match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Index.addOrRemove (cognitive 25) · ×1
  • Index.addOrRemove (cognitive 25) common/kvstore/src/main/java/org/apache/spark/util/kvstore/LevelDBTypeInfo.java:325 — Index.addOrRemove has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (15 pts), ternaries 3 (6 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.
D2 · Cognitive Complexity · SparkEnv.create (cognitive 24) · ×1
  • SparkEnv.create (cognitive 24) core/src/main/scala/org/apache/spark/SparkEnv.scala:217 — SparkEnv.create has cognitive complexity 24 (threshold 15). Drivers by points: if/else 21, 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.
D2 · Cognitive Complexity · PipedRDD.compute (cognitive 24) · ×1
  • PipedRDD.compute (cognitive 24) core/src/main/scala/org/apache/spark/rdd/PipedRDD.scala:66 — PipedRDD.compute has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (16 pts), error handling 3 (4 pts), loops 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.
D2 · Cognitive Complexity · BlockManagerInfo.updateBlockInfo (cognitive 24) · ×1
  • BlockManagerInfo.updateBlockInfo (cognitive 24) core/src/main/scala/org/apache/spark/storage/BlockManagerMasterEndpoint.scala:600 — BlockManagerInfo.updateBlockInfo has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (23 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.
D2 · Cognitive Complexity · ShuffleBlockFetcherIterator.splitLocalRemoteBlocks (cognitive 24) · ×1
  • ShuffleBlockFetcherIterator.splitLocalRemoteBlocks (cognitive 24) core/src/main/scala/org/apache/spark/storage/ShuffleBlockFetcherIterator.scala:275 — ShuffleBlockFetcherIterator.splitLocalRemoteBlocks has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (4 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Utils.splitCommandString (cognitive 24) · ×1
  • Utils.splitCommandString (cognitive 24) core/src/main/scala/org/apache/spark/util/Utils.scala:1641 — Utils.splitCommandString has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (21 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.
D2 · Cognitive Complexity · SchemaConverters.toSqlTypeHelper (cognitive 24) · ×1
  • SchemaConverters.toSqlTypeHelper (cognitive 24) external/avro/src/main/scala/org/apache/spark/sql/avro/SchemaConverters.scala:49 — SchemaConverters.toSqlTypeHelper has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (14 pts), match/switch 5 (10 pts) (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · SparseMatrix.toSparseMatrix (cognitive 24) · ×1
  • SparseMatrix.toSparseMatrix (cognitive 24) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:741 — SparseMatrix.toSparseMatrix has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (7 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.
D2 · Cognitive Complexity · LocalKMeans.kMeansPlusPlus (cognitive 24) · ×1
  • LocalKMeans.kMeansPlusPlus (cognitive 24) mllib/src/main/scala/org/apache/spark/mllib/clustering/LocalKMeans.scala:36 — LocalKMeans.kMeansPlusPlus has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 6 (10 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.
D2 · Cognitive Complexity · ParserUtils.unescapeSQLString (cognitive 24) · ×1
  • ParserUtils.unescapeSQLString (cognitive 24) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/ParserUtils.scala:115 — ParserUtils.unescapeSQLString has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 3, loops 1, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Decoder.decompress (cognitive 24) · ×1
  • Decoder.decompress (cognitive 24) sql/core/src/main/scala/org/apache/spark/sql/execution/columnar/compression/compressionSchemes.scala:488 — Decoder.decompress has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 2 (4 pts), match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SortState.gallopLeft (cognitive 24) · ×1
  • SortState.gallopLeft (cognitive 24) core/src/main/java/org/apache/spark/util/collection/TimSort.java:557 — SortState.gallopLeft has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3 (5 pts), boolean chains 4 (nesting depth added 9). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages. This shape REPEATS in the file: one other method here (SortState.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.
D2 · Cognitive Complexity · SortState.gallopRight (cognitive 24) · ×1
  • SortState.gallopRight (cognitive 24) core/src/main/java/org/apache/spark/util/collection/TimSort.java:628 — SortState.gallopRight has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3 (5 pts), boolean chains 4 (nesting depth added 9). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages. This shape REPEATS in the file: one other method here (SortState.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.
D2 · Cognitive Complexity · Worker.reregisterWithMaster (cognitive 23) · ×1
  • Worker.reregisterWithMaster (cognitive 23) core/src/main/scala/org/apache/spark/deploy/worker/Worker.scala:284 — Worker.reregisterWithMaster has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (15 pts), error handling 2 (6 pts), match/switch 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AppStatusListener.updateRDDBlock (cognitive 23) · ×1
  • AppStatusListener.updateRDDBlock (cognitive 23) core/src/main/scala/org/apache/spark/status/AppStatusListener.scala:909 — AppStatusListener.updateRDDBlock has cognitive complexity 23 (threshold 15). Drivers by points: if/else 19 (23 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.
D2 · Cognitive Complexity · MemoryStore.putIterator (cognitive 23) · ×1
  • MemoryStore.putIterator (cognitive 23) core/src/main/scala/org/apache/spark/storage/memory/MemoryStore.scala:186 — MemoryStore.putIterator has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (21 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.
D2 · Cognitive Complexity · ExternalSorter.mergeWithAggregation (cognitive 23) · ×1
  • ExternalSorter.mergeWithAggregation (cognitive 23) core/src/main/scala/org/apache/spark/util/collection/ExternalSorter.scala:394 — ExternalSorter.mergeWithAggregation has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (7 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.
D2 · Cognitive Complexity · ReorderAssociativeOperator.apply (cognitive 23) · ×1
  • ReorderAssociativeOperator.apply (cognitive 23) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/expressions.scala:180 — ReorderAssociativeOperator.apply has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (18 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · TungstenAggregationIterator.processInputs (cognitive 23) · ×1
  • TungstenAggregationIterator.processInputs (cognitive 23) sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/TungstenAggregationIterator.scala:179 — TungstenAggregationIterator.processInputs has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 2 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OrcUtils.requestedColumnIds (cognitive 23) · ×1
  • OrcUtils.requestedColumnIds (cognitive 23) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcUtils.scala:121 — OrcUtils.requestedColumnIds has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (23 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.
D2 · Cognitive Complexity · SortMergeJoinScanner.findNextInnerJoinRows (cognitive 23) · ×1
  • SortMergeJoinScanner.findNextInnerJoinRows (cognitive 23) sql/core/src/main/scala/org/apache/spark/sql/execution/joins/SortMergeJoinExec.scala:701 — SortMergeJoinScanner.findNextInnerJoinRows has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 4, loops 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.
D2 · Cognitive Complexity · SparkSubmitOptionParser.parse (cognitive 23) · ×1
  • SparkSubmitOptionParser.parse (cognitive 23) launcher/src/main/java/org/apache/spark/launcher/SparkSubmitOptionParser.java:138 — SparkSubmitOptionParser.parse has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (22 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.
D2 · Cognitive Complexity · UTF8String.toInt (cognitive 23) · ×1
  • UTF8String.toInt (cognitive 23) common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java:1170 — UTF8String.toInt has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 3, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (UTF8String.toLong) 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.
D2 · Cognitive Complexity · UTF8String.toLong (cognitive 23) · ×1
  • UTF8String.toLong (cognitive 23) common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java:1079 — UTF8String.toLong has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 3, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (UTF8String.toInt) 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.
D2 · Cognitive Complexity · VectorizedColumnReader.readBinaryBatch (cognitive 23) · ×1
  • VectorizedColumnReader.readBinaryBatch (cognitive 23) sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedColumnReader.java:466 — VectorizedColumnReader.readBinaryBatch has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (16 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.
D2 · Cognitive Complexity · java_gateway.launch_gateway (cognitive 23) · ×1
  • java_gateway.launch_gateway (cognitive 23) REDACTED:39 — java_gateway.launch_gateway has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2 (5 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.
D2 · Cognitive Complexity · merge_spark_pr.resolve_jira_issue (cognitive 23) · ×1
  • merge_spark_pr.resolve_jira_issue (cognitive 23) dev/merge_spark_pr.py:243 — merge_spark_pr.resolve_jira_issue has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (15 pts), error handling 3 (5 pts), loops 2, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · jquery.mustache.Context.lookup (cognitive 23) · ×1
  • jquery.mustache.Context.lookup (cognitive 23) core/src/main/resources/org/apache/spark/ui/static/jquery.mustache.js:386 — jquery.mustache.Context.lookup has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (6 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.
D2 · Cognitive Complexity · SparkConf.validateSettings (cognitive 22) · ×1
  • SparkConf.validateSettings (cognitive 22) core/src/main/scala/org/apache/spark/SparkConf.scala:507 — SparkConf.validateSettings has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 5, match/switch 2 (4 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.
D2 · Cognitive Complexity · Inbox.process (cognitive 22) · ×1
  • Inbox.process (cognitive 22) core/src/main/scala/org/apache/spark/rpc/netty/Inbox.scala:87 — Inbox.process has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (14 pts), error handling 1 (3 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReplayListenerBus.replay (cognitive 22) · ×1
  • ReplayListenerBus.replay (cognitive 22) core/src/main/scala/org/apache/spark/scheduler/ReplayListenerBus.scala:65 — ReplayListenerBus.replay has cognitive complexity 22 (threshold 15). Drivers by points: error handling 7 (10 pts), if/else 4 (10 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.
D2 · Cognitive Complexity · Utils.startServiceOnPort (cognitive 22) · ×1
  • Utils.startServiceOnPort (cognitive 22) core/src/main/scala/org/apache/spark/util/Utils.scala:2238 — Utils.startServiceOnPort has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 2, error handling 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.
D2 · Cognitive Complexity · RandomForest.binsToBestSplit (cognitive 22) · ×1
  • RandomForest.binsToBestSplit (cognitive 22) mllib/src/main/scala/org/apache/spark/ml/tree/impl/RandomForest.scala:734 — RandomForest.binsToBestSplit has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (18 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.
D2 · Cognitive Complexity · Word2Vec.createBinaryTree (cognitive 22) · ×1
  • Word2Vec.createBinaryTree (cognitive 22) mllib/src/main/scala/org/apache/spark/mllib/feature/Word2Vec.scala:224 — Word2Vec.createBinaryTree has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 6 (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.
D2 · Cognitive Complexity · CheckAnalysis.checkSubqueryExpression (cognitive 22) · ×1
  • CheckAnalysis.checkSubqueryExpression (cognitive 22) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala:431 — CheckAnalysis.checkSubqueryExpression has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (11 pts), match/switch 6 (11 pts) (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · RowEncoder.serializerFor (cognitive 22) · ×1
  • RowEncoder.serializerFor (cognitive 22) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/encoders/RowEncoder.scala:74 — RowEncoder.serializerFor has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (19 pts), match/switch 2 (3 pts) (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · InterpretedUnsafeProjection.generateFieldWriter (cognitive 22) · ×1
  • InterpretedUnsafeProjection.generateFieldWriter (cognitive 22) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/InterpretedUnsafeProjection.scala:130 — InterpretedUnsafeProjection.generateFieldWriter has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (16 pts), match/switch 4 (6 pts) (nesting depth added 6). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · FromUnixTime.eval (cognitive 22) · ×1
  • FromUnixTime.eval (cognitive 22) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala:808 — FromUnixTime.eval has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (13 pts), error handling 2 (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.
D2 · Cognitive Complexity · JsonTuple.parseRow (cognitive 22) · ×1
  • JsonTuple.parseRow (cognitive 22) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/jsonExpressions.scala:408 — JsonTuple.parseRow has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (6 pts), match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InterpretedOrdering.compare (cognitive 22) · ×1
  • InterpretedOrdering.compare (cognitive 22) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/ordering.scala:33 — InterpretedOrdering.compare has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (17 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.
D2 · Cognitive Complexity · LoadDataCommand.run (cognitive 22) · ×1
  • LoadDataCommand.run (cognitive 22) sql/core/src/main/scala/org/apache/spark/sql/execution/command/tables.scala:276 — LoadDataCommand.run has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 1, 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.
D2 · Cognitive Complexity · LevelDBIterator.loadNext (cognitive 22) · ×1
  • LevelDBIterator.loadNext (cognitive 22) common/kvstore/src/main/java/org/apache/spark/util/kvstore/LevelDBIterator.java:205 — LevelDBIterator.loadNext has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 3 (7 pts), error handling 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.
D2 · Cognitive Complexity · UTF8String.soundex (cognitive 22) · ×1
  • UTF8String.soundex (cognitive 22) common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java:1405 — UTF8String.soundex has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 5, 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.
D2 · Cognitive Complexity · VectorizedColumnReader.readBatch (cognitive 22) · ×1
  • VectorizedColumnReader.readBatch (cognitive 22) sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedColumnReader.java:153 — VectorizedColumnReader.readBatch has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 5, match/switch 1 (3 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorizedColumnReader.readFixedLenByteArrayBatch (cognitive 22) · ×1
  • VectorizedColumnReader.readFixedLenByteArrayBatch (cognitive 22) sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedColumnReader.java:501 — VectorizedColumnReader.readFixedLenByteArrayBatch has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 3 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ColumnVectorUtils.populate (cognitive 22) · ×1
  • ColumnVectorUtils.populate (cognitive 22) sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/ColumnVectorUtils.java:48 — ColumnVectorUtils.populate has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16 (17 pts), loops 2 (5 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.
D2 · Cognitive Complexity · merge_spark_pr.choose_jira_assignee (cognitive 22) · ×1
  • merge_spark_pr.choose_jira_assignee (cognitive 22) dev/merge_spark_pr.py:325 — merge_spark_pr.choose_jira_assignee has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (9 pts), error handling 3 (7 pts), loops 2 (3 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.
D2 · Cognitive Complexity · SparkSubmitArguments.validateSubmitArguments (cognitive 21) · ×1
  • SparkSubmitArguments.validateSubmitArguments (cognitive 21) core/src/main/scala/org/apache/spark/deploy/SparkSubmitArguments.scala:265 — SparkSubmitArguments.validateSubmitArguments has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 9 (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.
D2 · Cognitive Complexity · Master.receiveAndReply (cognitive 21) · ×1
  • Master.receiveAndReply (cognitive 21) core/src/main/scala/org/apache/spark/deploy/master/Master.scala:424 — Master.receiveAndReply has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 3 (7 pts) (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · RDDOperationGraph.makeOperationGraph (cognitive 21) · ×1
  • RDDOperationGraph.makeOperationGraph (cognitive 21) core/src/main/scala/org/apache/spark/ui/scope/RDDOperationGraph.scala:110 — RDDOperationGraph.makeOperationGraph has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (17 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · KafkaSourceProvider.validateGeneralOptions (cognitive 21) · ×1
  • KafkaSourceProvider.validateGeneralOptions (cognitive 21) external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaSourceProvider.scala:203 — KafkaSourceProvider.validateGeneralOptions has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (20 pts), match/switch 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.
D2 · Cognitive Complexity · ALS.train (cognitive 21) · ×1
  • ALS.train (cognitive 21) mllib/src/main/scala/org/apache/spark/ml/recommendation/ALS.scala:902 — ALS.train has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (4 pts), boolean chains 1, error handling 1, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RandomForest.findBestSplits (cognitive 21) · ×1
  • RandomForest.findBestSplits (cognitive 21) mllib/src/main/scala/org/apache/spark/ml/tree/impl/RandomForest.scala:396 — RandomForest.findBestSplits has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 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.
D2 · Cognitive Complexity · SlidingRDD.getPartitions (cognitive 21) · ×1
  • SlidingRDD.getPartitions (cognitive 21) mllib/src/main/scala/org/apache/spark/mllib/rdd/SlidingRDD.scala:68 — SlidingRDD.getPartitions has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 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.
D2 · Cognitive Complexity · ResolveFunctions.apply (cognitive 21) · ×1
  • ResolveFunctions.apply (cognitive 21) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala:1405 — ResolveFunctions.apply has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 4 (9 pts) (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · ToTimestamp.eval (cognitive 21) · ×1
  • ToTimestamp.eval (cognitive 21) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala:650 — ToTimestamp.eval has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 2 (8 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FormatNumber.nullSafeEval (cognitive 21) · ×1
  • FormatNumber.nullSafeEval (cognitive 21) REDACTED:2099 — FormatNumber.nullSafeEval has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 4 (6 pts), loops 1 (4 pts) (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · JsonInferSchema.inferField (cognitive 21) · ×1
  • JsonInferSchema.inferField (cognitive 21) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/json/JsonInferSchema.scala:105 — JsonInferSchema.inferField has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (4 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · EstimationUtils.getOverlappedRanges (cognitive 21) · ×1
  • EstimationUtils.getOverlappedRanges (cognitive 21) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/statsEstimation/EstimationUtils.scala:244 — EstimationUtils.getOverlappedRanges has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 7 (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.
D2 · Cognitive Complexity · JoinEstimation.estimateInnerOuterJoin (cognitive 21) · ×1
  • JoinEstimation.estimateInnerOuterJoin (cognitive 21) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/statsEstimation/JoinEstimation.scala:55 — JoinEstimation.estimateInnerOuterJoin has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (9 pts), match/switch 4 (9 pts), boolean chains 3 (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.
D2 · Cognitive Complexity · StructType.merge (cognitive 21) · ×1
  • StructType.merge (cognitive 21) sql/catalyst/src/main/scala/org/apache/spark/sql/types/StructType.scala:503 — StructType.merge has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (6 pts), match/switch 3 (6 pts), boolean chains 5, error handling 1 (4 pts) (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · AdaptiveSparkPlanExec.createQueryStages (cognitive 21) · ×1
  • AdaptiveSparkPlanExec.createQueryStages (cognitive 21) sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/AdaptiveSparkPlanExec.scala:205 — AdaptiveSparkPlanExec.createQueryStages has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (18 pts), match/switch 2 (3 pts) (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · HiveUtils.newClientForMetadata (cognitive 21) · ×1
  • HiveUtils.newClientForMetadata (cognitive 21) sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveUtils.scala:308 — HiveUtils.newClientForMetadata has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (17 pts), match/switch 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.
D2 · Cognitive Complexity · SparkLauncher.startApplication (cognitive 21) · ×1
  • SparkLauncher.startApplication (cognitive 21) launcher/src/main/java/org/apache/spark/launcher/SparkLauncher.java:351 — SparkLauncher.startApplication has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 5, ternaries 1 (2 pts), 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.
D2 · Cognitive Complexity · LevelDBIterator.<init> (cognitive 21) · ×1
  • LevelDBIterator.<init> (cognitive 21) common/kvstore/src/main/java/org/apache/spark/util/kvstore/LevelDBIterator.java:48 — LevelDBIterator.<init> has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (19 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.
D2 · Cognitive Complexity · SpecializedGettersReader.read (cognitive 21) · ×1
  • SpecializedGettersReader.read (cognitive 21) sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/SpecializedGettersReader.java:25 — SpecializedGettersReader.read has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18, boolean chains 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.
D2 · Cognitive Complexity · VectorizedRleValuesReader.readShorts (cognitive 21) · ×1
  • VectorizedRleValuesReader.readShorts (cognitive 21) sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedRleValuesReader.java:275 — VectorizedRleValuesReader.readShorts has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (8 pts), match/switch 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ThriftHttpServlet.doPost (cognitive 21) · ×1
  • ThriftHttpServlet.doPost (cognitive 21) REDACTED:118 — ThriftHttpServlet.doPost has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (18 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.
D2 · Cognitive Complexity · types._infer_type (cognitive 21) · ×1
  • types._infer_type (cognitive 21) python/pyspark/sql/types.py:1003 — types._infer_type has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 2 (4 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.
D2 · Cognitive Complexity · ExternalSorter.writePartitionedFile (cognitive 20) · ×1
  • ExternalSorter.writePartitionedFile (cognitive 20) core/src/main/scala/org/apache/spark/util/collection/ExternalSorter.scala:679 — ExternalSorter.writePartitionedFile has cognitive complexity 20 (threshold 15). Drivers by points: loops 4 (11 pts), if/else 5 (8 pts), boolean chains 1 (nesting depth added 10). 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.
D2 · Cognitive Complexity · EdgePartition.aggregateMessagesEdgeScan (cognitive 20) · ×1
  • EdgePartition.aggregateMessagesEdgeScan (cognitive 20) graphx/src/main/scala/org/apache/spark/graphx/impl/EdgePartition.scala:383 — EdgePartition.aggregateMessagesEdgeScan 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.
D2 · Cognitive Complexity · LinearSVC.train (cognitive 20) · ×1
  • LinearSVC.train (cognitive 20) mllib/src/main/scala/org/apache/spark/ml/classification/LinearSVC.scala:166 — LinearSVC.train has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 2, match/switch 2, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · HingeAggregator.add (cognitive 20) · ×1
  • HingeAggregator.add (cognitive 20) mllib/src/main/scala/org/apache/spark/ml/optim/aggregator/HingeAggregator.scala:58 — HingeAggregator.add has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 2, match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · ExecutorPodsAllocator.onNewSnapshots (cognitive 20) · ×1
  • ExecutorPodsAllocator.onNewSnapshots (cognitive 20) resource-managers/kubernetes/core/src/main/scala/org/apache/spark/scheduler/cluster/k8s/ExecutorPodsAllocator.scala:77 — ExecutorPodsAllocator.onNewSnapshots has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (11 pts), match/switch 2 (4 pts), loops 1 (3 pts), boolean chains 2 (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.
D2 · Cognitive Complexity · CatalogV2Util.applySchemaChanges (cognitive 20) · ×1
  • CatalogV2Util.applySchemaChanges (cognitive 20) sql/catalyst/src/main/java/org/apache/spark/sql/catalog/v2/utils/CatalogV2Util.scala:68 — CatalogV2Util.applySchemaChanges has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 5 (13 pts), if/else 5 (6 pts), boolean chains 1 (nesting depth added 9). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · TypeCoercion.findCommonTypeForBinaryComparison (cognitive 20) · ×1
  • TypeCoercion.findCommonTypeForBinaryComparison (cognitive 20) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala:121 — TypeCoercion.findCommonTypeForBinaryComparison has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (19 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.
D2 · Cognitive Complexity · StarSchemaDetection.isUnique (cognitive 20) · ×1
  • StarSchemaDetection.isUnique (cognitive 20) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/StarSchemaDetection.scala:179 — StarSchemaDetection.isUnique has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (12 pts), match/switch 3 (6 pts), boolean chains 2 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · SimplifyConditionals.apply (cognitive 20) · ×1
  • SimplifyConditionals.apply (cognitive 20) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/expressions.scala:415 — SimplifyConditionals.apply has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 1 (3 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · DateTimeUtils.stringToDate (cognitive 20) · ×1
  • DateTimeUtils.stringToDate (cognitive 20) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeUtils.scala:376 — DateTimeUtils.stringToDate has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 6, error handling 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JDBCRelation.columnPartition (cognitive 20) · ×1
  • JDBCRelation.columnPartition (cognitive 20) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JDBCRelation.scala:63 — JDBCRelation.columnPartition has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 4, 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.
D2 · Cognitive Complexity · OrcDeserializer.newWriter (cognitive 20) · ×1
  • OrcDeserializer.newWriter (cognitive 20) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcDeserializer.scala:74 — OrcDeserializer.newWriter has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (6 pts), match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · FilePartitionReader.next (cognitive 20) · ×1
  • FilePartitionReader.next (cognitive 20) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/FilePartitionReader.scala:38 — FilePartitionReader.next has cognitive complexity 20 (threshold 15). Drivers by points: error handling 6 (12 pts), if/else 6 (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.
D2 · Cognitive Complexity · SortMergeJoinScanner.findNextOuterJoinRows (cognitive 20) · ×1
  • SortMergeJoinScanner.findNextOuterJoinRows (cognitive 20) sql/core/src/main/scala/org/apache/spark/sql/execution/joins/SortMergeJoinExec.scala:755 — SortMergeJoinScanner.findNextOuterJoinRows has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 1 (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.
D2 · Cognitive Complexity · WindowInPandasExec.doExecute (cognitive 20) · ×1
  • WindowInPandasExec.doExecute (cognitive 20) sql/core/src/main/scala/org/apache/spark/sql/execution/python/WindowInPandasExec.scala:181 — WindowInPandasExec.doExecute has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 5, loops 3, match/switch 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.
D2 · Cognitive Complexity · StateStoreSaveExec.doExecute (cognitive 20) · ×1
  • StateStoreSaveExec.doExecute (cognitive 20) sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/statefulOperators.scala:289 — StateStoreSaveExec.doExecute has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 3 (6 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · SparkExecuteStatementOperation.getNextRowSet (cognitive 20) · ×1
  • SparkExecuteStatementOperation.getNextRowSet (cognitive 20) sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkExecuteStatementOperation.scala:112 — SparkExecuteStatementOperation.getNextRowSet has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 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.
D2 · Cognitive Complexity · UTF8String.subStringIndex (cognitive 20) · ×1
  • UTF8String.subStringIndex (cognitive 20) common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java:801 — UTF8String.subStringIndex 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.
D2 · Cognitive Complexity · ColumnVectorUtils.appendValue (cognitive 20) · ×1
  • ColumnVectorUtils.appendValue (cognitive 20) sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/ColumnVectorUtils.java:127 — ColumnVectorUtils.appendValue has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18 (20 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.
D2 · Cognitive Complexity · HiveServer2.startHiveServer2 (cognitive 20) · ×1
  • HiveServer2.startHiveServer2 (cognitive 20) sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/server/HiveServer2.java:116 — HiveServer2.startHiveServer2 has cognitive complexity 20 (threshold 15). Drivers by points: error handling 4 (12 pts), if/else 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.
D2 · Cognitive Complexity · heapq3.nsmallest (cognitive 20) · ×1
  • heapq3.nsmallest (cognitive 20) python/pyspark/heapq3.py:742 — heapq3.nsmallest has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 2 (3 pts), ternaries 1 (2 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. This shape REPEATS in the file: one other method here (heapq3.nlargest) 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.
D2 · Cognitive Complexity · heapq3.nlargest (cognitive 20) · ×1
  • heapq3.nlargest (cognitive 20) python/pyspark/heapq3.py:805 — heapq3.nlargest has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 2 (3 pts), ternaries 1 (2 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. This shape REPEATS in the file: one other method here (heapq3.nsmallest) 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.
D2 · Cognitive Complexity · ExternalGroupBy._spill (cognitive 20) · ×1
  • ExternalGroupBy._spill (cognitive 20) python/pyspark/shuffle.py:709 — ExternalGroupBy._spill has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 4 (10 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.
D2 · Cognitive Complexity · translate-contributors.generate_candidates (cognitive 20) · ×1
  • translate-contributors.generate_candidates (cognitive 20) dev/create-release/translate-contributors.py:97 — translate-contributors.generate_candidates has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (14 pts), error handling 2 (4 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.
D2 · Cognitive Complexity · merge_spark_pr.main (cognitive 20) · ×1
  • merge_spark_pr.main (cognitive 20) dev/merge_spark_pr.py:449 — merge_spark_pr.main has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 3, 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.
D2 · Cognitive Complexity · TorrentBroadcast.readBlocks (cognitive 19) · ×1
  • TorrentBroadcast.readBlocks (cognitive 19) core/src/main/scala/org/apache/spark/broadcast/TorrentBroadcast.scala:155 — TorrentBroadcast.readBlocks has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (13 pts), match/switch 2 (5 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SparkSubmit.runMain (cognitive 19) · ×1
  • SparkSubmit.runMain (cognitive 19) core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala:862 — SparkSubmit.runMain has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (14 pts), error handling 3, loops 1, match/switch 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.
D2 · Cognitive Complexity · FsHistoryProvider.checkForLogs (cognitive 19) · ×1
  • FsHistoryProvider.checkForLogs (cognitive 19) core/src/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala:432 — FsHistoryProvider.checkForLogs has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), error handling 6, 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.
D2 · Cognitive Complexity · DoubleRDDFunctions.histogram (cognitive 19) · ×1
  • DoubleRDDFunctions.histogram (cognitive 19) core/src/main/scala/org/apache/spark/rdd/DoubleRDDFunctions.scala:170 — DoubleRDDFunctions.histogram has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 2, match/switch 1 (2 pts), loops 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.
D2 · Cognitive Complexity · BlockStoreUpdater.save (cognitive 19) · ×1
  • BlockStoreUpdater.save (cognitive 19) core/src/main/scala/org/apache/spark/storage/BlockManager.scala:271 — BlockStoreUpdater.save has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 2, error handling 1 (2 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.
D2 · Cognitive Complexity · FieldAccessFinder.visitMethod (cognitive 19) · ×1
  • FieldAccessFinder.visitMethod (cognitive 19) core/src/main/scala/org/apache/spark/util/ClosureCleaner.scala:469 — FieldAccessFinder.visitMethod has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (7 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.
D2 · Cognitive Complexity · InternalKafkaConsumer.fetchRecord (cognitive 19) · ×1
  • InternalKafkaConsumer.fetchRecord (cognitive 19) external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaDataConsumer.scala:357 — InternalKafkaConsumer.fetchRecord has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (19 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.
D2 · Cognitive Complexity · GaussianMixture.fit (cognitive 19) · ×1
  • GaussianMixture.fit (cognitive 19) mllib/src/main/scala/org/apache/spark/ml/clustering/GaussianMixture.scala:327 — GaussianMixture.fit has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (9 pts), match/switch 3 (5 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.
D2 · Cognitive Complexity · VectorSizeHint.transform (cognitive 19) · ×1
  • VectorSizeHint.transform (cognitive 19) mllib/src/main/scala/org/apache/spark/ml/feature/VectorSizeHint.scala:98 — VectorSizeHint.transform has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BisectingKMeans.run (cognitive 19) · ×1
  • BisectingKMeans.run (cognitive 19) mllib/src/main/scala/org/apache/spark/mllib/clustering/BisectingKMeans.scala:156 — BisectingKMeans.run has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 2 (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.
D2 · Cognitive Complexity · MFDataGenerator.main (cognitive 19) · ×1
  • MFDataGenerator.main (cognitive 19) mllib/src/main/scala/org/apache/spark/mllib/util/MFDataGenerator.scala:56 — MFDataGenerator.main has cognitive complexity 19 (threshold 15). Drivers by points: if/else 19. 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.
D2 · Cognitive Complexity · SparkILoop.process (cognitive 19) · ×1
  • SparkILoop.process (cognitive 19) repl/src/main/scala/org/apache/spark/repl/SparkILoop.scala:136 — SparkILoop.process has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (10 pts), loops 2 (4 pts), match/switch 3 (4 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · CheckAnalysis.checkCorrelationsInSubquery (cognitive 19) · ×1
  • CheckAnalysis.checkCorrelationsInSubquery (cognitive 19) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala:514 — CheckAnalysis.checkCorrelationsInSubquery has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (9 pts), match/switch 5 (8 pts), boolean chains 2 (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.
D2 · Cognitive Complexity · ImplicitTypeCasts.coerceTypes (cognitive 19) · ×1
  • ImplicitTypeCasts.coerceTypes (cognitive 19) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala:847 — ImplicitTypeCasts.coerceTypes has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 1, match/switch 1 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · CSVHeaderChecker.checkHeaderColumnNames (cognitive 19) · ×1
  • CSVHeaderChecker.checkHeaderColumnNames (cognitive 19) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/csv/CSVHeaderChecker.scala:58 — CSVHeaderChecker.checkHeaderColumnNames has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ArrayIntersect.doGenCode (cognitive 19) · ×1
  • ArrayIntersect.doGenCode (cognitive 19) REDACTED:3580 — ArrayIntersect.doGenCode 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.
D2 · Cognitive Complexity · InterpretedHashFunction.hash (cognitive 19) · ×1
  • InterpretedHashFunction.hash (cognitive 19) REDACTED:480 — InterpretedHashFunction.hash has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 4 (7 pts), if/else 4 (6 pts), loops 3 (6 pts) (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · MapZipWith.getKeysWithIndexesBruteForce (cognitive 19) · ×1
  • MapZipWith.getKeysWithIndexesBruteForce (cognitive 19) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/higherOrderFunctions.scala:769 — MapZipWith.getKeysWithIndexesBruteForce has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (12 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MapObjects.doGenCode (cognitive 19) · ×1
  • MapObjects.doGenCode (cognitive 19) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/objects/objects.scala:808 — MapObjects.doGenCode has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (10 pts), match/switch 5 (6 pts), boolean chains 3 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · RewriteDistinctAggregates.rewrite (cognitive 19) · ×1
  • RewriteDistinctAggregates.rewrite (cognitive 19) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/RewriteDistinctAggregates.scala:108 — RewriteDistinctAggregates.rewrite has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (9 pts), match/switch 5 (9 pts), boolean chains 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.
D2 · Cognitive Complexity · PullupCorrelatedPredicates.pullOutCorrelatedPredicates (cognitive 19) · ×1
  • PullupCorrelatedPredicates.pullOutCorrelatedPredicates (cognitive 19) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/subquery.scala:195 — PullupCorrelatedPredicates.pullOutCorrelatedPredicates has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (13 pts), match/switch 3 (6 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.
D2 · Cognitive Complexity · ExtractEquiJoinKeys.unapply (cognitive 19) · ×1
  • ExtractEquiJoinKeys.unapply (cognitive 19) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/planning/patterns.scala:108 — ExtractEquiJoinKeys.unapply has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 9, if/else 4 (5 pts), match/switch 3 (5 pts) (nesting depth added 3). 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.
D2 · Cognitive Complexity · SparkSqlAstBuilder.visitCreateHiveTable (cognitive 19) · ×1
  • SparkSqlAstBuilder.visitCreateHiveTable (cognitive 19) sql/core/src/main/scala/org/apache/spark/sql/execution/SparkSqlParser.scala:908 — SparkSqlAstBuilder.visitCreateHiveTable has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 4, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ParquetFileFormat.buildReaderWithPartitionValues (cognitive 19) · ×1
  • ParquetFileFormat.buildReaderWithPartitionValues (cognitive 19) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFileFormat.scala:197 — ParquetFileFormat.buildReaderWithPartitionValues has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (15 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.
D2 · Cognitive Complexity · EnsureRequirements.ensureDistributionAndOrdering (cognitive 19) · ×1
  • EnsureRequirements.ensureDistributionAndOrdering (cognitive 19) sql/core/src/main/scala/org/apache/spark/sql/execution/exchange/EnsureRequirements.scala:141 — EnsureRequirements.ensureDistributionAndOrdering has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (11 pts), match/switch 4 (8 pts) (nesting depth added 6). 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.
D2 · Cognitive Complexity · MicroBatchExecution.constructNextBatch (cognitive 19) · ×1
  • MicroBatchExecution.constructNextBatch (cognitive 19) sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/MicroBatchExecution.scala:353 — MicroBatchExecution.constructNextBatch has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), match/switch 2 (5 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.
D2 · Cognitive Complexity · ReceiverInputDStream.createBlockRDD (cognitive 19) · ×1
  • ReceiverInputDStream.createBlockRDD (cognitive 19) streaming/src/main/scala/org/apache/spark/streaming/dstream/ReceiverInputDStream.scala:94 — ReceiverInputDStream.createBlockRDD has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (19 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.
D2 · Cognitive Complexity · ColumnarBatchRow.copy (cognitive 19) · ×1
  • ColumnarBatchRow.copy (cognitive 19) sql/catalyst/src/main/java/org/apache/spark/sql/vectorized/ColumnarBatch.java:144 — ColumnarBatchRow.copy has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15 (18 pts), 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.
D2 · Cognitive Complexity · ColumnarRow.copy (cognitive 19) · ×1
  • ColumnarRow.copy (cognitive 19) sql/catalyst/src/main/java/org/apache/spark/sql/vectorized/ColumnarRow.java:51 — ColumnarRow.copy has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15 (18 pts), 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.
D2 · Cognitive Complexity · SpecificParquetRecordReaderBase.initialize (cognitive 19) · ×1
  • SpecificParquetRecordReaderBase.initialize (cognitive 19) sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/SpecificParquetRecordReaderBase.java:92 — SpecificParquetRecordReaderBase.initialize has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 4 (8 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.
D2 · Cognitive Complexity · MutableColumnarRow.copy (cognitive 19) · ×1
  • MutableColumnarRow.copy (cognitive 19) sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/MutableColumnarRow.java:51 — MutableColumnarRow.copy has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15 (18 pts), 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.
D2 · Cognitive Complexity · Column.addValue (cognitive 19) · ×1
  • Column.addValue (cognitive 19) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/Column.java:328 — Column.addValue has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 9 (18 pts), match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · CloudPickler.save_function (cognitive 19) · ×1
  • CloudPickler.save_function (cognitive 19) REDACTED:319 — CloudPickler.save_function has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (13 pts), error handling 4, boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Pipeline._fit (cognitive 19) · ×1
  • Pipeline._fit (cognitive 19) python/pyspark/ml/pipeline.py:92 — Pipeline._fit has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 3, 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.
D2 · Cognitive Complexity · getInnerText (cognitive 19) · ×1
  • getInnerText (cognitive 19) REDACTED:199 — getInnerText has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, loops 1 (3 pts), match/switch 1 (2 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.
D2 · Cognitive Complexity · MapOutputTrackerMaster.getLocationsWithLargestOutputs (cognitive 18) · ×1
  • MapOutputTrackerMaster.getLocationsWithLargestOutputs (cognitive 18) core/src/main/scala/org/apache/spark/MapOutputTracker.scala:589 — MapOutputTrackerMaster.getLocationsWithLargestOutputs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 1 (3 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.
D2 · Cognitive Complexity · SparkContext.addJar (cognitive 18) · ×1
  • SparkContext.addJar (cognitive 18) core/src/main/scala/org/apache/spark/SparkContext.scala:1793 — SparkContext.addJar has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), match/switch 1 (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.
D2 · Cognitive Complexity · IndexShuffleBlockResolver.writeIndexFileAndCommit (cognitive 18) · ×1
  • IndexShuffleBlockResolver.writeIndexFileAndCommit (cognitive 18) core/src/main/scala/org/apache/spark/shuffle/IndexShuffleBlockResolver.scala:136 — IndexShuffleBlockResolver.writeIndexFileAndCommit has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, 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.
D2 · Cognitive Complexity · ShuffleBlockFetcherIterator.fetchUpToMaxBytes (cognitive 18) · ×1
  • ShuffleBlockFetcherIterator.fetchUpToMaxBytes (cognitive 18) core/src/main/scala/org/apache/spark/storage/ShuffleBlockFetcherIterator.scala:526 — ShuffleBlockFetcherIterator.fetchUpToMaxBytes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 3 (6 pts), boolean chains 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.
D2 · Cognitive Complexity · MemoryStore.evictBlocksToFreeSpace (cognitive 18) · ×1
  • MemoryStore.evictBlocksToFreeSpace (cognitive 18) core/src/main/scala/org/apache/spark/storage/memory/MemoryStore.scala:434 — MemoryStore.evictBlocksToFreeSpace has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, loops 1, match/switch 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.
D2 · Cognitive Complexity · TaskPagedTable.headers (cognitive 18) · ×1
  • TaskPagedTable.headers (cognitive 18) core/src/main/scala/org/apache/spark/ui/jobs/StagePage.scala:522 — TaskPagedTable.headers has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17 (18 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.
D2 · Cognitive Complexity · GeneralizedLinearRegressionTrainingSummary.toString (cognitive 18) · ×1
  • GeneralizedLinearRegressionTrainingSummary.toString (cognitive 18) mllib/src/main/scala/org/apache/spark/ml/regression/GeneralizedLinearRegression.scala:1488 — GeneralizedLinearRegressionTrainingSummary.toString has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 5 (11 pts), if/else 5 (7 pts) (nesting depth added 8). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · YarnAllocator.runAllocatedContainers (cognitive 18) · ×1
  • YarnAllocator.runAllocatedContainers (cognitive 18) resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/YarnAllocator.scala:527 — YarnAllocator.runAllocatedContainers has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), error handling 1 (4 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.
D2 · Cognitive Complexity · HandleNullInputsForUDF.apply (cognitive 18) · ×1
  • HandleNullInputsForUDF.apply (cognitive 18) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala:2196 — HandleNullInputsForUDF.apply has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 3 (6 pts), boolean chains 2 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · ResolveTableValuedFunctions.apply (cognitive 18) · ×1
  • ResolveTableValuedFunctions.apply (cognitive 18) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveTableValuedFunctions.scala:109 — ResolveTableValuedFunctions.apply has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (8 pts), match/switch 3 (6 pts), error handling 1 (4 pts) (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · StreamingJoinHelper.collectTerms (cognitive 18) · ×1
  • StreamingJoinHelper.collectTerms (cognitive 18) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/StreamingJoinHelper.scala:205 — StreamingJoinHelper.collectTerms has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (13 pts), match/switch 3 (5 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.
D2 · Cognitive Complexity · ZipWith.eval (cognitive 18) · ×1
  • ZipWith.eval (cognitive 18) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/higherOrderFunctions.scala:864 — ZipWith.eval has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 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.
D2 · Cognitive Complexity · JsonInferSchema.compatibleType (cognitive 18) · ×1
  • JsonInferSchema.compatibleType (cognitive 18) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/json/JsonInferSchema.scala:307 — JsonInferSchema.compatibleType has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 3 (6 pts), boolean chains 2, 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.
D2 · Cognitive Complexity · PushDownLeftSemiAntiJoin.apply (cognitive 18) · ×1
  • PushDownLeftSemiAntiJoin.apply (cognitive 18) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/PushDownLeftSemiAntiJoin.scala:35 — PushDownLeftSemiAntiJoin.apply has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 4, match/switch 2 (4 pts) (nesting depth added 6). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · RuleExecutor.execute (cognitive 18) · ×1
  • RuleExecutor.execute (cognitive 18) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/rules/RuleExecutor.scala:85 — RuleExecutor.execute has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (17 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.
D2 · Cognitive Complexity · Dataset.joinWith (cognitive 18) · ×1
  • Dataset.joinWith (cognitive 18) sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala:1105 — Dataset.joinWith has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (15 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SortBasedAggregator.destructiveIterator (cognitive 18) · ×1
  • SortBasedAggregator.destructiveIterator (cognitive 18) sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/ObjectAggregationIterator.scala:238 — SortBasedAggregator.destructiveIterator has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 4, loops 2 (4 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.
D2 · Cognitive Complexity · LoadDataCommand.makeQualified (cognitive 18) · ×1
  • LoadDataCommand.makeQualified (cognitive 18) sql/core/src/main/scala/org/apache/spark/sql/execution/command/tables.scala:384 — LoadDataCommand.makeQualified has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 2, 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.
D2 · Cognitive Complexity · InMemoryFileIndex.listLeafFiles (cognitive 18) · ×1
  • InMemoryFileIndex.listLeafFiles (cognitive 18) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/InMemoryFileIndex.scala:284 — InMemoryFileIndex.listLeafFiles has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), error handling 2 (3 pts), match/switch 3, boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ParquetToSparkSchemaConverter.convertPrimitiveField (cognitive 18) · ×1
  • ParquetToSparkSchemaConverter.convertPrimitiveField (cognitive 18) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetSchemaConverter.scala:93 — ParquetToSparkSchemaConverter.convertPrimitiveField has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 5 (9 pts), if/else 7, boolean chains 2 (nesting depth added 4). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · SymmetricHashJoinStateManager.removeByValueCondition (cognitive 18) · ×1
  • SymmetricHashJoinStateManager.removeByValueCondition (cognitive 18) sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/SymmetricHashJoinStateManager.scala:158 — SymmetricHashJoinStateManager.removeByValueCondition has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 2, 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.
D2 · Cognitive Complexity · DataStreamWriter.start (cognitive 18) · ×1
  • DataStreamWriter.start (cognitive 18) sql/core/src/main/scala/org/apache/spark/sql/streaming/DataStreamWriter.scala:246 — DataStreamWriter.start has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (13 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ServerConnection.handle (cognitive 18) · ×1
  • ServerConnection.handle (cognitive 18) REDACTED:306 — ServerConnection.handle has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), ternaries 1 (2 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.
D2 · Cognitive Complexity · SparkSubmitCommandBuilder.buildSparkSubmitArgs (cognitive 18) · ×1
  • SparkSubmitCommandBuilder.buildSparkSubmitArgs (cognitive 18) launcher/src/main/java/org/apache/spark/launcher/SparkSubmitCommandBuilder.java:168 — SparkSubmitCommandBuilder.buildSparkSubmitArgs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, boolean chains 2, loops 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · Index.toKey (cognitive 18) · ×1
  • Index.toKey (cognitive 18) common/kvstore/src/main/java/org/apache/spark/util/kvstore/LevelDBTypeInfo.java:458 — Index.toKey has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (10 pts), loops 2 (4 pts), ternaries 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.
D2 · Cognitive Complexity · ByteArrayMethods.arrayEquals (cognitive 18) · ×1
  • ByteArrayMethods.arrayEquals (cognitive 18) common/unsafe/src/main/java/org/apache/spark/unsafe/array/ByteArrayMethods.java:59 — ByteArrayMethods.arrayEquals has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (5 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.
D2 · Cognitive Complexity · HiveServer2.startHiveServer2 (cognitive 18) · ×1
  • HiveServer2.startHiveServer2 (cognitive 18) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/server/HiveServer2.java:116 — HiveServer2.startHiveServer2 has cognitive complexity 18 (threshold 15). Drivers by points: error handling 3 (10 pts), if/else 3 (7 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.
D2 · Cognitive Complexity · ArrowStreamPandasSerializer._create_batch (cognitive 18) · ×1
  • ArrowStreamPandasSerializer._create_batch (cognitive 18) REDACTED:278 — ArrowStreamPandasSerializer._create_batch has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 5, loops 1, 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.
D2 · Cognitive Complexity · UserDefinedFunction.returnType (cognitive 18) · ×1
  • UserDefinedFunction.returnType (cognitive 18) python/pyspark/sql/udf.py:110 — UserDefinedFunction.returnType has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 3 (7 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · (anonymous) (cognitive 18) · ×1
  • (anonymous) (cognitive 18) REDACTED:99 — (anonymous) has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 3 (5 pts), loops 2 (3 pts) (nesting depth added 6). Most of this is not in the body itself: 2 of the 18 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 116, 158). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · drawTimeline (cognitive 18) · ×1
  • drawTimeline (cognitive 18) streaming/src/main/resources/org/apache/spark/streaming/ui/static/streaming-page.js:90 — drawTimeline has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 10, if/else 7, boolean chains 1. Most of this is not in the body itself: 2 of the 18 points are its own statements and the rest belongs to 20 function items inside it that branch (a function literal at line 192, a function literal at line 103, a function literal at line 166, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · RPackageUtils.checkAndBuildRPackage (cognitive 17) · ×1
  • RPackageUtils.checkAndBuildRPackage (cognitive 17) core/src/main/scala/org/apache/spark/deploy/RPackageUtils.scala:174 — RPackageUtils.checkAndBuildRPackage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (17 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.
D2 · Cognitive Complexity · DriverEndpoint.receiveAndReply (cognitive 17) · ×1
  • DriverEndpoint.receiveAndReply (cognitive 17) core/src/main/scala/org/apache/spark/scheduler/cluster/CoarseGrainedSchedulerBackend.scala:191 — DriverEndpoint.receiveAndReply has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 1 (2 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.
D2 · Cognitive Complexity · BlockManager.getCurrentBlockStatus (cognitive 17) · ×1
  • BlockManager.getCurrentBlockStatus (cognitive 17) core/src/main/scala/org/apache/spark/storage/BlockManager.scala:683 — BlockManager.getCurrentBlockStatus has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3, match/switch 1 (nesting depth added 4). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · SizeEstimator.getClassInfo (cognitive 17) · ×1
  • SizeEstimator.getClassInfo (cognitive 17) core/src/main/scala/org/apache/spark/util/SizeEstimator.scala:319 — SizeEstimator.getClassInfo has cognitive complexity 17 (threshold 15). Drivers by points: error handling 2 (8 pts), if/else 4 (7 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.
D2 · Cognitive Complexity · AvroFileFormat.buildReader (cognitive 17) · ×1
  • AvroFileFormat.buildReader (cognitive 17) external/avro/src/main/scala/org/apache/spark/sql/avro/AvroFileFormat.scala:171 — AvroFileFormat.buildReader has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 2, error handling 1 (2 pts), match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NodeIdCache.updateNodeIndices (cognitive 17) · ×1
  • NodeIdCache.updateNodeIndices (cognitive 17) mllib/src/main/scala/org/apache/spark/ml/tree/impl/NodeIdCache.scala:92 — NodeIdCache.updateNodeIndices has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), error handling 1 (4 pts), loops 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.
D2 · Cognitive Complexity · Client.createConfArchive (cognitive 17) · ×1
  • Client.createConfArchive (cognitive 17) resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala:682 — Client.createConfArchive has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 2 (3 pts), boolean chains 2, match/switch 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.
D2 · Cognitive Complexity · YarnSparkHadoopUtil.setEnvFromInputString (cognitive 17) · ×1
  • YarnSparkHadoopUtil.setEnvFromInputString (cognitive 17) resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/YarnSparkHadoopUtil.scala:85 — YarnSparkHadoopUtil.setEnvFromInputString has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (11 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.
D2 · Cognitive Complexity · HyperLogLogPlusPlusHelper.query (cognitive 17) · ×1
  • HyperLogLogPlusPlusHelper.query (cognitive 17) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/HyperLogLogPlusPlusHelper.scala:190 — HyperLogLogPlusPlusHelper.query has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 4, loops 2 (3 pts), match/switch 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.
D2 · Cognitive Complexity · NumberConverter.convert (cognitive 17) · ×1
  • NumberConverter.convert (cognitive 17) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/NumberConverter.scala:121 — NumberConverter.convert has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 4, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · DataFrameWriter.save (cognitive 17) · ×1
  • DataFrameWriter.save (cognitive 17) sql/core/src/main/scala/org/apache/spark/sql/DataFrameWriter.scala:243 — DataFrameWriter.save has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), match/switch 3 (6 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · OptimizeMetadataOnlyQuery.apply (cognitive 17) · ×1
  • OptimizeMetadataOnlyQuery.apply (cognitive 17) sql/core/src/main/scala/org/apache/spark/sql/execution/OptimizeMetadataOnlyQuery.scala:47 — OptimizeMetadataOnlyQuery.apply has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), match/switch 3 (7 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ObjectAggregationIterator.processInputs (cognitive 17) · ×1
  • ObjectAggregationIterator.processInputs (cognitive 17) sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/ObjectAggregationIterator.scala:139 — ObjectAggregationIterator.processInputs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JdbcUtils.makeGetter (cognitive 17) · ×1
  • JdbcUtils.makeGetter (cognitive 17) REDACTED:386 — JdbcUtils.makeGetter has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), match/switch 2 (3 pts), loops 1 (2 pts) (nesting depth added 6). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · EnsureRequirements.withExchangeCoordinator (cognitive 17) · ×1
  • EnsureRequirements.withExchangeCoordinator (cognitive 17) sql/core/src/main/scala/org/apache/spark/sql/execution/exchange/EnsureRequirements.scala:54 — EnsureRequirements.withExchangeCoordinator has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7, match/switch 3 (7 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.
D2 · Cognitive Complexity · ExtractPythonUDFs.extract (cognitive 17) · ×1
  • ExtractPythonUDFs.extract (cognitive 17) sql/core/src/main/scala/org/apache/spark/sql/execution/python/ExtractPythonUDFs.scala:161 — ExtractPythonUDFs.extract has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), match/switch 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.
D2 · Cognitive Complexity · HDFSMetadataLog.verifyBatchIds (cognitive 17) · ×1
  • HDFSMetadataLog.verifyBatchIds (cognitive 17) sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/HDFSMetadataLog.scala:271 — HDFSMetadataLog.verifyBatchIds has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (16 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.
D2 · Cognitive Complexity · ScriptTransformationWriterThread.run (cognitive 17) · ×1
  • ScriptTransformationWriterThread.run (cognitive 17) sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/ScriptTransformationExec.scala:270 — ScriptTransformationWriterThread.run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 1 (3 pts), error handling 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.
D2 · Cognitive Complexity · CheckpointWriteHandler.run (cognitive 17) · ×1
  • CheckpointWriteHandler.run (cognitive 17) streaming/src/main/scala/org/apache/spark/streaming/Checkpoint.scala:216 — CheckpointWriteHandler.run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 2, error handling 1 (2 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.
D2 · Cognitive Complexity · RawTextHelper.topK (cognitive 17) · ×1
  • RawTextHelper.topK (cognitive 17) streaming/src/main/scala/org/apache/spark/streaming/util/RawTextHelper.scala:61 — RawTextHelper.topK has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (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.
D2 · Cognitive Complexity · AbstractCommandBuilder.buildClassPath (cognitive 17) · ×1
  • AbstractCommandBuilder.buildClassPath (cognitive 17) launcher/src/main/java/org/apache/spark/launcher/AbstractCommandBuilder.java:138 — AbstractCommandBuilder.buildClassPath has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 2 (6 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UTF8String.levenshteinDistance (cognitive 17) · ×1
  • UTF8String.levenshteinDistance (cognitive 17) common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java:1330 — UTF8String.levenshteinDistance has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), loops 3 (4 pts), ternaries 1 (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.
D2 · Cognitive Complexity · ArrowColumnVector.<init> (cognitive 17) · ×1
  • ArrowColumnVector.<init> (cognitive 17) sql/catalyst/src/main/java/org/apache/spark/sql/vectorized/ArrowColumnVector.java:134 — ArrowColumnVector.<init> has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, loops 1 (2 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · VectorizedRleValuesReader.readBinarys (cognitive 17) · ×1
  • VectorizedRleValuesReader.readBinarys (cognitive 17) sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedRleValuesReader.java:413 — VectorizedRleValuesReader.readBinarys has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 7 other methods here (VectorizedRleValuesReader.readIntegers, VectorizedRleValuesReader.readBooleans, VectorizedRleValuesReader.readBytes, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 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.
D2 · Cognitive Complexity · VectorizedRleValuesReader.readBooleans (cognitive 17) · ×1
  • VectorizedRleValuesReader.readBooleans (cognitive 17) sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedRleValuesReader.java:207 — VectorizedRleValuesReader.readBooleans has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 7 other methods here (VectorizedRleValuesReader.readIntegers, VectorizedRleValuesReader.readBytes, VectorizedRleValuesReader.readLongs, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 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.
D2 · Cognitive Complexity · VectorizedRleValuesReader.readBytes (cognitive 17) · ×1
  • VectorizedRleValuesReader.readBytes (cognitive 17) sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedRleValuesReader.java:241 — VectorizedRleValuesReader.readBytes has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 7 other methods here (VectorizedRleValuesReader.readIntegers, VectorizedRleValuesReader.readBooleans, VectorizedRleValuesReader.readLongs, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 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.
D2 · Cognitive Complexity · VectorizedRleValuesReader.readDoubles (cognitive 17) · ×1
  • VectorizedRleValuesReader.readDoubles (cognitive 17) sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedRleValuesReader.java:379 — VectorizedRleValuesReader.readDoubles has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 7 other methods here (VectorizedRleValuesReader.readIntegers, VectorizedRleValuesReader.readBooleans, VectorizedRleValuesReader.readBytes, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 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.
D2 · Cognitive Complexity · VectorizedRleValuesReader.readFloats (cognitive 17) · ×1
  • VectorizedRleValuesReader.readFloats (cognitive 17) sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedRleValuesReader.java:345 — VectorizedRleValuesReader.readFloats has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 7 other methods here (VectorizedRleValuesReader.readIntegers, VectorizedRleValuesReader.readBooleans, VectorizedRleValuesReader.readBytes, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 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.
D2 · Cognitive Complexity · VectorizedRleValuesReader.readLongs (cognitive 17) · ×1
  • VectorizedRleValuesReader.readLongs (cognitive 17) sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedRleValuesReader.java:311 — VectorizedRleValuesReader.readLongs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 7 other methods here (VectorizedRleValuesReader.readIntegers, VectorizedRleValuesReader.readBooleans, VectorizedRleValuesReader.readBytes, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 8 times rather than 8 independent problems. Splitting this body alone leaves the other 7 exactly as they are. Where these are variations on one operation, the change that clears all 8 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.
D2 · Cognitive Complexity · CloudPickler._save_subimports (cognitive 17) · ×1
  • CloudPickler._save_subimports (cognitive 17) REDACTED:416 — CloudPickler._save_subimports has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (11 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SparseVector.__init__ (cognitive 17) · ×1
  • SparseVector.__init__ (cognitive 17) python/pyspark/ml/linalg/__init__.py:470 — SparseVector.__init__ has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 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.
D2 · Cognitive Complexity · mlutils.check_params (cognitive 17) · ×1
  • mlutils.check_params (cognitive 17) python/pyspark/testing/mlutils.py:29 — mlutils.check_params has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 1 (4 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExecutorAllocationManager.addExecutors (cognitive 16) · ×1
  • ExecutorAllocationManager.addExecutors (cognitive 16) core/src/main/scala/org/apache/spark/ExecutorAllocationManager.scala:351 — ExecutorAllocationManager.addExecutors has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 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, 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.
D2 · Cognitive Complexity · Master.scheduleExecutorsOnWorkers (cognitive 16) · ×1
  • Master.scheduleExecutorsOnWorkers (cognitive 16) core/src/main/scala/org/apache/spark/deploy/master/Master.scala:609 — Master.scheduleExecutorsOnWorkers has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RestSubmissionClient.readResponse (cognitive 16) · ×1
  • RestSubmissionClient.readResponse (cognitive 16) core/src/main/scala/org/apache/spark/deploy/rest/RestSubmissionClient.scala:231 — RestSubmissionClient.readResponse has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), error handling 4, match/switch 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.
D2 · Cognitive Complexity · NettyRpcEnv.ask (cognitive 16) · ×1
  • NettyRpcEnv.ask (cognitive 16) core/src/main/scala/org/apache/spark/rpc/netty/NettyRpcEnv.scala:207 — NettyRpcEnv.ask has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), match/switch 4 (7 pts), error handling 1 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · DAGScheduler.getMissingParentStages (cognitive 16) · ×1
  • DAGScheduler.getMissingParentStages (cognitive 16) core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala:552 — DAGScheduler.getMissingParentStages has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 2 (4 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.
D2 · Cognitive Complexity · TaskSetManager.dequeueTask (cognitive 16) · ×1
  • TaskSetManager.dequeueTask (cognitive 16) core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala:417 — TaskSetManager.dequeueTask has cognitive complexity 16 (threshold 15). Drivers by points: loops 6 (12 pts), if/else 4 (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.
D2 · Cognitive Complexity · TaskSetManager.resourceOffer (cognitive 16) · ×1
  • TaskSetManager.resourceOffer (cognitive 16) core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala:468 — TaskSetManager.resourceOffer has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 3, error handling 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.
D2 · Cognitive Complexity · TaskSetManager.getAllowedLocalityLevel (cognitive 16) · ×1
  • TaskSetManager.getAllowedLocalityLevel (cognitive 16) core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala:583 — TaskSetManager.getAllowedLocalityLevel has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), match/switch 2 (3 pts), loops 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.
D2 · Cognitive Complexity · AppStatusListener.onJobEnd (cognitive 16) · ×1
  • AppStatusListener.onJobEnd (cognitive 16) core/src/main/scala/org/apache/spark/status/AppStatusListener.scala:403 — AppStatusListener.onJobEnd has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 4 (7 pts), match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BlockManager.fetchRemoteManagedBuffer (cognitive 16) · ×1
  • BlockManager.fetchRemoteManagedBuffer (cognitive 16) core/src/main/scala/org/apache/spark/storage/BlockManager.scala:924 — BlockManager.fetchRemoteManagedBuffer has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BlockManagerMasterEndpoint.updateBlockInfo (cognitive 16) · ×1
  • BlockManagerMasterEndpoint.updateBlockInfo (cognitive 16) core/src/main/scala/org/apache/spark/storage/BlockManagerMasterEndpoint.scala:445 — BlockManagerMasterEndpoint.updateBlockInfo has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Utils.findLocalInetAddress (cognitive 16) · ×1
  • Utils.findLocalInetAddress (cognitive 16) core/src/main/scala/org/apache/spark/util/Utils.scala:930 — Utils.findLocalInetAddress has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 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.
D2 · Cognitive Complexity · EdgePartition.innerJoin (cognitive 16) · ×1
  • EdgePartition.innerJoin (cognitive 16) graphx/src/main/scala/org/apache/spark/graphx/impl/EdgePartition.scala:283 — EdgePartition.innerJoin has cognitive complexity 16 (threshold 15). Drivers by points: loops 3 (6 pts), boolean chains 5, if/else 2 (5 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.
D2 · Cognitive Complexity · VectorAssembler.transform (cognitive 16) · ×1
  • VectorAssembler.transform (cognitive 16) mllib/src/main/scala/org/apache/spark/ml/feature/VectorAssembler.scala:83 — VectorAssembler.transform has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), match/switch 5 (6 pts) (nesting depth added 4). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · GradientBoostedTrees.boost (cognitive 16) · ×1
  • GradientBoostedTrees.boost (cognitive 16) mllib/src/main/scala/org/apache/spark/ml/tree/impl/GradientBoostedTrees.scala:247 — GradientBoostedTrees.boost has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 1, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · RandomForest.mixedBinSeqOp (cognitive 16) · ×1
  • RandomForest.mixedBinSeqOp (cognitive 16) mllib/src/main/scala/org/apache/spark/ml/tree/impl/RandomForest.scala:289 — RandomForest.mixedBinSeqOp has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RandomForest.findSplitsForContinuousFeature (cognitive 16) · ×1
  • RandomForest.findSplitsForContinuousFeature (cognitive 16) mllib/src/main/scala/org/apache/spark/ml/tree/impl/RandomForest.scala:1030 — RandomForest.findSplitsForContinuousFeature has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 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.
D2 · Cognitive Complexity · ResolveReferences.expandStarExpression (cognitive 16) · ×1
  • ResolveReferences.expandStarExpression (cognitive 16) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala:1068 — ResolveReferences.expandStarExpression has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 6 (11 pts), if/else 5 (nesting depth added 5). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own 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.
D2 · Cognitive Complexity · UnivocityParser.convert (cognitive 16) · ×1
  • UnivocityParser.convert (cognitive 16) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/csv/UnivocityParser.scala:211 — UnivocityParser.convert has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), error handling 2 (5 pts), 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, 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.
D2 · Cognitive Complexity · ApproxCountDistinctForIntervals.findHllppIndex (cognitive 16) · ×1
  • ApproxCountDistinctForIntervals.findHllppIndex (cognitive 16) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/ApproxCountDistinctForIntervals.scala:141 — ApproxCountDistinctForIntervals.findHllppIndex has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GenerateUnsafeProjection.writeExpressionsToBuffer (cognitive 16) · ×1
  • GenerateUnsafeProjection.writeExpressionsToBuffer (cognitive 16) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/GenerateUnsafeProjection.scala:84 — GenerateUnsafeProjection.writeExpressionsToBuffer has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · GenerateUnsafeRowJoiner.create (cognitive 16) · ×1
  • GenerateUnsafeRowJoiner.create (cognitive 16) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/GenerateUnsafeRowJoiner.scala:56 — GenerateUnsafeRowJoiner.create has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AtLeastNNonNulls.eval (cognitive 16) · ×1
  • AtLeastNNonNulls.eval (cognitive 16) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/nullExpressions.scala:379 — AtLeastNNonNulls.eval has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 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.
D2 · Cognitive Complexity · FilterEstimation.evaluateEquality (cognitive 16) · ×1
  • FilterEstimation.evaluateEquality (cognitive 16) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/statsEstimation/FilterEstimation.scala:304 — FilterEstimation.evaluateEquality has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), match/switch 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.
D2 · Cognitive Complexity · Dataset.showString (cognitive 16) · ×1
  • Dataset.showString (cognitive 16) sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala:295 — Dataset.showString has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · SparkSqlAstBuilder.visitManageResource (cognitive 16) · ×1
  • SparkSqlAstBuilder.visitManageResource (cognitive 16) sql/core/src/main/scala/org/apache/spark/sql/execution/SparkSqlParser.scala:854 — SparkSqlAstBuilder.visitManageResource has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 3 (5 pts) (nesting depth added 6). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · HashAggregateExec.doProduceWithKeys (cognitive 16) · ×1
  • HashAggregateExec.doProduceWithKeys (cognitive 16) sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/HashAggregateExec.scala:575 — HashAggregateExec.doProduceWithKeys has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (14 pts), match/switch 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · SortMergeFullOuterJoinScanner.advanceNext (cognitive 16) · ×1
  • SortMergeFullOuterJoinScanner.advanceNext (cognitive 16) sql/core/src/main/scala/org/apache/spark/sql/execution/joins/SortMergeJoinExec.scala:1101 — SortMergeFullOuterJoinScanner.advanceNext has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 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.
D2 · Cognitive Complexity · BytesToBytesMap.safeLookup (cognitive 16) · ×1
  • BytesToBytesMap.safeLookup (cognitive 16) core/src/main/java/org/apache/spark/unsafe/map/BytesToBytesMap.java:460 — BytesToBytesMap.safeLookup has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 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.
D2 · Cognitive Complexity · HeapMemoryAllocator.allocate (cognitive 16) · ×1
  • HeapMemoryAllocator.allocate (cognitive 16) common/unsafe/src/main/java/org/apache/spark/unsafe/memory/HeapMemoryAllocator.java:48 — HeapMemoryAllocator.allocate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 1 (3 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.
D2 · Cognitive Complexity · ColumnarBatchRow.get (cognitive 16) · ×1
  • ColumnarBatchRow.get (cognitive 16) sql/catalyst/src/main/java/org/apache/spark/sql/vectorized/ColumnarBatch.java:249 — ColumnarBatchRow.get has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ColumnarRow.get (cognitive 16) · ×1
  • ColumnarRow.get (cognitive 16) sql/catalyst/src/main/java/org/apache/spark/sql/vectorized/ColumnarRow.java:156 — ColumnarRow.get has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · MutableColumnarRow.get (cognitive 16) · ×1
  • MutableColumnarRow.get (cognitive 16) sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/MutableColumnarRow.java:156 — MutableColumnarRow.get has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ThriftHttpServlet.doPost (cognitive 16) · ×1
  • ThriftHttpServlet.doPost (cognitive 16) REDACTED:113 — ThriftHttpServlet.doPost has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 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.
D2 · Cognitive Complexity · PlainSaslServer.evaluateResponse (cognitive 16) · ×1
  • PlainSaslServer.evaluateResponse (cognitive 16) sql/hive-thriftserver/src/main/java/org/apache/hive/service/auth/PlainSaslServer.java:58 — PlainSaslServer.evaluateResponse has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 3, error handling 3, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · SparseVector.__init__ (cognitive 16) · ×1
  • SparseVector.__init__ (cognitive 16) python/pyspark/mllib/linalg/__init__.py:514 — SparseVector.__init__ has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExternalMerger.mergeCombiners (cognitive 16) · ×1
  • ExternalMerger.mergeCombiners (cognitive 16) python/pyspark/shuffle.py:265 — ExternalMerger.mergeCombiners has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 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.
D2 · Cognitive Complexity · StructType.toInternal (cognitive 16) · ×1
  • StructType.toInternal (cognitive 16) python/pyspark/sql/types.py:593 — StructType.toInternal has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 3 (9 pts), if/else 5 (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.
D2 · Cognitive Complexity · releaseutils.get_commits (cognitive 16) · ×1
  • releaseutils.get_commits (cognitive 16) dev/create-release/releaseutils.py:119 — releaseutils.get_commits has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 2 (4 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.
D2 · Cognitive Complexity · table.onSearchStringChange (cognitive 16) · ×1
  • table.onSearchStringChange (cognitive 16) core/src/main/resources/org/apache/spark/ui/static/table.js:79 — table.onSearchStringChange has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 8). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 88). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member pair (46 shared lines) · ×1
  • Near-duplicate member pair (46 shared lines) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftBinaryCLIService.java:48 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftBinaryCLIService.java:48-106 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftBinaryCLIService.java:49-107 — These two members are variants of one another: 46 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Members sharing a duplicated core (23 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (23 members, 50+ identical tokens) sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:169 — sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:169-182 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:189-202 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:209-222 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:229-242 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:249-262 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:269-282 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:289-302 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:309-322 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:329-342 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:349-362 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:369-382 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:389-402 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:409-422 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:429-442 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:449-462 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:469-482 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:489-502 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:509-522 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:529-542 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:549-562 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:569-582 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:589-602 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:609-622 — These 23 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 23 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 23 times.
D4 · Code Duplication · Members sharing a duplicated core (22 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (22 members, 50+ identical tokens) sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:734 — sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:734-743 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:749-758 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:764-773 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:779-788 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:794-803 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:809-818 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:824-833 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:839-848 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:854-863 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:869-878 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:884-893 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:899-908 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:914-923 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:929-938 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:944-953 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:959-968 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:974-983 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:989-998 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:1004-1013 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:1019-1028 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:1034-1043 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:1049-1058 — These 22 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 22 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 22 times.
D4 · Code Duplication · Members sharing a duplicated core (18 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (18 members, 50+ identical tokens) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:133 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:133-148 | sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:154-166 | sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:172-184 | sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:192-206 | sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:214-229 | sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:235-247 | sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:255-272 | sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:279-293 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:143-159 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:165-177 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:183-195 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:203-217 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:225-240 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:246-258 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:266-283 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:290-304 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:454-469 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:474-492 — These 18 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 18 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 18 times.
D4 · Code Duplication · Members sharing a duplicated core (12 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (12 members, 50+ identical tokens) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:462 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:462-482 | sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:526-543 | sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:548-565 | sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:589-610 | sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:614-631 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:476-496 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:540-557 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:562-579 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:603-624 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:628-645 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:851-868 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:873-892 — These 12 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 12 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 12 times.
D4 · Code Duplication · Members sharing a duplicated core (9 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (9 members, 50+ identical tokens) mllib/src/main/scala/org/apache/spark/ml/r/BisectingKMeansWrapper.scala:129 — mllib/src/main/scala/org/apache/spark/ml/r/BisectingKMeansWrapper.scala:129-140 | mllib/src/main/scala/org/apache/spark/ml/r/DecisionTreeClassificationWrapper.scala:140-152 | mllib/src/main/scala/org/apache/spark/ml/r/DecisionTreeRegressionWrapper.scala:123-135 | mllib/src/main/scala/org/apache/spark/ml/r/GBTClassificationWrapper.scala:147-159 | mllib/src/main/scala/org/apache/spark/ml/r/GBTRegressionWrapper.scala:131-143 | mllib/src/main/scala/org/apache/spark/ml/r/GaussianMixtureWrapper.scala:123-134 | mllib/src/main/scala/org/apache/spark/ml/r/KMeansWrapper.scala:132-143 | mllib/src/main/scala/org/apache/spark/ml/r/RandomForestClassificationWrapper.scala:148-160 | mllib/src/main/scala/org/apache/spark/ml/r/RandomForestRegressionWrapper.scala:131-143 — These 9 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 9 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 9 times.
D4 · Code Duplication · Members sharing a duplicated core (8 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (8 members, 50+ identical tokens) sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedRleValuesReader.java:177 — sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedRleValuesReader.java:177-204 | sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedRleValuesReader.java:212-239 | sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedRleValuesReader.java:246-273 | sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedRleValuesReader.java:316-343 | sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedRleValuesReader.java:350-377 | sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedRleValuesReader.java:384-411 | sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedRleValuesReader.java:418-445 | sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedRleValuesReader.java:457-484 — 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 · Edited copy of a member (108 corresponding lines) · ×1
  • Edited copy of a member (108 corresponding lines) core/src/main/java/org/apache/spark/util/collection/TimSort.java:703 — core/src/main/java/org/apache/spark/util/collection/TimSort.java:703-810 | core/src/main/java/org/apache/spark/util/collection/TimSort.java:823-934 — These two members are one piece of code written twice and then edited apart: 108 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (96 corresponding lines) · ×1
  • Edited copy of a member (96 corresponding lines) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftHttpCLIService.java:62 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftHttpCLIService.java:62-157 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftHttpCLIService.java:63-158 — These two members are one piece of code written twice and then edited apart: 96 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (121 corresponding lines) · ×1
  • Edited copy of a member (121 corresponding lines) core/src/main/scala/org/apache/spark/rdd/HadoopRDD.scala:223 — core/src/main/scala/org/apache/spark/rdd/HadoopRDD.scala:223-343 | core/src/main/scala/org/apache/spark/rdd/NewHadoopRDD.scala:150-298 — These two members are one piece of code written twice and then edited apart: 121 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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) core/src/main/java/org/apache/spark/util/collection/TimSort.java:557 — core/src/main/java/org/apache/spark/util/collection/TimSort.java:557-613 | core/src/main/java/org/apache/spark/util/collection/TimSort.java:628-685 — 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 (70 corresponding lines) · ×1
  • Edited copy of a member (70 corresponding lines) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFileFormat.scala:79 — sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFileFormat.scala:79-158 | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/parquet/ParquetWriteBuilder.scala:46-115 — These two members are one piece of code written twice and then edited apart: 70 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:121 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:121-165 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:123-171 — 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 copies of one member (3 members, 45+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 45+ corresponding lines) sql/catalyst/src/main/scala/org/apache/spark/sql/Row.scala:393 — sql/catalyst/src/main/scala/org/apache/spark/sql/Row.scala:393-437 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/rows.scala:83-128 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/GenericArrayData.scala:88-133 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 45 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 (66 corresponding lines) · ×1
  • Edited copy of a member (66 corresponding lines) sql/core/src/main/scala/org/apache/spark/sql/execution/Columnar.scala:137 — sql/core/src/main/scala/org/apache/spark/sql/execution/Columnar.scala:137-208 | sql/core/src/main/scala/org/apache/spark/sql/execution/ColumnarBatchScan.scala:85-150 — 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 (72 corresponding lines) · ×1
  • Edited copy of a member (72 corresponding lines) common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java:1079 — common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java:1079-1151 | common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java:1170-1241 — These two members are one piece of code written twice and then edited apart: 72 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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) core/src/main/scala/org/apache/spark/ui/jobs/AllJobsPage.scala:208 — core/src/main/scala/org/apache/spark/ui/jobs/AllJobsPage.scala:208-258 | sql/core/src/main/scala/org/apache/spark/sql/execution/ui/AllExecutionsPage.scala:159-210 — 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 copies of one member (3 members, 83+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 83+ corresponding lines) REDACTED:3336 — REDACTED:3336-3418 | REDACTED:3580-3697 | REDACTED:3812-3918 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 83 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 (44 corresponding lines) · ×1
  • Edited copy of a member (44 corresponding lines) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/ColumnValue.java:165 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/ColumnValue.java:165-208 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/ColumnValue.java:167-214 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (58 corresponding lines) · ×1
  • Edited copy of a member (58 corresponding lines) sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/FixedLengthRowBasedKeyValueBatch.java:106 — sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/FixedLengthRowBasedKeyValueBatch.java:106-163 | sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/VariableLengthRowBasedKeyValueBatch.java:113-178 — These two members are one piece of code written twice and then edited apart: 58 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (4 members, 39+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 39+ corresponding lines) mllib/src/main/scala/org/apache/spark/mllib/util/MLUtils.scala:290 — mllib/src/main/scala/org/apache/spark/mllib/util/MLUtils.scala:290-330 | mllib/src/main/scala/org/apache/spark/mllib/util/MLUtils.scala:342-382 | mllib/src/main/scala/org/apache/spark/mllib/util/MLUtils.scala:394-432 | mllib/src/main/scala/org/apache/spark/mllib/util/MLUtils.scala:444-482 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 39 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 copy of a member (60 corresponding lines) · ×1
  • Edited copy of a member (60 corresponding lines) sql/core/src/main/scala/org/apache/spark/sql/execution/joins/BroadcastHashJoinExec.scala:257 — sql/core/src/main/scala/org/apache/spark/sql/execution/joins/BroadcastHashJoinExec.scala:257-328 | sql/core/src/main/scala/org/apache/spark/sql/execution/joins/BroadcastHashJoinExec.scala:442-501 — These two members are one piece of code written twice and then edited apart: 60 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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) REDACTED:563 — REDACTED:563-623 | REDACTED:2138-2198 — 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 (41 corresponding lines) · ×1
  • Edited copy of a member (41 corresponding lines) core/src/main/scala/org/apache/spark/ui/jobs/AllJobsPage.scala:161 — core/src/main/scala/org/apache/spark/ui/jobs/AllJobsPage.scala:161-201 | core/src/main/scala/org/apache/spark/ui/jobs/JobPage.scala:143-183 — 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 copies of one member (4 members, 6+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 6+ corresponding lines) sql/core/src/main/scala/org/apache/spark/sql/functions.scala:4079 — sql/core/src/main/scala/org/apache/spark/sql/functions.scala:4079-4084 | sql/core/src/main/scala/org/apache/spark/sql/functions.scala:4095-4100 | sql/core/src/main/scala/org/apache/spark/sql/functions.scala:4111-4116 | sql/core/src/main/scala/org/apache/spark/sql/functions.scala:4127-4132 — 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.
D4 · Code Duplication · Edited copies of one member (4 members, 38+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 38+ corresponding lines) mllib/src/main/scala/org/apache/spark/ml/r/DecisionTreeClassificationWrapper.scala:77 — mllib/src/main/scala/org/apache/spark/ml/r/DecisionTreeClassificationWrapper.scala:77-114 | mllib/src/main/scala/org/apache/spark/ml/r/GBTClassificationWrapper.scala:82-122 | mllib/src/main/scala/org/apache/spark/ml/r/LinearSVCWrapper.scala:84-123 | mllib/src/main/scala/org/apache/spark/ml/r/RandomForestClassificationWrapper.scala:82-122 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 38 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 copy of a member (32 corresponding lines) · ×1
  • Edited copy of a member (32 corresponding lines) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Expression.scala:727 — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Expression.scala:727-758 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Expression.scala:828-863 — 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 (4 members, 20+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 20+ corresponding lines) mllib/src/main/scala/org/apache/spark/ml/classification/GBTClassifier.scala:414 — mllib/src/main/scala/org/apache/spark/ml/classification/GBTClassifier.scala:414-436 | mllib/src/main/scala/org/apache/spark/ml/classification/RandomForestClassifier.scala:314-335 | mllib/src/main/scala/org/apache/spark/ml/regression/GBTRegressor.scala:341-363 | mllib/src/main/scala/org/apache/spark/ml/regression/RandomForestRegressor.scala:269-288 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 20 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, 6+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 6+ corresponding lines) sql/core/src/main/scala/org/apache/spark/sql/functions.scala:4031 — sql/core/src/main/scala/org/apache/spark/sql/functions.scala:4031-4036 | sql/core/src/main/scala/org/apache/spark/sql/functions.scala:4047-4052 | sql/core/src/main/scala/org/apache/spark/sql/functions.scala:4063-4068 — 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 copies of one member (6 members, 13+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 13+ corresponding lines) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala:434 — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala:434-446 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala:449-461 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala:464-480 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala:483-499 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala:546-559 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala:562-575 — These 6 members are one piece of code written 6 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 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 16+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 16+ corresponding lines) sql/core/src/main/scala/org/apache/spark/sql/execution/joins/BroadcastNestedLoopJoinExec.scala:65 — sql/core/src/main/scala/org/apache/spark/sql/execution/joins/BroadcastNestedLoopJoinExec.scala:65-83 | sql/core/src/main/scala/org/apache/spark/sql/execution/joins/HashJoin.scala:40-55 | sql/core/src/main/scala/org/apache/spark/sql/execution/joins/SortMergeJoinExec.scala:48-66 — 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 copy of a member (48 corresponding lines) · ×1
  • Edited copy of a member (48 corresponding lines) python/pyspark/sql/dataframe.py:663 — python/pyspark/sql/dataframe.py:663-721 | python/pyspark/sql/dataframe.py:725-772 — These two members are one piece of code written twice and then edited apart: 48 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (4 members, 23+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 23+ corresponding lines) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/CSVFileFormat.scala:72 — sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/CSVFileFormat.scala:72-94 | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/json/JsonFileFormat.scala:68-90 | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/csv/CSVWriteBuilder.scala:40-62 | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/json/JsonWriteBuilder.scala:40-62 — These 4 members are one piece of code written 4 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 4 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) common/sketch/src/main/java/org/apache/spark/util/sketch/BloomFilterImpl.java:86 — common/sketch/src/main/java/org/apache/spark/util/sketch/BloomFilterImpl.java:86-101 | common/sketch/src/main/java/org/apache/spark/util/sketch/BloomFilterImpl.java:109-125 | common/sketch/src/main/java/org/apache/spark/util/sketch/BloomFilterImpl.java:128-148 | common/sketch/src/main/java/org/apache/spark/util/sketch/BloomFilterImpl.java:151-167 — 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 (3 members, 14+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 14+ corresponding lines) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/json/JsonTable.scala:55 — sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/json/JsonTable.scala:55-70 | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/orc/OrcTable.scala:49-62 | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/parquet/ParquetTable.scala:49-62 — 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, 32+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 32+ corresponding lines) REDACTED:750 — REDACTED:750-781 | REDACTED:851-882 | REDACTED:954-985 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 32 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) · ×1
  • Edited copies of one member (4 members, 11+ corresponding lines) sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/OffHeapColumnVector.java:415 — sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/OffHeapColumnVector.java:415-426 | sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/OffHeapColumnVector.java:470-481 | sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/OnHeapColumnVector.java:394-404 | sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/OnHeapColumnVector.java:443-453 — 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, 12+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 12+ corresponding lines) mllib/src/main/scala/org/apache/spark/ml/classification/MultilayerPerceptronClassifier.scala:362 — mllib/src/main/scala/org/apache/spark/ml/classification/MultilayerPerceptronClassifier.scala:362-373 | mllib/src/main/scala/org/apache/spark/ml/feature/RFormula.scala:603-614 | mllib/src/main/scala/org/apache/spark/ml/feature/VectorIndexer.scala:531-542 | mllib/src/main/scala/org/apache/spark/ml/regression/GeneralizedLinearRegression.scala:1127-1140 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 17+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 17+ corresponding lines) python/pyspark/sql/catalog.py:76 — python/pyspark/sql/catalog.py:76-93 | python/pyspark/sql/catalog.py:98-114 | python/pyspark/sql/catalog.py:119-139 — 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 (4 members, 33+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 33+ corresponding lines) python/pyspark/mllib/linalg/distributed.py:71 — python/pyspark/mllib/linalg/distributed.py:71-103 | python/pyspark/mllib/linalg/distributed.py:475-516 | python/pyspark/mllib/linalg/distributed.py:767-808 | python/pyspark/mllib/linalg/distributed.py:1004-1048 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 33 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, 11+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 11+ corresponding lines) mllib/src/main/scala/org/apache/spark/ml/classification/NaiveBayes.scala:402 — mllib/src/main/scala/org/apache/spark/ml/classification/NaiveBayes.scala:402-415 | mllib/src/main/scala/org/apache/spark/ml/feature/BucketedRandomProjectionLSH.scala:228-241 | mllib/src/main/scala/org/apache/spark/ml/feature/MinMaxScaler.scala:237-248 | mllib/src/main/scala/org/apache/spark/ml/feature/StandardScaler.scala:207-217 | mllib/src/main/scala/org/apache/spark/ml/regression/AFTSurvivalRegression.scala:415-428 — These 5 members are one piece of code written 5 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 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (7 members, 14+ corresponding lines) · ×1
  • Edited copies of one member (7 members, 14+ corresponding lines) python/pyspark/ml/classification.py:969 — python/pyspark/ml/classification.py:969-983 | python/pyspark/ml/classification.py:1098-1113 | python/pyspark/ml/classification.py:1279-1295 | python/pyspark/ml/recommendation.py:159-174 | python/pyspark/ml/regression.py:812-825 | python/pyspark/ml/regression.py:1001-1016 | python/pyspark/ml/regression.py:1143-1158 — These 7 members are one piece of code written 7 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 7 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 4+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 4+ corresponding lines) sql/core/src/main/scala/org/apache/spark/sql/functions.scala:4231 — sql/core/src/main/scala/org/apache/spark/sql/functions.scala:4231-4234 | sql/core/src/main/scala/org/apache/spark/sql/functions.scala:4245-4248 | sql/core/src/main/scala/org/apache/spark/sql/functions.scala:4259-4262 | sql/core/src/main/scala/org/apache/spark/sql/functions.scala:4273-4276 | sql/core/src/main/scala/org/apache/spark/sql/functions.scala:4287-4290 — These 5 members are one piece of code written 5 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 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 33+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 33+ corresponding lines) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/GenerateOrdering.scala:150 — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/GenerateOrdering.scala:150-182 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/GeneratePredicate.scala:47-83 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/GenerateUnsafeProjection.scala:335-379 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 33 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, 9+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 9+ corresponding lines) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:226 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:226-234 | sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:238-246 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:232-240 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:244-252 — 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 (3 members, 11+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 11+ corresponding lines) common/kvstore/src/main/java/org/apache/spark/util/kvstore/ArrayWrappers.java:121 — common/kvstore/src/main/java/org/apache/spark/util/kvstore/ArrayWrappers.java:121-131 | common/kvstore/src/main/java/org/apache/spark/util/kvstore/ArrayWrappers.java:200-210 | common/kvstore/src/main/java/org/apache/spark/util/kvstore/LevelDBIterator.java:271-282 — 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 (5 members, 46+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 46+ corresponding lines) python/pyspark/mllib/classification.py:274 — python/pyspark/mllib/classification.py:274-323 | python/pyspark/mllib/classification.py:510-555 | python/pyspark/mllib/regression.py:233-291 | python/pyspark/mllib/regression.py:384-435 | python/pyspark/mllib/regression.py:529-580 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 46 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 (8 members, 9+ corresponding lines) · ×1
  • Edited copies of one member (8 members, 9+ corresponding lines) sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeArrayData.java:218 — sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeArrayData.java:218-226 | sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeArrayData.java:239-247 | sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeArrayData.java:250-258 | sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeArrayData.java:261-269 | sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeRow.java:378-395 | sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeRow.java:411-422 | sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeRow.java:425-436 | sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeRow.java:439-450 — These 8 members are one piece of code written 8 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 8 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 9+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 9+ corresponding lines) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala:878 — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala:878-886 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala:897-905 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala:938-946 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala:952-960 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala:971-981 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala:992-1002 — These 6 members are one piece of code written 6 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 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 7+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 7+ corresponding lines) python/pyspark/mllib/classification.py:487 — python/pyspark/mllib/classification.py:487-497 | python/pyspark/mllib/regression.py:195-201 | python/pyspark/mllib/regression.py:364-370 | python/pyspark/mllib/regression.py:508-514 — 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.
D4 · Code Duplication · Edited copies of one member (6 members, 6+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 6+ corresponding lines) core/src/main/scala/org/apache/spark/api/java/JavaRDDLike.scala:151 — core/src/main/scala/org/apache/spark/api/java/JavaRDDLike.scala:151-156 | core/src/main/scala/org/apache/spark/api/java/JavaRDDLike.scala:162-168 | core/src/main/scala/org/apache/spark/api/java/JavaRDDLike.scala:184-189 | core/src/main/scala/org/apache/spark/api/java/JavaRDDLike.scala:207-213 | streaming/src/main/scala/org/apache/spark/streaming/api/java/JavaDStreamLike.scala:190-195 | streaming/src/main/scala/org/apache/spark/streaming/api/java/JavaDStreamLike.scala:203-208 — 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 (5 members, 9+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 9+ corresponding lines) mllib/src/main/scala/org/apache/spark/ml/classification/DecisionTreeClassifier.scala:316 — mllib/src/main/scala/org/apache/spark/ml/classification/DecisionTreeClassifier.scala:316-324 | mllib/src/main/scala/org/apache/spark/ml/classification/GBTClassifier.scala:445-454 | mllib/src/main/scala/org/apache/spark/ml/classification/RandomForestClassifier.scala:344-353 | mllib/src/main/scala/org/apache/spark/ml/regression/GBTRegressor.scala:371-380 | mllib/src/main/scala/org/apache/spark/ml/regression/RandomForestRegressor.scala:296-305 — These 5 members are one piece of code written 5 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 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 15+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 15+ corresponding lines) mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala:150 — mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala:150-165 | mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala:179-193 | mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala:207-221 | mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala:236-251 | mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala:266-281 — These 5 members are one piece of code written 5 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 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 2+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 2+ corresponding lines) core/src/main/scala/org/apache/spark/api/java/JavaHadoopRDD.scala:39 — core/src/main/scala/org/apache/spark/api/java/JavaHadoopRDD.scala:39-42 | core/src/main/scala/org/apache/spark/api/java/JavaNewHadoopRDD.scala:39-42 | core/src/main/scala/org/apache/spark/api/java/JavaRDDLike.scala:102-103 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 2 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 · Duplicated block (101 lines × 2) · ×1
  • Duplicated block (101 lines × 2) mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:423 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:423-523 | mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala:405-505 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 476 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.
D4 · Code Duplication · Duplicated block (58 lines × 2) · ×1
  • Duplicated block (58 lines × 2) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:1219 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:1219-1276 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala:1171-1228 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 394 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 `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:1219` 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.
D4 · Code Duplication · Duplicated block (54–55 lines × 2) · ×1
  • Duplicated block (54–55 lines × 2) sql/core/src/main/scala/org/apache/spark/sql/execution/Columnar.scala:154 — sql/core/src/main/scala/org/apache/spark/sql/execution/Columnar.scala:154-208 | sql/core/src/main/scala/org/apache/spark/sql/execution/ColumnarBatchScan.scala:97-150 — before extracting anything, compare `sql/core/src/main/scala/org/apache/spark/sql/execution/Columnar.scala` and `sql/core/src/main/scala/org/apache/spark/sql/execution/ColumnarBatchScan.scala` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 82 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `sql/core/src/main/scala/org/apache/spark/sql/execution/Columnar.scala:154` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (51 lines × 2) · ×1
  • Duplicated block (51 lines × 2) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:336 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:336-386 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala:488-538 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 357 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.
D4 · Code Duplication · Duplicated block (43–44 lines × 2) · ×1
  • Duplicated block (43–44 lines × 2) REDACTED:3376 — REDACTED:3376-3418 | REDACTED:3654-3697 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:3376` 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.
D4 · Code Duplication · Duplicated block (30–35 lines × 2) · ×1
  • Duplicated block (30–35 lines × 2) sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFileFormat.scala:82 — sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFileFormat.scala:82-116 | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/parquet/ParquetWriteBuilder.scala:49-78 — 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 `sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFileFormat.scala:82` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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.
D4 · Code Duplication · Duplicated block (16–32 lines × 7) · ×1
  • Duplicated block (16–32 lines × 7) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala:984 — sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala:984-1015 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala:1137-1154 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala:1164-1181 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala:1189-1206 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala:1215-1232 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala:1239-1254 | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala:1261-1276 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. 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.
D4 · Code Duplication · Duplicated block (52 lines × 3) · ×1
  • Duplicated block (52 lines × 3) sql/core/v1.2.1/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilters.scala:82 — sql/core/v1.2.1/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilters.scala:82-133 | sql/core/v2.3.5/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilters.scala:82-133 | sql/hive/src/main/scala/org/apache/spark/sql/hive/orc/OrcFilters.scala:92-143 — before extracting anything, compare `sql/core/v1.2.1/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilters.scala` and `sql/core/v2.3.5/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilters.scala` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 159 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.
D4 · Code Duplication · Duplicated block (38 lines × 2) · ×1
  • Duplicated block (38 lines × 2) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:916 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:916-953 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala:851-888 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 394 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 `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala:916` 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.
D4 · Code Duplication · Duplicated block (26–29 lines × 2) · ×1
  • Duplicated block (26–29 lines × 2) external/kafka-0-10/src/main/scala/org/apache/spark/streaming/kafka010/ConsumerStrategy.scala:94 — external/kafka-0-10/src/main/scala/org/apache/spark/streaming/kafka010/ConsumerStrategy.scala:94-122 | external/kafka-0-10/src/main/scala/org/apache/spark/streaming/kafka010/ConsumerStrategy.scala:151-176 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `external/kafka-0-10/src/main/scala/org/apache/spark/streaming/kafka010/ConsumerStrategy.scala:94` 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.
D4 · Code Duplication · Duplicated block (21–23 lines × 2) · ×1
  • Duplicated block (21–23 lines × 2) resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMasterArguments.scala:36 — resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMasterArguments.scala:36-58 | resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/ClientArguments.scala:34-54 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMasterArguments.scala:36` 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.
D4 · Code Duplication · Duplicated block (21 lines × 3) · ×1
  • Duplicated block (21 lines × 3) sql/core/v1.2.1/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilters.scala:179 — sql/core/v1.2.1/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilters.scala:179-199 | sql/core/v2.3.5/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilters.scala:179-199 | sql/hive/src/main/scala/org/apache/spark/sql/hive/orc/OrcFilters.scala:157-177 — before extracting anything, compare `sql/core/v1.2.1/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilters.scala` and `sql/core/v2.3.5/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilters.scala` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 159 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 `sql/core/v1.2.1/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilters.scala:179` 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.
D4 · Code Duplication · Duplicated block (17–20 lines × 2) · ×1
  • Duplicated block (17–20 lines × 2) core/src/main/scala/org/apache/spark/rdd/HadoopRDD.scala:268 — core/src/main/scala/org/apache/spark/rdd/HadoopRDD.scala:268-284 | core/src/main/scala/org/apache/spark/rdd/NewHadoopRDD.scala:201-220 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `core/src/main/scala/org/apache/spark/rdd/HadoopRDD.scala:268` 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.
D4 · Code Duplication · Duplicated block (19–20 lines × 2) · ×1
  • Duplicated block (19–20 lines × 2) sql/core/src/main/scala/org/apache/spark/sql/execution/python/WindowInPandasExec.scala:304 — sql/core/src/main/scala/org/apache/spark/sql/execution/python/WindowInPandasExec.scala:304-322 | sql/core/src/main/scala/org/apache/spark/sql/execution/window/WindowExec.scala:123-142 — 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.
D4 · Code Duplication · Duplicated block (15–17 lines × 2) · ×1
  • Duplicated block (15–17 lines × 2) sql/core/src/main/scala/org/apache/spark/sql/execution/joins/BroadcastHashJoinExec.scala:267 — sql/core/src/main/scala/org/apache/spark/sql/execution/joins/BroadcastHashJoinExec.scala:267-283 | sql/core/src/main/scala/org/apache/spark/sql/execution/joins/BroadcastHashJoinExec.scala:451-465 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sql/core/src/main/scala/org/apache/spark/sql/execution/joins/BroadcastHashJoinExec.scala:267` 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.
D4 · Code Duplication · Duplicated block (15–16 lines × 2) · ×1
  • Duplicated block (15–16 lines × 2) sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/continuous/ContinuousTextSocketSource.scala:163 — sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/continuous/ContinuousTextSocketSource.scala:163-178 | sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/sources/TextSocketMicroBatchStream.scala:70-84 — 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 `sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/continuous/ContinuousTextSocketSource.scala:163` 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.
D4 · Code Duplication · Duplicated block (14–15 lines × 4) · ×1
  • Duplicated block (14–15 lines × 4) mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:643 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:643-657 | mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:707-720 | mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala:624-638 | mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala:688-701 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 476 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 `mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:643` 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.
D4 · Code Duplication · Duplicated block (12 lines × 4) · ×1
  • Duplicated block (12 lines × 4) mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:513 — mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:513-524 | mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:655-666 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala:685-696 | mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala:840-851 — before extracting anything, compare `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala` and `mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 357 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 `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:655` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala:698` calls `Since` and `mllib-local/src/main/scala/org/apache/spark/ml/linalg/Vectors.scala:526` 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.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×1
  • Duplicated block (12 lines × 3) sql/core/src/main/scala/org/apache/spark/sql/execution/joins/SortMergeJoinExec.scala:262 — sql/core/src/main/scala/org/apache/spark/sql/execution/joins/SortMergeJoinExec.scala:262-273 | sql/core/src/main/scala/org/apache/spark/sql/execution/joins/SortMergeJoinExec.scala:297-308 | sql/core/src/main/scala/org/apache/spark/sql/execution/joins/SortMergeJoinExec.scala:339-350 — 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 `sql/core/src/main/scala/org/apache/spark/sql/execution/joins/SortMergeJoinExec.scala:262` 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, `sql/core/src/main/scala/org/apache/spark/sql/execution/joins/SortMergeJoinExec.scala:338` calls `GenericInternalRow` and `sql/core/src/main/scala/org/apache/spark/sql/execution/joins/SortMergeJoinExec.scala:261` 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 · Duplicated block (10–12 lines × 2) · ×1
  • Duplicated block (10–12 lines × 2) core/src/main/scala/org/apache/spark/deploy/worker/Worker.scala:264 — core/src/main/scala/org/apache/spark/deploy/worker/Worker.scala:264-275 | core/src/main/scala/org/apache/spark/deploy/worker/Worker.scala:322-331 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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.
D4 · Code Duplication · Duplicated block (11 lines × 23) · ×1
  • Duplicated block (11 lines × 23) sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:172 — sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:172-182 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:192-202 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:212-222 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:232-242 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:252-262 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:272-282 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:292-302 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:312-322 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:332-342 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:352-362 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:372-382 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:392-402 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:412-422 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:432-442 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:452-462 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:472-482 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:492-502 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:512-522 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:532-542 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:552-562 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:572-582 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:592-602 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:612-622 — all 23 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 `sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:172` 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 `e` to `Seq[Expression]) = if (e.length == 0` in one and `Seq[Expression]) = if (e.length == 1` 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 · Duplicated block (11 lines × 6) · ×1
  • Duplicated block (11 lines × 6) mllib/src/main/scala/org/apache/spark/ml/r/DecisionTreeClassificationWrapper.scala:125 — mllib/src/main/scala/org/apache/spark/ml/r/DecisionTreeClassificationWrapper.scala:125-135 | mllib/src/main/scala/org/apache/spark/ml/r/DecisionTreeRegressionWrapper.scala:108-118 | mllib/src/main/scala/org/apache/spark/ml/r/GBTClassificationWrapper.scala:132-142 | mllib/src/main/scala/org/apache/spark/ml/r/GBTRegressionWrapper.scala:116-126 | mllib/src/main/scala/org/apache/spark/ml/r/RandomForestClassificationWrapper.scala:133-143 | mllib/src/main/scala/org/apache/spark/ml/r/RandomForestRegressionWrapper.scala:116-126 — before extracting anything, compare `mllib/src/main/scala/org/apache/spark/ml/r/DecisionTreeRegressionWrapper.scala` and `mllib/src/main/scala/org/apache/spark/ml/r/GBTRegressionWrapper.scala` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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.
D4 · Code Duplication · Duplicated block (11 lines × 5) · ×1
  • Duplicated block (11 lines × 5) external/avro/src/main/scala/org/apache/spark/sql/avro/AvroFileFormat.scala:253 — external/avro/src/main/scala/org/apache/spark/sql/avro/AvroFileFormat.scala:253-263 | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/json/JsonFileFormat.scala:143-153 | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFileFormat.scala:241-251 | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFileFormat.scala:362-372 | sql/hive/src/main/scala/org/apache/spark/sql/hive/orc/OrcFileFormat.scala:196-206 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times. Read the line range as the matched WINDOW rather than a finished unit: at `external/avro/src/main/scala/org/apache/spark/sql/avro/AvroFileFormat.scala: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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/json/JsonFileFormat.scala:139` calls `hashCode`, `equals` and `external/avro/src/main/scala/org/apache/spark/sql/avro/AvroFileFormat.scala:251` 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 · Duplicated block (10 lines × 4) · ×1
  • Duplicated block (10 lines × 4) mllib/src/main/scala/org/apache/spark/ml/r/BisectingKMeansWrapper.scala:76 — mllib/src/main/scala/org/apache/spark/ml/r/BisectingKMeansWrapper.scala:76-85 | mllib/src/main/scala/org/apache/spark/ml/r/GaussianMixtureWrapper.scala:72-81 | mllib/src/main/scala/org/apache/spark/ml/r/IsotonicRegressionWrapper.scala:60-69 | mllib/src/main/scala/org/apache/spark/ml/r/KMeansWrapper.scala:78-87 — before extracting anything, compare `mllib/src/main/scala/org/apache/spark/ml/r/BisectingKMeansWrapper.scala` and `mllib/src/main/scala/org/apache/spark/ml/r/KMeansWrapper.scala` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (8–10 lines × 2) · ×1
  • Duplicated block (8–10 lines × 2) mllib/src/main/scala/org/apache/spark/ml/feature/QuantileDiscretizer.scala:175 — mllib/src/main/scala/org/apache/spark/ml/feature/QuantileDiscretizer.scala:175-184 | mllib/src/main/scala/org/apache/spark/ml/feature/StringIndexer.scala:91-98 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `mllib/src/main/scala/org/apache/spark/ml/feature/QuantileDiscretizer.scala:175` 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.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×1
  • Duplicated block (9 lines × 3) mllib/src/main/scala/org/apache/spark/ml/r/DecisionTreeRegressionWrapper.scala:69 — mllib/src/main/scala/org/apache/spark/ml/r/DecisionTreeRegressionWrapper.scala:69-77 | mllib/src/main/scala/org/apache/spark/ml/r/GBTRegressionWrapper.scala:74-82 | mllib/src/main/scala/org/apache/spark/ml/r/RandomForestRegressionWrapper.scala:74-82 — before extracting anything, compare `mllib/src/main/scala/org/apache/spark/ml/r/DecisionTreeRegressionWrapper.scala` and `mllib/src/main/scala/org/apache/spark/ml/r/GBTRegressionWrapper.scala` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (11–14 lines × 3) · ×1
  • Duplicated block (11–14 lines × 3) mllib/src/main/scala/org/apache/spark/mllib/util/LinearDataGenerator.scala:195 — mllib/src/main/scala/org/apache/spark/mllib/util/LinearDataGenerator.scala:195-208 | mllib/src/main/scala/org/apache/spark/mllib/util/LogisticRegressionDataGenerator.scala:71-84 | mllib/src/main/scala/org/apache/spark/mllib/util/SVMDataGenerator.scala:43-53 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 `mllib/src/main/scala/org/apache/spark/mllib/util/LinearDataGenerator.scala:195` 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.
D4 · Code Duplication · Duplicated block (7–9 lines × 2) · ×1
  • Duplicated block (7–9 lines × 2) mllib/src/main/scala/org/apache/spark/mllib/classification/LogisticRegression.scala:176 — mllib/src/main/scala/org/apache/spark/mllib/classification/LogisticRegression.scala:176-184 | mllib/src/main/scala/org/apache/spark/mllib/classification/SVM.scala:98-104 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `mllib/src/main/scala/org/apache/spark/mllib/classification/LogisticRegression.scala:176` 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.
D4 · Code Duplication · Duplicated block (8 lines × 7) · ×1
  • Duplicated block (8 lines × 7) mllib/src/main/scala/org/apache/spark/ml/r/BisectingKMeansWrapper.scala:79 — mllib/src/main/scala/org/apache/spark/ml/r/BisectingKMeansWrapper.scala:79-86 | mllib/src/main/scala/org/apache/spark/ml/r/DecisionTreeRegressionWrapper.scala:71-78 | mllib/src/main/scala/org/apache/spark/ml/r/GBTRegressionWrapper.scala:76-83 | mllib/src/main/scala/org/apache/spark/ml/r/GaussianMixtureWrapper.scala:75-82 | mllib/src/main/scala/org/apache/spark/ml/r/IsotonicRegressionWrapper.scala:63-70 | mllib/src/main/scala/org/apache/spark/ml/r/KMeansWrapper.scala:81-88 | mllib/src/main/scala/org/apache/spark/ml/r/RandomForestRegressionWrapper.scala:76-83 — before extracting anything, compare `mllib/src/main/scala/org/apache/spark/ml/r/BisectingKMeansWrapper.scala` and `mllib/src/main/scala/org/apache/spark/ml/r/KMeansWrapper.scala` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `mllib/src/main/scala/org/apache/spark/ml/r/BisectingKMeansWrapper.scala:78` calls `setFeaturesCol` and `mllib/src/main/scala/org/apache/spark/ml/r/DecisionTreeRegressionWrapper.scala:70` 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 · Duplicated block (7–8 lines × 3) · ×1
  • Duplicated block (7–8 lines × 3) sql/core/src/main/scala/org/apache/spark/sql/execution/joins/BroadcastHashJoinExec.scala:186 — sql/core/src/main/scala/org/apache/spark/sql/execution/joins/BroadcastHashJoinExec.scala:186-193 | sql/core/src/main/scala/org/apache/spark/sql/execution/joins/BroadcastHashJoinExec.scala:266-272 | sql/core/src/main/scala/org/apache/spark/sql/execution/joins/BroadcastHashJoinExec.scala:450-457 — 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 `sql/core/src/main/scala/org/apache/spark/sql/execution/joins/BroadcastHashJoinExec.scala: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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `sql/core/src/main/scala/org/apache/spark/sql/execution/joins/BroadcastHashJoinExec.scala:262` calls `metricTerm`, `freshName` and `sql/core/src/main/scala/org/apache/spark/sql/execution/joins/BroadcastHashJoinExec.scala:185` 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 · Duplicated block (8 lines × 22) · ×1
  • Duplicated block (8 lines × 22) sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:736 — sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:736-743 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:751-758 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:766-773 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:781-788 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:796-803 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:811-818 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:826-833 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:841-848 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:856-863 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:871-878 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:886-893 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:901-908 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:916-923 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:931-938 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:946-953 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:961-968 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:976-983 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:991-998 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:1006-1013 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:1021-1028 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:1036-1043 | sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:1051-1058 — all 22 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 `sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala:736` 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 `e` to `Seq[Expression]) = if (e.length == 1` in one and `Seq[Expression]) = if (e.length == 2` 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 · Duplicated block (7 lines × 9) · ×1
  • Duplicated block (7 lines × 9) mllib/src/main/scala/org/apache/spark/ml/r/BisectingKMeansWrapper.scala:130 — mllib/src/main/scala/org/apache/spark/ml/r/BisectingKMeansWrapper.scala:130-136 | mllib/src/main/scala/org/apache/spark/ml/r/DecisionTreeClassificationWrapper.scala:141-147 | mllib/src/main/scala/org/apache/spark/ml/r/DecisionTreeRegressionWrapper.scala:124-130 | mllib/src/main/scala/org/apache/spark/ml/r/GBTClassificationWrapper.scala:148-154 | mllib/src/main/scala/org/apache/spark/ml/r/GBTRegressionWrapper.scala:132-138 | mllib/src/main/scala/org/apache/spark/ml/r/GaussianMixtureWrapper.scala:124-130 | mllib/src/main/scala/org/apache/spark/ml/r/KMeansWrapper.scala:133-139 | mllib/src/main/scala/org/apache/spark/ml/r/RandomForestClassificationWrapper.scala:149-155 | mllib/src/main/scala/org/apache/spark/ml/r/RandomForestRegressionWrapper.scala:132-138 — before extracting anything, compare `mllib/src/main/scala/org/apache/spark/ml/r/BisectingKMeansWrapper.scala` and `mllib/src/main/scala/org/apache/spark/ml/r/KMeansWrapper.scala` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (4–7 lines × 3) · ×1
  • Duplicated block (4–7 lines × 3) mllib/src/main/scala/org/apache/spark/ml/classification/LinearSVC.scala:169 — mllib/src/main/scala/org/apache/spark/ml/classification/LinearSVC.scala:169-175 | mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala:496-499 | mllib/src/main/scala/org/apache/spark/ml/regression/LinearRegression.scala:326-332 — 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 `mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala:496` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `mllib/src/main/scala/org/apache/spark/ml/classification/LinearSVC.scala:169` calls `col`, `$` and `mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala:496` 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 · Duplicated block (69 lines × 2) · ×1
  • Duplicated block (69 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftHttpCLIService.java:63 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftHttpCLIService.java:63-131 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftHttpCLIService.java:64-132 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftHttpCLIService.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftHttpCLIService.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 97 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 `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftHttpCLIService.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. Note first that the copies are not typed on the same thing: `Iface` names `org.apache.hive.service.cli.thrift.TCLIService.Iface` in one and `org.apache.hive.service.rpc.thrift.TCLIService.Iface` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (67 lines × 2) · ×1
  • Duplicated block (67 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java:181 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java:181-247 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java:180-246 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 274 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 `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java:181` 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.
D4 · Code Duplication · Duplicated block (52–53 lines × 2) · ×1
  • Duplicated block (52–53 lines × 2) common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java:1099 — common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java:1099-1151 | common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java:1190-1241 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.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. 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.
D4 · Code Duplication · Duplicated block (42 lines × 2) · ×1
  • Duplicated block (42 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/Operation.java:183 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/Operation.java:183-224 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/Operation.java:201-242 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/Operation.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/Operation.java` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 88 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.
D4 · Code Duplication · Duplicated block (40 lines × 2) · ×1
  • Duplicated block (40 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/HiveSQLException.java:201 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/HiveSQLException.java:201-240 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/HiveSQLException.java:201-240 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/HiveSQLException.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/HiveSQLException.java` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 105 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.
D4 · Code Duplication · Duplicated block (37 lines × 2) · ×1
  • Duplicated block (37 lines × 2) REDACTED:198 — REDACTED:198-234 | REDACTED:209-245 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 325 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.
D4 · Code Duplication · Duplicated block (35 lines × 3) · ×1
  • Duplicated block (35 lines × 3) sql/catalyst/src/main/java/org/apache/spark/sql/vectorized/ColumnarBatch.java:250 — sql/catalyst/src/main/java/org/apache/spark/sql/vectorized/ColumnarBatch.java:250-284 | sql/catalyst/src/main/java/org/apache/spark/sql/vectorized/ColumnarRow.java:157-191 | sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/MutableColumnarRow.java:157-191 — 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. 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.
D4 · Code Duplication · Duplicated block (35 lines × 2) · ×1
  • Duplicated block (35 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:649 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:649-683 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:686-720 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 436 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.
D4 · Code Duplication · Duplicated block (31 lines × 2) · ×1
  • Duplicated block (31 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/CLIService.java:375 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/CLIService.java:375-405 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java:437-467 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/CLIService.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 195 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java:469` calls `getSessionConf`, `getSession`, `getHiveConf` and `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/CLIService.java:410` 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 · Duplicated block (32 lines × 3) · ×1
  • Duplicated block (32 lines × 3) sql/catalyst/src/main/java/org/apache/spark/sql/vectorized/ColumnarBatch.java:151 — sql/catalyst/src/main/java/org/apache/spark/sql/vectorized/ColumnarBatch.java:151-182 | sql/catalyst/src/main/java/org/apache/spark/sql/vectorized/ColumnarRow.java:58-89 | sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/MutableColumnarRow.java:58-89 — 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 `sql/catalyst/src/main/java/org/apache/spark/sql/vectorized/ColumnarBatch.java:151` 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.
D4 · Code Duplication · Duplicated block (12 lines × 12) · ×1
  • Duplicated block (12 lines × 12) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:468 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:468-482 | sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:532-543 | sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:554-565 | sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:599-610 | sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:620-631 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:482-496 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:546-557 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:568-579 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:613-624 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:634-645 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:857-868 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:880-892 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 435 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 `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:468` 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.
D4 · Code Duplication · Duplicated block (12 lines × 6) · ×1
  • Duplicated block (12 lines × 6) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:491 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:491-502 | sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:511-522 | sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:574-585 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:505-516 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:525-536 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:588-599 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 435 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 `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:491` 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.
D4 · Code Duplication · Duplicated block (9 lines × 18) · ×1
  • Duplicated block (9 lines × 18) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:140 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:140-148 | sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:158-166 | sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:176-184 | sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:198-206 | sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:221-229 | sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:239-247 | sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:264-272 | sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:285-293 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:151-159 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:169-177 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:187-195 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:209-217 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:232-240 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:250-258 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:275-283 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:296-304 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:461-469 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:484-492 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 224 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 `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:140` 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, `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:149` calls `setQueryTimeout` and `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java:138` 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.
D4 · Code Duplication · Duplicated block (7 lines × 8) · ×1
  • Duplicated block (7 lines × 8) sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedRleValuesReader.java:178 — sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedRleValuesReader.java:178-184 | sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedRleValuesReader.java:213-219 | sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedRleValuesReader.java:247-253 | sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedRleValuesReader.java:317-323 | sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedRleValuesReader.java:351-357 | sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedRleValuesReader.java:385-391 | sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedRleValuesReader.java:419-425 | sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedRleValuesReader.java:458-464 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedRleValuesReader.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.
D4 · Code Duplication · Duplicated block (115 lines × 2) · ×1
  • Duplicated block (115 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/AbstractService.java:68 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/AbstractService.java:68-182 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/AbstractService.java:68-182 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/AbstractService.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/AbstractService.java` as WHOLE FILES: 97% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (108 lines × 2) · ×1
  • Duplicated block (108 lines × 2) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/ServiceOperations.java:32 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/ServiceOperations.java:32-139 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/ServiceOperations.java:32-139 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/ServiceOperations.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/ServiceOperations.java` as WHOLE FILES: 96% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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.
D4 · Code Duplication · Duplicated block (7 lines × 11) · ×1
  • Duplicated block (7 lines × 11) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/ColumnValue.java:109 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/ColumnValue.java:109-115 | sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/ColumnValue.java:117-123 | sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/ColumnValue.java:133-139 | sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/ColumnValue.java:141-147 | sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/ColumnValue.java:149-155 | sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/ColumnValue.java:157-163 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/ColumnValue.java:110-116 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/ColumnValue.java:118-124 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/ColumnValue.java:134-140 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/ColumnValue.java:151-157 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/ColumnValue.java:159-165 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/ColumnValue.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/ColumnValue.java` as WHOLE FILES: this scan already matched 11 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. Note first that the copies are not typed on the same thing: `TColumnValue` names `org.apache.hive.service.cli.thrift.TColumnValue` in one and `org.apache.hive.service.rpc.thrift.TColumnValue` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, 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, `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/ColumnValue.java:168` calls `getType` and `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/ColumnValue.java:166` 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.
D4 · Code Duplication · Duplicated block (8 lines × 16) · ×1
  • Duplicated block (8 lines × 16) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetCatalogsOperation.java:73 — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetCatalogsOperation.java:73-80 | sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetColumnsOperation.java:225-232 | sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetFunctionsOperation.java:139-146 | sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetSchemasOperation.java:88-95 | sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetTableTypesOperation.java:84-91 | sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetTablesOperation.java:127-134 | sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetTypeInfoOperation.java:134-141 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/GetCatalogsOperation.java:73-80 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/GetColumnsOperation.java:242-249 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/GetCrossReferenceOperation.java:153-160 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/GetFunctionsOperation.java:139-146 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/GetPrimaryKeysOperation.java:107-114 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/GetSchemasOperation.java:88-95 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/GetTableTypesOperation.java:84-91 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/GetTablesOperation.java:135-142 | sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/GetTypeInfoOperation.java:134-141 — before extracting anything, compare `sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetCatalogsOperation.java` and `sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/GetCatalogsOperation.java` as WHOLE FILES: 98% 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 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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.
D4 · Code Duplication · Duplicated block (89 lines × 4) · ×1
  • Duplicated block (89 lines × 4) python/pyspark/sql/readwriter.py:187 — python/pyspark/sql/readwriter.py:187-278 | python/pyspark/sql/readwriter.py:365-484 | python/pyspark/sql/streaming.py:415-503 | python/pyspark/sql/streaming.py:588-700 — before extracting anything, compare `python/pyspark/sql/readwriter.py` and `python/pyspark/sql/streaming.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 177 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `python/pyspark/sql/readwriter.py:187` 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.
D4 · Code Duplication · Duplicated block (54 lines × 2) · ×1
  • Duplicated block (54 lines × 2) python/pyspark/ml/linalg/__init__.py:560 — python/pyspark/ml/linalg/__init__.py:560-613 | python/pyspark/mllib/linalg/__init__.py:638-691 — before extracting anything, compare `python/pyspark/ml/linalg/__init__.py` and `python/pyspark/mllib/linalg/__init__.py` as WHOLE FILES: this scan already matched 34 separate duplicated blocks between them, totalling at least 667 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.
D4 · Code Duplication · Duplicated block (49–57 lines × 2) · ×1
  • Duplicated block (49–57 lines × 2) python/pyspark/ml/linalg/__init__.py:471 — python/pyspark/ml/linalg/__init__.py:471-527 | python/pyspark/mllib/linalg/__init__.py:515-563 — before extracting anything, compare `python/pyspark/ml/linalg/__init__.py` and `python/pyspark/mllib/linalg/__init__.py` as WHOLE FILES: this scan already matched 34 separate duplicated blocks between them, totalling at least 667 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.
D4 · Code Duplication · Duplicated block (21–24 lines × 2) · ×1
  • Duplicated block (21–24 lines × 2) python/pyspark/sql/readwriter.py:93 — python/pyspark/sql/readwriter.py:93-113 | python/pyspark/sql/streaming.py:311-334 — before extracting anything, compare `python/pyspark/sql/readwriter.py` and `python/pyspark/sql/streaming.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 177 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `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.
D4 · Code Duplication · Duplicated block (18–20 lines × 2) · ×1
  • Duplicated block (18–20 lines × 2) python/pyspark/shuffle.py:292 — python/pyspark/shuffle.py:292-311 | python/pyspark/shuffle.py:710-727 — both copies are in the same file, so extract the 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 · Duplicated block (9–11 lines × 3) · ×1
  • Duplicated block (9–11 lines × 3) python/pyspark/mllib/feature.py:825 — python/pyspark/mllib/feature.py:825-833 | python/pyspark/mllib/random.py:414-424 | python/pyspark/mllib/stat/_statistics.py:313-321 — 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.
D4 · Code Duplication · Duplicated block (9 lines × 7) · ×1
  • Duplicated block (9 lines × 7) python/pyspark/mllib/classification.py:758 — python/pyspark/mllib/classification.py:758-766 | python/pyspark/mllib/evaluation.py:610-618 | python/pyspark/mllib/feature.py:826-834 | python/pyspark/mllib/random.py:417-425 | python/pyspark/mllib/regression.py:834-842 | python/pyspark/mllib/stat/_statistics.py:314-322 | python/pyspark/mllib/tree.py:650-658 — 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.
D4 · Code Duplication · Duplicated block (7–8 lines × 4) · ×1
  • Duplicated block (7–8 lines × 4) python/pyspark/sql/readwriter.py:275 — python/pyspark/sql/readwriter.py:275-282 | python/pyspark/sql/readwriter.py:486-492 | python/pyspark/sql/streaming.py:500-506 | python/pyspark/sql/streaming.py:702-708 — before extracting anything, compare `python/pyspark/sql/readwriter.py` and `python/pyspark/sql/streaming.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 177 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `python/pyspark/sql/readwriter.py:275` 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.
D4 · Code Duplication · Duplicated block (9 lines × 5) · ×1
  • Duplicated block (9 lines × 5) python/pyspark/ml/clustering.py:130 — python/pyspark/ml/clustering.py:130-138 | python/pyspark/ml/clustering.py:332-340 | python/pyspark/ml/clustering.py:523-531 | python/pyspark/ml/regression.py:199-208 | python/pyspark/ml/regression.py:1680-1690 — there are 5 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 5 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.
D4 · Code Duplication · Near-duplicate member family (4 members, 43 shared lines) · ×1
  • Near-duplicate member family (4 members, 43 shared lines) examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeExample.scala:68 — examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeExample.scala:68-132 | examples/src/main/scala/org/apache/spark/examples/ml/GBTExample.scala:66-135 | examples/src/main/scala/org/apache/spark/examples/ml/RandomForestExample.scala:67-141 | examples/src/main/scala/org/apache/spark/examples/mllib/DecisionTreeRunner.scala:70-154 — These 4 members are variants of one another: a block of 43 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Near-duplicate member family (4 members, 23 shared lines) · ×1
  • Near-duplicate member family (4 members, 23 shared lines) examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeExample.scala:68 — examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeExample.scala:68-132 | examples/src/main/scala/org/apache/spark/examples/ml/GBTExample.scala:66-135 | examples/src/main/scala/org/apache/spark/examples/ml/RandomForestExample.scala:67-141 | examples/src/main/scala/org/apache/spark/examples/mllib/GradientBoostedTreesRunner.scala:53-95 — These 4 members are variants of one another: a block of 23 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Near-duplicate member pair (62 shared lines) · ×1
  • Near-duplicate member pair (62 shared lines) examples/src/main/scala/org/apache/spark/examples/ml/GBTExample.scala:137 — examples/src/main/scala/org/apache/spark/examples/ml/GBTExample.scala:137-240 | examples/src/main/scala/org/apache/spark/examples/ml/RandomForestExample.scala:143-248 — These two members are variants of one another: 62 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Edited copies of one member (3 members, 49+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 49+ corresponding lines) examples/src/main/scala/org/apache/spark/examples/ml/LinearRegressionExample.scala:53 — examples/src/main/scala/org/apache/spark/examples/ml/LinearRegressionExample.scala:53-101 | examples/src/main/scala/org/apache/spark/examples/ml/LogisticRegressionExample.scala:58-109 | examples/src/main/scala/org/apache/spark/examples/mllib/LDAExample.scala:56-108 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 49 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 (35 corresponding lines) · ×1
  • Edited copy of a member (35 corresponding lines) examples/src/main/java/org/apache/spark/examples/ml/JavaChiSqSelectorExample.java:39 — examples/src/main/java/org/apache/spark/examples/ml/JavaChiSqSelectorExample.java:39-73 | examples/src/main/java/org/apache/spark/examples/ml/JavaPowerIterationClusteringExample.java:36-70 — 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 (6 members, 53+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 53+ corresponding lines) examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeClassificationExample.scala:31 — examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeClassificationExample.scala:31-93 | examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeRegressionExample.scala:31-83 | examples/src/main/scala/org/apache/spark/examples/ml/GradientBoostedTreeClassifierExample.scala:30-96 | examples/src/main/scala/org/apache/spark/examples/ml/GradientBoostedTreeRegressorExample.scala:30-83 | examples/src/main/scala/org/apache/spark/examples/ml/RandomForestClassifierExample.scala:30-95 | examples/src/main/scala/org/apache/spark/examples/ml/RandomForestRegressorExample.scala:30-82 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 53 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 copy of a member (38 corresponding lines) · ×1
  • Edited copy of a member (38 corresponding lines) examples/src/main/java/org/apache/spark/examples/sql/streaming/JavaStructuredKafkaWordCount.java:53 — examples/src/main/java/org/apache/spark/examples/sql/streaming/JavaStructuredKafkaWordCount.java:53-91 | examples/src/main/java/org/apache/spark/examples/sql/streaming/JavaStructuredNetworkWordCount.java:40-77 — 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 copies of one member (3 members, 36+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 36+ corresponding lines) examples/src/main/java/org/apache/spark/examples/ml/JavaMultilayerPerceptronClassifierExample.java:34 — examples/src/main/java/org/apache/spark/examples/ml/JavaMultilayerPerceptronClassifierExample.java:34-75 | examples/src/main/java/org/apache/spark/examples/ml/JavaNaiveBayesExample.java:34-69 | examples/src/main/java/org/apache/spark/examples/ml/JavaOneVsRestExample.java:40-82 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 36 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) examples/src/main/scala/org/apache/spark/examples/graphx/ConnectedComponentsExample.scala:41 — examples/src/main/scala/org/apache/spark/examples/graphx/ConnectedComponentsExample.scala:41-66 | examples/src/main/scala/org/apache/spark/examples/graphx/PageRankExample.scala:34-59 | examples/src/main/scala/org/apache/spark/examples/graphx/TriangleCountingExample.scala:42-68 — 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 · Duplicated block (23–25 lines × 3) · ×1
  • Duplicated block (23–25 lines × 3) examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeClassificationExample.scala:32 — examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeClassificationExample.scala:32-54 | examples/src/main/scala/org/apache/spark/examples/ml/GradientBoostedTreeClassifierExample.scala:31-55 | examples/src/main/scala/org/apache/spark/examples/ml/RandomForestClassifierExample.scala:31-55 — before extracting anything, compare `examples/src/main/scala/org/apache/spark/examples/ml/GradientBoostedTreeClassifierExample.scala` and `examples/src/main/scala/org/apache/spark/examples/ml/RandomForestClassifierExample.scala` as WHOLE FILES: 82% 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 2 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.
D4 · Code Duplication · Duplicated block (22 lines × 3) · ×1
  • Duplicated block (22 lines × 3) examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeExample.scala:213 — examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeExample.scala:213-234 | examples/src/main/scala/org/apache/spark/examples/ml/GBTExample.scala:150-171 | examples/src/main/scala/org/apache/spark/examples/ml/RandomForestExample.scala:156-177 — before extracting anything, compare `examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeExample.scala` and `examples/src/main/scala/org/apache/spark/examples/ml/GBTExample.scala` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 127 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeExample.scala:213` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (19–22 lines × 2) · ×1
  • Duplicated block (19–22 lines × 2) examples/src/main/scala/org/apache/spark/examples/ml/LogisticRegressionWithElasticNetExample.scala:29 — examples/src/main/scala/org/apache/spark/examples/ml/LogisticRegressionWithElasticNetExample.scala:29-47 | examples/src/main/scala/org/apache/spark/examples/ml/MulticlassLogisticRegressionWithElasticNetExample.scala:29-50 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 · Duplicated block (21–22 lines × 2) · ×1
  • Duplicated block (21–22 lines × 2) examples/src/main/scala/org/apache/spark/examples/mllib/BinaryClassification.scala:77 — examples/src/main/scala/org/apache/spark/examples/mllib/BinaryClassification.scala:77-98 | examples/src/main/scala/org/apache/spark/examples/mllib/LinearRegression.scala:65-85 — before extracting anything, compare `examples/src/main/scala/org/apache/spark/examples/mllib/BinaryClassification.scala` and `examples/src/main/scala/org/apache/spark/examples/mllib/LinearRegression.scala` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `examples/src/main/scala/org/apache/spark/examples/mllib/BinaryClassification.scala:77` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (19–20 lines × 3) · ×1
  • Duplicated block (19–20 lines × 3) examples/src/main/scala/org/apache/spark/examples/mllib/Correlations.scala:42 — examples/src/main/scala/org/apache/spark/examples/mllib/Correlations.scala:42-61 | examples/src/main/scala/org/apache/spark/examples/mllib/MultivariateSummarizer.scala:43-62 | examples/src/main/scala/org/apache/spark/examples/mllib/SampledRDDs.scala:39-57 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `examples/src/main/scala/org/apache/spark/examples/mllib/Correlations.scala:42` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (17–19 lines × 4) · ×1
  • Duplicated block (17–19 lines × 4) examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeExample.scala:97 — examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeExample.scala:97-113 | examples/src/main/scala/org/apache/spark/examples/ml/GBTExample.scala:98-116 | examples/src/main/scala/org/apache/spark/examples/ml/RandomForestExample.scala:104-122 | examples/src/main/scala/org/apache/spark/examples/mllib/DecisionTreeRunner.scala:112-128 — before extracting anything, compare `examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeExample.scala` and `examples/src/main/scala/org/apache/spark/examples/ml/GBTExample.scala` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 127 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeExample.scala:97` 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.
D4 · Code Duplication · Duplicated block (18 lines × 5) · ×1
  • Duplicated block (18 lines × 5) examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeExample.scala:115 — examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeExample.scala:115-132 | examples/src/main/scala/org/apache/spark/examples/ml/GBTExample.scala:118-135 | examples/src/main/scala/org/apache/spark/examples/ml/LinearRegressionExample.scala:84-101 | examples/src/main/scala/org/apache/spark/examples/ml/LogisticRegressionExample.scala:92-109 | examples/src/main/scala/org/apache/spark/examples/ml/RandomForestExample.scala:124-141 — before extracting anything, compare `examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeExample.scala` and `examples/src/main/scala/org/apache/spark/examples/ml/GBTExample.scala` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 127 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeExample.scala:115` 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.
D4 · Code Duplication · Duplicated block (17–18 lines × 3) · ×1
  • Duplicated block (17–18 lines × 3) examples/src/main/scala/org/apache/spark/examples/mllib/BinaryClassification.scala:83 — examples/src/main/scala/org/apache/spark/examples/mllib/BinaryClassification.scala:83-100 | examples/src/main/scala/org/apache/spark/examples/mllib/LinearRegression.scala:71-87 | examples/src/main/scala/org/apache/spark/examples/mllib/MovieLensALS.scala:77-94 — before extracting anything, compare `examples/src/main/scala/org/apache/spark/examples/mllib/BinaryClassification.scala` and `examples/src/main/scala/org/apache/spark/examples/mllib/LinearRegression.scala` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `examples/src/main/scala/org/apache/spark/examples/mllib/BinaryClassification.scala: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.
D4 · Code Duplication · Duplicated block (15 lines × 6) · ×1
  • Duplicated block (15 lines × 6) examples/src/main/scala/org/apache/spark/examples/mllib/BinaryClassification.scala:86 — examples/src/main/scala/org/apache/spark/examples/mllib/BinaryClassification.scala:86-102 | examples/src/main/scala/org/apache/spark/examples/mllib/Correlations.scala:48-63 | examples/src/main/scala/org/apache/spark/examples/mllib/LinearRegression.scala:74-89 | examples/src/main/scala/org/apache/spark/examples/mllib/MovieLensALS.scala:80-96 | examples/src/main/scala/org/apache/spark/examples/mllib/MultivariateSummarizer.scala:49-64 | examples/src/main/scala/org/apache/spark/examples/mllib/SampledRDDs.scala:45-59 — before extracting anything, compare `examples/src/main/scala/org/apache/spark/examples/mllib/BinaryClassification.scala` and `examples/src/main/scala/org/apache/spark/examples/mllib/LinearRegression.scala` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `examples/src/main/scala/org/apache/spark/examples/mllib/BinaryClassification.scala:86` 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, `examples/src/main/scala/org/apache/spark/examples/mllib/BinaryClassification.scala:84` calls `required`, `text` and `examples/src/main/scala/org/apache/spark/examples/mllib/Correlations.scala:47` 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 · Duplicated block (9–15 lines × 3) · ×1
  • Duplicated block (9–15 lines × 3) examples/src/main/scala/org/apache/spark/examples/ml/IndexToStringExample.scala:29 — examples/src/main/scala/org/apache/spark/examples/ml/IndexToStringExample.scala:29-42 | examples/src/main/scala/org/apache/spark/examples/ml/OneHotEncoderExample.scala:28-42 | examples/src/main/scala/org/apache/spark/examples/ml/StringIndexerExample.scala:28-36 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 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.
D4 · Code Duplication · Duplicated block (13 lines × 4) · ×1
  • Duplicated block (13 lines × 4) examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeExample.scala:76 — examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeExample.scala:76-88 | examples/src/main/scala/org/apache/spark/examples/ml/GBTExample.scala:74-86 | examples/src/main/scala/org/apache/spark/examples/ml/RandomForestExample.scala:75-87 | examples/src/main/scala/org/apache/spark/examples/mllib/DecisionTreeRunner.scala:82-94 — before extracting anything, compare `examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeExample.scala` and `examples/src/main/scala/org/apache/spark/examples/ml/GBTExample.scala` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 127 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (12 lines × 7) · ×1
  • Duplicated block (12 lines × 7) examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeExample.scala:108 — examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeExample.scala:108-119 | examples/src/main/scala/org/apache/spark/examples/ml/GBTExample.scala:111-122 | examples/src/main/scala/org/apache/spark/examples/ml/LinearRegressionExample.scala:77-88 | examples/src/main/scala/org/apache/spark/examples/ml/LogisticRegressionExample.scala:85-96 | examples/src/main/scala/org/apache/spark/examples/ml/RandomForestExample.scala:117-128 | examples/src/main/scala/org/apache/spark/examples/mllib/DecisionTreeRunner.scala:123-134 | examples/src/main/scala/org/apache/spark/examples/mllib/GradientBoostedTreesRunner.scala:71-82 — before extracting anything, compare `examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeExample.scala` and `examples/src/main/scala/org/apache/spark/examples/ml/GBTExample.scala` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 127 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeExample.scala:108` 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.
D4 · Code Duplication · Duplicated block (11 lines × 4) · ×1
  • Duplicated block (11 lines × 4) examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeExample.scala:69 — examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeExample.scala:69-79 | examples/src/main/scala/org/apache/spark/examples/ml/GBTExample.scala:67-77 | examples/src/main/scala/org/apache/spark/examples/ml/RandomForestExample.scala:68-78 | examples/src/main/scala/org/apache/spark/examples/mllib/GradientBoostedTreesRunner.scala:54-64 — before extracting anything, compare `examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeExample.scala` and `examples/src/main/scala/org/apache/spark/examples/ml/GBTExample.scala` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 127 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeExample.scala: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.
D4 · Code Duplication · Duplicated block (8–9 lines × 6) · ×1
  • Duplicated block (8–9 lines × 6) examples/src/main/scala/org/apache/spark/examples/mllib/DecisionTreeClassificationExample.scala:31 — examples/src/main/scala/org/apache/spark/examples/mllib/DecisionTreeClassificationExample.scala:31-39 | examples/src/main/scala/org/apache/spark/examples/mllib/DecisionTreeRegressionExample.scala:31-39 | examples/src/main/scala/org/apache/spark/examples/mllib/GradientBoostingClassificationExample.scala:31-38 | examples/src/main/scala/org/apache/spark/examples/mllib/GradientBoostingRegressionExample.scala:31-38 | examples/src/main/scala/org/apache/spark/examples/mllib/RandomForestClassificationExample.scala:30-37 | examples/src/main/scala/org/apache/spark/examples/mllib/RandomForestRegressionExample.scala:30-37 — before extracting anything, compare `examples/src/main/scala/org/apache/spark/examples/mllib/RandomForestClassificationExample.scala` and `examples/src/main/scala/org/apache/spark/examples/mllib/RandomForestRegressionExample.scala` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (6–7 lines × 2) · ×1
  • Duplicated block (6–7 lines × 2) examples/src/main/scala/org/apache/spark/examples/mllib/GaussianMixtureExample.scala:31 — examples/src/main/scala/org/apache/spark/examples/mllib/GaussianMixtureExample.scala:31-36 | examples/src/main/scala/org/apache/spark/examples/mllib/LatentDirichletAllocationExample.scala:31-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. 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.
D4 · Code Duplication · Duplicated block (25–28 lines × 3) · ×1
  • Duplicated block (25–28 lines × 3) examples/src/main/java/org/apache/spark/examples/ml/JavaDecisionTreeClassificationExample.java:34 — examples/src/main/java/org/apache/spark/examples/ml/JavaDecisionTreeClassificationExample.java:34-61 | examples/src/main/java/org/apache/spark/examples/ml/JavaGradientBoostedTreeClassifierExample.java:35-62 | examples/src/main/java/org/apache/spark/examples/ml/JavaRandomForestClassifierExample.java:35-59 — before extracting anything, compare `examples/src/main/java/org/apache/spark/examples/ml/JavaDecisionTreeClassificationExample.java` and `examples/src/main/java/org/apache/spark/examples/ml/JavaGradientBoostedTreeClassifierExample.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (25 lines × 3) · ×1
  • Duplicated block (25 lines × 3) examples/src/main/java/org/apache/spark/examples/ml/JavaDecisionTreeClassificationExample.java:71 — examples/src/main/java/org/apache/spark/examples/ml/JavaDecisionTreeClassificationExample.java:71-95 | examples/src/main/java/org/apache/spark/examples/ml/JavaGradientBoostedTreeClassifierExample.java:73-97 | examples/src/main/java/org/apache/spark/examples/ml/JavaRandomForestClassifierExample.java:69-93 — before extracting anything, compare `examples/src/main/java/org/apache/spark/examples/ml/JavaDecisionTreeClassificationExample.java` and `examples/src/main/java/org/apache/spark/examples/ml/JavaGradientBoostedTreeClassifierExample.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (13–20 lines × 2) · ×1
  • Duplicated block (13–20 lines × 2) examples/src/main/java/org/apache/spark/examples/sql/JavaSQLDataSourceExample.java:177 — examples/src/main/java/org/apache/spark/examples/sql/JavaSQLDataSourceExample.java:177-189 | examples/src/main/java/org/apache/spark/examples/sql/JavaSparkSQLExample.java:324-343 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `examples/src/main/java/org/apache/spark/examples/sql/JavaSQLDataSourceExample.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.
D4 · Code Duplication · Duplicated block (18–19 lines × 2) · ×1
  • Duplicated block (18–19 lines × 2) examples/src/main/java/org/apache/spark/examples/ml/JavaGradientBoostedTreeRegressorExample.java:65 — examples/src/main/java/org/apache/spark/examples/ml/JavaGradientBoostedTreeRegressorExample.java:65-82 | examples/src/main/java/org/apache/spark/examples/ml/JavaRandomForestRegressorExample.java:64-82 — before extracting anything, compare `examples/src/main/java/org/apache/spark/examples/ml/JavaGradientBoostedTreeRegressorExample.java` and `examples/src/main/java/org/apache/spark/examples/ml/JavaRandomForestRegressorExample.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (13–18 lines × 2) · ×1
  • Duplicated block (13–18 lines × 2) examples/src/main/java/org/apache/spark/examples/JavaHdfsLR.java:117 — examples/src/main/java/org/apache/spark/examples/JavaHdfsLR.java:117-129 | examples/src/main/java/org/apache/spark/examples/JavaPageRank.java:69-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.
D4 · Code Duplication · Duplicated block (16–17 lines × 3) · ×1
  • Duplicated block (16–17 lines × 3) examples/src/main/java/org/apache/spark/examples/ml/JavaLogisticRegressionSummaryExample.java:32 — examples/src/main/java/org/apache/spark/examples/ml/JavaLogisticRegressionSummaryExample.java:32-47 | examples/src/main/java/org/apache/spark/examples/ml/JavaLogisticRegressionWithElasticNetExample.java:30-46 | examples/src/main/java/org/apache/spark/examples/ml/JavaMulticlassLogisticRegressionWithElasticNetExample.java:31-47 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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.
D4 · Code Duplication · Duplicated block (15–16 lines × 3) · ×1
  • Duplicated block (15–16 lines × 3) examples/src/main/java/org/apache/spark/examples/mllib/JavaBinaryClassificationMetricsExample.java:35 — examples/src/main/java/org/apache/spark/examples/mllib/JavaBinaryClassificationMetricsExample.java:35-50 | examples/src/main/java/org/apache/spark/examples/mllib/JavaLogisticRegressionWithLBFGSExample.java:40-54 | examples/src/main/java/org/apache/spark/examples/mllib/JavaMulticlassClassificationMetricsExample.java:36-50 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `examples/src/main/java/org/apache/spark/examples/mllib/JavaBinaryClassificationMetricsExample.java:53` calls `clearThreshold` and `examples/src/main/java/org/apache/spark/examples/mllib/JavaLogisticRegressionWithLBFGSExample.java:57` 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 · Duplicated block (12–14 lines × 3) · ×1
  • Duplicated block (12–14 lines × 3) examples/src/main/java/org/apache/spark/examples/ml/JavaIndexToStringExample.java:44 — examples/src/main/java/org/apache/spark/examples/ml/JavaIndexToStringExample.java:44-55 | examples/src/main/java/org/apache/spark/examples/ml/JavaOneHotEncoderExample.java:42-55 | examples/src/main/java/org/apache/spark/examples/ml/JavaStringIndexerExample.java:41-52 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 `examples/src/main/java/org/apache/spark/examples/ml/JavaIndexToStringExample.java:44` 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.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×1
  • Duplicated block (12–13 lines × 2) examples/src/main/java/org/apache/spark/examples/ml/JavaVectorAssemblerExample.java:53 — examples/src/main/java/org/apache/spark/examples/ml/JavaVectorAssemblerExample.java:53-64 | examples/src/main/java/org/apache/spark/examples/ml/JavaVectorSizeHintExample.java:65-77 — before extracting anything, compare `examples/src/main/java/org/apache/spark/examples/ml/JavaVectorAssemblerExample.java` and `examples/src/main/java/org/apache/spark/examples/ml/JavaVectorSizeHintExample.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 2 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 `examples/src/main/java/org/apache/spark/examples/ml/JavaVectorAssemblerExample.java:53` 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.
D4 · Code Duplication · Duplicated block (11–12 lines × 4) · ×1
  • Duplicated block (11–12 lines × 4) examples/src/main/java/org/apache/spark/examples/ml/JavaIndexToStringExample.java:41 — examples/src/main/java/org/apache/spark/examples/ml/JavaIndexToStringExample.java:41-51 | examples/src/main/java/org/apache/spark/examples/ml/JavaOneHotEncoderExample.java:39-50 | examples/src/main/java/org/apache/spark/examples/ml/JavaQuantileDiscretizerExample.java:37-48 | examples/src/main/java/org/apache/spark/examples/ml/JavaStringIndexerExample.java:38-48 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 `examples/src/main/java/org/apache/spark/examples/ml/JavaIndexToStringExample.java:41` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `examples/src/main/java/org/apache/spark/examples/ml/JavaOneHotEncoderExample.java:50` calls `create` and `examples/src/main/java/org/apache/spark/examples/ml/JavaQuantileDiscretizerExample.java:48` 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.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×1
  • Duplicated block (11–12 lines × 2) examples/src/main/java/org/apache/spark/examples/ml/JavaModelSelectionViaCrossValidationExample.java:45 — examples/src/main/java/org/apache/spark/examples/ml/JavaModelSelectionViaCrossValidationExample.java:45-55 | examples/src/main/java/org/apache/spark/examples/ml/JavaPipelineExample.java:39-50 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `examples/src/main/java/org/apache/spark/examples/ml/JavaModelSelectionViaCrossValidationExample.java:45` 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.
D4 · Code Duplication · Duplicated block (10 lines × 6) · ×1
  • Duplicated block (10 lines × 6) examples/src/main/java/org/apache/spark/examples/ml/JavaDecisionTreeClassificationExample.java:54 — examples/src/main/java/org/apache/spark/examples/ml/JavaDecisionTreeClassificationExample.java:54-63 | examples/src/main/java/org/apache/spark/examples/ml/JavaDecisionTreeRegressionExample.java:46-55 | examples/src/main/java/org/apache/spark/examples/ml/JavaGradientBoostedTreeClassifierExample.java:55-64 | examples/src/main/java/org/apache/spark/examples/ml/JavaGradientBoostedTreeRegressorExample.java:47-56 | examples/src/main/java/org/apache/spark/examples/ml/JavaRandomForestClassifierExample.java:52-61 | examples/src/main/java/org/apache/spark/examples/ml/JavaRandomForestRegressorExample.java:47-56 — before extracting anything, compare `examples/src/main/java/org/apache/spark/examples/ml/JavaDecisionTreeClassificationExample.java` and `examples/src/main/java/org/apache/spark/examples/ml/JavaGradientBoostedTreeClassifierExample.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (6–9 lines × 7) · ×1
  • Duplicated block (6–9 lines × 7) examples/src/main/java/org/apache/spark/examples/mllib/JavaDecisionTreeClassificationExample.java:41 — examples/src/main/java/org/apache/spark/examples/mllib/JavaDecisionTreeClassificationExample.java:41-48 | examples/src/main/java/org/apache/spark/examples/mllib/JavaDecisionTreeRegressionExample.java:41-48 | examples/src/main/java/org/apache/spark/examples/mllib/JavaGradientBoostingClassificationExample.java:40-48 | examples/src/main/java/org/apache/spark/examples/mllib/JavaGradientBoostingRegressionExample.java:40-47 | examples/src/main/java/org/apache/spark/examples/mllib/JavaNaiveBayesExample.java:34-39 | examples/src/main/java/org/apache/spark/examples/mllib/JavaRandomForestClassificationExample.java:39-45 | examples/src/main/java/org/apache/spark/examples/mllib/JavaRandomForestRegressionExample.java:39-45 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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.
D4 · Code Duplication · Duplicated block (7–8 lines × 2) · ×1
  • Duplicated block (7–8 lines × 2) examples/src/main/java/org/apache/spark/examples/ml/JavaBinarizerExample.java:46 — examples/src/main/java/org/apache/spark/examples/ml/JavaBinarizerExample.java:46-52 | examples/src/main/java/org/apache/spark/examples/ml/JavaQuantileDiscretizerExample.java:47-54 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `examples/src/main/java/org/apache/spark/examples/ml/JavaBinarizerExample.java:46` 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, `examples/src/main/java/org/apache/spark/examples/ml/JavaQuantileDiscretizerExample.java:44` calls `create` and `examples/src/main/java/org/apache/spark/examples/ml/JavaBinarizerExample.java:44` 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 · Duplicated block (2–7 lines × 4) · ×1
  • Duplicated block (2–7 lines × 4) REDACTED:74 — REDACTED:74-80 | examples/src/main/java/org/apache/spark/examples/streaming/JavaDirectKafkaWordCount.java:90-97 | examples/src/main/java/org/apache/spark/examples/streaming/JavaNetworkWordCount.java:66-72 | examples/src/main/java/org/apache/spark/examples/streaming/JavaRecoverableNetworkWordCount.java:131-132 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 `REDACTED:74` 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.
D4 · Code Duplication · Duplicated block (5 lines × 5) · ×1
  • Duplicated block (5 lines × 5) examples/src/main/java/org/apache/spark/examples/ml/JavaBucketedRandomProjectionLSHExample.java:67 — examples/src/main/java/org/apache/spark/examples/ml/JavaBucketedRandomProjectionLSHExample.java:67-72 | examples/src/main/java/org/apache/spark/examples/ml/JavaMaxAbsScalerExample.java:51-55 | examples/src/main/java/org/apache/spark/examples/ml/JavaMinHashLSHExample.java:65-70 | examples/src/main/java/org/apache/spark/examples/ml/JavaMinMaxScalerExample.java:51-55 | examples/src/main/java/org/apache/spark/examples/ml/JavaNormalizerExample.java:50-54 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `examples/src/main/java/org/apache/spark/examples/ml/JavaBucketedRandomProjectionLSHExample.java:67` 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.
GD1 · Unfinished & placeholder code · Unfinished stub · ×1
  • Unfinished stub — body is a "not implemented" error sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/DriverWrapper.scala:40 — `getParentLogger` is a shipped member whose whole body is still a "not implemented" error, and nothing in the repository overrides it — generated scaffolding that was never completed. Implement it or remove the dead surface.
IC1 · Incompleteness & stubs · Unfinished stub · ×1
  • Unfinished stub — throws a "not implemented" exception sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/DriverWrapper.scala:40 — `getParentLogger` throws an exception whose message says it isn't finished — a not-implemented stub wearing an ordinary exception. Implement it or remove it.
R1 · Type Safety · Type Safety · ×1
  • Type Safety — 0 typed · 17 plain JS — the untyped files are core/src/main/resources/org/apache/spark/ui/static/additional-metrics.js, core/src/main/resources/org/apache/spark/ui/static/bootstrap-tooltip.js, core/src/main/resources/org/apache/spark/ui/static/dataTables.rowsGroup.js, core/src/main/resources/org/apache/spark/ui/static/executorspage.js, core/src/main/resources/org/apache/spark/ui/static/historypage-common.js, REDACTED (+11 more).
R10 · Code Duplication · Duplicated block (52 lines × 2 locations) · ×1
  • Duplicated block (52 lines × 2 locations) core/src/main/resources/org/apache/spark/ui/static/timeline-view.js:18 — core/src/main/resources/org/apache/spark/ui/static/timeline-view.js:18 · core/src/main/resources/org/apache/spark/ui/static/timeline-view.js:94 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (34 lines × 2 locations) · ×1
  • Duplicated block (34 lines × 2 locations) core/src/main/resources/org/apache/spark/ui/static/executorspage.js:387 — core/src/main/resources/org/apache/spark/ui/static/executorspage.js:387 · core/src/main/resources/org/apache/spark/ui/static/executorspage.js:483 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (21 lines × 2 locations) · ×1
  • Duplicated block (21 lines × 2 locations) core/src/main/resources/org/apache/spark/ui/static/stagepage.js:681 — core/src/main/resources/org/apache/spark/ui/static/stagepage.js:681 · core/src/main/resources/org/apache/spark/ui/static/stagepage.js:731 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block with local edits (17 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (17 matched lines × 2 locations) streaming/src/main/resources/org/apache/spark/streaming/ui/static/streaming-page.js:90 — streaming/src/main/resources/org/apache/spark/streaming/ui/static/streaming-page.js:90 · streaming/src/main/resources/org/apache/spark/streaming/ui/static/streaming-page.js:227 — the two spans are one implementation copied and then locally edited — 287 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (15 lines × 2 locations) · ×1
  • Duplicated block (15 lines × 2 locations) REDACTED:273 — REDACTED:273 · REDACTED:288 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (14 lines × 3 locations) · ×1
  • Duplicated block (14 lines × 3 locations) core/src/main/resources/org/apache/spark/ui/static/stagepage.js:763 — core/src/main/resources/org/apache/spark/ui/static/stagepage.js:763 · core/src/main/resources/org/apache/spark/ui/static/stagepage.js:777 · core/src/main/resources/org/apache/spark/ui/static/stagepage.js:801 — all 3 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (12 lines × 3 locations) · ×1
  • Duplicated block (12 lines × 3 locations) core/src/main/resources/org/apache/spark/ui/static/executorspage.js:42 — core/src/main/resources/org/apache/spark/ui/static/executorspage.js:42 · REDACTED:58 · REDACTED:73 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
R10 · Code Duplication · Duplicated block (11 lines × 2 locations) · ×1
  • Duplicated block (11 lines × 2 locations) core/src/main/resources/org/apache/spark/ui/static/stagepage.js:750 — core/src/main/resources/org/apache/spark/ui/static/stagepage.js:750 · core/src/main/resources/org/apache/spark/ui/static/stagepage.js:838 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block with local edits (10 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (10 matched lines × 2 locations) core/src/main/resources/org/apache/spark/ui/static/utils.js:139 — core/src/main/resources/org/apache/spark/ui/static/utils.js:139 · core/src/main/resources/org/apache/spark/ui/static/utils.js:167 — the two spans are one implementation copied and then locally edited — 74 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (8 lines × 2 locations) · ×1
  • Duplicated block (8 lines × 2 locations) REDACTED:65 — REDACTED:65 · REDACTED:80 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (7 lines × 4 locations) · ×1
  • Duplicated block (7 lines × 4 locations) core/src/main/resources/org/apache/spark/ui/static/stagepage.js:440 — core/src/main/resources/org/apache/spark/ui/static/stagepage.js:440 · core/src/main/resources/org/apache/spark/ui/static/stagepage.js:447 · core/src/main/resources/org/apache/spark/ui/static/stagepage.js:454 · core/src/main/resources/org/apache/spark/ui/static/stagepage.js:461 — 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.
R10 · Code Duplication · Duplicated block (5 lines × 4 locations) · ×1
  • Duplicated block (5 lines × 4 locations) core/src/main/resources/org/apache/spark/ui/static/additional-metrics.js:27 — core/src/main/resources/org/apache/spark/ui/static/additional-metrics.js:27 · core/src/main/resources/org/apache/spark/ui/static/timeline-view.js:76 · core/src/main/resources/org/apache/spark/ui/static/timeline-view.js:152 · core/src/main/resources/org/apache/spark/ui/static/timeline-view.js:219 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 19, cognitive 15) · ×1
  • Complex function (anonymous) (cyclomatic 19, cognitive 15) core/src/main/resources/org/apache/spark/ui/static/stagepage.js:501 — (anonymous) has cyclomatic complexity 19 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function getInnerText (cyclomatic 17, cognitive 19) · ×1
  • Complex function getInnerText (cyclomatic 17, cognitive 19) REDACTED:199 — getInnerText has cyclomatic complexity 17 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function makeSortable (cyclomatic 14, cognitive 22) · ×1
  • Complex function makeSortable (cyclomatic 14, cognitive 22) REDACTED:42 — makeSortable has cyclomatic complexity 14 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function show (cyclomatic 11, cognitive 12) · ×1
  • Complex function show (cyclomatic 11, cognitive 12) core/src/main/resources/org/apache/spark/ui/static/bootstrap-tooltip.js:114 — show has cyclomatic complexity 11 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R3 · Large Files · core/src/main/resources/org/apache/spark/ui/static/stagepage.js · ×1
  • core/src/main/resources/org/apache/spark/ui/static/stagepage.js: 896 lines of code core/src/main/resources/org/apache/spark/ui/static/stagepage.js:1 — core/src/main/resources/org/apache/spark/ui/static/stagepage.js has 896 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · core/src/main/resources/org/apache/spark/ui/static/spark-dag-viz.js · ×1
  • core/src/main/resources/org/apache/spark/ui/static/spark-dag-viz.js: 506 lines of code core/src/main/resources/org/apache/spark/ui/static/spark-dag-viz.js:1 — core/src/main/resources/org/apache/spark/ui/static/spark-dag-viz.js has 506 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · core/src/main/resources/org/apache/spark/ui/static/executorspage.js · ×1
  • core/src/main/resources/org/apache/spark/ui/static/executorspage.js: 498 lines of code core/src/main/resources/org/apache/spark/ui/static/executorspage.js:1 — core/src/main/resources/org/apache/spark/ui/static/executorspage.js has 498 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 446 lines of code REDACTED:1 — REDACTED has 446 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R7 · Dead Code · Dead file (~14 LoC) · ×1
  • Dead file (~14 LoC) index.js — no import path from any entry point (16 application, 0 tooling, 0 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Minor — 1996 finding(s)
D34 · Knowledge Freshness · Orphaned file · ×1823
  • Orphaned file python/pyspark/sql/functions.py: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 REDACTED: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 sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala: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 core/src/main/scala/org/apache/spark/SparkContext.scala: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 sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala: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 core/src/main/scala/org/apache/spark/util/Utils.scala: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 sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala: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 python/pyspark/rdd.py: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 core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala: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 python/pyspark/sql/dataframe.py: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 sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala: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 python/pyspark/ml/classification.py: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 core/src/main/scala/org/apache/spark/rdd/RDD.scala: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 sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/HyperLogLogPlusPlusHelper.scala: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 REDACTED: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 core/src/main/scala/org/apache/spark/storage/BlockManager.scala: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 sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala: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 sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeGenerator.scala: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 python/pyspark/ml/regression.py: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 mllib/src/main/scala/org/apache/spark/ml/recommendation/ALS.scala: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 mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala: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 sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala: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 sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/objects/objects.scala: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 resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala: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 python/pyspark/sql/types.py: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.
  • + 1798 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×40
  • Duplicated predicate sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:113 — `! hiveConf.getBoolVar(ConfVars.HIVE_SERVER2_ENABLE_DOAS) && hiveConf.getBoolVar(ConfVars.HIVE_SERVER2_MAP_FAIR_SCHEDULER_QUEUE)` appears character-identically in 2 files — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java, sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.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 sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java:445 — `!getConfOverlay().isEmpty() || shouldRunAsync()` appears character-identically in 2 files — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java, sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.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 sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/CLIService.java:463 — `!hiveConf.getBoolVar(HiveConf.ConfVars.METASTORE_USE_THRIFT_SASL) || !hiveConf.getBoolVar(HiveConf.ConfVars.HIVE_SERVER2_ENABLE_DOAS)` appears character-identically in 2 files — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/CLIService.java, sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.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 sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/Operation.java:198 — `!operationLogFile.canRead() || !operationLogFile.canWrite()` appears character-identically in 2 files — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/Operation.java, sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/Operation.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 sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:190 — `(httpServer != null) && httpServer.isStarted()` appears character-identically in 2 files — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java, sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.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 common/unsafe/src/main/java/org/apache/spark/unsafe/memory/HeapMemoryAllocator.java:86 — `(memory.pageNumber == MemoryBlock.NO_PAGE_NUMBER) || (memory.pageNumber == MemoryBlock.FREED_IN_TMM_PAGE_NUMBER)` appears character-identically in 2 files — common/unsafe/src/main/java/org/apache/spark/unsafe/memory/HeapMemoryAllocator.java, common/unsafe/src/main/java/org/apache/spark/unsafe/memory/UnsafeMemoryAllocator.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 sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetFunctionsOperation.java:99 — `(null == catalogName || "".equals(catalogName)) && (null == schemaName || "".equals(schemaName))` appears character-identically in 2 files — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetFunctionsOperation.java, sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/GetFunctionsOperation.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 sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeArrayData.java:338 — `(sizeInBytes == o.sizeInBytes) && ByteArrayMethods.arrayEquals(baseObject, baseOffset, o.baseObject, o.baseOffset, sizeInBytes)` appears character-identically in 2 files — sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeArrayData.java, sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeRow.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 common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/protocol/OpenBlocks.java:63 — `Objects.equal(appId, o.appId) && Objects.equal(execId, o.execId) && Arrays.equals(blockIds, o.blockIds)` appears character-identically in 2 files — common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/protocol/OpenBlocks.java, common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/protocol/RemoveBlocks.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 REDACTED:500 — `authHeader == null || authHeader.isEmpty()` appears character-identically in 2 files — REDACTED, REDACTED. 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 REDACTED:515 — `authHeaderBase64String == null || authHeaderBase64String.isEmpty()` appears character-identically in 2 files — REDACTED, REDACTED. 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 common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/ExternalShuffleBlockHandler.java:288 — `blockIdParts.length != 4 || !blockIdParts[0].equals("shuffle")` appears character-identically in 2 files — common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/ExternalShuffleBlockHandler.java, common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/OneForOneBlockFetcher.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 sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:348 — `cliService.getHiveConf().getBoolVar(ConfVars.HIVE_SERVER2_ENABLE_DOAS) && (userName != null)` appears character-identically in 2 files — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java, sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.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 sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetColumnsOperation.java:160 — `columnPattern != null && !columnPattern.matcher(column.getName()).matches()` appears character-identically in 2 files — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/GetColumnsOperation.java, sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/GetColumnsOperation.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 core/src/main/java/org/apache/spark/shuffle/sort/ShuffleExternalSorter.java:382 — `currentPage == null || pageCursor + required > currentPage.getBaseOffset() + currentPage.size()` appears character-identically in 2 files — core/src/main/java/org/apache/spark/shuffle/sort/ShuffleExternalSorter.java, core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeExternalSorter.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 sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java:401 — `fieldSchemas != null && !fieldSchemas.isEmpty()` appears character-identically in 2 files — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java, sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.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 sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/codegen/UnsafeArrayWriter.java:161 — `input != null && input.changePrecision(precision, scale)` appears character-identically in 2 files — sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/codegen/UnsafeArrayWriter.java, sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/codegen/UnsafeRowWriter.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 sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/HiveSQLException.java:157 — `m >= 0 && n >= 0 && trace[m].equals(parent[n])` appears character-identically in 2 files — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/HiveSQLException.java, sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/HiveSQLException.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 sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java:120 — `mResultSchema == null || !mResultSchema.isSetFieldSchemas()` appears character-identically in 2 files — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java, sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.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 common/network-common/src/main/java/org/apache/spark/network/crypto/TransportCipher.java:224 — `msg instanceof ByteBuf || msg instanceof FileRegion` appears character-identically in 2 files — common/network-common/src/main/java/org/apache/spark/network/crypto/TransportCipher.java, common/network-common/src/main/java/org/apache/spark/network/sasl/SaslEncryption.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 sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:675 — `name.startsWith(sessionID) && name.endsWith(".pipeout")` appears character-identically in 2 files — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java, sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.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 sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:399 — `null == ugi || !ugi.hasKerberosCredentials() || !ugi.getUserName().equals(principal) || !Objects.equals(keytab, getKeytabFromUgi())` appears character-identically in 2 files — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java, sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.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 sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/FixedLengthRowBasedKeyValueBatch.java:49 — `numRows >= capacity || page == null || page.size() - pageCursor < recordLength` appears character-identically in 2 files — sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/FixedLengthRowBasedKeyValueBatch.java, sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/VariableLengthRowBasedKeyValueBatch.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 sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/OperationManager.java:185 — `opState == OperationState.CANCELED || opState == OperationState.CLOSED || opState == OperationState.FINISHED || opState == OperationState.ER…` appears character-identically in 2 files — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/OperationManager.java, sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/OperationManager.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 sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/OperationManager.java:162 — `operation != null && operation.isTimedOut(System.currentTimeMillis())` appears character-identically in 2 files — sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/operation/OperationManager.java, sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/OperationManager.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.
  • + 15 more in this group — see findings.md.
X4 · Structured logging · Interpolated log message defeats structured logging · ×40
  • Interpolated log message defeats structured logging sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/AbstractService.java:89 — `info` 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.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 sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/AbstractService.java:104 — `info` at line 104 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 sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/AbstractService.java:125 — `info` at line 125 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 sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/CompositeService.java:74 — `error` 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.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 sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/CompositeService.java:104 — `info` at line 104 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 sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/CompositeService.java:127 — `info` 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.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 sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/CookieSigner.java:62 — `debug` at line 62 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 sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/CookieSigner.java:82 — `debug` at line 82 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 sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/ServiceOperations.java:133 — `warn` at line 133 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 sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/ServiceUtils.java:63 — `debug` at line 63 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 sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/server/HiveServer2.java:147 — `warn` at line 147 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 sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/server/HiveServer2.java:177 — `error` 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.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 sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/server/ThreadWithGarbageCleanup.java:58 — `debug` at line 58 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 sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/server/ThreadWithGarbageCleanup.java:72 — `debug` at line 72 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 sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java:100 — `info` at line 100 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 sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java:176 — `debug` at line 176 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 sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java:189 — `debug` at line 189 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 sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java:196 — `debug` at line 196 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 sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java:205 — `debug` at line 205 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 sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java:216 — `debug` at line 216 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 sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java:228 — `debug` at line 228 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 sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java:239 — `debug` at line 239 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 sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java:250 — `debug` at line 250 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 sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java:266 — `debug` at line 266 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 sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/CLIService.java:281 — `debug` at line 281 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.
  • + 15 more in this group — see findings.md.
IC1 · Incompleteness & stubs · Blanket warning suppression · ×21
  • Blanket warning suppression core/src/main/scala/org/apache/spark/InternalAccumulator.scala:46 — A bare `// scalastyle:off`, `// scalafix:off` or `@nowarn` (or Wartremover's `warts.All`) switches every rule or warning off — hidden debt. Suppress the specific rule on the specific line, with a justification, instead.
  • Blanket warning suppression core/src/main/scala/org/apache/spark/rdd/CheckpointRDD.scala:42 — A bare `// scalastyle:off`, `// scalafix:off` or `@nowarn` (or Wartremover's `warts.All`) switches every rule or warning off — hidden debt. Suppress the specific rule on the specific line, with a justification, instead.
  • Blanket warning suppression core/src/main/scala/org/apache/spark/serializer/KryoSerializer.scala:181 — A bare `// scalastyle:off`, `// scalafix:off` or `@nowarn` (or Wartremover's `warts.All`) switches every rule or warning off — hidden debt. Suppress the specific rule on the specific line, with a justification, instead.
  • Blanket warning suppression core/src/main/scala/org/apache/spark/ui/UIWorkloadGenerator.scala:28 — A bare `// scalastyle:off`, `// scalafix:off` or `@nowarn` (or Wartremover's `warts.All`) switches every rule or warning off — hidden debt. Suppress the specific rule on the specific line, with a justification, instead.
  • Blanket warning suppression core/src/main/scala/org/apache/spark/ui/exec/ExecutorThreadDumpPage.scala:68 — A bare `// scalastyle:off`, `// scalafix:off` or `@nowarn` (or Wartremover's `warts.All`) switches every rule or warning off — hidden debt. Suppress the specific rule on the specific line, with a justification, instead.
  • Blanket warning suppression core/src/main/scala/org/apache/spark/ui/jobs/StagePage.scala:720 — A bare `// scalastyle:off`, `// scalafix:off` or `@nowarn` (or Wartremover's `warts.All`) switches every rule or warning off — hidden debt. Suppress the specific rule on the specific line, with a justification, instead.
  • Blanket warning suppression core/src/main/scala/org/apache/spark/ui/jobs/StageTable.scala:319 — A bare `// scalastyle:off`, `// scalafix:off` or `@nowarn` (or Wartremover's `warts.All`) switches every rule or warning off — hidden debt. Suppress the specific rule on the specific line, with a justification, instead.
  • Blanket warning suppression core/src/main/scala/org/apache/spark/ui/storage/StoragePage.scala:77 — A bare `// scalastyle:off`, `// scalafix:off` or `@nowarn` (or Wartremover's `warts.All`) switches every rule or warning off — hidden debt. Suppress the specific rule on the specific line, with a justification, instead.
  • Blanket warning suppression external/kinesis-asl/src/main/scala/org/apache/spark/streaming/kinesis/KinesisUtils.scala:112 — A bare `// scalastyle:off`, `// scalafix:off` or `@nowarn` (or Wartremover's `warts.All`) switches every rule or warning off — hidden debt. Suppress the specific rule on the specific line, with a justification, instead.
  • Blanket warning suppression external/kinesis-asl/src/main/scala/org/apache/spark/streaming/kinesis/SparkAWSCredentials.scala:98 — A bare `// scalastyle:off`, `// scalafix:off` or `@nowarn` (or Wartremover's `warts.All`) switches every rule or warning off — hidden debt. Suppress the specific rule on the specific line, with a justification, instead.
  • Blanket warning suppression mllib/src/main/scala/org/apache/spark/ml/param/params.scala:86 — A bare `// scalastyle:off`, `// scalafix:off` or `@nowarn` (or Wartremover's `warts.All`) switches every rule or warning off — hidden debt. Suppress the specific rule on the specific line, with a justification, instead.
  • Blanket warning suppression mllib/src/main/scala/org/apache/spark/ml/param/shared/sharedParams.scala:25 — A bare `// scalastyle:off`, `// scalafix:off` or `@nowarn` (or Wartremover's `warts.All`) switches every rule or warning off — hidden debt. Suppress the specific rule on the specific line, with a justification, instead.
  • Blanket warning suppression mllib/src/main/scala/org/apache/spark/ml/r/GeneralizedLinearRegressionWrapper.scala:68 — A bare `// scalastyle:off`, `// scalafix:off` or `@nowarn` (or Wartremover's `warts.All`) switches every rule or warning off — hidden debt. Suppress the specific rule on the specific line, with a justification, instead.
  • Blanket warning suppression sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/DecimalPrecision.scala:28 — A bare `// scalastyle:off`, `// scalafix:off` or `@nowarn` (or Wartremover's `warts.All`) switches every rule or warning off — hidden debt. Suppress the specific rule on the specific line, with a justification, instead.
  • Blanket warning suppression sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/HyperLogLogPlusPlus.scala:26 — A bare `// scalastyle:off`, `// scalafix:off` or `@nowarn` (or Wartremover's `warts.All`) switches every rule or warning off — hidden debt. Suppress the specific rule on the specific line, with a justification, instead.
  • Blanket warning suppression sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/statsEstimation/JoinEstimation.scala:158 — A bare `// scalastyle:off`, `// scalafix:off` or `@nowarn` (or Wartremover's `warts.All`) switches every rule or warning off — hidden debt. Suppress the specific rule on the specific line, with a justification, instead.
  • Blanket warning suppression sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/trees/TreeNode.scala:80 — A bare `// scalastyle:off`, `// scalafix:off` or `@nowarn` (or Wartremover's `warts.All`) switches every rule or warning off — hidden debt. Suppress the specific rule on the specific line, with a justification, instead.
  • Blanket warning suppression sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/HyperLogLogPlusPlusHelper.scala:251 — A bare `// scalastyle:off`, `// scalafix:off` or `@nowarn` (or Wartremover's `warts.All`) switches every rule or warning off — hidden debt. Suppress the specific rule on the specific line, with a justification, instead.
  • Blanket warning suppression sql/core/src/main/scala/org/apache/spark/sql/SQLContext.scala:231 — A bare `// scalastyle:off`, `// scalafix:off` or `@nowarn` (or Wartremover's `warts.All`) switches every rule or warning off — hidden debt. Suppress the specific rule on the specific line, with a justification, instead.
  • Blanket warning suppression sql/core/src/main/scala/org/apache/spark/sql/SparkSession.scala:696 — A bare `// scalastyle:off`, `// scalafix:off` or `@nowarn` (or Wartremover's `warts.All`) switches every rule or warning off — hidden debt. Suppress the specific rule on the specific line, with a justification, instead.
  • Blanket warning suppression sql/core/src/main/scala/org/apache/spark/sql/execution/QueryExecution.scala:186 — A bare `// scalastyle:off`, `// scalafix:off` or `@nowarn` (or Wartremover's `warts.All`) switches every rule or warning off — hidden debt. Suppress the specific rule on the specific line, with a justification, instead.
IC1 · Incompleteness & stubs · Disabled test · ×18
  • Disabled test common/unsafe/src/test/scala/org/apache/spark/unsafe/types/UTF8StringPropertyCheckSuite.scala:225 — 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 core/src/test/scala/org/apache/spark/DriverSuite.scala:33 — 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 core/src/test/scala/org/apache/spark/deploy/SparkSubmitSuite.scala:604 — 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 core/src/test/scala/org/apache/spark/ui/UISuite.scala:75 — 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 core/src/test/scala/org/apache/spark/ui/UISuite.scala:89 — 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 core/src/test/scala/org/apache/spark/util/collection/ExternalSorterSuite.scala:102 — 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 core/src/test/scala/org/apache/spark/util/collection/SorterSuite.scala:209 — 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 core/src/test/scala/org/apache/spark/util/collection/SorterSuite.scala:261 — 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 external/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/DB2IntegrationSuite.scala:32 — 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 mllib/src/test/scala/org/apache/spark/ml/classification/LinearSVCSuite.scala:70 — 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 mllib/src/test/scala/org/apache/spark/ml/classification/LogisticRegressionSuite.scala:125 — 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 mllib/src/test/scala/org/apache/spark/ml/regression/AFTSurvivalRegressionSuite.scala:55 — 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 mllib/src/test/scala/org/apache/spark/ml/regression/GeneralizedLinearRegressionSuite.scala:130 — 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 mllib/src/test/scala/org/apache/spark/ml/regression/LinearRegressionSuite.scala:131 — 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 mllib/src/test/scala/org/apache/spark/ml/stat/SummarizerSuite.scala:534 — 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 mllib/src/test/scala/org/apache/spark/mllib/stat/CorrelationSuite.scala:136 — 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 sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/FilterPushdownSuite.scala:1034 — 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 sql/catalyst/src/test/scala/org/apache/spark/sql/types/DataTypeWriteCompatibilitySuite.scala:200 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
AX6 · Interface segregation · Fat interface · ×10
  • Fat interface: SessionManager (30 abstract methods) resource-managers/yarn/src/test/java/org/eclipse/jetty/server/SessionManager.java:37 — `SessionManager` declares 30 abstract methods: `access`, `addEventListener`, `clearEventListeners`, `complete`, `getClusterId`, `getDefaultSessionTrackingModes`, `getEffectiveSessionTrackingModes`, `getHttpOnly`, `getHttpSession`, `getMaxInactiveInterval`, `getMetaManager`, `getNodeId`, `getSessionCookie`, `getSessionCookieConfig`, `getSessionIdManager`, `getSessionIdPathParameterName`, `getSessionIdPathParameterNamePrefix`, `isCheckingRemoteSessionIdEncoding`, `isUsingCookies`, `isUsingURLs`, `isValid`, `newHttpSession`, `removeEventListener`, `renewSessionId`, `setCheckingRemoteSessionIdEncoding`, `setMaxInactiveInterval`, `setSessionHandler`, `setSessionIdManager`, `setSessionIdPathParameterName`, `setSessionTrackingModes`. 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: SpecializedGetters (16 abstract methods) sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/SpecializedGetters.java:28 — `SpecializedGetters` declares 16 abstract methods: `get`, `getArray`, `getBinary`, `getBoolean`, `getByte`, `getDecimal`, `getDouble`, `getFloat`, `getInt`, `getInterval`, `getLong`, `getMap`, `getShort`, `getStruct`, `getUTF8String`, `isNullAt`. 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: HiveSession (26 abstract methods) sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSession.java:28 — `HiveSession` declares 26 abstract methods: `cancelDelegationToken`, `cancelOperation`, `close`, `closeExpiredOperations`, `closeOperation`, `executeStatement`, `executeStatement`, `executeStatementAsync`, `executeStatementAsync`, `fetchResults`, `getCatalogs`, `getColumns`, `getCrossReference`, `getDelegationToken`, `getFunctions`, `getInfo`, `getMetaStoreClient`, `getNoOperationTime`, `getPrimaryKeys`, `getResultSetMetadata`, `getSchemas`, `getTableTypes`, `getTables`, `getTypeInfo`, `open`, `renewDelegationToken`. 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 26 declarations carry 24 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 24 operations clears the >15 bar on its own, so the row is about responsibilities, not signatures. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: HiveSessionBase (17 abstract methods) sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/session/HiveSessionBase.java:33 — `HiveSessionBase` declares 17 abstract methods: `getHiveConf`, `getIpAddress`, `getLastAccessTime`, `getOperationLogSessionDir`, `getPassword`, `getProtocolVersion`, `getSessionHandle`, `getSessionManager`, `getSessionState`, `getUserName`, `getUsername`, `isOperationLogEnabled`, `setIpAddress`, `setOperationLogSessionDir`, `setOperationManager`, `setSessionManager`, `setUserName`. 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: ICLIService (26 abstract methods) sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/ICLIService.java:28 — `ICLIService` declares 26 abstract methods: `cancelDelegationToken`, `cancelOperation`, `closeOperation`, `closeSession`, `executeStatement`, `executeStatement`, `executeStatementAsync`, `executeStatementAsync`, `fetchResults`, `fetchResults`, `getCatalogs`, `getColumns`, `getCrossReference`, `getDelegationToken`, `getFunctions`, `getInfo`, `getOperationStatus`, `getPrimaryKeys`, `getResultSetMetadata`, `getSchemas`, `getTableTypes`, `getTables`, `getTypeInfo`, `openSession`, `openSessionWithImpersonation`, `renewDelegationToken`. 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 26 declarations carry 23 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 23 operations clears the >15 bar on its own, so the row is about responsibilities, not signatures. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: HiveSession (22 abstract methods) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSession.java:28 — `HiveSession` declares 22 abstract methods: `cancelDelegationToken`, `cancelOperation`, `close`, `closeExpiredOperations`, `closeOperation`, `executeStatement`, `executeStatementAsync`, `fetchResults`, `getCatalogs`, `getColumns`, `getDelegationToken`, `getFunctions`, `getInfo`, `getMetaStoreClient`, `getNoOperationTime`, `getResultSetMetadata`, `getSchemas`, `getTableTypes`, `getTables`, `getTypeInfo`, `open`, `renewDelegationToken`. 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: HiveSessionBase (17 abstract methods) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionBase.java:33 — `HiveSessionBase` declares 17 abstract methods: `getHiveConf`, `getIpAddress`, `getLastAccessTime`, `getOperationLogSessionDir`, `getPassword`, `getProtocolVersion`, `getSessionHandle`, `getSessionManager`, `getSessionState`, `getUserName`, `getUsername`, `isOperationLogEnabled`, `setIpAddress`, `setOperationLogSessionDir`, `setOperationManager`, `setSessionManager`, `setUserName`. 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: ICLIService (22 abstract methods) sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/ICLIService.java:28 — `ICLIService` declares 22 abstract methods: `cancelDelegationToken`, `cancelOperation`, `closeOperation`, `closeSession`, `executeStatement`, `executeStatementAsync`, `fetchResults`, `fetchResults`, `getCatalogs`, `getColumns`, `getDelegationToken`, `getFunctions`, `getInfo`, `getOperationStatus`, `getResultSetMetadata`, `getSchemas`, `getTableTypes`, `getTables`, `getTypeInfo`, `openSession`, `openSessionWithImpersonation`, `renewDelegationToken`. 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 22 declarations carry 21 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 21 operations clears the >15 bar on its own, so the row is about responsibilities, not signatures. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: ExternalCatalog (38 abstract members) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/ExternalCatalog.scala:33 — `ExternalCatalog` declares 38 abstract members: `createDatabase`, `dropDatabase`, `alterDatabase`, `getDatabase`, `databaseExists`, `listDatabases`, `listDatabases`, `setCurrentDatabase`, `createTable`, `dropTable`, `renameTable`, `alterTable`, `alterTableDataSchema`, `alterTableStats`, `getTable`, `getTablesByName`, `tableExists`, `listTables`, `listTables`, `loadTable`, `loadPartition`, `loadDynamicPartitions`, `createPartitions`, `dropPartitions`, `renamePartitions`, `alterPartitions`, `getPartition`, `getPartitionOption`, `listPartitionNames`, `listPartitions`, `listPartitionsByFilter`, `createFunction`, `dropFunction`, `alterFunction`, `renameFunction`, `getFunction`, `functionExists`, `listFunctions`. Counted over its ABSTRACT members — a `def` with no body or a `val`/`var` with no initializer, once per signature; concrete members, private and protected members, and members of a companion `object` are not counted, because no implementer is forced to write them. Those 38 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: LogicalPlanVisitor[T] (19 abstract members) sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/LogicalPlanVisitor.scala:23 — `LogicalPlanVisitor[T]` declares 19 abstract members: `default`, `visitAggregate`, `visitDistinct`, `visitExcept`, `visitExpand`, `visitFilter`, `visitGenerate`, `visitGlobalLimit`, `visitIntersect`, `visitJoin`, `visitLocalLimit`, `visitPivot`, `visitProject`, `visitRepartition`, `visitRepartitionByExpr`, `visitSample`, `visitScriptTransform`, `visitUnion`, `visitWindow`. Counted over its ABSTRACT members — a `def` with no body or a `val`/`var` with no initializer, once per signature; concrete members, private and protected members, and members of a companion `object` 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.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×7
  • Projects may be oversized for their cohesion REDACTED:1 — `core` (105400 LoC, 501 module-visible types across 50 directories) overshoots its size bounds. 7 of 31 build unit(s) (Maven, Python) overshoot their size bounds, lowering Project Cohesion to 5.5/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
  • Projects may be oversized for their cohesion REDACTED:1 — `sql/core` (89802 LoC, 902 module-visible types across 64 directories) overshoots its size bounds. 7 of 31 build unit(s) (Maven, Python) overshoot their size bounds, lowering Project Cohesion to 5.5/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
  • Projects may be oversized for their cohesion REDACTED:1 — `sql/catalyst` (80928 LoC, 1377 module-visible types across 49 directories) overshoots its size bounds. 7 of 31 build unit(s) (Maven, Python) overshoot their size bounds, lowering Project Cohesion to 5.5/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
  • Projects may be oversized for their cohesion REDACTED:1 — `mllib` (66930 LoC, 622 module-visible types across 46 directories) overshoots its size bounds. 7 of 31 build unit(s) (Maven, Python) overshoot their size bounds, lowering Project Cohesion to 5.5/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
  • Projects may be oversized for their cohesion REDACTED:1 — `python` (45005 LoC, 545 module-visible types across 14 directories) overshoots its size bounds. 7 of 31 build unit(s) (Maven, Python) overshoot their size bounds, lowering Project Cohesion to 5.5/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
  • Projects may be oversized for their cohesion REDACTED:1 — `sql/hive-thriftserver` (24826 LoC, 169 module-visible types across 21 directories) overshoots its size bounds. 7 of 31 build unit(s) (Maven, Python) overshoot their size bounds, lowering Project Cohesion to 5.5/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
  • Projects may be oversized for their cohesion REDACTED:1 — `streaming` (16440 LoC, 72 module-visible types across 12 directories) overshoots its size bounds. 7 of 31 build unit(s) (Maven, Python) overshoot their size bounds, lowering Project Cohesion to 5.5/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D24 · Comment Value · redundant comment · ×5
  • redundant comment core/src/main/resources/org/apache/spark/ui/static/executorspage.js:99 — "Red if GC time over GCTimePercent of total time" repeats the code it sits on: 4 of its 5 words (gc, time, percent, total) are already in `return (totalGCTime > GCTimePercent * totalDuration) ?`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment streaming/src/main/resources/org/apache/spark/streaming/ui/static/streaming-page.js:36 — "Show a tooltip "text" for "node"" repeats the code it sits on: 4 of its 4 words (show, tooltip, text, node) are already in `function showBootstrapTooltip(node, text)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment streaming/src/main/resources/org/apache/spark/streaming/ui/static/streaming-page.js:42 — "Hide the tooltip for "node"" repeats the code it sits on: 3 of its 3 words (hide, tooltip, node) are already in `function hideBootstrapTooltip(node)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment streaming/src/main/resources/org/apache/spark/streaming/ui/static/streaming-page.js:309 — "Toggle the class of the arrow between open and closed" repeats the code it sits on: 5 of its 5 words (toggle, class, arrow, open, closed) are already in `$(this).find('.expand-input-rate-arrow').toggleClass('arrow-open').toggleClass('arrow-closed');`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment streaming/src/main/resources/org/apache/spark/streaming/ui/static/streaming-page.js:318 — "Toggle the class of the arrow between open and closed" repeats the code it sits on: 5 of its 5 words (toggle, class, arrow, open, closed) are already in `$(this).find('.expand-input-rate-arrow').toggleClass('arrow-open').toggleClass('arrow-closed');`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
D34 · Knowledge Freshness · Most significant orphaned file · ×3
  • Most significant orphaned file sql/core/src/main/scala/org/apache/spark/sql/functions.scala:1 — One of the orphaned files carrying the most lost knowledge — ranked by size weighted by the file's role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites.
  • Most significant orphaned file project/MimaExcludes.scala:1 — One of the orphaned files carrying the most lost knowledge — ranked by size weighted by the file's role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites.
  • Most significant orphaned file python/pyspark/ml/feature.py:1 — One of the orphaned files carrying the most lost knowledge — ranked by size weighted by the file's role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites.
D21 · Naming Consistency · `toJSON` spells `JSON` where 126 names in the project spell it `Json` · ×2
  • `toJSON` spells `JSON` where 126 names in the project spell it `Json` sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/trees/TreeNode.scala:669 — 126 of 128 names in project repository spell the token `Json` (126 of 128; unit: names in project repository containing `Json`). Peers: TestUtils.createTempJsonFile (core/src/main/scala/org/apache/spark/TestUtils.scala:320); MasterPage.renderJson (core/src/main/scala/org/apache/spark/deploy/master/ui/MasterPage.scala:39); RestSubmissionClient.postJson (core/src/main/scala/org/apache/spark/deploy/rest/RestSubmissionClient.scala:205); RestServlet.findUnknownFields(requestJson) (core/src/main/scala/org/apache/spark/deploy/rest/RestSubmissionServer.scala:148); SubmitRequestServlet.handleSubmit(requestMessageJson) (core/src/main/scala/org/apache/spark/deploy/rest/RestSubmissionServer.scala:285). Rename to `toJson`. [rule N6]
  • `toJSON` spells `JSON` where 126 names in the project spell it `Json` sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala:3152 — 126 of 128 names in project repository spell the token `Json` (126 of 128; unit: names in project repository containing `Json`). Peers: TestUtils.createTempJsonFile (core/src/main/scala/org/apache/spark/TestUtils.scala:320); MasterPage.renderJson (core/src/main/scala/org/apache/spark/deploy/master/ui/MasterPage.scala:39); RestSubmissionClient.postJson (core/src/main/scala/org/apache/spark/deploy/rest/RestSubmissionClient.scala:205); RestServlet.findUnknownFields(requestJson) (core/src/main/scala/org/apache/spark/deploy/rest/RestSubmissionServer.scala:148); SubmitRequestServlet.handleSubmit(requestMessageJson) (core/src/main/scala/org/apache/spark/deploy/rest/RestSubmissionServer.scala:285). Rename to `toJson`. [rule N6]
D21 · Naming Consistency · `toDS` spells `DS` where 28 names in the project spell it `Ds` · ×2
  • `toDS` spells `DS` where 28 names in the project spell it `Ds` sql/core/src/main/scala/org/apache/spark/sql/DatasetHolder.scala:38 — 28 of 30 names in project repository spell the token `Ds` (28 of 30; unit: names in project repository containing `Ds`). Peers: SparkContext.getPersistentRDDs (core/src/main/scala/org/apache/spark/SparkContext.scala:1726); JavaSparkContext.getPersistentRDDs (core/src/main/scala/org/apache/spark/api/java/JavaSparkContext.scala:726); DAGScheduler.traverseParentRDDsWithinStage (core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala:530); org.apache.spark.examples.mllib.SampledRDDs (examples/src/main/scala/org/apache/spark/examples/mllib/SampledRDDs.scala:33); GraphImpl.fromExistingRDDs (graphx/src/main/scala/org/apache/spark/graphx/impl/GraphImpl.scala:343). Rename to `toDs`. [rule N6]
  • `toDS` spells `DS` where 28 names in the project spell it `Ds` sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/memory.scala:56 — 28 of 30 names in project repository spell the token `Ds` (28 of 30; unit: names in project repository containing `Ds`). Peers: SparkContext.getPersistentRDDs (core/src/main/scala/org/apache/spark/SparkContext.scala:1726); JavaSparkContext.getPersistentRDDs (core/src/main/scala/org/apache/spark/api/java/JavaSparkContext.scala:726); DAGScheduler.traverseParentRDDsWithinStage (core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala:530); org.apache.spark.examples.mllib.SampledRDDs (examples/src/main/scala/org/apache/spark/examples/mllib/SampledRDDs.scala:33); GraphImpl.fromExistingRDDs (graphx/src/main/scala/org/apache/spark/graphx/impl/GraphImpl.scala:343). Rename to `toDs`. [rule N6]
D21 · Naming Consistency · `getServerIPAddress` spells `IP` where 24 names in the project spell it `Ip` · ×2
  • `getServerIPAddress` spells `IP` where 24 names in the project spell it `Ip` sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:207 — 24 of 26 names in project spark-hive-thriftserver_2.12 spell the token `Ip` (24 of 26; unit: names in project spark-hive-thriftserver_2.12 containing `Ip`). Peers: HiveAuthFactory.getIpAddress (sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:217); org.apache.hive.service.auth.TSetIpAddressProcessor (sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/TSetIpAddressProcessor.java:40); TSetIpAddressProcessor.setIpAddress (sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/TSetIpAddressProcessor.java:68); TSetIpAddressProcessor.getUserIpAddress (sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/TSetIpAddressProcessor.java:107); HiveSessionBase.getIpAddress (sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionBase.java:85). Rename to `getServerIpAddress`. [rule N6]
  • `getServerIPAddress` spells `IP` where 24 names in the project spell it `Ip` sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java:208 — 24 of 26 names in project spark-hive-thriftserver_2.12 spell the token `Ip` (24 of 26; unit: names in project spark-hive-thriftserver_2.12 containing `Ip`). Peers: HiveAuthFactory.getIpAddress (sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java:217); org.apache.hive.service.auth.TSetIpAddressProcessor (sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/TSetIpAddressProcessor.java:40); TSetIpAddressProcessor.setIpAddress (sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/TSetIpAddressProcessor.java:68); TSetIpAddressProcessor.getUserIpAddress (sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/auth/TSetIpAddressProcessor.java:107); HiveSessionBase.getIpAddress (sql/hive-thriftserver/v1.2.1/src/main/java/org/apache/hive/service/cli/session/HiveSessionBase.java:85). Rename to `getServerIpAddress`. [rule N6]
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D19 · Documentation Quality · Documentation · ×1
  • Documentation: no build, run or usage example python/README.md:1 — `python` is a published distribution (`setup()` in `REDACTED`) and neither `python/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found main.go:2 — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`. ADRs are expected here because `main.go` makes this repository a deployable product (line 2).
D21 · Naming Consistency · `getClassFileInputStreamFromSparkRPC` spells `RPC` where 23 names in the project spell it `Rpc` · ×1
  • `getClassFileInputStreamFromSparkRPC` spells `RPC` where 23 names in the project spell it `Rpc` repl/src/main/scala/org/apache/spark/repl/ExecutorClassLoader.scala:133 — 23 of 24 names in project repository spell the token `Rpc` (23 of 24; unit: names in project repository containing `Rpc`). Peers: Master.startRpcEnvAndEndpoint (core/src/main/scala/org/apache/spark/deploy/master/Master.scala:1072); Worker.startRpcEnvAndEndpoint (core/src/main/scala/org/apache/spark/deploy/worker/Worker.scala:821); org.apache.spark.network.netty.NettyBlockRpcServer (core/src/main/scala/org/apache/spark/network/netty/NettyBlockRpcServer.scala:41); org.apache.spark.rpc.ThreadSafeRpcEndpoint (core/src/main/scala/org/apache/spark/rpc/RpcEndpoint.scala:148); RpcTimeout.createRpcTimeoutException (core/src/main/scala/org/apache/spark/rpc/RpcTimeout.scala:46). Rename to `getClassFileInputStreamFromSparkRpc`. [rule N6]
D21 · Naming Consistency · `runSQLonFile` spells `SQ` where 22 names in the project spell it `Sq` · ×1
  • `runSQLonFile` spells `SQ` where 22 names in the project spell it `Sq` sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala:2132 — 22 of 23 names in project repository spell the token `Sq` (22 of 23; unit: names in project repository containing `Sq`). Peers: org.apache.spark.examples.ml.ChiSqSelectorExample (examples/src/main/scala/org/apache/spark/examples/ml/ChiSqSelectorExample.scala:27); org.apache.spark.examples.mllib.ChiSqSelectorExample (examples/src/main/scala/org/apache/spark/examples/mllib/ChiSqSelectorExample.scala:30); org.apache.spark.ml.feature.ChiSqSelectorParams (mllib/src/main/scala/org/apache/spark/ml/feature/ChiSqSelector.scala:41); org.apache.spark.ml.feature.ChiSqSelector (mllib/src/main/scala/org/apache/spark/ml/feature/ChiSqSelector.scala:156); org.apache.spark.ml.feature.ChiSqSelector (mllib/src/main/scala/org/apache/spark/ml/feature/ChiSqSelector.scala:235). Rename to `runSqLonFile`. [rule N6]
D21 · Naming Consistency · `bitwiseOR` spells `OR` where 77 names in the project spell it `Or` · ×1
  • `bitwiseOR` spells `OR` where 77 names in the project spell it `Or` sql/core/src/main/scala/org/apache/spark/sql/Column.scala:1166 — 77 of 78 names in project repository spell the token `Or` (77 of 78; unit: names in project repository containing `Or`). Peers: SparkContext.getOrCreate (core/src/main/scala/org/apache/spark/SparkContext.scala:2483); SparkContext.getOrCreate (core/src/main/scala/org/apache/spark/SparkContext.scala:2507); BasePythonRunner.newReaderIterator(releasedOrClosed) (core/src/main/scala/org/apache/spark/api/python/PythonRunner.scala:154); PythonRunner.newReaderIterator(releasedOrClosed) (core/src/main/scala/org/apache/spark/api/python/PythonRunner.scala:573); CoarseGrainedExecutorBackend.parseOrFindResources (core/src/main/scala/org/apache/spark/executor/CoarseGrainedExecutorBackend.scala:91). Rename to `bitwiseOr`. [rule N6]
D21 · Naming Consistency · `bitwiseAND` spells `AND` where 218 names in the project spell it `And` · ×1
  • `bitwiseAND` spells `AND` where 218 names in the project spell it `And` sql/core/src/main/scala/org/apache/spark/sql/Column.scala:1177 — 218 of 219 names in project repository spell the token `And` (218 of 219; unit: names in project repository containing `And`). Peers: BarrierCoordinator.receiveAndReply (core/src/main/scala/org/apache/spark/BarrierCoordinator.scala:201); ExecutorAllocationManager.updateAndSyncNumExecutorsTarget (core/src/main/scala/org/apache/spark/ExecutorAllocationManager.scala:305); HeartbeatReceiver.receiveAndReply (core/src/main/scala/org/apache/spark/HeartbeatReceiver.scala:106); MapOutputTrackerMasterEndpoint.receiveAndReply (core/src/main/scala/org/apache/spark/MapOutputTracker.scala:226); SparkContext.killAndReplaceExecutor (core/src/main/scala/org/apache/spark/SparkContext.scala:1673). Rename to `bitwiseAnd`. [rule N6]
D21 · Naming Consistency · `hasPythonUdfOverAggregate` spells `Udf` where 18 names in the project spell it `UDF` · ×1
  • `hasPythonUdfOverAggregate` spells `Udf` where 18 names in the project spell it `UDF` sql/core/src/main/scala/org/apache/spark/sql/execution/python/ExtractPythonUDFs.scala:46 — 18 of 19 names in project repository spell the token `UDF` (18 of 19; unit: names in project repository containing `UDF`). Peers: org.apache.spark.sql.catalyst.analysis.Analyzer.HandleNullInputsForUDF (sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala:2195); org.apache.spark.sql.catalyst.expressions.PythonUDF (sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/PythonUDF.scala:27); PythonUDF.isScalarPythonUDF (sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/PythonUDF.scala:34); PythonUDF.isGroupedAggPandasUDF (sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/PythonUDF.scala:38); PythonUDF.isWindowPandasUDF (sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/PythonUDF.scala:45). Rename to `hasPythonUDFOverAggregate`. [rule N6]
D21 · Naming Consistency · `bitwiseNOT` spells `NOT` where 76 names in the project spell it `Not` · ×1
  • `bitwiseNOT` spells `NOT` where 76 names in the project spell it `Not` sql/core/src/main/scala/org/apache/spark/sql/functions.scala:1274 — 76 of 77 names in project repository spell the token `Not` (76 of 77; unit: names in project repository containing `Not`). Peers: SparkContext.assertNotStopped (core/src/main/scala/org/apache/spark/SparkContext.scala:91); org.apache.spark.TaskNotSerializableException (core/src/main/scala/org/apache/spark/TaskNotSerializableException.scala:23); TestUtils.assertNotSpilled (core/src/main/scala/org/apache/spark/TestUtils.scala:192); org.apache.spark.rpc.RpcEndpointNotFoundException (core/src/main/scala/org/apache/spark/rpc/RpcEndpointNotFoundException.scala:21); org.apache.spark.storage.BlockNotFoundException (core/src/main/scala/org/apache/spark/storage/BlockNotFoundException.scala:20). Rename to `bitwiseNot`. [rule N6]
D28 · Secrets (history) · Rotate the exposed credentials · ×1
  • REDACTED
D34 · Knowledge Freshness · Dormant codebase · ×1
  • Dormant codebase — 1826 of 1826 significant files have no living knowledge — the codebase as a whole is dormant, not 1826 separate risks. Counted over 1826 of the 2532 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over. Re-engage owners or document before change.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M2 · Architecture documentation · No ADRs · ×1
  • 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.
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 13/23 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `.`, `.`, `.`, `dev` and 5 more.
P3 · Security & performance tooling · No dependency-update automation · ×1
  • No dependency-update automation REDACTED:280 — `REDACTED` 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`.
P6 · Release Hygiene · No changelog · ×1
  • No changelog — No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
X5 · Nullable reference types · Scala's null is not held to the type system everywhere · ×1
  • Scala's null is not held to the type system everywhere — No build over this repository's 1854 Scala product file(s) passes `-Yexplicit-nulls`, enables WartRemover's `Null` wart or runs Scalafix's `DisableSyntax.noNulls`, so every reference type admits null and nothing reports a `null` written into the code or returned from a Java API — the first one to reach a method call is a `NullPointerException`. `Option` by convention is a habit no tool here holds the code to.
X7 · Silent fallback defaults · Silent fallback default on parse failure · ×1
  • Silent fallback default on parse failure core/src/main/scala/org/apache/spark/ui/SparkUI.scala:86 — `getSparkUser` answers `"<unknown>"` when `NoSuchElementException` is thrown, with no log or throw — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch case or in the Scaladoc, and the row stops firing.
X7 · Silent fallback defaults · Silent fallback default in catch · ×1
  • Silent fallback default in catch common/network-common/src/main/java/org/apache/spark/network/util/NettyMemoryMetrics.java:124 — `registerArenaMetric` swallows every exception into `return -1` — 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.

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.

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=0 --max-count=200" --report-format json --report-path /tmp/watchdog-gitleaks-725e3c4f93dc46c8bea1bd6647b3b572/history.json --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=200 --max-count=800" --report-format json --report-path /tmp/watchdog-gitleaks-725e3c4f93dc46c8bea1bd6647b3b572/history-1.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-1.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=1000 --max-count=3200" --report-format json --report-path /tmp/watchdog-gitleaks-725e3c4f93dc46c8bea1bd6647b3b572/history-2.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-2.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=4200 --max-count=12800" --report-format json --report-path /tmp/watchdog-gitleaks-725e3c4f93dc46c8bea1bd6647b3b572/history-3.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-3.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=17000 --max-count=17509" --report-format json --report-path /tmp/watchdog-gitleaks-725e3c4f93dc46c8bea1bd6647b3b572/history-4.json --exit-code 0 --source .2artifacts/raw/gitleaks-history-4.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-725e3c4f93dc46c8bea1bd6647b3b572/tree.json --exit-code 0 --source .0artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/canine-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt --exclude sql/core/src/test/gen-java --exclude sql/hive-thriftserver/v1.2.1/src/gen --exclude sql/hive-thriftserver/v2.3.5/src/gen .75artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .118artifacts/raw/osv-scanner.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .10artifacts/raw/trivy-config.json
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 36 file(s) — `Main.java`, `core/src/main/scala/org/apache/spark/deploy/history/HistoryPage.scala`, `core/src/main/scala/org/apache/spark/deploy/history/HistoryServer.scala`, `core/src/main/scala/org/apache/spark/deploy/master/ui/ApplicationPage.scala`, `core/src/main/scala/org/apache/spark/deploy/master/ui/MasterPage.scala`, … (+31 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.0—
D37 · Vulnerability-disclosure Policydisclosure—disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.0—
D40 · Network Egress Confinementruntime-hardening—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.0—
D41 · Kernel & Syscall Confinementruntime-hardening—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.0—
D42 · Runtime Threat Enforcementruntime-hardening—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.0—
D43 · Malicious Dependenciesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .0artifacts/raw/osv-scanner.json

Run 01a1eb60-baf6-743f-a900-bc84b115cce1 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

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.

⬇ Findings, MITRE CWE-tagged .sarif⬇ Health changelog .md