Public report of opensearch-project/sql, 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, 20:39 UTC · Survey ID cd_8244a507d72b46b2a8a26ab150d6c350

opensearch-project/sql

Measured 17 November 2026, 20:38 UTC, at code version 0e71902

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

Supply-chain provenance & signing is not measured: Supply-chain provenance is not scored (this pipeline releases no artifact), but its build steps or GitHub Actions workflows have integrity defects, or nothing watches its dependency set for published advisories.

CAI score 69.1out of 100 Adequate
CriticalWeakAdequateStrongExemplary

The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.

A large codebase: 157,244 lines of product code in 21 projects, tests not counted · Estimated rebuild effort: about 4.3 person-years · Weakest lens: Code Health, 57.7

Findings by how serious they are

34 critical 1361 serious 426 minor

11 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, 20:38 UTC

A measurement, not a certificate. The Code Assurance Index records a number together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that implements it, and today the Canine Code Analyzer is the only one that does.

The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸

61of 61 dimensions measured by tools.
1810of 1821 findings point to an exact file and line, so you can open each one in the code. The other 11 concern the repository as a whole, such as missing documentation.
61dimensions across 6 lenses, read from 157,244 lines of product code in 21 projects.
Chapters

Executive summary

opensearch-project/sql falls short of our standard for production, held back most by its Code Health lens, the quality of the code itself. It scores 69.1 out of 100 and is rated Adequate, and 16 of its 34 critical findings are security problems.

Code Health, at 57.7, is the weakest lens and counts most in the score. The best first step is declaring which values may be missing, worth about 8.4 points. Writing log messages as searchable templates is another step, worth about 2.7 points. Raising Code Health to 70 would lift the score to about 74.8.

Seven pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Three pipeline steps run downloads nobody checks, and eleven parts of the code are no longer understood by anyone working on it. Pinning each tool to an exact version, checking each download against a checksum and having someone learn the forgotten files would close these risks. Reading outside data into plain values would fix the two places where outside data is turned straight into objects, and limiting each secret to its own step would deal with the two secrets exposed to more of the pipeline than needed. The five tests the project itself marks as unreliable need fixing or deleting.

The product code is 157,244 lines, about €630,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 57.7 · counts for 46%Maturity 75.6 · counts for 25%Production Readiness 78.2 · counts for 14%Security and Compliance 79.8 · counts for 8%Performance 91.4 · counts for 4%Architecture 94.1 · counts for 2%

If Code Health rose from 57.7 to 70, the lowest score rated Strong, the score would rise from 69.1 to about 74.8.

Code composition: what the lines of code are
Product code 38%Tests 62%
Rebuild cost: about €630,000 · Estimate
Cost to rebuild€210,000 to €1,100,000, for 3,495 to 11,088 hours of work, about 4.3 person-years for 2 to 9 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×1.0 at a score of 69. 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.
SizeLarge: 157,244 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
Declare the default where Java declares it: `@NullMarked` (org.jspecify.annotations) in each package's `package-info.java`, or once in `module-info.java`, and run NullAway (Error Prone) or the Checker Framework so the declaration is enforced.
Then annotate the real exceptions `@Nullable` and resolve the suppressions rather than adding to them: a `@SuppressWarnings("NullAway")` or `castToNonNull(x)` on a value the checker could show to be null is a `NullPointerException` waiting for the path that makes it true — where the value genuinely cannot be null, say something the checker can see instead (a null check, `Objects.requireNonNull`, a non-null field initialised in the constructor).
Raises the score by about 8.4 points · Medium effort · Nullable reference types
2
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with build.gradle.
Raises the score by about 2.0 points · Low effort · ADR Quality
3
Interpolated log message defeats structured logging
Raises the score by about 2.7 points · Medium effort · Structured logging

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 €630,000 to build again, about 4.3 person-years of work. Its weakest lens is Code Health, at 57.7 (Adequate). Code Health is about how easy the code is to read and change safely, and code that is hard to read is slow and risky to change, so every future change costs more than it should. Because the weakest lens counts most in the score, work on Code Health also moves the score most.
Based on: the rebuild estimate · the Code Health grade · how much each lens counts
What to do: Start with the Code Health actions in Top priorities.
If you do one thing first · First action
Declare the default where Java declares it: `@NullMarked` (org.jspecify.annotations) in each package's `package-info.java`, or once in `module-info.java`, and run NullAway (Error Prone) or the Checker Framework so the declaration is enforced. Of all the actions in this report, it raises the score most for the work it takes: about 8.4 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.4 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 2% to 5% on every change. The history of the code shows how much it changes: about 45,804 lines over the last 90 days, which is about 185,761 lines a year. At that pace, the extra work comes to an estimated 9.3 to 61.9 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture — module dependency graph

Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.

arch :api :api :ppl :ppl :api->:ppl :sql :sql :api->:sql :async-query :async-query :async-query-core :async-query-core :async-query->:async-query-core :core :core :async-query->:core :datasources :datasources :async-query->:datasources :legacy :legacy :async-query->:legacy :protocol :protocol :async-query->:protocol :async-query-core->:core :common :common :core->:common :datasources->:core :datasources->:legacy :opensearch :opensearch :datasources->:opensearch :datasources->:protocol :direct-query :direct-query :direct-query->:async-query-core :direct-query->:core :direct-query->:datasources :direct-query-core :direct-query-core :direct-query->:direct-query-core :direct-query->:opensearch :direct-query->:protocol :direct-query-core->:async-query-core :direct-query-core->:core :direct-query-core->:datasources :doctest :doctest :integ-test :integ-test :language-grammar :language-grammar :legacy->:common :legacy->:opensearch :legacy->:sql :opensearch->:core :ppl-rest-spi :ppl-rest-spi :opensearch->:ppl-rest-spi :plugin :plugin :plugin->:api :plugin->:async-query :plugin->:datasources :plugin->:direct-query :plugin->:legacy :plugin->:opensearch :plugin->:ppl :prometheus :prometheus :plugin->:prometheus :ppl->:common :ppl->:core :ppl->:protocol :prometheus->:core :prometheus->:datasources :prometheus->:direct-query-core :protocol->:core :protocol->:opensearch :spark :spark :sql->:common :sql->:core :sql->:protocol __more__ +1 more projects

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.

320 modules, with 1073 dependencies between them. 8 loops run through 81 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 280 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 common.setting2 data.type3 expression.env4 ast.tree5 data.model6 legacy.query7 legacy.query.planner.physical8 protocol.response.format9 ast.statement10 expression.aggregation11 legacy.executor12 expression13 legacy.domain14 legacy.query.planner.core15 planner.physical16 planner17 planner.logical18 executor.execution19 storage20 datasource.model21 opensearch.storage.scan22 datasource23 spark.dispatcher.model24 executor25 calcite26 spark.asyncquery.model27 expression.function28 spark.dispatcher29 ast.expression30 opensearch.storage31 prometheus.storage32 spark.transport.config33 ast34 opensearch.request35 analysis36 opensearch.client37 opensearch.executor38 plugin.config39 plugin.transport40 plugin.rest
1 common.setting
2 data.type
3 expression.env
4 ast.tree284681
5 data.model191
6 legacy.query121
7 legacy.query.planner.physical5
8 protocol.response.format21
9 ast.statement2124
10 expression.aggregation12126124
11 legacy.executor81
12 expression76845
13 legacy.domain1
14 legacy.query.planner.core22
15 planner.physical3122723221
16 planner22262
17 planner.logical22219155
18 executor.execution6384311
19 storage13231
20 datasource.model1
21 opensearch.storage.scan331813024114
22 datasource2
23 spark.dispatcher.model12
24 executor1141231202111161
25 calcite2160221214
26 spark.asyncquery.model1112
27 expression.function1521021112
28 spark.dispatcher212416
29 ast.expression10145
30 opensearch.storage621132154311737
31 prometheus.storage13122731
32 spark.transport.config113
33 ast65334
34 opensearch.request161121
35 analysis215611712215487
36 opensearch.client3
37 opensearch.executor2111121921
38 plugin.config1111312
39 plugin.transport148111
40 plugin.rest11113114
Uses a module listed above itPart of a loopThe module itself
1 common.setting2 data.type3 expression.env4 ast.tree5 data.model6 legacy.query7 legacy.query.planner.physical8 protocol.response.format9 ast.statement10 expression.aggregation11 legacy.executor12 expression13 legacy.domain14 legacy.query.planner.core15 planner.physical16 planner17 planner.logical18 executor.execution19 storage20 datasource.model21 opensearch.storage.scan22 datasource23 spark.dispatcher.model24 executor25 calcite26 spark.asyncquery.model27 expression.function28 spark.dispatcher29 ast.expression30 opensearch.storage31 prometheus.storage32 spark.transport.config33 ast34 opensearch.request35 analysis36 opensearch.client37 opensearch.executor38 plugin.config39 plugin.transport40 plugin.restcommon.setting1data.type2expression.env3ast.tree4data.model5legacy.query6legacy.query.planner.physical7protocol.response.format8ast.statement9expression.aggregation10legacy.executor11expression12legacy.domain13legacy.query.planner.core14planner.physical15planner16planner.logical17executor.execution18storage19datasource.model20opensearch.storage.scan21datasource22spark.dispatcher.model23executor24calcite25spark.asyncquery.model26expression.function27spark.dispatcher28ast.expression29opensearch.storage30prometheus.storage31spark.transport.config32ast33opensearch.request34analysis35opensearch.client36opensearch.executor37plugin.config38plugin.transport39plugin.rest402846811911215212124121261248176845122312272322122262222191556384311132311331813024114212114123120211116121602212141112152102111221241610145621132154311737131227311136533416112121561171221548732111121921111131214811111113114+280 more modules (most-connected shown)

At a glance — Code Health · 57.7 · Adequate · gated by X5 ·

At a glance — Architecture · 94.1 · Exemplary ·

At a glance — Maturity · 75.6 · Strong ·

At a glance — Readiness · 78.2 · Strong ·

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

At a glance — Performance · 91.4 · 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
A05:2025 — Injection20High / Critical

Roadmap

Top priorities: Declare the default where Java declares it: `@NullMarked` (org.jspecify.annotations) in each package's `package-info.java`, or once in `module-info.java`, and run NullAway (Error Prone) or the Checker Framework so the declaration is enforced. Then annotate the real exceptions `@Nullable` and resolve the suppressions rather than adding to them: a `@SuppressWarnings("NullAway")` or `castToNonNull(x)` on a value the checker could show to be null is a `NullPointerException` waiting for the path that makes it true — where the value genuinely cannot be null, say something the checker can see instead (a null check, `Objects.requireNonNull`, a non-null field initialised in the constructor); Interpolated log message defeats structured logging; Resolve the 1 No ADRs found finding(s) in ADR Quality — start with build.gradle.

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

Do thisHelpsEffortDimension
Declare the default where Java declares it: `@NullMarked` (org.jspecify.annotations) in each package's `package-info.java`, or once in `module-info.java`, and run NullAway (Error Prone) or the Checker Framework so the declaration is enforced. Then annotate the real exceptions `@Nullable` and resolve the suppressions rather than adding to them: a `@SuppressWarnings("NullAway")` or `castToNonNull(x)` on a value the checker could show to be null is a `NullPointerException` waiting for the path that makes it true — where the value genuinely cannot be null, say something the checker can see instead (a null check, `Objects.requireNonNull`, a non-null field initialised in the constructor).+8.4 ptsMediumNullable reference types
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with build.gradle.+2.0 ptsLowADR Quality
Interpolated log message defeats structured logging+2.7 ptsMediumStructured logging
Swallowed exception (caught, then discarded)+1.8 ptsMediumException handling
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.+1.6 ptsMediumArchitecture documentation
Resolve the 11 Orphaned knowledge finding(s) in Knowledge Freshness — start with DateTimeFunctions.java, SQLFunctions.java, ExtendedRelJson.java.+1.1 ptsMediumKnowledge Freshness
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.+1.0 ptsMediumDeployment & Rollback
Resolve the 240 Orphaned file finding(s) in Knowledge Freshness — start with build.gradle (5), DateTimeFormatterUtil.java, OpenSearchDateType.java.+1.4 ptsHighKnowledge Freshness

File quality

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

FileScoreBandWorst signal
integ-test/src/test/java/org/opensearch/sql/ppl/ExplainIT.java3.9SlopTest Reliability: Test declared unreliable: testFilterScriptPushDownExplain
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
plugin/src/main/java/org/opensearch/sql/plugin/request/PPLQueryRequestFactory.java4.7MixedChange Coupling: Boundary-crossing change coupling: PPLQueryRequestFactory.java ↔ PPLService.java
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.7MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.8MixedStatic Analysis (SAST): High: REDACTED
legacy/src/main/java/org/opensearch/sql/legacy/query/maker/Maker.java6.0MixedExplicit Debt: TodoComment
legacy/src/main/java/org/opensearch/sql/legacy/domain/hints/HintFactory.java6.0MixedExplicit Debt: TodoComment
opensearch/src/main/java/org/opensearch/sql/opensearch/request/AggregateAnalyzer.java6.0MixedExplicit Debt: TodoComment
legacy/src/main/java/org/opensearch/sql/legacy/query/AggregationQueryAction.java6.0MixedExplicit Debt: TodoComment
opensearch/src/main/java/org/opensearch/sql/opensearch/request/PredicateAnalyzer.java6.0MixedExplicit Debt: TodoComment
core/src/main/java/org/opensearch/sql/calcite/utils/OpenSearchTypeFactory.java6.0MixedExplicit Debt: TodoComment
core/src/main/java/org/opensearch/sql/calcite/utils/TimewrapPivot.java6.0MixedExplicit Debt: TodoComment
core/src/main/java/org/opensearch/sql/data/model/ExprValueUtils.java6.0MixedExplicit Debt: TodoComment
core/src/main/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java6.0MixedExplicit Debt: TodoComment

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

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

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

Recorded, with no effect on how the codebase functions. Present so the survey is complete, not because it needs doing.

Could not be resolved — 11

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 61 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.8, 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 — 61 dimensions across the health lenses
D1D2D3D4D5D6D10D13D14D15D16D17D19D20D21D26D27D28D29D30D34D35D37D43D44AX10AX3AX5AX6AX9GD1IC1M1M2M3M4P1P10P2P3P4P6PF1PF3X12X15X16X17X18X19X21X23X25X26X27X28X29X3X30X4X5

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, 1810 of 1821 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 · trivySecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3✓ deterministic

Every finding is locatable in findings.md. Run 01a1eb3b-2041-72aa-bfba-808868ab4876.

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: test source is present (.java, .mjs) but the built-in coverage collector has no runner for this repository's ecosystem — so this suite was never executed by it. Not scored — this is a gap in the analyzer's language coverage, not a defect in the repo.
  • D10 Test Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 7,802 test(s) behind this row are the ones the code-model census could read, and this repository also carries at least 2 test source file(s) (.mjs) that it cannot: it reads the test types the .java frontend declared, so a suite in any other language is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
  • D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This repository declares 5 of its own test(s) unreliable. The built-in reliability runner does not support this repository's ecosystem (.java, .mjs), 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 ci.opensearch.org — the registry that answers it — was asked and did not reply (the build stopped because ci.opensearch.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, so the dependency graph was not resolved). 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 ci.opensearch.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.
  • 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. 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 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is a COLLECTOR gap, not an environment fault: it declares a published package (build.gradle), but no published-package marker D22 reads admitted any project here, so this ecosystem's public API has no collector, and the remedy is to write one — no change to the scan image can close it.
  • D24 Comment Value — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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.
  • 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. `core/src/main/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java`, `core/src/main/java/org/opensearch/sql/calcite/MapPathPreMaterializer.java`, `core/src/main/java/org/opensearch/sql/calcite/utils/datetime/DateTimeConversionUtils.java`, `core/src/main/java/org/opensearch/sql/executor/QueryService.java`, `plugin/src/main/java/org/opensearch/sql/plugin/transport/TransportPPLQueryAction.java`, … (+1 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.
  • 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. 148 further occurrence(s) are not listed individually; the score already reflects all 188.
  • M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • S1 Web-Security Posture — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.

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.
  • D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
  • D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
  • D20 ADR Quality: ADR quality 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.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
  • M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • 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 Complexity6.2 / 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 6.2 / 10 · rule-coverage 100% · ceiling Prevented

52 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was SQLFunctions.function at 84. A further 13 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 ExprSqlType.getJavaType at 45 — they are counted neither in the figure above nor in this dimension's score. 9 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/java/org/opensearch/sql/calcite/type/ExprSqlType.java (ExprSqlType.getJavaType at 45), core/src/main/java/org/opensearch/sql/calcite/utils/PlanUtils.java (PlanUtils.spanUnitToIntervalUnit at 39), core/src/main/java/org/opensearch/sql/utils/DateTimeUtils.java (DateTimeUtils.normalizeUnit at 38), async-query/src/main/java/org/opensearch/sql/spark/scheduler/parser/IntervalScheduleParser.java (IntervalScheduleParser.convertToSupportedUnit at 31), legacy/src/main/java/org/opensearch/sql/legacy/metrics/MetricFactory.java (MetricFactory.createMetric at 27), and 4 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.

SQLFunctions.function (cyclomatic 84)legacy/src/main/java/org/opensearch/sql/legacy/utils/SQLFunctions.java:130
ElasticSqlExprParser.primaryRest (cyclomatic 62)legacy/src/main/java/org/opensearch/sql/legacy/parser/ElasticSqlExprParser.java:298
WhereParser.explainCond (cyclomatic 54)legacy/src/main/java/org/opensearch/sql/legacy/parser/WhereParser.java:229
Maker.make (cyclomatic 53)legacy/src/main/java/org/opensearch/sql/legacy/query/maker/Maker.java:193
HintFactory.getHintFromString (cyclomatic 38)legacy/src/main/java/org/opensearch/sql/legacy/domain/hints/HintFactory.java:23

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

What to do

  1. Bring the 2 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with SQLFunctions.function (cyclomatic 84), ElasticSqlExprParser.primaryRest (cyclomatic 62). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 2 together lifts Cyclomatic Complexity from 6.2 to about 6.5/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.

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

D2 · Cognitive Complexity5.7 / 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.7 / 10 · rule-coverage 100% · ceiling Prevented

118 method(s) exceeded the cognitive complexity threshold of 15; the worst was ElasticSqlExprParser.primaryRest at 132.

ElasticSqlExprParser.primaryRest (cognitive 132)legacy/src/main/java/org/opensearch/sql/legacy/parser/ElasticSqlExprParser.java:298
WhereParser.explainCond (cognitive 124)legacy/src/main/java/org/opensearch/sql/legacy/parser/WhereParser.java:229
AggregationQueryAction.explain (cognitive 97)legacy/src/main/java/org/opensearch/sql/legacy/query/AggregationQueryAction.java:53
ExtendedRelJson.toRex (cognitive 71)opensearch/src/main/java/org/opensearch/sql/opensearch/storage/serde/ExtendedRelJson.java:394
HintFactory.getHintFromString (cognitive 64)legacy/src/main/java/org/opensearch/sql/legacy/domain/hints/HintFactory.java:23

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

What to do

  1. Bring the 5 bodies over 60 down to 60 or less in Cognitive Complexity — start with ElasticSqlExprParser.primaryRest (cognitive 132), WhereParser.explainCond (cognitive 124), AggregationQueryAction.explain (cognitive 97). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 5 together lifts Cognitive Complexity from 5.7 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: d2_recommendation.md · top locations in Appendix A, every location in findings.md.

D3 · God Classes8.8 / 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.8 / 10 · rule-coverage 100% · ceiling Prevented

80 god class(es) detected.

TooManyMethods: DSL · ×24core/src/main/java/org/opensearch/sql/expression/DSL.java:29
FileTooLong: calcite/CalciteRelNodeVisitor.java · ×23core/src/main/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java
ClassTooLong: AstBuilder · ×20ppl/src/main/java/org/opensearch/sql/ppl/parser/AstBuilder.java:159
MethodTooLong: WhereParser.explainCond · ×13legacy/src/main/java/org/opensearch/sql/legacy/parser/WhereParser.java:229

What to do

  1. Resolve the 24 TooManyMethods finding(s) in God Classes — start with PredicateAnalyzer.java (3), AstExpressionBuilder.java (2), DSL.java. — One of this dimension's main actionable groups (24 warning-level).
  2. Resolve the 23 FileTooLong finding(s) in God Classes — start with AstExpressionBuilder.java (2), CalciteRelNodeVisitor.java, PPLFuncImpTable.java. — One of this dimension's main actionable groups (23 warning-level).
  3. Resolve the 20 ClassTooLong finding(s) in God Classes — start with AstExpressionBuilder.java (2), AstBuilder.java, SQLFunctions.java. — One of this dimension's main actionable groups (20 warning-level).

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

D4 · Code Duplication7.8 / 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.8 / 10 · rule-coverage 100% · ceiling Verified

172 duplicated block group(s) detected. 5.5 % of the production lines (8,600 of 157,244) are in a reported copy. A further 187 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 1 of the 359 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 (8 lines × 2) · ×19core/src/main/java/org/opensearch/sql/ast/expression/WindowFrame.java:57
Duplicated block (7 lines × 2) · ×18async-query/src/main/java/org/opensearch/sql/spark/execution/statestore/StateStore.java:223
Edited copy of a member (9 corresponding lines) · ×15prometheus/src/main/java/org/opensearch/sql/prometheus/request/system/PrometheusDescribeMetricRequest.java:99
Edited copy of a member (7 corresponding lines) · ×13common/src/main/java/org/opensearch/sql/common/patterns/BrainLogParser.java:214
Duplicated block (9 lines × 2) · ×13api/src/main/java/org/opensearch/sql/api/parser/PPLQueryParser.java:34

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

What to do

  1. Resolve the 19 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with CalciteRelNodeVisitor.java (2), EarliestFunction.java (2), WindowFrame.java. — One of this dimension's main actionable groups (19 warning-level).
  2. Resolve the 18 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with AstExpressionBuilder.java (2), StateStore.java, CalciteRelNodeVisitor.java. — One of this dimension's main actionable groups (18 warning-level).
  3. Resolve the 15 Edited copy of a member (9 corresponding lines) finding(s) in Code Duplication — start with SqlRequestFactory.java (2), PrometheusDescribeMetricRequest.java, MLCommonsOperatorActions.java. — One of this dimension's main actionable groups (15 warning-level).

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

D5 · Coupling8.7 / 10Strong✓ Tool-verified

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

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

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

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

21 production modules (Gradle), 0 dependency cycle(s), 2 unstable depended-on module(s). Read from the build's own module declarations; edges a convention plugin adds from buildSrc or build-logic are not visible there; 2 module(s) off the main sequence, with abstractness counted on 18 of the 21 (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).

Unstable project :async-query · ×2
Off the main sequence: :core
Off the main sequence: :common

What to do

  1. Resolve the 2 Unstable project finding(s) in Coupling. — One of this dimension's main actionable groups (2 warning-level).
  2. Resolve the 1 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).

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

D6 · Cohesion (LCOM4)9.9 / 10Stronggated by 5 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.9 / 10 · rule-coverage 100% · ceiling Verified

5 of 485 classes have LCOM4 above 3.

Low cohesion: ClusterPluginsTests (LCOM4 6) · ×5integ-test/src/test/java/org/opensearch/sql/util/ClusterPluginsTests.java:42

What to do

  1. Resolve the 5 Low cohesion finding(s) in Cohesion (LCOM4) — start with ClusterPluginsTests.java, Config.java, PPLIntegTestCase.java. — One of this dimension's main actionable groups (5 warning-level).

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

D10 · Test Quality9.1 / 10Stronggated by 478 serious findings✓ Tool-verified

What it measures: Whether the tests truly assert behaviour rather than just running the code.

Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.

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

29 skipped (29 with a documented reason), 478 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 7802 tests. Measured on the .java suite only — at least 2 test source file(s) (.mjs) went unread, so its test quality is unmeasured and is not in these counts.

No assertions: testCompileFailure · ×478api/src/test/java/org/opensearch/sql/api/compiler/UnifiedQueryCompilerTest.java:82
Skipped (documented): datasourceWithBasicAuth · ×29async-query/src/test/java/org/opensearch/sql/spark/asyncquery/AsyncQueryExecutorServiceImplSpecTest.java:267

What to do

  1. Resolve the 478 No assertions finding(s) in Test Quality — start with AstBuilderTest.java (24), MapPathPreMaterializerTest.java (19), SemanticAnalyzerFromClauseTest.java (18). — One of this dimension's main actionable groups (478 warning-level).

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

D13 · Secret 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

Secret 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 19 declared JVM dependency artifact(s) use a banned license. Licences were resolved from the POMs Maven Central publishes, over the coordinates this repository's 23 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. 18 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. A further 2 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.

D16 · Bus Factor9.8 / 10Exemplary✓ Tool-verified

What it measures: Whether knowledge is concentrated in too few people (the "bus factor").

Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.

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

16 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is legacy/src/main/java/org/opensearch/sql/legacy/executor/format/Protocol.java. Counted over 702 of the 1587 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Off-boarding risk: anonymized user #1
Further sole-owners (lower concentration)

✓ On the Gold path — maintain.

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

D17 · Explicit Debt9.7 / 10Stronggated by 220 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.7 / 10 · rule-coverage 100% · ceiling Prevented

220 deducted task-comment markers across 157244 LoC (0.1/KLoC) → score 9.7. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.

TodoComment · ×217sql/src/main/java/org/opensearch/sql/sql/parser/AstBuilder.java:136
FixmeComment · ×3core/src/main/java/org/opensearch/sql/calcite/MapPathPreMaterializer.java:104

What to do

  1. Resolve the 217 TodoComment finding(s) in Explicit Debt — start with JoinIT.java (10), HashJoinElasticExecutor.java (5), QueryIT.java (5). — One of this dimension's main actionable groups (217 warning-level).
  2. Resolve the 3 FixmeComment finding(s) in Explicit Debt — start with MapPathPreMaterializer.java, IndexQueryDetailsTest.java, UnifiedRelevanceSearchSqlTest.java. — One of this dimension's main actionable groups (3 warning-level).

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

D19 · Documentation Quality10.0 / 10Exemplary○ Nothing flagged

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 10.0 / 10 · rule-coverage 100% · ceiling Documented

2 of 2 documentation facets pass in full. 152 document(s) read across 22 unit(s).

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.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 foundppl/build.gradle:136

What to do

  1. Resolve the 1 No ADRs found finding(s) in ADR Quality — start with build.gradle. — 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 Consistency8.6 / 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 8.6 / 10 · rule-coverage 100% · ceiling Verified

28 naming inconsistencies among 1999 declarations measured against a convention their peers follow.

`stID` spells `ID` where 63 names in the project spell it `Id`async-query-core/src/main/java/org/opensearch/sql/spark/execution/session/Session.java:38
`testFilterBooleanFieldWithTRUE` spells `TRUE` where 17 names in the project spell it `True`integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteExplainIT.java:2862
`CalciteMVAppendFunctionIT` spells `MV` where 39 names in the project spell it `Mv`integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteMVAppendFunctionIT.java:19
`testDATEInvalid` spells `DATE` where 169 names in the project spell it `Date`integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalcitePPLBuiltinDatetimeFunctionInvalidIT.java:101
`testTIMEInvalid` spells `TIME` where 170 names in the project spell it `Time`integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalcitePPLBuiltinDatetimeFunctionInvalidIT.java:128

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

What to do

  1. Resolve the 1 `stID` spells `ID` where 63 names in the project spell it `Id` finding(s) in Naming Consistency — start with Session.java. — One of this dimension's main actionable groups (1 recommendation-level).
  2. Resolve the 1 `testFilterBooleanFieldWithTRUE` spells `TRUE` where 17 names in the… finding(s) in Naming Consistency — start with CalciteExplainIT.java. — One of this dimension's main actionable groups (1 recommendation-level).
  3. Resolve the 1 `CalciteMVAppendFunctionIT` spells `MV` where 39 names in the project… finding(s) in Naming Consistency — start with CalciteMVAppendFunctionIT.java. — One of this dimension's main actionable groups (1 recommendation-level).

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

D26 · Project Cohesion5.6 / 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.6 / 10 · rule-coverage 100% · ceiling Documented

4 of 18 build units (Gradle) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion · ×4core/build.gradle:1

What to do

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

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

D27 · Navigability9.0 / 10Strong✓ Tool-verified

What it measures: How far you must trace to follow a call — low indirection and co-located slices read easier.

Method: Call indirection (interface hops, cross-namespace calls, slice-locality scaled) over a sampled set of method invocations, size-aware baseline. Sampled; confidence discounted by symbol-resolution gaps. C# also names each pass-through layer (a class whose every public method only forwards its own parameters to one collaborator) as a located finding; the score is not affected.

Coverage: Slice locality from the first namespace segments, SAMPLED (≤400 methods) — not exhaustive.

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

59 % of calls cross a namespace and 20 % go through an interface, but 100 % of collaborators are co-located — so following a call takes several hops. Baseline: small — navigation cost is tolerated.

Detailed fixes: d27_recommendation.md.

D28 · Secrets (history)10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.

Method: Secret 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 10.0 / 10 · rule-coverage 100% · ceiling Documented

gitleaks scanned the full history AND the current working tree and found no secrets.

✓ On the Gold path — maintain.

Detailed fixes: d28_recommendation.md.

D29 · Static Analysis (SAST)1.9 / 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 1.9 / 10 · rule-coverage 100% · ceiling Documented

20 finding(s): 0 critical, 15 high, 5 medium, 0 low. 7 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 31 file(s) — `core/src/main/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java` (line 582, line 607, line 613), `core/src/main/java/org/opensearch/sql/calcite/MapPathPreMaterializer.java` (line 68, line 69, line 70, …), `core/src/main/java/org/opensearch/sql/calcite/utils/datetime/DateTimeConversionUtils.java` (lines 31–39, lines 57–58, line 88, …), `core/src/main/java/org/opensearch/sql/executor/QueryService.java` (line 610, line 611), `doctest/test_data/accounts.json`, … (+26 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 5 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

  1. Resolve the 3 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3). — One of this dimension's main actionable groups (3 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. No action in Static Analysis (SAST) — all 7 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (7 issue-level, 0 of them charged here).

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

D30 · Dependency Vulnerabilities10.0 / 10Exemplary○ Nothing flagged

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 10.0 / 10 · rule-coverage 100% · ceiling Documented

No known-vulnerable dependencies in any ecosystem this repository declares.

✓ On the Gold path — maintain.

Detailed fixes: d30_recommendation.md.

D34 · Knowledge Freshness6.4 / 10Adequate✓ 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 6.4 / 10 · rule-coverage 100% · ceiling Documented

251 of 702 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is core/src/main/java/org/opensearch/sql/expression/datetime/DateTimeFunctions.java. Counted over 702 of the 1587 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned knowledge · ×11core/src/main/java/org/opensearch/sql/expression/datetime/DateTimeFunctions.java:1
Orphaned file · ×240core/src/main/java/org/opensearch/sql/expression/datetime/DateTimeFormatterUtil.java:1
Further orphaned files (smaller)

What to do

  1. Resolve the 240 Orphaned file finding(s) in Knowledge Freshness — start with build.gradle (5), DateTimeFormatterUtil.java, OpenSearchDateType.java. — One of this dimension's main actionable groups (240 recommendation-level).
  2. Resolve the 11 Orphaned knowledge finding(s) in Knowledge Freshness — start with DateTimeFunctions.java, SQLFunctions.java, ExtendedRelJson.java. — One of this dimension's main actionable groups (11 issue-level).
  3. Resolve the 1 Further orphaned files (smaller) finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).

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

D35 · Change Coupling10.0 / 10Adequategated by 2 critical findings✓ 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

Strongest change-coupling: Analyzer.java↔AstBuilder.java 59%; OpenSearchIndex.java↔OpenSearchIndexEnumerator.java 58%; PPLQueryRequestFactory.java↔PPLService.java 50%

Boundary-crossing change coupling: PPLQueryRequestFactory.java ↔ PPLService.java · ×2plugin/src/main/java/org/opensearch/sql/plugin/request/PPLQueryRequestFactory.java:1
Change coupling: Analyzer.java ↔ AstBuilder.java · ×2core/src/main/java/org/opensearch/sql/analysis/Analyzer.java:1

What to do

  1. Resolve the 2 Boundary-crossing change coupling finding(s) in Change Coupling — start with PPLQueryRequestFactory.java, AsyncQueryExecutorServiceImpl.java. — One of this dimension's main actionable groups (2 issue-level).
  2. Resolve the 2 Change coupling finding(s) in Change Coupling — start with Analyzer.java, OpenSearchIndex.java. — One of this dimension's main actionable groups (2 warning-level).

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

D37 · Vulnerability-disclosure Policy10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.

Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.

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

A vulnerability-disclosure policy (SECURITY.md) is published with a reporting contact.

✓ On the Gold path — maintain.

Detailed fixes: d37_recommendation.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 3 platform declaration(s) and 54 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.

AX10 · Code composition9.6 / 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.

AX5 · Architecture & structure10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether the codebase has a recognisable, scale-appropriate structure (a named architectural style, or modular enough for its size) rather than being an ad-hoc ball of mud.

Method: Roslyn plus csproj analysis: architecture style detection (DDD, clean, vertical-slice, CQRS) and structure fitness for repo size. Deterministic.

AX6 · Interface segregation10.0 / 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.

  • `PrometheusClient` declares 23 abstract methods: `createAlertmanagerSilences`, `createOrUpdateRuleGroup`, `deleteAlertmanagerSilence`, `deleteRuleGroup`, `deleteRuleNamespace`, `getAlertmanagerAlertGroups`, `getAlertmanagerAlerts`, `getAlertmanagerReceivers`, `getAlertmanagerSilences`, `getAlertmanagerStatus`, `getAlerts`, `getAllMetrics`, `getAllMetrics`, `getLabel`, `getLabels`, `getLabels`, `getRules`, `getRulesByNamespace`, `getSeries`, `query`, `queryExemplars`, `queryRange`, `queryRange`. 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 23 declarations carry 20 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 20 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. — direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClient.java:19
  • `Content` declares 24 abstract methods: `array`, `booleanValue`, `byteValue`, `doubleValue`, `floatValue`, `geoValue`, `intValue`, `isArray`, `isBoolean`, `isByte`, `isDouble`, `isFloat`, `isInt`, `isLong`, `isNull`, `isNumber`, `isObject`, `isShort`, `isString`, `longValue`, `map`, `objectValue`, `shortValue`, `stringValue`. 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. — opensearch/src/main/java/org/opensearch/sql/opensearch/data/utils/Content.java:21

What to do

  • Split fat interfaces into focused role-interfaces so clients depend only on what they use.
AX9 · CQS / query purity10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.

Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.

Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.

GD1 · Unfinished & placeholder code10.0 / 10Exemplary✓ Tool-verified

Other · Code Health — Unreviewed-generation residue in this repository's Java: methods whose whole body only throws a "not implemented" or bare unsupported-operation exception, or returns a default value (or nothing) under a TODO/FIXME marker, and placeholder text (lorem ipsum, changeme/replace_me…) left in strings of non-test, non-generated code. Scored as a quality signature, never as a claim about authorship.

Method: Roslyn syntax scan: NotImplementedException throws and placeholder string literals in non-test, non-generated shipped code. Deterministic, code-shape signature.

  • `setEnginePlan` is a shipped method whose body is empty except for a TODO/FIXME — scaffolding that was never completed. Implement it or remove it. — core/src/main/java/org/opensearch/sql/monitor/profile/ProfileContext.java:31
  • `createScanBuilder` is a shipped method whose whole body returns a default value under a TODO/FIXME — a placeholder standing in for the implementation. Implement it or remove it. — core/src/main/java/org/opensearch/sql/storage/Table.java:74
  • `verify` is a shipped method whose whole body only throws `SqlFeatureNotImplementedException` saying it is not implemented — scaffolding that was never completed. Implement it or remove the dead surface. — legacy/src/main/java/org/opensearch/sql/legacy/antlr/visitor/UnsupportedSemanticVerifier.java:80

What to do

  • Finish or delete the methods that still throw "not implemented" or return a placeholder under a TODO, and replace placeholder text before shipping.
IC1 · Incompleteness & stubs10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Unfinished work detected by code SHAPE, not keywords, in this repository's Java: methods that only throw a "not implemented" exception, methods that take inputs and return a constant or do nothing, dead `if (false)` branches, and skeleton classes most of whose methods are holes.

Method: Roslyn syntax scan: incompleteness by code shape (constant-returning methods, async-never-await, #if false branches, guards that return what the code already falls through to, tests an earlier guard already decided, comparisons against NaN, skeleton types), not keyword-gated. Deterministic, code-shape heuristic.

  • A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something. (×40) — api/src/test/java/org/opensearch/sql/api/UnifiedFunctionSpecTest.java:26, api/src/test/java/org/opensearch/sql/api/UnifiedQueryPlannerSqlTest.java:19, api/src/test/java/org/opensearch/sql/api/UnifiedRelevanceSearchSqlTest.java:17, …

What to do

  • Clear the softer debt: re-enable or delete @Disabled/@Ignore tests, decide whether each empty method or UnsupportedOperationException is deliberate (and say so in a comment), and replace @SuppressWarnings("all") with targeted, justified suppressions.
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.

M4 · Documentation accuracy10.0 / 10Exemplary○ Nothing flagged

Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.

Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.

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 & versioning9.8 / 10Exemplary✓ Tool-verified

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.

  • 1 public type in `org.opensearch.sql.spark.asyncquery` is marked as implementation by its own namespace, folder or name: `AsyncQueryExecutorServiceImpl` (async-query-core/src/main/java/org/opensearch/sql/spark/asyncquery/AsyncQueryExecutorServiceImpl.java:49, name ends in `Impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers. — async-query-core/src/main/java/org/opensearch/sql/spark/asyncquery/AsyncQueryExecutorServiceImpl.java:49
  • 2 public types in `org.opensearch.sql.spark.client` are marked as implementation by their own namespace, folder or name: `EMRServerlessClientFactoryImpl` (async-query-core/src/main/java/org/opensearch/sql/spark/client/EMRServerlessClientFactoryImpl.java:20, name ends in `Impl`), `EmrServerlessClientImpl` (async-query-core/src/main/java/org/opensearch/sql/spark/client/EmrServerlessClientImpl.java:31, name ends in `Impl`). While they are public, every consumer of the library can bind to them, so changing them is a breaking change for those consumers. — async-query-core/src/main/java/org/opensearch/sql/spark/client/EMRServerlessClientFactoryImpl.java:20
  • 1 public type in `org.opensearch.sql.spark.config` is marked as implementation by its own namespace, folder or name: `SparkExecutionEngineConfigSupplierImpl` (async-query/src/main/java/org/opensearch/sql/spark/config/SparkExecutionEngineConfigSupplierImpl.java:16, name ends in `Impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers. — async-query/src/main/java/org/opensearch/sql/spark/config/SparkExecutionEngineConfigSupplierImpl.java:16
  • 1 public type in `org.opensearch.sql.spark.flint` is marked as implementation by its own namespace, folder or name: `FlintIndexMetadataServiceImpl` (async-query/src/main/java/org/opensearch/sql/spark/flint/FlintIndexMetadataServiceImpl.java:31, name ends in `Impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers. — async-query/src/main/java/org/opensearch/sql/spark/flint/FlintIndexMetadataServiceImpl.java:31
  • 1 public type in `org.opensearch.sql.calcite.utils` is marked as implementation by its own namespace, folder or name: `OpenSearchPrepareImpl` (core/src/main/java/org/opensearch/sql/calcite/utils/CalciteToolsHelper.java:229, name ends in `Impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers. — core/src/main/java/org/opensearch/sql/calcite/utils/CalciteToolsHelper.java:229
  • 14 public types in `org.opensearch.sql.expression.function.CollectionUDF` are marked as implementation by their own namespace, folder or name: `ArrayFunctionImpl` (core/src/main/java/org/opensearch/sql/expression/function/CollectionUDF/ArrayFunctionImpl.java:35, name ends in `Impl`), `ExistsFunctionImpl` (core/src/main/java/org/opensearch/sql/expression/function/CollectionUDF/ExistsFunctionImpl.java:27, name ends in `Impl`), `FilterFunctionImpl` (core/src/main/java/org/opensearch/sql/expression/function/CollectionUDF/FilterFunctionImpl.java:27, name ends in `Impl`), `ForallFunctionImpl` (core/src/main/java/org/opensearch/sql/expression/function/CollectionUDF/ForallFunctionImpl.java:26, name ends in `Impl`), `ForeachPairCollectionFunctionImpl` (core/src/main/java/org/opensearch/sql/expression/function/CollectionUDF/ForeachPairCollectionFunctionImpl.java:26, name ends in `Impl`), `ForeachPairItemFunctionImpl` (core/src/main/java/org/opensearch/sql/expression/function/CollectionUDF/ForeachPairItemFunctionImpl.java:26, name ends in `Impl`), `ForeachStateFunctionImpl` (core/src/main/java/org/opensearch/sql/expression/function/CollectionUDF/ForeachStateFunctionImpl.java:25, name ends in `Impl`), `MVAppendFunctionImpl` (core/src/main/java/org/opensearch/sql/expression/function/CollectionUDF/MVAppendFunctionImpl.java:33, name ends in `Impl`), and 6 more. While they are public, every consumer of the library can bind to them, so changing them is a breaking change for those consumers. — core/src/main/java/org/opensearch/sql/expression/function/CollectionUDF/ArrayFunctionImpl.java:35
  • 1 public type in `org.opensearch.sql.expression.function` is marked as implementation by its own namespace, folder or name: `PatternParserFunctionImpl` (core/src/main/java/org/opensearch/sql/expression/function/PatternParserFunctionImpl.java:39, name ends in `Impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers. — core/src/main/java/org/opensearch/sql/expression/function/PatternParserFunctionImpl.java:39
  • 10 public types in `org.opensearch.sql.expression.function.jsonUDF` are marked as implementation by their own namespace, folder or name: `ForeachJsonArrayFunctionImpl` (core/src/main/java/org/opensearch/sql/expression/function/jsonUDF/ForeachJsonArrayFunctionImpl.java:30, name ends in `Impl`), `JsonAppendFunctionImpl` (core/src/main/java/org/opensearch/sql/expression/function/jsonUDF/JsonAppendFunctionImpl.java:29, name ends in `Impl`), `JsonArrayLengthFunctionImpl` (core/src/main/java/org/opensearch/sql/expression/function/jsonUDF/JsonArrayLengthFunctionImpl.java:26, name ends in `Impl`), `JsonDeleteFunctionImpl` (core/src/main/java/org/opensearch/sql/expression/function/jsonUDF/JsonDeleteFunctionImpl.java:27, name ends in `Impl`), `JsonExtendFunctionImpl` (core/src/main/java/org/opensearch/sql/expression/function/jsonUDF/JsonExtendFunctionImpl.java:29, name ends in `Impl`), `JsonExtractAllFunctionImpl` (core/src/main/java/org/opensearch/sql/expression/function/jsonUDF/JsonExtractAllFunctionImpl.java:43, name ends in `Impl`), `JsonExtractFunctionImpl` (core/src/main/java/org/opensearch/sql/expression/function/jsonUDF/JsonExtractFunctionImpl.java:32, name ends in `Impl`), `JsonFunctionImpl` (core/src/main/java/org/opensearch/sql/expression/function/jsonUDF/JsonFunctionImpl.java:27, name ends in `Impl`), and 2 more. While they are public, every consumer of the library can bind to them, so changing them is a breaking change for those consumers. — core/src/main/java/org/opensearch/sql/expression/function/jsonUDF/ForeachJsonArrayFunctionImpl.java:30
  • 1 public type in `org.opensearch.sql.datasources.auth` is marked as implementation by its own namespace, folder or name: `DataSourceUserAuthorizationHelperImpl` (datasources/src/main/java/org/opensearch/sql/datasources/auth/DataSourceUserAuthorizationHelperImpl.java:20, name ends in `Impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers. — datasources/src/main/java/org/opensearch/sql/datasources/auth/DataSourceUserAuthorizationHelperImpl.java:20
  • 1 public type in `org.opensearch.sql.datasources.encryptor` is marked as implementation by its own namespace, folder or name: `EncryptorImpl` (datasources/src/main/java/org/opensearch/sql/datasources/encryptor/EncryptorImpl.java:21, name ends in `Impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers. — datasources/src/main/java/org/opensearch/sql/datasources/encryptor/EncryptorImpl.java:21
  • 2 public types in `org.opensearch.sql.datasources.service` are marked as implementation by their own namespace, folder or name: `DataSourceLoaderCacheImpl` (datasources/src/main/java/org/opensearch/sql/datasources/service/DataSourceLoaderCacheImpl.java:19, name ends in `Impl`), `DataSourceServiceImpl` (datasources/src/main/java/org/opensearch/sql/datasources/service/DataSourceServiceImpl.java:31, name ends in `Impl`). While they are public, every consumer of the library can bind to them, so changing them is a breaking change for those consumers. — datasources/src/main/java/org/opensearch/sql/datasources/service/DataSourceLoaderCacheImpl.java:19
  • 1 public type in `org.opensearch.sql.directquery` is marked as implementation by its own namespace, folder or name: `DirectQueryExecutorServiceImpl` (direct-query-core/src/main/java/org/opensearch/sql/directquery/DirectQueryExecutorServiceImpl.java:25, name ends in `Impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers. — direct-query-core/src/main/java/org/opensearch/sql/directquery/DirectQueryExecutorServiceImpl.java:25
  • 1 public type in `org.opensearch.sql.prometheus.client` is marked as implementation by its own namespace, folder or name: `PrometheusClientImpl` (direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:37, name ends in `Impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers. — direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:37
  • 1 public type in `org.opensearch.sql.legacy.pit` is marked as implementation by its own namespace, folder or name: `PointInTimeHandlerImpl` (legacy/src/main/java/org/opensearch/sql/legacy/pit/PointInTimeHandlerImpl.java:29, name ends in `Impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers. — legacy/src/main/java/org/opensearch/sql/legacy/pit/PointInTimeHandlerImpl.java:29
  • 2 public types in `org.opensearch.sql.prometheus.functions.implementation` are marked as implementation by their own namespace, folder or name: `QueryExemplarFunctionImplementation` (prometheus/src/main/java/org/opensearch/sql/prometheus/functions/implementation/QueryExemplarFunctionImplementation.java:31, `implementation`), `QueryRangeFunctionImplementation` (prometheus/src/main/java/org/opensearch/sql/prometheus/functions/implementation/QueryRangeFunctionImplementation.java:32, `implementation`). While they are public, every consumer of the library can bind to them, so changing them is a breaking change for those consumers. — prometheus/src/main/java/org/opensearch/sql/prometheus/functions/implementation/QueryExemplarFunctionImplementation.java:31

What to do

  • Hide `org.opensearch.sql.spark.asyncquery` (`AsyncQueryExecutorServiceImpl`) (Java: package-private (no modifier), or leave its package out of `module-info` exports): its own namespace, folder or name already says it is implementation, and hidden it can change without breaking a consumer.
  • Hide `org.opensearch.sql.spark.client` (`EMRServerlessClientFactoryImpl`, `EmrServerlessClientImpl`) (Java: package-private (no modifier), or leave its package out of `module-info` exports): its own namespace, folder or name already says it is implementation, and hidden it can change without breaking a consumer.
  • Hide `org.opensearch.sql.spark.config` (`SparkExecutionEngineConfigSupplierImpl`) (Java: package-private (no modifier), or leave its package out of `module-info` exports): its own namespace, folder or name already says it is implementation, and hidden it can change without breaking a consumer.
  • Hide `org.opensearch.sql.spark.flint` (`FlintIndexMetadataServiceImpl`) (Java: package-private (no modifier), or leave its package out of `module-info` exports): its own namespace, folder or name already says it is implementation, and hidden it can change without breaking a consumer.
  • Hide `org.opensearch.sql.calcite.utils` (`OpenSearchPrepareImpl`) (Java: package-private (no modifier), or leave its package out of `module-info` exports): its own namespace, folder or name already says it is implementation, and hidden it can change without breaking a consumer.
  • Hide `org.opensearch.sql.expression.function.CollectionUDF` (`ArrayFunctionImpl`, `ExistsFunctionImpl`, `FilterFunctionImpl`, `ForallFunctionImpl`, `ForeachPairCollectionFunctionImpl`, `ForeachPairItemFunctionImpl`, `ForeachStateFunctionImpl`, `MVAppendFunctionImpl`, and 6 more) (Java: package-private (no modifier), or leave its package out of `module-info` exports): its own namespace, folder or name already says it is implementation, and hidden it can change without breaking a consumer.
  • Hide `org.opensearch.sql.expression.function` (`PatternParserFunctionImpl`) (Java: package-private (no modifier), or leave its package out of `module-info` exports): its own namespace, folder or name already says it is implementation, and hidden it can change without breaking a consumer.
  • Hide `org.opensearch.sql.expression.function.jsonUDF` (`ForeachJsonArrayFunctionImpl`, `JsonAppendFunctionImpl`, `JsonArrayLengthFunctionImpl`, `JsonDeleteFunctionImpl`, `JsonExtendFunctionImpl`, `JsonExtractAllFunctionImpl`, `JsonExtractFunctionImpl`, `JsonFunctionImpl`, and 2 more) (Java: package-private (no modifier), or leave its package out of `module-info` exports): its own namespace, folder or name already says it is implementation, and hidden it can change without breaking a consumer.
  • Hide `org.opensearch.sql.datasources.auth` (`DataSourceUserAuthorizationHelperImpl`) (Java: package-private (no modifier), or leave its package out of `module-info` exports): its own namespace, folder or name already says it is implementation, and hidden it can change without breaking a consumer.
  • Hide `org.opensearch.sql.datasources.encryptor` (`EncryptorImpl`) (Java: package-private (no modifier), or leave its package out of `module-info` exports): its own namespace, folder or name already says it is implementation, and hidden it can change without breaking a consumer.
  • Hide `org.opensearch.sql.datasources.service` (`DataSourceLoaderCacheImpl`, `DataSourceServiceImpl`) (Java: package-private (no modifier), or leave its package out of `module-info` exports): its own namespace, folder or name already says it is implementation, and hidden it can change without breaking a consumer.
  • Hide `org.opensearch.sql.directquery` (`DirectQueryExecutorServiceImpl`) (Java: package-private (no modifier), or leave its package out of `module-info` exports): its own namespace, folder or name already says it is implementation, and hidden it can change without breaking a consumer.
  • Hide `org.opensearch.sql.prometheus.client` (`PrometheusClientImpl`) (Java: package-private (no modifier), or leave its package out of `module-info` exports): its own namespace, folder or name already says it is implementation, and hidden it can change without breaking a consumer.
  • Hide `org.opensearch.sql.legacy.pit` (`PointInTimeHandlerImpl`) (Java: package-private (no modifier), or leave its package out of `module-info` exports): its own namespace, folder or name already says it is implementation, and hidden it can change without breaking a consumer.
  • Hide `org.opensearch.sql.prometheus.functions.implementation` (`QueryExemplarFunctionImplementation`, `QueryRangeFunctionImplementation`) (Java: package-private (no modifier), or leave its package out of `module-info` exports): its own namespace, folder or name already says it is implementation, and hidden it can change without breaking a consumer.
P2 · Observability10.0 / 10Exemplary○ Nothing flagged

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.

P3 · Security & performance tooling7.0 / 10Strong✓ 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` schedules updates, but no `package-ecosystem` entry covers `github-actions`, `pip`, which this tree depends on — so those dependencies get no update pull requests and no advisory pressure, however complete the dep-scan credit looks. Add the missing entries to the `updates:` list. — REDACTED:2

What to do

  • Dependabot is configured but does not watch `github-actions`, `pip` — add those `package-ecosystem` entries to .github/dependabot.yml so those dependencies get the same automatic update and advisory pressure as the ones it already covers.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
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.

  • The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release.

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 Hygiene10.0 / 10Exemplary✓ 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.

PF1 · Benchmark discipline8.5 / 10Strong✓ Tool-verified

Readiness · Performance — Whether the code protects its performance with benchmarks — a benchmark suite, allocation/memory measurement, and (ideally) a CI gate. Presence is credited as a bonus, never a deduction.

Method: Repo + source scan: BenchmarkDotNet referenced (csproj/source), [Benchmark]/[MemoryDiagnoser] attribute counts, and a benchmark step in CI; off .NET, the same ladder over Go testing.B, Rust criterion/#[bench]/divan, JMH/kotlinx-benchmark, pytest-benchmark/asv/pyperf, tinybench/mitata/vitest bench/benchmark.js and Swift package-benchmark — scored as a bonus ladder (absence is neutral, never a deduction). Deterministic, presence detection.

  • A JMH/Jetpack Benchmark suite exists but nothing turns on its allocation measurement — allocations (the main way hot code pressures a garbage collector or allocator) aren't being measured. — benchmarks/src/jmh/java/org/opensearch/sql/opensearch/executor/BuildResultSetBenchmark.java

What to do

  • Run JMH with the GC profiler (`-prof gc`, or addProfiler(GCProfiler.class)) so allocation rate regressions are visible, not just time.
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.

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.

X15 · Unvalidated length from an untrusted reader10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.

Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.

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.

X17 · Uncapped recursion over a caller-supplied document1.6 / 10Critical✓ Tool-verified

Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.

Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.

  • `parse` is not private, takes a value from its caller (line 57) and hands it on to `getLeafValue`, which calls itself at line 203 with a piece of `object` — and nowhere in the walk is a depth or nesting counter compared with a bound, nor is the parser that builds the document given a nesting limit in this file. The walk therefore spends one stack frame (more through a lambda or a stream) per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes; javac turns no recursive call into a loop. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25). org.json, the W3C DOM, dom4j and StAX set no nesting limit of their own, Jackson before 2.15 none and 2.15+ 1,000 — on a cold JVM past the point the walk fails — and a `Map<String, Object>` tree is as deep as whatever built it. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (Exception e)` around the call does not stop it, and the request or the thread dies with it. Thread a depth argument through `getLeafValue` and reject the value past a fixed maximum, configure the parser's nesting limit (`StreamReadConstraints.maxNestingDepth`, SnakeYAML's `setNestingDepthLimit`), or rewrite the descent with an explicit stack. — opensearch/src/main/java/org/opensearch/sql/opensearch/response/agg/TopHitsParser.java:203
  • `buildResultSet` is not private, takes a value from its caller (line 435) and hands it on to `processValue`, which calls itself at line 405 with a piece of `value` (and at line 415, line 427) — and nowhere in the walk is a depth or nesting counter compared with a bound, nor is the parser that builds the document given a nesting limit in this file. The walk therefore spends one stack frame (more through a lambda or a stream) per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes; javac turns no recursive call into a loop. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25). org.json, the W3C DOM, dom4j and StAX set no nesting limit of their own, Jackson before 2.15 none and 2.15+ 1,000 — on a cold JVM past the point the walk fails — and a `Map<String, Object>` tree is as deep as whatever built it. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (Exception e)` around the call does not stop it, and the request or the thread dies with it. Thread a depth argument through `processValue` and reject the value past a fixed maximum, configure the parser's nesting limit (`StreamReadConstraints.maxNestingDepth`, SnakeYAML's `setNestingDepthLimit`), or rewrite the descent with an explicit stack. — opensearch/src/main/java/org/opensearch/sql/opensearch/executor/OpenSearchExecutionEngine.java:405
  • `parseMapping` is not private and takes `Map<String, Object> indexMapping` from its caller, and it recurses at line 134 through `of` and back with a piece of `indexMapping` (and at line 160, line 168) — and nowhere in the walk is a depth or nesting counter compared with a bound, nor is the parser that builds the document given a nesting limit in this file. The walk therefore spends one stack frame (more through a lambda or a stream) per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes; javac turns no recursive call into a loop. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25). org.json, the W3C DOM, dom4j and StAX set no nesting limit of their own, Jackson before 2.15 none and 2.15+ 1,000 — on a cold JVM past the point the walk fails — and a `Map<String, Object>` tree is as deep as whatever built it. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (Exception e)` around the call does not stop it, and the request or the thread dies with it. Thread a depth argument through `parseMapping` and reject the value past a fixed maximum, configure the parser's nesting limit (`StreamReadConstraints.maxNestingDepth`, SnakeYAML's `setNestingDepthLimit`), or rewrite the descent with an explicit stack. — opensearch/src/main/java/org/opensearch/sql/opensearch/data/type/OpenSearchDataType.java:134
  • `clearEmptyPaths` is not private and takes `Map<String, Object> map` from its caller, and it calls itself at line 230 with a piece of `map` — and nowhere in the walk is a depth or nesting counter compared with a bound, nor is the parser that builds the document given a nesting limit in this file. The walk therefore spends one stack frame (more through a lambda or a stream) per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes; javac turns no recursive call into a loop. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25). org.json, the W3C DOM, dom4j and StAX set no nesting limit of their own, Jackson before 2.15 none and 2.15+ 1,000 — on a cold JVM past the point the walk fails — and a `Map<String, Object>` tree is as deep as whatever built it. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (Exception e)` around the call does not stop it, and the request or the thread dies with it. Thread a depth argument through `clearEmptyPaths` and reject the value past a fixed maximum, configure the parser's nesting limit (`StreamReadConstraints.maxNestingDepth`, SnakeYAML's `setNestingDepthLimit`), or rewrite the descent with an explicit stack. — legacy/src/main/java/org/opensearch/sql/legacy/utils/Util.java:230
  • `tupleValue` is not private and takes `Map<String, Object> map` from its caller, and it recurses at line 39 through `collectionValue`, `from` and back with a piece of `map` (and at line 45) — and nowhere in the walk is a depth or nesting counter compared with a bound, nor is the parser that builds the document given a nesting limit in this file. The walk therefore spends one stack frame (more through a lambda or a stream) per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes; javac turns no recursive call into a loop. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25). org.json, the W3C DOM, dom4j and StAX set no nesting limit of their own, Jackson before 2.15 none and 2.15+ 1,000 — on a cold JVM past the point the walk fails — and a `Map<String, Object>` tree is as deep as whatever built it. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (Exception e)` around the call does not stop it, and the request or the thread dies with it. Thread a depth argument through `tupleValue` and reject the value past a fixed maximum, configure the parser's nesting limit (`StreamReadConstraints.maxNestingDepth`, SnakeYAML's `setNestingDepthLimit`), or rewrite the descent with an explicit stack. — legacy/src/main/java/org/opensearch/sql/legacy/expression/model/ExprValueFactory.java:39
  • `mergeHeaders` is not private, takes a value from its caller (line 341) and hands it on to `mergeFieldNamesRecursive`, which calls itself at line 354 with a piece of `doc` — and nowhere in the walk is a depth or nesting counter compared with a bound, nor is the parser that builds the document given a nesting limit in this file. The walk therefore spends one stack frame (more through a lambda or a stream) per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes; javac turns no recursive call into a loop. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25). org.json, the W3C DOM, dom4j and StAX set no nesting limit of their own, Jackson before 2.15 none and 2.15+ 1,000 — on a cold JVM past the point the walk fails — and a `Map<String, Object>` tree is as deep as whatever built it. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (Exception e)` around the call does not stop it, and the request or the thread dies with it. Thread a depth argument through `mergeFieldNamesRecursive` and reject the value past a fixed maximum, configure the parser's nesting limit (`StreamReadConstraints.maxNestingDepth`, SnakeYAML's `setNestingDepthLimit`), or rewrite the descent with an explicit stack. — legacy/src/main/java/org/opensearch/sql/legacy/executor/csv/CSVResultsExtractor.java:354
  • `castJson` is not private, takes a value from its caller (line 69) and hands it on to `processJsonNode`, which calls itself at line 95 with a piece of `jsonNode` — and nowhere in the walk is a depth or nesting counter compared with a bound, nor is the parser that builds the document given a nesting limit in this file. The walk therefore spends one stack frame (more through a lambda or a stream) per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes; javac turns no recursive call into a loop. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25). org.json, the W3C DOM, dom4j and StAX set no nesting limit of their own, Jackson before 2.15 none and 2.15+ 1,000 — on a cold JVM past the point the walk fails — and a `Map<String, Object>` tree is as deep as whatever built it. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (Exception e)` around the call does not stop it, and the request or the thread dies with it. Thread a depth argument through `processJsonNode` and reject the value past a fixed maximum, configure the parser's nesting limit (`StreamReadConstraints.maxNestingDepth`, SnakeYAML's `setNestingDepthLimit`), or rewrite the descent with an explicit stack. — core/src/main/java/org/opensearch/sql/utils/JsonUtils.java:95
  • `tupleValue` is not private and takes `Map<String, Object> map` from its caller, and it recurses at line 95 through `collectionValue`, `fromObjectValue` and back with a piece of `map` (and at line 102) — and nowhere in the walk is a depth or nesting counter compared with a bound, nor is the parser that builds the document given a nesting limit in this file. The walk therefore spends one stack frame (more through a lambda or a stream) per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes; javac turns no recursive call into a loop. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25). org.json, the W3C DOM, dom4j and StAX set no nesting limit of their own, Jackson before 2.15 none and 2.15+ 1,000 — on a cold JVM past the point the walk fails — and a `Map<String, Object>` tree is as deep as whatever built it. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (Exception e)` around the call does not stop it, and the request or the thread dies with it. Thread a depth argument through `tupleValue` and reject the value past a fixed maximum, configure the parser's nesting limit (`StreamReadConstraints.maxNestingDepth`, SnakeYAML's `setNestingDepthLimit`), or rewrite the descent with an explicit stack. — core/src/main/java/org/opensearch/sql/data/model/ExprValueUtils.java:95

What to do

  • Each finding names the externally-callable member that accepts the document and the self-call that descends, and states that no depth parameter or counter exists anywhere in the walk. Confirm from the two, then thread a depth argument through the walk and reject documents past a fixed maximum, or rewrite it with an explicit stack.
X18 · Disposal-pattern correctness10.0 / 10Exemplary○ Nothing flagged

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.

X19 · Unrestored process-global state3.5 / 10Weak✓ Tool-verified

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.

  • `parseDateString` changes state that belongs to the whole JVM and changes it back at the end of the same body — the JVM's default `TimeZone` (changed at line 149, put back at line 198) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, not a `finally`, so it is skipped by any exception thrown in between: the JVM then keeps the overwritten value for the rest of its life, and every later property lookup, formatter, date conversion or console write in ANY class reads it. That failure is silent and remote from its cause — the method that breaks is not the method that moved the value. The window is not private while it is open either: system properties, the default `Locale` and `TimeZone` and the standard streams are per-JVM, not per-thread, so a concurrent thread reads the moved value too. The durable fix is not to widen the restore but to stop mutating the global: pass the value to the operation that needs it — an explicit `Locale` to `String.format`/`NumberFormat`/`DateTimeFormatter`, a `ZoneId` to `java.time`, the setting to the component that reads the property, a `PrintStream` to the code that writes, `ProcessBuilder.environment()`/`directory()` for a child. Where the global genuinely must move, wrap it `try`/`finally` so the restore runs on every path. — legacy/src/main/java/org/opensearch/sql/legacy/executor/format/DateFieldFormatter.java:142

What to do

  • Each finding names the statement that changes the JVM-global value and the statement that puts it back. Confirm from the two that nothing between them is protected — then prefer removing the mutation over widening the restore: a `Locale`, a `ZoneId` or a setting passed to the operation that needs it (`String.format(Locale.ROOT, …)`, `DateTimeFormatter.withZone`, `ProcessBuilder.environment()`) is scoped to that operation, which is what the save-and-restore was trying to approximate. Where the global genuinely must move, a `try`/`finally` is the least that makes the restore unconditional. In Python the same holds for `os.chdir`, `os.environ` and `sys.stdout`: pass `cwd=`/`env=` to `subprocess`, or use `contextlib.chdir`/`redirect_stdout`, rather than moving the global by hand.
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.

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 `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen.

Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.

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.0 / 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.

  • `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. (×11) — plugin/src/main/java/org/opensearch/sql/plugin/rest/RestUnifiedQueryAction.java:135, plugin/src/main/java/org/opensearch/sql/plugin/rest/RestUnifiedQueryAction.java:478, opensearch/src/main/java/org/opensearch/sql/opensearch/storage/OpenSearchIndex.java:210, …
  • `catch (RuntimeException)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×4) — core/src/main/java/org/opensearch/sql/job/QueryJob.java:310, core/src/main/java/org/opensearch/sql/expression/function/PPLFuncImpTable.java:472, core/src/main/java/org/opensearch/sql/expression/function/jsonUDF/ForeachJsonArrayFunctionImpl.java:111, …
  • `catch (ReflectiveOperationException | 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. (×2) — core/src/main/java/org/opensearch/sql/expression/function/CalciteIntParameters.java:111, core/src/main/java/org/opensearch/sql/expression/function/PPLTypeChecker.java:796
  • 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. — core/src/main/java/org/opensearch/sql/expression/function/udf/ToNumberFunction.java:97

What to do

  • Swallowed exception (caught, then discarded)
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 logging6.1 / 10Adequate✓ 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.

  • `warn` at line 218 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. — opensearch/src/main/java/org/opensearch/sql/opensearch/executor/OpenSearchExecutionEngine.java:218
  • `info` 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.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. — legacy/src/main/java/org/opensearch/sql/legacy/query/planner/physical/node/pointInTime/PointInTime.java:82
  • `info` at line 197 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. — legacy/src/main/java/org/opensearch/sql/legacy/plugin/RestSqlAction.java:197
  • `error` at line 277 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. — legacy/src/main/java/org/opensearch/sql/legacy/plugin/RestSqlAction.java:277
  • `error` at line 280 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. — legacy/src/main/java/org/opensearch/sql/legacy/plugin/RestSqlAction.java:280
  • `warn` at line 192 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. — legacy/src/main/java/org/opensearch/sql/legacy/executor/format/DateFieldFormatter.java:192
  • `debug` at line 172 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.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. — direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:172
  • `debug` at line 190 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. — direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:190
  • `debug` at line 207 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. — direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:207
  • `debug` at line 229 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. — direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:229
  • `debug` at line 249 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. — direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:249
  • `error` at line 61 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. — direct-query-core/src/main/java/org/opensearch/sql/datasource/client/DataSourceClientFactory.java:61
  • `debug` at line 1926 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. — core/src/main/java/org/opensearch/sql/expression/function/PPLFuncImpTable.java:1926
  • `error` at line 38 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. — async-query-core/src/main/java/org/opensearch/sql/spark/validator/PPLQueryValidator.java:38
  • `error` at line 36 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. — async-query-core/src/main/java/org/opensearch/sql/spark/validator/SQLQueryValidator.java:36
  • `info` at line 136 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. — async-query-core/src/main/java/org/opensearch/sql/spark/flint/operation/FlintIndexOp.java:136
  • `info` at line 74 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text. — async-query-core/src/main/java/org/opensearch/sql/spark/client/EmrServerlessClientImpl.java:74
  • `info` at line 90 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. — async-query-core/src/main/java/org/opensearch/sql/spark/client/EmrServerlessClientImpl.java:90
  • `error` at line 107 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. — async-query-core/src/main/java/org/opensearch/sql/spark/client/EmrServerlessClientImpl.java:107
  • `info` at line 115 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) — async-query-core/src/main/java/org/opensearch/sql/spark/client/EmrServerlessClientImpl.java:115, async-query/src/main/java/org/opensearch/sql/spark/scheduler/job/ScheduledAsyncQueryJobRunner.java:115
  • `info` at line 108 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. — async-query/src/main/java/org/opensearch/sql/spark/scheduler/job/ScheduledAsyncQueryJobRunner.java:108
  • `info` at line 65 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. — async-query/src/main/java/org/opensearch/sql/spark/response/OpenSearchJobExecutionResponseReader.java:65
  • `error` at line 115 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. — async-query/src/main/java/org/opensearch/sql/spark/cluster/FlintIndexRetention.java:115
  • `error` at line 137 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. — async-query/src/main/java/org/opensearch/sql/spark/cluster/FlintIndexRetention.java:137
  • `error` at line 144 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. — async-query/src/main/java/org/opensearch/sql/spark/cluster/FlintIndexRetention.java:144

What to do

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

Other · Code Health — Whether Java packages are null-marked and not undermined by heavy nullness suppression — a package under `@NullMarked` (or `@NonNullApi`, `@ParametersAreNonnullByDefault`, `@NonNullByDefault`, or a NullAway/Checker Framework configuration naming it) makes an unannotated reference exclude null, and `@SuppressWarnings("NullAway")`, `("nullness")`, `("null")` and `castToNonNull(…)` are what silence it.

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

  • 0/325 of this repository's Java package directories are under a non-null default: a `package-info.java` declaring `@NullMarked` (JSpecify) or `@NonNullApi`, `@ParametersAreNonnullByDefault`, `@NonNullByDefault`, `@DefaultQualifier(NonNull.class)`; a `module-info.java` declaring `@NullMarked`; every type in it `@NullMarked`; or a build that runs NullAway with the package in `AnnotatedPackages`, or the Checker Framework's `NullnessChecker`. Elsewhere every reference admits null and no checker warns on the dereference that throws a `NullPointerException`.

What to do

  • Declare the default where Java declares it: `@NullMarked` (org.jspecify.annotations) in each package's `package-info.java`, or once in `module-info.java`, and run NullAway (Error Prone) or the Checker Framework so the declaration is enforced. Then annotate the real exceptions `@Nullable` and resolve the suppressions rather than adding to them: a `@SuppressWarnings("NullAway")` or `castToNonNull(x)` on a value the checker could show to be null is a `NullPointerException` waiting for the path that makes it true — where the value genuinely cannot be null, say something the checker can see instead (a null check, `Objects.requireNonNull`, a non-null field initialised in the constructor).

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 Health57.7Adequate — gated by X5Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture94.1ExemplaryStrongest area.
Maturity75.6StrongSolid.
Readiness78.2StrongSolid.
Security79.8Checked 5 of 11Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance91.4ExemplarySolid.
Unscored — 4 check(s) recorded observations but carry no score

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

  • D11 Test Reliability — 5 observation(s) recorded · This repository declares 5 of its own test(s) unreliable. The built-in reliability runner does not support this repository's ecosystem (.java, .mjs), so the suite was not re-run and no reliability score is given — these are the repository's own declarations, not our measurement.
  • D36 Supply-chain Provenance & Signing — 10 observation(s) recorded · The CI pipeline publishes no artifact — no package publish, container push or release with files to download. Supply-chain provenance, signing and an SBOM describe a PUBLISHED artifact for the people who obtain it, so there is nothing to attest here; a deployment of the service itself publishes nothing for anyone else to verify. Add them to the release pipeline when this repo starts publishing artifacts (a package, a container image, or a release with downloadable files). Build integrity and workflow-token hygiene are reported below: they describe what the CI runs and the token it runs with, neither of which is affected by whether the pipeline ships an artifact.
  • X10 Duplicated predicate — 29 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 — 48 check(s) not relevant to this codebase

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

  • AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
  • AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
  • AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
  • AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
  • AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
  • AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
  • AX1 Captive dependencies — Not applicable: this repository's Java imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's Python imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
  • AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No class in this Java code is a Spring, JSR-330 or CDI singleton bean. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. 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).
  • AX4 Dependency direction — not applicable to a CQRS architecture (the inward-dependency rule is for layered/clean styles)
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — no test/production split to check
  • AXB1 Runtime evidence locked — no reproducible boot — This repository has nothing the runtime tiers could boot or serve — no markup, no UI framework or web-server dependency, no UI component source, no native UI project and no API definition — nothing here is a surface to boot — so runtime a11y/egress/header evidence has no subject here. Not applicable: this is neither a gap in the scan nor a finding about your code.
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • D12 Dependency Hygiene — Dependency currency not established — ci.opensearch.org did not answer
  • 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 — The exposed public-API surface could not be collected — no C#/VB projects loaded.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — D24 reads C#, Visual Basic, TypeScript and JavaScript comments only; comments in this repository's .java, .py source were not judged.
  • D25 ADR Conformance — no ADRs to check
  • D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
  • D32 Data Compliance (PII/GDPR) — 6 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • 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 included — suite not readable by the collector
  • DM1 Domain Modelling — applicable but not scored (2 of 3 signals for this style — below the bar we score at): 290 value object(s); a Domain/Aggregates/ValueObjects layer
  • ED1 Event-Driven — not scored — this repository shows only 1 of the 3 signals this lens looks for (1 CQRS handler(s))
  • 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
  • P12 CI test-gate honesty — Reported, not scored — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
  • P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the JVM, Python source, so there is no service whose uptime a failing dependency could take down
  • P8 Schema migrations — jOOQ is declared, but this repository defines no table or model of its own, so there is no database schema here for this check to judge
  • P9 Domain vs controller coverage — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
  • PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • X1 Async correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X13 Undrained process stream — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • 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
  • X2 Cancellation propagation — no C# was loaded; this repository's Java and Python were read, and no request in it can be cancelled by a caller — a Java request off Android takes no token: it is cancelled through the handle it returns (Future.cancel, Call.cancel, a Disposable), ambiently (io.grpc.Context) or by interrupting its thread, not through a parameter; a Python request takes no token: asyncio cancels the task and trio or anyio the scope that made it, from outside the call, and requests, httpx, aiohttp and gRPC take a timeout, not a cancellation
  • X20 Mistyped argument guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X24 Document value interpolated into markup unescaped — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • 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 — 34 finding(s)
D34 · Knowledge Freshness · Orphaned knowledge · ×11
  • Orphaned knowledge core/src/main/java/org/opensearch/sql/expression/datetime/DateTimeFunctions.java:1 — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge legacy/src/main/java/org/opensearch/sql/legacy/utils/SQLFunctions.java:1 — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge opensearch/src/main/java/org/opensearch/sql/opensearch/storage/serde/ExtendedRelJson.java:1 — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge legacy/src/main/java/org/opensearch/sql/legacy/executor/format/SelectResultSet.java:1 — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge core/src/main/java/org/opensearch/sql/calcite/ForeachPlanner.java:1 — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge core/src/main/java/org/opensearch/sql/utils/DateTimeUtils.java:1 — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge async-query-core/src/main/java/org/opensearch/sql/spark/validator/SQLQueryValidationVisitor.java:1 — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge scripts/docs_exporter/export_to_docs_website.py:1 — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge legacy/src/main/java/org/opensearch/sql/legacy/executor/multi/MinusExecutor.java:1 — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge scripts/docs_exporter/convert_rst_to_md.py:1 — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/filter/lucene/relevance/FunctionParameterRepository.java:1 — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D11 · Test Reliability · Test declared unreliable · ×5
  • Test declared unreliable: datasourceWithBasicAuth async-query/src/test/java/org/opensearch/sql/spark/asyncquery/AsyncQueryExecutorServiceImplSpecTest.java:263 — This test is disabled or skipped with a reason naming unreliability — the repository's own words: "flaky test, java.lang.IllegalArgumentException: Right now only AES/GCM/NoPadding is". A test that is skipped for flakiness is neither passing nor protecting the code it covers; either stabilise it or delete it, but do not leave it disabled indefinitely. (Found by reading the repository's own test source — the suite itself was not re-run, since the reliability runner does not support this ecosystem.)
  • Test declared unreliable: testDateTimeInQuery integ-test/src/test/java/org/opensearch/sql/legacy/JdbcTestIT.java:70 — This test is disabled or skipped with a reason naming unreliability — the repository's own words: "flaky test, trigger resource not enough exception.". A test that is skipped for flakiness is neither passing nor protecting the code it covers; either stabilise it or delete it, but do not leave it disabled indefinitely. (Found by reading the repository's own test source — the suite itself was not re-run, since the reliability runner does not support this ecosystem.)
  • Test declared unreliable: testDivisionInQuery integ-test/src/test/java/org/opensearch/sql/legacy/JdbcTestIT.java:85 — This test is disabled or skipped with a reason naming unreliability — the repository's own words: "flaky test, trigger resource not enough exception.". A test that is skipped for flakiness is neither passing nor protecting the code it covers; either stabilise it or delete it, but do not leave it disabled indefinitely. (Found by reading the repository's own test source — the suite itself was not re-run, since the reliability runner does not support this ecosystem.)
  • Test declared unreliable: testFilterScriptPushDownExplain integ-test/src/test/java/org/opensearch/sql/ppl/ExplainIT.java:626 — This test is disabled or skipped with a reason naming unreliability — the repository's own words: "The serialized string is unstable because of function properties". A test that is skipped for flakiness is neither passing nor protecting the code it covers; either stabilise it or delete it, but do not leave it disabled indefinitely. (Found by reading the repository's own test source — the suite itself was not re-run, since the reliability runner does not support this ecosystem.)
  • Test declared unreliable: testFilterFunctionScriptPushDownExplain integ-test/src/test/java/org/opensearch/sql/ppl/ExplainIT.java:637 — This test is disabled or skipped with a reason naming unreliability — the repository's own words: "The serialized string is unstable because of function properties". 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
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D35 · Change Coupling · Boundary-crossing change coupling · ×2
  • Boundary-crossing change coupling: PPLQueryRequestFactory.java ↔ PPLService.java plugin/src/main/java/org/opensearch/sql/plugin/request/PPLQueryRequestFactory.java:1 — `plugin/src/main/java/org/opensearch/sql/plugin/request/PPLQueryRequestFactory.java` (context plugin) and `ppl/src/main/java/org/opensearch/sql/ppl/PPLService.java` (context ppl) sit in DIFFERENT parts of the tree yet change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `6d666ba4` Remove the opt-in partial-result mode for mapping conflicts (#5814); `92acbec3` Add include_metadata request parameter for PPL queries #5235 (#5412); `f09ab9b6` Overriding profile endpoint with analyze endpoint with operator tree … — run `git show` on any of them.
  • Boundary-crossing change coupling: AsyncQueryExecutorServiceImpl.java ↔ SQLPlugin.java async-query-core/src/main/java/org/opensearch/sql/spark/asyncquery/AsyncQueryExecutorServiceImpl.java:1 — `async-query-core/src/main/java/org/opensearch/sql/spark/asyncquery/AsyncQueryExecutorServiceImpl.java` (context async-query-core) and `plugin/src/main/java/org/opensearch/sql/plugin/SQLPlugin.java` (context plugin) sit in DIFFERENT parts of the tree yet change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `94bd664b` Refactor async executor service dependencies using guice framework (#… (at that commit the file was still `spark/src/main/java/org/opensearch/sql/spark/asyncquery/AsyncQueryExecutorServiceImpl.java`); `b30d3c98` deprecated job-metadata-index (#2339) (at that commit the file was still `spark/src/main/java/org/opensearch/sql/spark/asyncquery/AsyncQueryExecutorServiceImpl.java`); `8f5e01d4` Add sessionId parameters for create async query API (#2312) (at that commit the file was still `spark/src/main/java/org/opensearch/sql/spark/asyncquery/AsyncQueryExecutorServiceImpl.java`) — run `git show` on any of them.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
Serious — 1361 finding(s)
D10 · Test Quality · No assertions · ×478
  • No assertions: testCompileFailure api/src/test/java/org/opensearch/sql/api/compiler/UnifiedQueryCompilerTest.java:82 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testCreateWithInvalidFunctionName api/src/test/java/org/opensearch/sql/api/function/UnifiedFunctionCalciteAdapterTest.java:44 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testParseAggregate api/src/test/java/org/opensearch/sql/api/parser/UnifiedQueryParserSqlTest.java:61 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testParseFilter api/src/test/java/org/opensearch/sql/api/parser/UnifiedQueryParserSqlTest.java:46 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testParseJoin api/src/test/java/org/opensearch/sql/api/parser/UnifiedQueryParserSqlTest.java:91 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testParseOrderBy api/src/test/java/org/opensearch/sql/api/parser/UnifiedQueryParserSqlTest.java:76 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testParseSelectColumns api/src/test/java/org/opensearch/sql/api/parser/UnifiedQueryParserSqlTest.java:36 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testParseSelectStar api/src/test/java/org/opensearch/sql/api/parser/UnifiedQueryParserSqlTest.java:26 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testSyntaxErrorFails api/src/test/java/org/opensearch/sql/api/parser/UnifiedQueryParserSqlTest.java:106 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testSequentialPlanCallsDoNotCorruptShuttleStack api/src/test/java/org/opensearch/sql/api/spec/datetime/DatetimeExtensionTest.java:157 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testInvalidDefaultNamespace api/src/test/java/org/opensearch/sql/api/UnifiedQueryContextTest.java:87 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testInvalidSettingName api/src/test/java/org/opensearch/sql/api/UnifiedQueryContextTest.java:62 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testMissingQueryType api/src/test/java/org/opensearch/sql/api/UnifiedQueryContextTest.java:71 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testPlanPropagatingSyntaxCheckException api/src/test/java/org/opensearch/sql/api/UnifiedQueryPlannerTest.java:122 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testUnsupportedStatementType api/src/test/java/org/opensearch/sql/api/UnifiedQueryPlannerTest.java:117 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: concurrentRefreshJobLimitNotAppliedToDDL async-query/src/test/java/org/opensearch/sql/spark/asyncquery/indexquery/IndexQuerySpecConcurrentTest.java:99 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testGetJobRunState async-query-core/src/test/java/org/opensearch/sql/spark/client/EmrServerlessClientImplTest.java:130 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testStartJobRunResultIndex async-query-core/src/test/java/org/opensearch/sql/spark/client/EmrServerlessClientImplTest.java:113 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testWhenIndexDetailsWithInvalidQueryActionType async-query-core/src/test/java/org/opensearch/sql/spark/dispatcher/IndexDMLHandlerTest.java:103 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: conversionToFullRefreshWithValidOption async-query-core/src/test/java/org/opensearch/sql/spark/flint/FlintIndexMetadataValidatorTest.java:65 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: conversionToIncrementalRefreshWithValidOption async-query-core/src/test/java/org/opensearch/sql/spark/flint/FlintIndexMetadataValidatorTest.java:20 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: leaseManagerAcceptsJobs async-query/src/test/java/org/opensearch/sql/spark/leasemanager/DefaultLeaseManagerTest.java:46 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: composeByDataSourceWithUnregisteredType async-query-core/src/test/java/org/opensearch/sql/spark/parameter/SparkParameterComposerCollectionTest.java:72 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testAcceptNullModifier async-query-core/src/test/java/org/opensearch/sql/spark/parameter/SparkSubmitParametersBuilderTest.java:158 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testAllowAllByDefault async-query-core/src/test/java/org/opensearch/sql/spark/validator/PPLQueryValidatorTest.java:97 — This method's body runs code, and no assertion was recognised in it. Recognised: JUnit's assertion methods (assertEquals, assertTrue, assertInstanceOf, assertThrows, assertThrowsExactly, assertTimeoutPreemptively, assertAll and the rest of JUnit 5's list), assertThat (AssertJ, Hamcrest, Truth), fail, Mockito's verify and the `assert` statement, in the test body and in helper methods of the test's own class or an in-repository base class, followed three calls deep. Verification through a helper on another object or in another class, through a custom matcher library, or through a harness that fails by throwing under some other name is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • + 453 more in this group — see findings.md.
D17 · Explicit Debt · TodoComment · ×217
  • TodoComment sql/src/main/java/org/opensearch/sql/sql/parser/AstBuilder.java:136 — // TODO: project operator should be required? — 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 ppl/src/test/java/org/opensearch/sql/ppl/utils/PPLQueryDataAnonymizerTest.java:369 — // todo, sort order is ignored, it doesn't impact the log analysis. — 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 ppl/src/test/java/org/opensearch/sql/ppl/calcite/CalcitePPLCastFunctionTest.java:30 — // TODO there is no SAFE_CAST() in Spark, the Spark CAST is always safe (return null). — 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 ppl/src/main/java/org/opensearch/sql/ppl/parser/AstExpressionBuilder.java:1236 — // TODO: options ignored for now — 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 ppl/src/main/java/org/opensearch/sql/ppl/parser/AstExpressionBuilder.java:1258 — // TODO: options ignored for now — 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 plugin/src/main/java/org/opensearch/sql/plugin/request/PPLQueryRequestFactory.java:78 — // TODO: deprecated after 4.x — 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 opensearch/src/test/java/org/opensearch/sql/opensearch/storage/script/filter/FilterQueryBuilderTest.java:443 — // TODO remove this test when alternate syntax is implemented for nested — 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 opensearch/src/test/java/org/opensearch/sql/opensearch/data/type/OpenSearchDataTypeRecognitionTest.java:31 — // TODO: ARRAY and new types — 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 opensearch/src/test/java/org/opensearch/sql/opensearch/data/type/OpenSearchDataTypeTest.java:315 — // TODO Arrays — 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 opensearch/src/main/java/org/opensearch/sql/opensearch/storage/OpenSearchIndex.java:218 — // TODO: Leave it here to avoid impact Prometheus and AD operators. Need to move to Planner. — 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 opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/CalciteScriptEngine.java:244 — // TODO: should we change to store timestamp as Instant in the future. — 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 opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/sort/CalciteNumberSortScript.java:39 — // TODO: we'd better get source from the leafLookup of super once it's available — 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 opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/sort/CalciteStringSortScript.java:44 — // TODO: we'd better get source from the leafLookup of super once it's available — 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 opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/filter/CalciteFilterScript.java:40 — // TODO: we'd better get source from the leafLookup of super once it's available — 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 opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/filter/FilterQueryBuilder.java:115 — // TODO Fill in case when adding support for syntax - nested(path, condition) — 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 opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/aggregation/dsl/CompositeAggregationBuilder.java:51 — // todo, Expression should implement buildCompositeValuesSourceBuilder() interface. — 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 opensearch/src/main/java/org/opensearch/sql/opensearch/storage/scan/AbstractCalciteIndexScan.java:385 — // TODO: support script sort and distance sort — 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 opensearch/src/main/java/org/opensearch/sql/opensearch/storage/scan/CalciteEnumerableGraphLookup.java:164 — // TODO: make it more accurate — 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 opensearch/src/main/java/org/opensearch/sql/opensearch/storage/scan/CalciteEnumerableGraphLookup.java:168 — // TODO: support non-scannable inputs — 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 opensearch/src/main/java/org/opensearch/sql/opensearch/storage/scan/CalciteEnumerableGraphLookup.java:418 — // TODO: support spillable for these collections — 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 opensearch/src/main/java/org/opensearch/sql/opensearch/storage/scan/CalciteEnumerableGraphLookup.java:423 — // TODO: If we want to include loop edges, we also need to track the visited edges — 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 opensearch/src/main/java/org/opensearch/sql/opensearch/storage/scan/CalciteLogicalIndexScan.java:168 — // TODO: handle the case where condition contains a score function — 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 opensearch/src/main/java/org/opensearch/sql/opensearch/storage/scan/CalciteLogicalIndexScan.java:396 — // TODO https://github.com/opensearch-project/sql/issues/5006
  • TodoComment opensearch/src/main/java/org/opensearch/sql/opensearch/planner/rules/DedupPushdownRule.java:87 — // TODO https://github.com/opensearch-project/sql/issues/5006
  • TodoComment opensearch/src/main/java/org/opensearch/sql/opensearch/storage/scan/OpenSearchIndexScanQueryBuilder.java:152 — // TODO: improve LogicalPlanOptimizer pushdown api. — 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.
  • + 192 more in this group — see findings.md.
D3 · God Classes · TooManyMethods · ×24
  • TooManyMethods: DSL core/src/main/java/org/opensearch/sql/expression/DSL.java:29 — TooManyMethods — 226 methods. The bar is 30 methods; this is 196 over it, 7.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: CalciteRelNodeVisitor core/src/main/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java:210 — TooManyMethods — 151 methods. The bar is 30 methods; this is 121 over it, 5.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: DateTimeFunctions core/src/main/java/org/opensearch/sql/expression/datetime/DateTimeFunctions.java:94 — TooManyMethods — 147 methods. The bar is 30 methods; this is 117 over it, 4.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: AstDSL core/src/main/java/org/opensearch/sql/ast/dsl/AstDSL.java:94 — 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: AstExpressionBuilder ppl/src/main/java/org/opensearch/sql/ppl/parser/AstExpressionBuilder.java:83 — TooManyMethods — 104 methods. The bar is 30 methods; this is 74 over it, 3.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: AbstractNodeVisitor core/src/main/java/org/opensearch/sql/ast/AbstractNodeVisitor.java:106 — TooManyMethods — 102 methods. The bar is 30 methods; this is 72 over it, 3.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: AstBuilder ppl/src/main/java/org/opensearch/sql/ppl/parser/AstBuilder.java:159 — TooManyMethods — 100 methods. The bar is 30 methods; this is 70 over it, 3.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: SQLQueryValidationVisitor async-query-core/src/main/java/org/opensearch/sql/spark/validator/SQLQueryValidationVisitor.java:90 — TooManyMethods — 80 methods. The bar is 30 methods; this is 50 over it, 2.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: AstExpressionBuilder sql/src/main/java/org/opensearch/sql/sql/parser/AstExpressionBuilder.java:106 — TooManyMethods — 73 methods. The bar is 30 methods; this is 43 over it, 2.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: SQLFunctions legacy/src/main/java/org/opensearch/sql/legacy/utils/SQLFunctions.java:42 — 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: Analyzer core/src/main/java/org/opensearch/sql/analysis/Analyzer.java:163 — TooManyMethods — 71 methods. The bar is 30 methods; this is 41 over it, 2.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PPLQueryDataAnonymizer ppl/src/main/java/org/opensearch/sql/ppl/utils/PPLQueryDataAnonymizer.java:132 — TooManyMethods — 62 methods. The bar is 30 methods; this is 32 over it, 2.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: AntlrSqlParseTreeVisitor legacy/src/main/java/org/opensearch/sql/legacy/antlr/visitor/AntlrSqlParseTreeVisitor.java:60 — TooManyMethods — 45 methods. The bar is 30 methods; this is 15 over it, 1.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: SelectResultSet legacy/src/main/java/org/opensearch/sql/legacy/executor/format/SelectResultSet.java:60 — TooManyMethods — 41 methods. The bar is 30 methods; this is 11 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: MathematicalFunctions REDACTED:49 — TooManyMethods — 40 methods. The bar is 30 methods; this is 10 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.
  • TooManyMethods: ExpressionAnalyzer core/src/main/java/org/opensearch/sql/analysis/ExpressionAnalyzer.java:86 — TooManyMethods — 38 methods. The bar is 30 methods; this is 8 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Visitor opensearch/src/main/java/org/opensearch/sql/opensearch/request/PredicateAnalyzer.java:256 — TooManyMethods — 38 methods. The bar is 30 methods; this is 8 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: SimpleQueryExpression opensearch/src/main/java/org/opensearch/sql/opensearch/request/PredicateAnalyzer.java:1501 — TooManyMethods — 38 methods. The bar is 30 methods; this is 8 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PrometheusClientImpl direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:37 — TooManyMethods — 36 methods. The bar is 30 methods; this is 6 over it, 1.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: QueryExpression opensearch/src/main/java/org/opensearch/sql/opensearch/request/PredicateAnalyzer.java:1241 — TooManyMethods — 34 methods. The bar is 30 methods; this is 4 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: CanPaginateVisitor core/src/main/java/org/opensearch/sql/executor/pagination/CanPaginateVisitor.java:66 — TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: OpenSearchRequestBuilder opensearch/src/main/java/org/opensearch/sql/opensearch/request/OpenSearchRequestBuilder.java:58 — TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ExprValueUtils core/src/main/java/org/opensearch/sql/data/model/ExprValueUtils.java:33 — TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: QueryService core/src/main/java/org/opensearch/sql/executor/QueryService.java:78 — TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D3 · God Classes · FileTooLong · ×23
  • FileTooLong: calcite/CalciteRelNodeVisitor.java core/src/main/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java — FileTooLong — 3543 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3043 over it, 7.09× 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: function/PPLFuncImpTable.java core/src/main/java/org/opensearch/sql/expression/function/PPLFuncImpTable.java — FileTooLong — 1451 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 951 over it, 2.90× 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: request/PredicateAnalyzer.java opensearch/src/main/java/org/opensearch/sql/opensearch/request/PredicateAnalyzer.java — FileTooLong — 1426 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 926 over it, 2.85× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: parser/AstBuilder.java ppl/src/main/java/org/opensearch/sql/ppl/parser/AstBuilder.java — FileTooLong — 1366 significant lines (blank, comment-only and punctuation-only lines excluded), about 89% of them inside a single declaration: AstBuilder (159-1954). The bar is 500 significant lines; this is 866 over it, 2.73× 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: datetime/DateTimeFunctions.java core/src/main/java/org/opensearch/sql/expression/datetime/DateTimeFunctions.java — FileTooLong — 1288 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 788 over it, 2.58× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: utils/PPLQueryDataAnonymizer.java ppl/src/main/java/org/opensearch/sql/ppl/utils/PPLQueryDataAnonymizer.java — FileTooLong — 962 significant lines (blank, comment-only and punctuation-only lines excluded), about 87% of them inside a single declaration: PPLQueryDataAnonymizer (132-1312). The bar is 500 significant lines; this is 462 over it, 1.92× 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: utils/SQLFunctions.java legacy/src/main/java/org/opensearch/sql/legacy/utils/SQLFunctions.java — FileTooLong — 901 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: SQLFunctions (42-1208). The bar is 500 significant lines; this is 401 over it, 1.80× 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/AstExpressionBuilder.java ppl/src/main/java/org/opensearch/sql/ppl/parser/AstExpressionBuilder.java — FileTooLong — 860 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: AstExpressionBuilder (83-1261). The bar is 500 significant lines; this is 360 over it, 1.72× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: analysis/Analyzer.java core/src/main/java/org/opensearch/sql/analysis/Analyzer.java — FileTooLong — 761 significant lines (blank, comment-only and punctuation-only lines excluded), about 80% of them inside a single declaration: Analyzer (163-1037). The bar is 500 significant lines; this is 261 over it, 1.52× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: setting/OpenSearchSettings.java opensearch/src/main/java/org/opensearch/sql/opensearch/setting/OpenSearchSettings.java — FileTooLong — 751 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: OpenSearchSettings (40-853). The bar is 500 significant lines; this is 251 over it, 1.50× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: calcite/CalciteRexNodeVisitor.java core/src/main/java/org/opensearch/sql/calcite/CalciteRexNodeVisitor.java — FileTooLong — 731 significant lines (blank, comment-only and punctuation-only lines excluded), about 87% of them inside a single declaration: CalciteRexNodeVisitor (104-1029). The bar is 500 significant lines; this is 231 over it, 1.46× 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/ElasticSqlExprParser.java legacy/src/main/java/org/opensearch/sql/legacy/parser/ElasticSqlExprParser.java — FileTooLong — 724 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: ElasticSqlExprParser (56-1053). The bar is 500 significant lines; this is 224 over it, 1.45× 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: request/AggregateAnalyzer.java opensearch/src/main/java/org/opensearch/sql/opensearch/request/AggregateAnalyzer.java — FileTooLong — 668 significant lines (blank, comment-only and punctuation-only lines excluded), about 88% of them inside a single declaration: AggregateAnalyzer (116-992). The bar is 500 significant lines; this is 168 over it, 1.34× 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/WhereParser.java legacy/src/main/java/org/opensearch/sql/legacy/parser/WhereParser.java — FileTooLong — 645 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: WhereParser (46-849). The bar is 500 significant lines; this is 145 over it, 1.29× 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: maker/AggMaker.java legacy/src/main/java/org/opensearch/sql/legacy/query/maker/AggMaker.java — FileTooLong — 639 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: AggMaker (63-847). The bar is 500 significant lines; this is 139 over it, 1.28× 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: utils/PlanUtils.java core/src/main/java/org/opensearch/sql/calcite/utils/PlanUtils.java — FileTooLong — 591 significant lines (blank, comment-only and punctuation-only lines excluded), about 88% of them inside a single declaration: PlanUtils (80-914). The bar is 500 significant lines; this is 91 over it, 1.18× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 580 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: MathematicalFunctions (49-916). The bar is 500 significant lines; this is 80 over it, 1.16× 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: serde/ExtendedRelJson.java opensearch/src/main/java/org/opensearch/sql/opensearch/storage/serde/ExtendedRelJson.java — FileTooLong — 573 significant lines (blank, comment-only and punctuation-only lines excluded), about 87% of them inside a single declaration: ExtendedRelJson (93-817). The bar is 500 significant lines; this is 73 over it, 1.15× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: client/PrometheusClientImpl.java direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java — FileTooLong — 529 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: PrometheusClientImpl (37-731). The bar is 500 significant lines; this is 29 over it, 1.06× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: executor/QueryService.java core/src/main/java/org/opensearch/sql/executor/QueryService.java — FileTooLong — 528 significant lines (blank, comment-only and punctuation-only lines excluded), about 87% of them inside a single declaration: QueryService (78-767). The bar is 500 significant lines; this is 28 over it, 1.06× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: expression/DSL.java core/src/main/java/org/opensearch/sql/expression/DSL.java — FileTooLong — 524 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: DSL (29-1000). The bar is 500 significant lines; this is 24 over it, 1.05× 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: function/PPLBuiltinOperators.java core/src/main/java/org/opensearch/sql/expression/function/PPLBuiltinOperators.java — FileTooLong — 524 significant lines (blank, comment-only and punctuation-only lines excluded), about 77% of them inside a single declaration: PPLBuiltinOperators (128-587). The bar is 500 significant lines; this is 24 over it, 1.05× 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/AstExpressionBuilder.java sql/src/main/java/org/opensearch/sql/sql/parser/AstExpressionBuilder.java — FileTooLong — 522 significant lines (blank, comment-only and punctuation-only lines excluded), about 82% of them inside a single declaration: AstExpressionBuilder (106-738). The bar is 500 significant lines; this is 22 over it, 1.04× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
D3 · God Classes · ClassTooLong · ×20
  • ClassTooLong: AstBuilder ppl/src/main/java/org/opensearch/sql/ppl/parser/AstBuilder.java:159 — ClassTooLong — 1217 significant lines (blank, comment-only and punctuation-only lines excluded), 100 methods. The bar is 400 significant lines; this is 817 over it, 3.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: SQLFunctions legacy/src/main/java/org/opensearch/sql/legacy/utils/SQLFunctions.java:42 — ClassTooLong — 869 significant lines (blank, comment-only and punctuation-only lines excluded), 72 methods. The bar is 400 significant lines; this is 469 over it, 2.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: PPLQueryDataAnonymizer ppl/src/main/java/org/opensearch/sql/ppl/utils/PPLQueryDataAnonymizer.java:132 — ClassTooLong — 840 significant lines (blank, comment-only and punctuation-only lines excluded), 62 methods. The bar is 400 significant lines; this is 440 over it, 2.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: AstExpressionBuilder ppl/src/main/java/org/opensearch/sql/ppl/parser/AstExpressionBuilder.java:83 — ClassTooLong — 787 significant lines (blank, comment-only and punctuation-only lines excluded), 104 methods. The bar is 400 significant lines; this is 387 over it, 1.97× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: OpenSearchSettings opensearch/src/main/java/org/opensearch/sql/opensearch/setting/OpenSearchSettings.java:40 — ClassTooLong — 721 significant lines (blank, comment-only and punctuation-only lines excluded), 7 methods. The bar is 400 significant lines; this is 321 over it, 1.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ElasticSqlExprParser legacy/src/main/java/org/opensearch/sql/legacy/parser/ElasticSqlExprParser.java:56 — ClassTooLong — 678 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods. The bar is 400 significant lines; this is 278 over it, 1.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Analyzer core/src/main/java/org/opensearch/sql/analysis/Analyzer.java:163 — ClassTooLong — 611 significant lines (blank, comment-only and punctuation-only lines excluded), 71 methods. The bar is 400 significant lines; this is 211 over it, 1.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: WhereParser legacy/src/main/java/org/opensearch/sql/legacy/parser/WhereParser.java:46 — ClassTooLong — 608 significant lines (blank, comment-only and punctuation-only lines excluded), 22 methods. The bar is 400 significant lines; this is 208 over it, 1.52× 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: AggregateAnalyzer opensearch/src/main/java/org/opensearch/sql/opensearch/request/AggregateAnalyzer.java:116 — ClassTooLong — 587 significant lines (blank, comment-only and punctuation-only lines excluded), 22 methods. The bar is 400 significant lines; this is 187 over it, 1.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.
  • ClassTooLong: AggMaker legacy/src/main/java/org/opensearch/sql/legacy/query/maker/AggMaker.java:63 — ClassTooLong — 584 significant lines (blank, comment-only and punctuation-only lines excluded), 21 methods. The bar is 400 significant lines; this is 184 over it, 1.46× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: MathematicalFunctions REDACTED:49 — ClassTooLong — 540 significant lines (blank, comment-only and punctuation-only lines excluded), 40 methods. The bar is 400 significant lines; this is 140 over it, 1.35× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: PlanUtils core/src/main/java/org/opensearch/sql/calcite/utils/PlanUtils.java:80 — ClassTooLong — 520 significant lines (blank, comment-only and punctuation-only lines excluded), 41 methods. The bar is 400 significant lines; this is 120 over it, 1.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: DSL core/src/main/java/org/opensearch/sql/expression/DSL.java:29 — ClassTooLong — 503 significant lines (blank, comment-only and punctuation-only lines excluded), 226 methods. The bar is 400 significant lines; this is 103 over it, 1.26× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: PrometheusClientImpl direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:37 — ClassTooLong — 503 significant lines (blank, comment-only and punctuation-only lines excluded), 36 methods. The bar is 400 significant lines; this is 103 over it, 1.26× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ExtendedRelJson opensearch/src/main/java/org/opensearch/sql/opensearch/storage/serde/ExtendedRelJson.java:93 — ClassTooLong — 498 significant lines (blank, comment-only and punctuation-only lines excluded), 25 methods. The bar is 400 significant lines; this is 98 over it, 1.25× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: QueryService core/src/main/java/org/opensearch/sql/executor/QueryService.java:78 — ClassTooLong — 459 significant lines (blank, comment-only and punctuation-only lines excluded), 31 methods. The bar is 400 significant lines; this is 59 over it, 1.15× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ForeachPlanner core/src/main/java/org/opensearch/sql/calcite/ForeachPlanner.java:63 — ClassTooLong — 429 significant lines (blank, comment-only and punctuation-only lines excluded), 27 methods. The bar is 400 significant lines; this is 29 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: SelectResultSet legacy/src/main/java/org/opensearch/sql/legacy/executor/format/SelectResultSet.java:60 — ClassTooLong — 428 significant lines (blank, comment-only and punctuation-only lines excluded), 41 methods. The bar is 400 significant lines; this is 28 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: AstExpressionBuilder sql/src/main/java/org/opensearch/sql/sql/parser/AstExpressionBuilder.java:106 — ClassTooLong — 426 significant lines (blank, comment-only and punctuation-only lines excluded), 73 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: PPLBuiltinOperators core/src/main/java/org/opensearch/sql/expression/function/PPLBuiltinOperators.java:128 — ClassTooLong — 406 significant lines (blank, comment-only and punctuation-only lines excluded), 2 methods. The bar is 400 significant lines; this is 6 over it, 1.02× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×19
  • Duplicated block (8 lines × 2) core/src/main/java/org/opensearch/sql/ast/expression/WindowFrame.java:57 — core/src/main/java/org/opensearch/sql/ast/expression/WindowFrame.java:57-64 | core/src/main/java/org/opensearch/sql/ast/expression/WindowFrame.java:65-72 — both copies are in the same file, so extract the block into 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) core/src/main/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java:2011 — core/src/main/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java:2011-2018 | core/src/main/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java:2073-2080 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/opensearch/sql/calcite/CalciteRelNodeVisitor.java:2011` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (8 lines × 2) core/src/main/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java:2032 — core/src/main/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java:2032-2039 | core/src/main/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java:2108-2115 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/opensearch/sql/calcite/CalciteRelNodeVisitor.java:2032` it does not close everything it opens, so those exact lines 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/java/org/opensearch/sql/data/model/ExprDateValue.java:35 — core/src/main/java/org/opensearch/sql/data/model/ExprDateValue.java:35-42 | core/src/main/java/org/opensearch/sql/data/model/ExprTimestampValue.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 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/opensearch/sql/data/model/ExprDateValue.java:35` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) core/src/main/java/org/opensearch/sql/expression/operator/predicate/UnaryPredicateOperators.java:104 — core/src/main/java/org/opensearch/sql/expression/operator/predicate/UnaryPredicateOperators.java:104-111 | core/src/main/java/org/opensearch/sql/expression/operator/predicate/UnaryPredicateOperators.java:120-127 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:353 — direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:353-360 | direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:467-474 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:353` it does not close everything it opens, so those exact lines 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) legacy/src/main/java/org/opensearch/sql/legacy/executor/AsyncRestExecutor.java:115 — legacy/src/main/java/org/opensearch/sql/legacy/executor/AsyncRestExecutor.java:115-122 | legacy/src/main/java/org/opensearch/sql/legacy/executor/cursor/CursorAsyncRestExecutor.java:57-64 — before extracting anything, compare `legacy/src/main/java/org/opensearch/sql/legacy/executor/AsyncRestExecutor.java` and `legacy/src/main/java/org/opensearch/sql/legacy/executor/cursor/CursorAsyncRestExecutor.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. Read the line range as the matched WINDOW rather than a finished unit: at `legacy/src/main/java/org/opensearch/sql/legacy/executor/AsyncRestExecutor.java:115` 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) legacy/src/main/java/org/opensearch/sql/legacy/parser/ChildrenType.java:54 — legacy/src/main/java/org/opensearch/sql/legacy/parser/ChildrenType.java:54-61 | legacy/src/main/java/org/opensearch/sql/legacy/parser/NestedType.java:80-87 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `legacy/src/main/java/org/opensearch/sql/legacy/parser/ChildrenType.java:54` 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) opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/aggregation/dsl/MetricAggregationBuilder.java:183 — opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/aggregation/dsl/MetricAggregationBuilder.java:183-190 | opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/aggregation/dsl/MetricAggregationBuilder.java:200-207 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/aggregation/dsl/MetricAggregationBuilder.java:183` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) REDACTED:51 — REDACTED:51-58 | REDACTED:135-142 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `REDACTED:51` it does not close everything it opens, so those exact lines 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) ppl/src/main/java/org/opensearch/sql/ppl/PPLService.java:146 — ppl/src/main/java/org/opensearch/sql/ppl/PPLService.java:146-153 | ppl/src/main/java/org/opensearch/sql/ppl/PPLService.java:193-200 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `ppl/src/main/java/org/opensearch/sql/ppl/PPLService.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `ppl/src/main/java/org/opensearch/sql/ppl/PPLService.java:201` calls `explainMode`, `getExplainMode`, `includeMetadata` and `ppl/src/main/java/org/opensearch/sql/ppl/PPLService.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 (8 lines × 2) sql/src/main/java/org/opensearch/sql/sql/parser/AstExpressionBuilder.java:591 — sql/src/main/java/org/opensearch/sql/sql/parser/AstExpressionBuilder.java:591-598 | sql/src/main/java/org/opensearch/sql/sql/parser/AstExpressionBuilder.java:606-613 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/src/main/java/org/opensearch/sql/sql/parser/AstExpressionBuilder.java:591` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note first that the copies are not typed on the same thing: the declarations holding them bind `ctx` to `SingleFieldRelevanceFunctionContext` in one and `AltSingleFieldRelevanceFunctionContext` 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) core/src/main/java/org/opensearch/sql/expression/function/udf/condition/EarliestFunction.java:61 — core/src/main/java/org/opensearch/sql/expression/function/udf/condition/EarliestFunction.java:61-68 | core/src/main/java/org/opensearch/sql/expression/function/udf/condition/LatestFunction.java:61-68 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) opensearch/src/main/java/org/opensearch/sql/opensearch/functions/GeoIpFunction.java:114 — opensearch/src/main/java/org/opensearch/sql/opensearch/functions/GeoIpFunction.java:114-121 | opensearch/src/main/java/org/opensearch/sql/opensearch/planner/physical/OpenSearchEvalProcessor.java:61-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 `opensearch/src/main/java/org/opensearch/sql/opensearch/functions/GeoIpFunction.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. Note first that the copies are not typed on the same thing: `Expression` names `org.apache.calcite.linq4j.tree.Expression` in one and `org.opensearch.sql.expression.Expression` 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 (8 lines × 2) core/src/main/java/org/opensearch/sql/ast/tree/Rename.java:52 — core/src/main/java/org/opensearch/sql/ast/tree/Rename.java:52-59 | core/src/main/java/org/opensearch/sql/ast/tree/Replace.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 both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) legacy/src/main/java/org/opensearch/sql/legacy/executor/format/ErrorMessage.java:50 — legacy/src/main/java/org/opensearch/sql/legacy/executor/format/ErrorMessage.java:50-57 | opensearch/src/main/java/org/opensearch/sql/opensearch/response/error/ErrorMessage.java:72-79 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) core/src/main/java/org/opensearch/sql/expression/function/udf/condition/EarliestFunction.java:50 — core/src/main/java/org/opensearch/sql/expression/function/udf/condition/EarliestFunction.java:50-57 | core/src/main/java/org/opensearch/sql/expression/function/udf/condition/LatestFunction.java:50-57 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/main/java/org/opensearch/sql/expression/function/udf/condition/EarliestFunction.java:50` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) direct-query-core/src/main/java/org/opensearch/sql/prometheus/model/PrometheusQueryType.java:28 — direct-query-core/src/main/java/org/opensearch/sql/prometheus/model/PrometheusQueryType.java:28-35 | opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/CompoundedScriptEngine.java:81-88 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) core/src/main/java/org/opensearch/sql/analysis/Analyzer.java:946 — core/src/main/java/org/opensearch/sql/analysis/Analyzer.java:946-953 | core/src/main/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java:861-868 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×18
  • Duplicated block (7 lines × 2) async-query/src/main/java/org/opensearch/sql/spark/execution/statestore/StateStore.java:223 — async-query/src/main/java/org/opensearch/sql/spark/execution/statestore/StateStore.java:223-229 | datasources/src/main/java/org/opensearch/sql/datasources/storage/OpenSearchDataSourceMetadataStorage.java:224-230 — 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 `async-query/src/main/java/org/opensearch/sql/spark/execution/statestore/StateStore.java:223` it does not close everything it opens, so those exact lines 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/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java:2630 — core/src/main/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java:2630-2636 | core/src/main/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java:2853-2859 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/opensearch/sql/calcite/CalciteRelNodeVisitor.java:2630` 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/java/org/opensearch/sql/expression/function/udf/Dur2SecConvertFunction.java:36 — core/src/main/java/org/opensearch/sql/expression/function/udf/Dur2SecConvertFunction.java:36-42 | core/src/main/java/org/opensearch/sql/expression/function/udf/MsTimeConvertFunction.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 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/opensearch/sql/expression/function/udf/Dur2SecConvertFunction.java: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.
  • Duplicated block (7 lines × 2) datasources/src/main/java/org/opensearch/sql/datasources/utils/XContentParserUtils.java:54 — datasources/src/main/java/org/opensearch/sql/datasources/utils/XContentParserUtils.java:54-60 | datasources/src/main/java/org/opensearch/sql/datasources/utils/XContentParserUtils.java:111-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 `datasources/src/main/java/org/opensearch/sql/datasources/utils/XContentParserUtils.java: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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `datasources/src/main/java/org/opensearch/sql/datasources/utils/XContentParserUtils.java:118` calls `put` and `datasources/src/main/java/org/opensearch/sql/datasources/utils/XContentParserUtils.java:61` 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) direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:174 — direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:174-180 | direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:192-198 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:174` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) legacy/src/main/java/org/opensearch/sql/legacy/parser/ElasticSqlExprParser.java:385 — legacy/src/main/java/org/opensearch/sql/legacy/parser/ElasticSqlExprParser.java:385-394 | legacy/src/main/java/org/opensearch/sql/legacy/parser/ElasticSqlExprParser.java:560-566 — both copies are in the same file, so extract the block into 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) opensearch/src/main/java/org/opensearch/sql/opensearch/response/agg/ArgMaxMinParser.java:25 — opensearch/src/main/java/org/opensearch/sql/opensearch/response/agg/ArgMaxMinParser.java:25-31 | opensearch/src/main/java/org/opensearch/sql/opensearch/response/agg/TopHitsParser.java:58-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. The matched lines also transfer control out of the body holding them, 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) opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/sort/CalciteNumberSortScript.java:37 — opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/sort/CalciteNumberSortScript.java:37-43 | opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/sort/CalciteStringSortScript.java:42-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 both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (7 lines × 2) prometheus/src/main/java/org/opensearch/sql/prometheus/functions/implementation/QueryExemplarFunctionImplementation.java:96 — prometheus/src/main/java/org/opensearch/sql/prometheus/functions/implementation/QueryExemplarFunctionImplementation.java:96-102 | prometheus/src/main/java/org/opensearch/sql/prometheus/functions/implementation/QueryRangeFunctionImplementation.java:97-103 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `prometheus/src/main/java/org/opensearch/sql/prometheus/functions/implementation/QueryRangeFunctionImplementation.java:105` calls `setStep`, `value`, `toString` and `prometheus/src/main/java/org/opensearch/sql/prometheus/functions/implementation/QueryExemplarFunctionImplementation.java:103` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 2) sql/src/main/java/org/opensearch/sql/sql/parser/AstExpressionBuilder.java:627 — sql/src/main/java/org/opensearch/sql/sql/parser/AstExpressionBuilder.java:627-633 | sql/src/main/java/org/opensearch/sql/sql/parser/AstExpressionBuilder.java:710-716 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sql/src/main/java/org/opensearch/sql/sql/parser/AstExpressionBuilder.java:627` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note first that the copies are not typed on the same thing: the declarations holding them bind `ctx` to `MultiFieldRelevanceFunctionContext` in one and `AltMultiFieldRelevanceFunctionContext` 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) core/src/main/java/org/opensearch/sql/calcite/utils/binning/time/DaySpanHandler.java:39 — core/src/main/java/org/opensearch/sql/calcite/utils/binning/time/DaySpanHandler.java:39-45 | core/src/main/java/org/opensearch/sql/calcite/utils/binning/time/MonthSpanHandler.java:84-90 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, 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) legacy/src/main/java/org/opensearch/sql/legacy/plugin/RestSqlAction.java:255 — legacy/src/main/java/org/opensearch/sql/legacy/plugin/RestSqlAction.java:255-261 | legacy/src/main/java/org/opensearch/sql/legacy/plugin/RestSqlStatsAction.java:84-90 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, 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) legacy/src/main/java/org/opensearch/sql/legacy/rewriter/nestedfield/NestedFieldProjection.java:161 — legacy/src/main/java/org/opensearch/sql/legacy/rewriter/nestedfield/NestedFieldProjection.java:161-167 | opensearch/src/main/java/org/opensearch/sql/opensearch/request/OpenSearchRequestBuilder.java:480-486 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) opensearch/src/main/java/org/opensearch/sql/opensearch/planner/rules/FilterIndexScanRule.java:43 — opensearch/src/main/java/org/opensearch/sql/opensearch/planner/rules/FilterIndexScanRule.java:43-49 | opensearch/src/main/java/org/opensearch/sql/opensearch/planner/rules/RelevanceFunctionPushdownRule.java:56-62 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) ppl/src/main/java/org/opensearch/sql/ppl/parser/AstStatementBuilder.java:88 — ppl/src/main/java/org/opensearch/sql/ppl/parser/AstStatementBuilder.java:88-94 | ppl/src/main/java/org/opensearch/sql/ppl/utils/UnresolvedPlanHelper.java:20-26 — 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) async-query-core/src/main/java/org/opensearch/sql/spark/utils/SQLQueryUtils.java:94 — async-query-core/src/main/java/org/opensearch/sql/spark/utils/SQLQueryUtils.java:94-100 | async-query-core/src/main/java/org/opensearch/sql/spark/validator/PPLQueryValidator.java:43-49 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) core/src/main/java/org/opensearch/sql/calcite/type/ExprJavaType.java:44 — core/src/main/java/org/opensearch/sql/calcite/type/ExprJavaType.java:44-50 | core/src/main/java/org/opensearch/sql/calcite/type/ExprSqlType.java:91-97 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, 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) ppl/src/main/java/org/opensearch/sql/ppl/parser/AstExpressionBuilder.java:284 — ppl/src/main/java/org/opensearch/sql/ppl/parser/AstExpressionBuilder.java:284-290 | sql/src/main/java/org/opensearch/sql/sql/parser/AstExpressionBuilder.java:306-312 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `ctx` to `OpenSearchPPLParser.IsNullPredicateContext` in one and `IsNullPredicateContext` 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.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×17
  • Swallowed exception (caught, then discarded) plugin/src/main/java/org/opensearch/sql/plugin/rest/RestUnifiedQueryAction.java:135 — `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) plugin/src/main/java/org/opensearch/sql/plugin/rest/RestUnifiedQueryAction.java:478 — `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) opensearch/src/main/java/org/opensearch/sql/opensearch/storage/OpenSearchIndex.java:210 — `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) opensearch/src/main/java/org/opensearch/sql/opensearch/planner/rules/RareTopPushdownRule.java:78 — `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) opensearch/src/main/java/org/opensearch/sql/opensearch/monitor/OpenSearchResourceMonitor.java:68 — `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) legacy/src/main/java/org/opensearch/sql/legacy/domain/ColumnTypeProvider.java:75 — `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) core/src/main/java/org/opensearch/sql/job/QueryJob.java:310 — `catch (RuntimeException)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) core/src/main/java/org/opensearch/sql/expression/function/CalciteIntParameters.java:111 — `catch (ReflectiveOperationException | 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) core/src/main/java/org/opensearch/sql/expression/function/PPLFuncImpTable.java:472 — `catch (RuntimeException)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) core/src/main/java/org/opensearch/sql/expression/function/PPLTypeChecker.java:796 — `catch (ReflectiveOperationException | 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) core/src/main/java/org/opensearch/sql/expression/function/udf/CTimeConvertFunction.java:83 — `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) core/src/main/java/org/opensearch/sql/expression/function/udf/ToStringFunction.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) core/src/main/java/org/opensearch/sql/expression/function/jsonUDF/ForeachJsonArrayFunctionImpl.java:111 — `catch (RuntimeException)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) core/src/main/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java:3909 — `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) core/src/main/java/org/opensearch/sql/calcite/ForeachPlanner.java:540 — `catch (RuntimeException)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) core/src/main/java/org/opensearch/sql/calcite/utils/PlanUtils.java:632 — `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) core/src/main/java/org/opensearch/sql/ast/statement/ExplainMode.java:26 — `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.
D4 · Code Duplication · Edited copy of a member (9 corresponding lines) · ×15
  • Edited copy of a member (9 corresponding lines) prometheus/src/main/java/org/opensearch/sql/prometheus/request/system/PrometheusDescribeMetricRequest.java:99 — prometheus/src/main/java/org/opensearch/sql/prometheus/request/system/PrometheusDescribeMetricRequest.java:99-107 | prometheus/src/main/java/org/opensearch/sql/prometheus/request/system/PrometheusListMetricsRequest.java:60-69 — 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) opensearch/src/main/java/org/opensearch/sql/opensearch/planner/physical/MLCommonsOperatorActions.java:106 — opensearch/src/main/java/org/opensearch/sql/opensearch/planner/physical/MLCommonsOperatorActions.java:106-114 | opensearch/src/main/java/org/opensearch/sql/opensearch/planner/physical/MLCommonsOperatorActions.java:163-176 — 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) api/src/main/java/org/opensearch/sql/api/function/UnifiedFunctionCalciteAdapter.java:99 — api/src/main/java/org/opensearch/sql/api/function/UnifiedFunctionCalciteAdapter.java:99-107 | api/src/main/java/org/opensearch/sql/api/function/UnifiedFunctionCalciteAdapter.java:109-117 — 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/java/org/opensearch/sql/expression/datetime/DateTimeFunctions.java:350 — core/src/main/java/org/opensearch/sql/expression/datetime/DateTimeFunctions.java:350-358 | core/src/main/java/org/opensearch/sql/expression/datetime/DateTimeFunctions.java:770-778 — 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) legacy/src/main/java/org/opensearch/sql/legacy/executor/format/OpenSearchErrorMessage.java:55 — legacy/src/main/java/org/opensearch/sql/legacy/executor/format/OpenSearchErrorMessage.java:55-63 | opensearch/src/main/java/org/opensearch/sql/opensearch/response/error/OpenSearchErrorMessage.java:53-62 — 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/java/org/opensearch/sql/calcite/utils/binning/handlers/DefaultBinHandler.java:73 — core/src/main/java/org/opensearch/sql/calcite/utils/binning/handlers/DefaultBinHandler.java:73-83 | core/src/main/java/org/opensearch/sql/calcite/utils/binning/time/StandardTimeSpanHandler.java:157-165 — 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) legacy/src/main/java/org/opensearch/sql/legacy/domain/Condition.java:137 — legacy/src/main/java/org/opensearch/sql/legacy/domain/Condition.java:137-145 | legacy/src/main/java/org/opensearch/sql/legacy/domain/Condition.java:147-155 — 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/java/org/opensearch/sql/ast/expression/SearchLiteral.java:124 — core/src/main/java/org/opensearch/sql/ast/expression/SearchLiteral.java:124-136 | core/src/main/java/org/opensearch/sql/utils/DateTimeUtils.java:420-428 — 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/java/org/opensearch/sql/expression/aggregation/AvgAggregator.java:108 — core/src/main/java/org/opensearch/sql/expression/aggregation/AvgAggregator.java:108-118 | core/src/main/java/org/opensearch/sql/expression/aggregation/AvgAggregator.java:150-158 — 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/java/org/opensearch/sql/expression/datetime/CalendarLookup.java:60 — core/src/main/java/org/opensearch/sql/expression/datetime/CalendarLookup.java:60-69 | core/src/main/java/org/opensearch/sql/expression/datetime/CalendarLookup.java:77-85 — 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/java/org/opensearch/sql/ast/AbstractNodeVisitor.java:119 — core/src/main/java/org/opensearch/sql/ast/AbstractNodeVisitor.java:119-127 | core/src/main/java/org/opensearch/sql/expression/ExpressionNodeVisitor.java:34-42 — 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) legacy/src/main/java/org/opensearch/sql/legacy/request/SqlRequestFactory.java:27 — legacy/src/main/java/org/opensearch/sql/legacy/request/SqlRequestFactory.java:27-35 | plugin/src/main/java/org/opensearch/sql/plugin/request/PPLQueryRequestFactory.java:49-59 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) protocol/src/main/java/org/opensearch/sql/protocol/response/format/CsvResponseFormatter.java:30 — protocol/src/main/java/org/opensearch/sql/protocol/response/format/CsvResponseFormatter.java:30-38 | protocol/src/main/java/org/opensearch/sql/protocol/response/format/RawResponseFormatter.java:36-44 — 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) legacy/src/main/java/org/opensearch/sql/legacy/request/SqlRequestFactory.java:37 — legacy/src/main/java/org/opensearch/sql/legacy/request/SqlRequestFactory.java:37-45 | plugin/src/main/java/org/opensearch/sql/plugin/request/PPLQueryRequestFactory.java:61-69 — 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) opensearch/src/main/java/org/opensearch/sql/opensearch/storage/scan/CalciteLogicalIndexScan.java:77 — opensearch/src/main/java/org/opensearch/sql/opensearch/storage/scan/CalciteLogicalIndexScan.java:77-86 | opensearch/src/main/java/org/opensearch/sql/opensearch/storage/system/CalciteLogicalCatalogScan.java:23-31 — 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.
D3 · God Classes · MethodTooLong · ×13
  • MethodTooLong: WhereParser.explainCond legacy/src/main/java/org/opensearch/sql/legacy/parser/WhereParser.java:229 — MethodTooLong — explainCond runs 333 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 233 over it, 3.33× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: OpenSearchSettings.<init> opensearch/src/main/java/org/opensearch/sql/opensearch/setting/OpenSearchSettings.java:421 — MethodTooLong — <init> runs 310 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 210 over it, 3.10× 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: SQLFunctions.function legacy/src/main/java/org/opensearch/sql/legacy/utils/SQLFunctions.java:130 — MethodTooLong — function runs 278 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 178 over it, 2.78× 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: ElasticSqlExprParser.primaryRest legacy/src/main/java/org/opensearch/sql/legacy/parser/ElasticSqlExprParser.java:298 — MethodTooLong — primaryRest runs 243 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 143 over it, 2.43× 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: Maker.make legacy/src/main/java/org/opensearch/sql/legacy/query/maker/Maker.java:193 — MethodTooLong — make 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: AggregateAnalyzer.createRegularAggregation opensearch/src/main/java/org/opensearch/sql/opensearch/request/AggregateAnalyzer.java:483 — MethodTooLong — createRegularAggregation runs 150 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 50 over it, 1.50× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ExtendedRelJson.toRex opensearch/src/main/java/org/opensearch/sql/opensearch/storage/serde/ExtendedRelJson.java:394 — MethodTooLong — toRex runs 122 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 22 over it, 1.22× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: QueryService.analyzeWithCalcite core/src/main/java/org/opensearch/sql/executor/QueryService.java:351 — MethodTooLong — analyzeWithCalcite runs 119 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 19 over it, 1.19× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: FieldMaker.makeMethodField legacy/src/main/java/org/opensearch/sql/legacy/parser/FieldMaker.java:280 — MethodTooLong — makeMethodField runs 112 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 12 over it, 1.12× 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: PPLAggregateConvertRule.apply core/src/main/java/org/opensearch/sql/calcite/plan/rule/PPLAggregateConvertRule.java:73 — MethodTooLong — apply runs 109 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 9 over it, 1.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: HintFactory.getHintFromString legacy/src/main/java/org/opensearch/sql/legacy/domain/hints/HintFactory.java:23 — MethodTooLong — getHintFromString runs 109 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 9 over it, 1.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: MetricAggregationBuilder.visitNamedAggregator opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/aggregation/dsl/MetricAggregationBuilder.java:64 — MethodTooLong — visitNamedAggregator runs 105 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 5 over it, 1.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: AggregationQueryAction.explain legacy/src/main/java/org/opensearch/sql/legacy/query/AggregationQueryAction.java:53 — MethodTooLong — explain runs 101 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1 over it, 1.01× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D4 · Code Duplication · Edited copy of a member (7 corresponding lines) · ×13
  • Edited copy of a member (7 corresponding lines) common/src/main/java/org/opensearch/sql/common/patterns/BrainLogParser.java:214 — common/src/main/java/org/opensearch/sql/common/patterns/BrainLogParser.java:214-220 | common/src/main/java/org/opensearch/sql/common/patterns/BrainLogParser.java:412-420 — 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) legacy/src/main/java/org/opensearch/sql/legacy/rewriter/subquery/SubQueryRewriteRule.java:45 — legacy/src/main/java/org/opensearch/sql/legacy/rewriter/subquery/SubQueryRewriteRule.java:45-53 | legacy/src/main/java/org/opensearch/sql/legacy/rewriter/subquery/SubQueryRewriter.java:83-89 — 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) ppl/src/main/java/org/opensearch/sql/ppl/utils/PPLQueryDataAnonymizer.java:1046 — ppl/src/main/java/org/opensearch/sql/ppl/utils/PPLQueryDataAnonymizer.java:1046-1052 | ppl/src/main/java/org/opensearch/sql/ppl/utils/PPLQueryDataAnonymizer.java:1055-1061 — 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/java/org/opensearch/sql/expression/operator/predicate/UnaryPredicateOperators.java:86 — core/src/main/java/org/opensearch/sql/expression/operator/predicate/UnaryPredicateOperators.java:86-92 | core/src/main/java/org/opensearch/sql/expression/operator/predicate/UnaryPredicateOperators.java:94-100 — 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) opensearch/src/main/java/org/opensearch/sql/opensearch/storage/scan/CalciteEnumerableGraphLookup.java:170 — opensearch/src/main/java/org/opensearch/sql/opensearch/storage/scan/CalciteEnumerableGraphLookup.java:170-179 | opensearch/src/main/java/org/opensearch/sql/opensearch/storage/system/CalciteEnumerableCatalogScan.java:64-70 — 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) async-query-core/src/main/java/org/opensearch/sql/spark/utils/SQLQueryUtils.java:364 — async-query-core/src/main/java/org/opensearch/sql/spark/utils/SQLQueryUtils.java:364-370 | async-query-core/src/main/java/org/opensearch/sql/spark/utils/SQLQueryUtils.java:373-380 — 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/java/org/opensearch/sql/planner/physical/TrendlineOperator.java:257 — core/src/main/java/org/opensearch/sql/planner/physical/TrendlineOperator.java:257-263 | core/src/main/java/org/opensearch/sql/planner/physical/TrendlineOperator.java:291-297 — 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) direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:647 — direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:647-657 | ppl/src/main/java/org/opensearch/sql/ppl/domain/PPLQueryRequest.java:372-378 — 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) legacy/src/main/java/org/opensearch/sql/legacy/query/planner/logical/node/Project.java:61 — legacy/src/main/java/org/opensearch/sql/legacy/query/planner/logical/node/Project.java:61-69 | legacy/src/main/java/org/opensearch/sql/legacy/query/planner/logical/node/Top.java:52-58 — 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) ppl/src/main/java/org/opensearch/sql/ppl/PPLService.java:83 — ppl/src/main/java/org/opensearch/sql/ppl/PPLService.java:83-89 | sql/src/main/java/org/opensearch/sql/sql/SQLService.java:55-61 — 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) ppl/src/main/java/org/opensearch/sql/ppl/PPLService.java:106 — ppl/src/main/java/org/opensearch/sql/ppl/PPLService.java:106-113 | sql/src/main/java/org/opensearch/sql/sql/SQLService.java:69-75 — 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/java/org/opensearch/sql/ast/tree/CountBin.java:37 — core/src/main/java/org/opensearch/sql/ast/tree/CountBin.java:37-43 | core/src/main/java/org/opensearch/sql/ast/tree/MinSpanBin.java:36-42 — 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/java/org/opensearch/sql/expression/function/CollectionUDF/MVAppendCore.java:46 — core/src/main/java/org/opensearch/sql/expression/function/CollectionUDF/MVAppendCore.java:46-52 | opensearch/src/main/java/org/opensearch/sql/opensearch/functions/DistinctCountApproxAggFunction.java:35-42 — 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 · Duplicated block (9 lines × 2) · ×13
  • Duplicated block (9 lines × 2) api/src/main/java/org/opensearch/sql/api/parser/PPLQueryParser.java:34 — api/src/main/java/org/opensearch/sql/api/parser/PPLQueryParser.java:34-42 | api/src/main/java/org/opensearch/sql/api/parser/SqlV2QueryParser.java:65-73 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `api/src/main/java/org/opensearch/sql/api/parser/PPLQueryParser.java:34` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: `AstStatementBuilder` names `org.opensearch.sql.ppl.parser.AstStatementBuilder` in one and `org.opensearch.sql.sql.parser.AstStatementBuilder` 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) async-query/src/main/java/org/opensearch/sql/spark/execution/xcontent/SessionModelXContentSerializer.java:57 — async-query/src/main/java/org/opensearch/sql/spark/execution/xcontent/SessionModelXContentSerializer.java:57-65 | async-query/src/main/java/org/opensearch/sql/spark/execution/xcontent/StatementModelXContentSerializer.java:65-73 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `async-query/src/main/java/org/opensearch/sql/spark/execution/xcontent/SessionModelXContentSerializer.java:57` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `async-query/src/main/java/org/opensearch/sql/spark/execution/xcontent/SessionModelXContentSerializer.java:67` calls `sessionType`, `fromString`, `text` and `async-query/src/main/java/org/opensearch/sql/spark/execution/xcontent/StatementModelXContentSerializer.java:76` 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) core/src/main/java/org/opensearch/sql/calcite/utils/WildcardUtils.java:135 — core/src/main/java/org/opensearch/sql/calcite/utils/WildcardUtils.java:135-144 | core/src/main/java/org/opensearch/sql/calcite/utils/WildcardUtils.java:166-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 `core/src/main/java/org/opensearch/sql/calcite/utils/WildcardUtils.java:135` it does not close everything it opens, so those exact lines 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/java/org/opensearch/sql/expression/function/FunctionDSL.java:206 — core/src/main/java/org/opensearch/sql/expression/function/FunctionDSL.java:206-214 | core/src/main/java/org/opensearch/sql/expression/function/FunctionDSL.java:298-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. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/main/java/org/opensearch/sql/expression/function/FunctionDSL.java:206` it does not close everything it opens, so those exact lines 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) datasources/src/main/java/org/opensearch/sql/datasources/utils/XContentParserUtils.java:72 — datasources/src/main/java/org/opensearch/sql/datasources/utils/XContentParserUtils.java:72-80 | datasources/src/main/java/org/opensearch/sql/datasources/utils/XContentParserUtils.java:132-140 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) legacy/src/main/java/org/opensearch/sql/legacy/executor/AsyncRestExecutor.java:123 — legacy/src/main/java/org/opensearch/sql/legacy/executor/AsyncRestExecutor.java:123-131 | legacy/src/main/java/org/opensearch/sql/legacy/executor/cursor/CursorAsyncRestExecutor.java:66-74 — before extracting anything, compare `legacy/src/main/java/org/opensearch/sql/legacy/executor/AsyncRestExecutor.java` and `legacy/src/main/java/org/opensearch/sql/legacy/executor/cursor/CursorAsyncRestExecutor.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. Read the line range as the matched WINDOW rather than a finished unit: at `legacy/src/main/java/org/opensearch/sql/legacy/executor/AsyncRestExecutor.java:123` 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) legacy/src/main/java/org/opensearch/sql/legacy/executor/AsyncRestExecutor.java:153 — legacy/src/main/java/org/opensearch/sql/legacy/executor/AsyncRestExecutor.java:153-161 | legacy/src/main/java/org/opensearch/sql/legacy/executor/cursor/CursorAsyncRestExecutor.java:96-104 — before extracting anything, compare `legacy/src/main/java/org/opensearch/sql/legacy/executor/AsyncRestExecutor.java` and `legacy/src/main/java/org/opensearch/sql/legacy/executor/cursor/CursorAsyncRestExecutor.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. Read the line range as the matched WINDOW rather than a finished unit: at `legacy/src/main/java/org/opensearch/sql/legacy/executor/AsyncRestExecutor.java:153` 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) legacy/src/main/java/org/opensearch/sql/legacy/executor/multi/MinusExecutor.java:157 — legacy/src/main/java/org/opensearch/sql/legacy/executor/multi/MinusExecutor.java:157-165 | legacy/src/main/java/org/opensearch/sql/legacy/executor/multi/MinusExecutor.java:197-205 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `legacy/src/main/java/org/opensearch/sql/legacy/executor/multi/MinusExecutor.java: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 (9 lines × 2) legacy/src/main/java/org/opensearch/sql/legacy/parser/WhereParser.java:432 — legacy/src/main/java/org/opensearch/sql/legacy/parser/WhereParser.java:432-441 | legacy/src/main/java/org/opensearch/sql/legacy/parser/WhereParser.java:443-451 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `legacy/src/main/java/org/opensearch/sql/legacy/parser/WhereParser.java: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 (9 lines × 2) opensearch/src/main/java/org/opensearch/sql/opensearch/planner/physical/ADOperator.java:128 — opensearch/src/main/java/org/opensearch/sql/opensearch/planner/physical/ADOperator.java:128-136 | opensearch/src/main/java/org/opensearch/sql/opensearch/planner/physical/ADOperator.java:156-164 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `opensearch/src/main/java/org/opensearch/sql/opensearch/planner/physical/ADOperator.java:128` 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) opensearch/src/main/java/org/opensearch/sql/opensearch/planner/rules/FilterIndexScanRule.java:33 — opensearch/src/main/java/org/opensearch/sql/opensearch/planner/rules/FilterIndexScanRule.java:33-41 | opensearch/src/main/java/org/opensearch/sql/opensearch/planner/rules/ProjectIndexScanRule.java:42-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 `opensearch/src/main/java/org/opensearch/sql/opensearch/planner/rules/FilterIndexScanRule.java:33` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) legacy/src/main/java/org/opensearch/sql/legacy/cursor/DefaultCursor.java:241 — legacy/src/main/java/org/opensearch/sql/legacy/cursor/DefaultCursor.java:241-249 | legacy/src/main/java/org/opensearch/sql/legacy/executor/format/Protocol.java:258-267 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) legacy/src/main/java/org/opensearch/sql/legacy/executor/format/DescribeResultSet.java:35 — legacy/src/main/java/org/opensearch/sql/legacy/executor/format/DescribeResultSet.java:35-43 | legacy/src/main/java/org/opensearch/sql/legacy/executor/format/ShowResultSet.java: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 both call sites, so a change lands once.
D4 · Code Duplication · Edited copy of a member (15 corresponding lines) · ×12
  • Edited copy of a member (15 corresponding lines) ppl/src/main/java/org/opensearch/sql/ppl/utils/PPLQueryDataAnonymizer.java:680 — ppl/src/main/java/org/opensearch/sql/ppl/utils/PPLQueryDataAnonymizer.java:680-696 | ppl/src/main/java/org/opensearch/sql/ppl/utils/PPLQueryDataAnonymizer.java:1012-1026 — 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/java/org/opensearch/sql/expression/operator/predicate/UnaryPredicateOperators.java:102 — core/src/main/java/org/opensearch/sql/expression/operator/predicate/UnaryPredicateOperators.java:102-116 | core/src/main/java/org/opensearch/sql/expression/operator/predicate/UnaryPredicateOperators.java:118-132 — 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) prometheus/src/main/java/org/opensearch/sql/prometheus/functions/resolver/QueryExemplarsTableFunctionResolver.java:40 — prometheus/src/main/java/org/opensearch/sql/prometheus/functions/resolver/QueryExemplarsTableFunctionResolver.java:40-54 | prometheus/src/main/java/org/opensearch/sql/prometheus/functions/resolver/QueryRangeTableFunctionResolver.java:37-51 — 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/java/org/opensearch/sql/data/model/ExprDateValue.java:34 — core/src/main/java/org/opensearch/sql/data/model/ExprDateValue.java:34-48 | core/src/main/java/org/opensearch/sql/data/model/ExprTimestampValue.java:39-56 — 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) async-query-core/src/main/java/org/opensearch/sql/spark/execution/session/SessionModel.java:35 — async-query-core/src/main/java/org/opensearch/sql/spark/execution/session/SessionModel.java:35-49 | async-query-core/src/main/java/org/opensearch/sql/spark/execution/session/SessionModel.java:52-66 — 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) datasources/src/main/java/org/opensearch/sql/datasources/transport/TransportPatchDataSourceAction.java:59 — datasources/src/main/java/org/opensearch/sql/datasources/transport/TransportPatchDataSourceAction.java:59-73 | datasources/src/main/java/org/opensearch/sql/datasources/transport/TransportUpdateDataSourceAction.java:58-72 — 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/java/org/opensearch/sql/utils/IPUtils.java:40 — core/src/main/java/org/opensearch/sql/utils/IPUtils.java:40-56 | core/src/main/java/org/opensearch/sql/utils/IPUtils.java:63-77 — 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) legacy/src/main/java/org/opensearch/sql/legacy/expression/core/builder/BinaryExpressionBuilder.java:28 — legacy/src/main/java/org/opensearch/sql/legacy/expression/core/builder/BinaryExpressionBuilder.java:28-43 | legacy/src/main/java/org/opensearch/sql/legacy/expression/core/builder/UnaryExpressionBuilder.java:28-42 — 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/java/org/opensearch/sql/expression/function/udf/RexExtractFunction.java:70 — core/src/main/java/org/opensearch/sql/expression/function/udf/RexExtractFunction.java:70-84 | core/src/main/java/org/opensearch/sql/expression/function/udf/RexExtractMultiFunction.java:90-105 — 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) legacy/src/main/java/org/opensearch/sql/legacy/domain/Paramer.java:106 — legacy/src/main/java/org/opensearch/sql/legacy/domain/Paramer.java:106-120 | legacy/src/main/java/org/opensearch/sql/legacy/domain/Paramer.java:140-158 — 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) legacy/src/main/java/org/opensearch/sql/legacy/query/AggregationQueryAction.java:336 — legacy/src/main/java/org/opensearch/sql/legacy/query/AggregationQueryAction.java:336-350 | legacy/src/main/java/org/opensearch/sql/legacy/query/AggregationQueryAction.java:352-368 — 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) async-query/src/main/java/org/opensearch/sql/spark/execution/statestore/StateStore.java:272 — async-query/src/main/java/org/opensearch/sql/spark/execution/statestore/StateStore.java:272-288 | async-query/src/main/java/org/opensearch/sql/spark/execution/statestore/StateStore.java:304-318 — 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 · Duplicated block (11 lines × 2) · ×11
  • Duplicated block (11 lines × 2) async-query/src/main/java/org/opensearch/sql/spark/transport/TransportCancelAsyncQueryRequestAction.java:58 — async-query/src/main/java/org/opensearch/sql/spark/transport/TransportCancelAsyncQueryRequestAction.java:58-68 | async-query/src/main/java/org/opensearch/sql/spark/transport/TransportGetAsyncQueryResultAction.java:60-70 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `async-query/src/main/java/org/opensearch/sql/spark/transport/TransportCancelAsyncQueryRequestAction.java:58` it does not close everything it opens, so those 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 `request` to `CancelAsyncQueryActionRequest` in one and `GetAsyncQueryResultActionRequest` 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) core/src/main/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java:4080 — core/src/main/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java:4080-4090 | core/src/main/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java:4127-4137 — both copies are in the same file, so extract the block into 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) core/src/main/java/org/opensearch/sql/calcite/plan/rule/PPLAggGroupMergeRule.java:56 — core/src/main/java/org/opensearch/sql/calcite/plan/rule/PPLAggGroupMergeRule.java:56-66 | core/src/main/java/org/opensearch/sql/calcite/plan/rule/PPLAggregateConvertRule.java:61-71 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting 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) datasources/src/main/java/org/opensearch/sql/datasources/storage/OpenSearchDataSourceMetadataStorage.java:291 — datasources/src/main/java/org/opensearch/sql/datasources/storage/OpenSearchDataSourceMetadataStorage.java:291-301 | datasources/src/main/java/org/opensearch/sql/datasources/storage/OpenSearchDataSourceMetadataStorage.java:316-326 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting 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) legacy/src/main/java/org/opensearch/sql/legacy/domain/Paramer.java:107 — legacy/src/main/java/org/opensearch/sql/legacy/domain/Paramer.java:107-117 | legacy/src/main/java/org/opensearch/sql/legacy/domain/Paramer.java:161-171 — both copies are in the same file, so extract the 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 `query` to `MatchPhraseQueryBuilder` in one and `MultiMatchQueryBuilder` 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) legacy/src/main/java/org/opensearch/sql/legacy/domain/hints/HintFactory.java:28 — legacy/src/main/java/org/opensearch/sql/legacy/domain/hints/HintFactory.java:28-38 | legacy/src/main/java/org/opensearch/sql/legacy/domain/hints/HintFactory.java:45-55 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `legacy/src/main/java/org/opensearch/sql/legacy/domain/hints/HintFactory.java:28` it does not close everything it opens, so those exact lines 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) legacy/src/main/java/org/opensearch/sql/legacy/executor/cursor/CursorCloseExecutor.java:49 — legacy/src/main/java/org/opensearch/sql/legacy/executor/cursor/CursorCloseExecutor.java:49-59 | legacy/src/main/java/org/opensearch/sql/legacy/executor/cursor/CursorResultExecutor.java:71-81 — before extracting anything, compare `legacy/src/main/java/org/opensearch/sql/legacy/executor/cursor/CursorCloseExecutor.java` and `legacy/src/main/java/org/opensearch/sql/legacy/executor/cursor/CursorResultExecutor.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `legacy/src/main/java/org/opensearch/sql/legacy/executor/cursor/CursorCloseExecutor.java:49` 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) legacy/src/main/java/org/opensearch/sql/legacy/rewriter/nestedfield/NestedFieldProjection.java:125 — legacy/src/main/java/org/opensearch/sql/legacy/rewriter/nestedfield/NestedFieldProjection.java:125-135 | opensearch/src/main/java/org/opensearch/sql/opensearch/request/OpenSearchRequestBuilder.java:397-407 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 2) opensearch/src/main/java/org/opensearch/sql/opensearch/client/OpenSearchRestClient.java:201 — opensearch/src/main/java/org/opensearch/sql/opensearch/client/OpenSearchRestClient.java:201-211 | opensearch/src/main/java/org/opensearch/sql/opensearch/client/OpenSearchRestClient.java:224-234 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `opensearch/src/main/java/org/opensearch/sql/opensearch/client/OpenSearchRestClient.java:201` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) ppl/src/main/java/org/opensearch/sql/ppl/parser/AstBuilder.java:601 — ppl/src/main/java/org/opensearch/sql/ppl/parser/AstBuilder.java:601-611 | ppl/src/main/java/org/opensearch/sql/ppl/parser/AstBuilder.java:1697-1707 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `ppl/src/main/java/org/opensearch/sql/ppl/parser/AstBuilder.java:601` 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) ppl/src/main/java/org/opensearch/sql/ppl/utils/ArgumentFactory.java:378 — ppl/src/main/java/org/opensearch/sql/ppl/utils/ArgumentFactory.java:378-388 | ppl/src/main/java/org/opensearch/sql/ppl/utils/ArgumentFactory.java:391-401 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting 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 `ctx` to `OpenSearchPPLParser.SqlLikeJoinTypeContext` in one and `OpenSearchPPLParser.JoinTypeContext` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Edited copy of a member (12 corresponding lines) · ×10
  • Edited copy of a member (12 corresponding lines) core/src/main/java/org/opensearch/sql/analysis/Analyzer.java:651 — core/src/main/java/org/opensearch/sql/analysis/Analyzer.java:651-667 | ppl/src/main/java/org/opensearch/sql/ppl/utils/PPLQueryDataAnonymizer.java:653-664 — 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/java/org/opensearch/sql/expression/function/udf/CTimeConvertFunction.java:50 — core/src/main/java/org/opensearch/sql/expression/function/udf/CTimeConvertFunction.java:50-61 | core/src/main/java/org/opensearch/sql/expression/function/udf/MkTimeConvertFunction.java:57-68 — 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) ppl/src/main/java/org/opensearch/sql/ppl/parser/AstExpressionBuilder.java:1235 — ppl/src/main/java/org/opensearch/sql/ppl/parser/AstExpressionBuilder.java:1235-1246 | ppl/src/main/java/org/opensearch/sql/ppl/parser/AstExpressionBuilder.java:1249-1260 — 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) opensearch/src/main/java/org/opensearch/sql/opensearch/client/OpenSearchNodeClient.java:123 — opensearch/src/main/java/org/opensearch/sql/opensearch/client/OpenSearchNodeClient.java:123-134 | opensearch/src/main/java/org/opensearch/sql/opensearch/client/OpenSearchNodeClient.java:170-182 — 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) opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/aggregation/dsl/MetricAggregationBuilder.java:216 — opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/aggregation/dsl/MetricAggregationBuilder.java:216-227 | opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/aggregation/dsl/MetricAggregationBuilder.java:236-249 — 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) prometheus/src/main/java/org/opensearch/sql/prometheus/storage/implementor/PrometheusDefaultImplementor.java:50 — prometheus/src/main/java/org/opensearch/sql/prometheus/storage/implementor/PrometheusDefaultImplementor.java:50-61 | prometheus/src/main/java/org/opensearch/sql/prometheus/storage/implementor/PrometheusDefaultImplementor.java:91-102 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) core/src/main/java/org/opensearch/sql/data/type/WideningTypeRule.java:45 — core/src/main/java/org/opensearch/sql/data/type/WideningTypeRule.java:45-56 | core/src/main/java/org/opensearch/sql/expression/function/CoercionUtils.java:236-249 — 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) opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/filter/lucene/relevance/NoFieldQuery.java:48 — opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/filter/lucene/relevance/NoFieldQuery.java:48-59 | opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/filter/lucene/relevance/RelevanceQuery.java:77-89 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) core/src/main/java/org/opensearch/sql/data/utils/NullsFirstExprValueOrdering.java:22 — core/src/main/java/org/opensearch/sql/data/utils/NullsFirstExprValueOrdering.java:22-33 | core/src/main/java/org/opensearch/sql/data/utils/NullsLastExprValueOrdering.java:22-33 — 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) opensearch/src/main/java/org/opensearch/sql/opensearch/storage/system/SystemIndexCatalogSource.java:58 — opensearch/src/main/java/org/opensearch/sql/opensearch/storage/system/SystemIndexCatalogSource.java:58-69 | prometheus/src/main/java/org/opensearch/sql/prometheus/storage/system/PrometheusSystemTable.java:61-73 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×10
  • Duplicated block (10 lines × 2) async-query-core/src/main/java/org/opensearch/sql/spark/flint/FlintIndexStateModel.java:32 — async-query-core/src/main/java/org/opensearch/sql/spark/flint/FlintIndexStateModel.java:32-41 | async-query-core/src/main/java/org/opensearch/sql/spark/flint/FlintIndexStateModel.java:47-56 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `async-query-core/src/main/java/org/opensearch/sql/spark/flint/FlintIndexStateModel.java:32` 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/java/org/opensearch/sql/calcite/utils/PlanUtils.java:536 — core/src/main/java/org/opensearch/sql/calcite/utils/PlanUtils.java:536-545 | opensearch/src/main/java/org/opensearch/sql/opensearch/planner/rules/ProjectIndexScanRule.java:59-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.
  • Duplicated block (10 lines × 2) core/src/main/java/org/opensearch/sql/data/type/WideningTypeRule.java:68 — core/src/main/java/org/opensearch/sql/data/type/WideningTypeRule.java:68-77 | core/src/main/java/org/opensearch/sql/expression/function/CoercionUtils.java:261-270 — 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 (10 lines × 2) direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:487 — direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:487-496 | direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:505-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 `direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:487` 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, `direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:504` calls `encode` and `direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:486` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 2) legacy/src/main/java/org/opensearch/sql/legacy/executor/cursor/CursorCloseExecutor.java:64 — legacy/src/main/java/org/opensearch/sql/legacy/executor/cursor/CursorCloseExecutor.java:64-73 | legacy/src/main/java/org/opensearch/sql/legacy/executor/cursor/CursorResultExecutor.java:90-99 — before extracting anything, compare `legacy/src/main/java/org/opensearch/sql/legacy/executor/cursor/CursorCloseExecutor.java` and `legacy/src/main/java/org/opensearch/sql/legacy/executor/cursor/CursorResultExecutor.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `legacy/src/main/java/org/opensearch/sql/legacy/executor/cursor/CursorCloseExecutor.java:64` it does not close everything it opens, so those exact lines 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) legacy/src/main/java/org/opensearch/sql/legacy/parser/ElasticSqlExprParser.java:902 — legacy/src/main/java/org/opensearch/sql/legacy/parser/ElasticSqlExprParser.java:902-911 | legacy/src/main/java/org/opensearch/sql/legacy/parser/ElasticSqlExprParser.java:934-943 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) opensearch/src/main/java/org/opensearch/sql/opensearch/request/AggregateAnalyzer.java:472 — opensearch/src/main/java/org/opensearch/sql/opensearch/request/AggregateAnalyzer.java:472-481 | opensearch/src/main/java/org/opensearch/sql/opensearch/request/AggregateAnalyzer.java:606-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. Read the line range as the matched WINDOW rather than a finished unit: at `opensearch/src/main/java/org/opensearch/sql/opensearch/request/AggregateAnalyzer.java:472` 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/java/org/opensearch/sql/expression/function/CollectionUDF/ForeachPairCollectionFunctionImpl.java:32 — core/src/main/java/org/opensearch/sql/expression/function/CollectionUDF/ForeachPairCollectionFunctionImpl.java:32-41 | core/src/main/java/org/opensearch/sql/expression/function/CollectionUDF/ForeachStateFunctionImpl.java:31-40 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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) core/src/main/java/org/opensearch/sql/expression/function/udf/math/ScalarMaxFunction.java:56 — core/src/main/java/org/opensearch/sql/expression/function/udf/math/ScalarMaxFunction.java:56-65 | core/src/main/java/org/opensearch/sql/expression/function/udf/math/ScalarMinFunction.java:56-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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) legacy/src/main/java/org/opensearch/sql/legacy/esdomain/mapping/FieldMappings.java:120 — legacy/src/main/java/org/opensearch/sql/legacy/esdomain/mapping/FieldMappings.java:120-129 | legacy/src/main/java/org/opensearch/sql/legacy/esdomain/mapping/IndexMappings.java:64-73 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from 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.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×10
  • Duplicated block (6 lines × 2) core/src/main/java/org/opensearch/sql/calcite/SchemaUnifier.java:116 — core/src/main/java/org/opensearch/sql/calcite/SchemaUnifier.java:116-121 | core/src/main/java/org/opensearch/sql/calcite/SchemaUnifier.java:209-214 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/main/java/org/opensearch/sql/calcite/SchemaUnifier.java: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 (6 lines × 2) core/src/main/java/org/opensearch/sql/calcite/plan/rule/PPLSimplifyDedupRule.java:91 — core/src/main/java/org/opensearch/sql/calcite/plan/rule/PPLSimplifyDedupRule.java:91-96 | opensearch/src/main/java/org/opensearch/sql/opensearch/planner/rules/DedupPushdownRule.java:81-86 — 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/opensearch/sql/calcite/plan/rule/PPLSimplifyDedupRule.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, `opensearch/src/main/java/org/opensearch/sql/opensearch/planner/rules/DedupPushdownRule.java:88` calls `debug` and `core/src/main/java/org/opensearch/sql/calcite/plan/rule/PPLSimplifyDedupRule.java:97` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 2) core/src/main/java/org/opensearch/sql/data/model/ExprValueUtils.java:129 — core/src/main/java/org/opensearch/sql/data/model/ExprValueUtils.java:129-134 | legacy/src/main/java/org/opensearch/sql/legacy/expression/model/ExprValueFactory.java:54-59 — 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/opensearch/sql/data/model/ExprValueUtils.java:129` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) opensearch/src/main/java/org/opensearch/sql/opensearch/request/AggregateAnalyzer.java:517 — opensearch/src/main/java/org/opensearch/sql/opensearch/request/AggregateAnalyzer.java:517-522 | opensearch/src/main/java/org/opensearch/sql/opensearch/request/AggregateAnalyzer.java:533-538 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `opensearch/src/main/java/org/opensearch/sql/opensearch/request/AggregateAnalyzer.java:517` 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) ppl/src/main/java/org/opensearch/sql/ppl/utils/PPLQueryDataAnonymizer.java:1047 — ppl/src/main/java/org/opensearch/sql/ppl/utils/PPLQueryDataAnonymizer.java:1047-1052 | ppl/src/main/java/org/opensearch/sql/ppl/utils/PPLQueryDataAnonymizer.java:1056-1061 — both copies are in the same file, so extract the 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 `node` to `AddTotals` in one and `AddColTotals` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (6 lines × 2) core/src/main/java/org/opensearch/sql/calcite/utils/binning/time/StandardTimeSpanHandler.java:184 — core/src/main/java/org/opensearch/sql/calcite/utils/binning/time/StandardTimeSpanHandler.java:184-189 | core/src/main/java/org/opensearch/sql/calcite/utils/binning/time/TimeUnitRegistry.java:118-123 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, 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) legacy/src/main/java/org/opensearch/sql/legacy/rewriter/nestedfield/NestedFieldProjection.java:137 — legacy/src/main/java/org/opensearch/sql/legacy/rewriter/nestedfield/NestedFieldProjection.java:137-142 | opensearch/src/main/java/org/opensearch/sql/opensearch/request/OpenSearchRequestBuilder.java:445-450 — 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) legacy/src/main/java/org/opensearch/sql/legacy/rewriter/nestedfield/NestedFieldProjection.java:149 — legacy/src/main/java/org/opensearch/sql/legacy/rewriter/nestedfield/NestedFieldProjection.java:149-154 | opensearch/src/main/java/org/opensearch/sql/opensearch/request/OpenSearchRequestBuilder.java:461-466 — 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 `legacy/src/main/java/org/opensearch/sql/legacy/rewriter/nestedfield/NestedFieldProjection.java:149` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (6 lines × 2) opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/field/CalciteFieldScript.java:43 — opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/field/CalciteFieldScript.java:43-48 | opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/filter/CalciteFilterScript.java:37-43 — 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 `opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/field/CalciteFieldScript.java:43` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (6 lines × 2) async-query/src/main/java/org/opensearch/sql/spark/transport/TransportCancelAsyncQueryRequestAction.java:46 — async-query/src/main/java/org/opensearch/sql/spark/transport/TransportCancelAsyncQueryRequestAction.java:46-51 | async-query/src/main/java/org/opensearch/sql/spark/transport/TransportGetAsyncQueryResultAction.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 both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `async-query/src/main/java/org/opensearch/sql/spark/transport/TransportCancelAsyncQueryRequestAction.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.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×10
  • Duplicated block (5 lines × 2) core/src/main/java/org/opensearch/sql/expression/function/CollectionUDF/ExistsFunctionImpl.java:55 — core/src/main/java/org/opensearch/sql/expression/function/CollectionUDF/ExistsFunctionImpl.java:55-59 | core/src/main/java/org/opensearch/sql/expression/function/CollectionUDF/ForallFunctionImpl.java:54-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 `core/src/main/java/org/opensearch/sql/expression/function/CollectionUDF/ExistsFunctionImpl.java: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 (5 lines × 2) core/src/main/java/org/opensearch/sql/expression/function/FunctionDSL.java:403 — core/src/main/java/org/opensearch/sql/expression/function/FunctionDSL.java:403-407 | core/src/main/java/org/opensearch/sql/expression/function/FunctionDSL.java:454-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. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/main/java/org/opensearch/sql/expression/function/FunctionDSL.java:403` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) core/src/main/java/org/opensearch/sql/expression/function/PPLTypeChecker.java:398 — core/src/main/java/org/opensearch/sql/expression/function/PPLTypeChecker.java:398-404 | core/src/main/java/org/opensearch/sql/expression/function/PPLTypeChecker.java:460-464 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/main/java/org/opensearch/sql/expression/function/PPLTypeChecker.java: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 (5 lines × 2) legacy/src/main/java/org/opensearch/sql/legacy/parser/FieldMaker.java:301 — legacy/src/main/java/org/opensearch/sql/legacy/parser/FieldMaker.java:301-305 | legacy/src/main/java/org/opensearch/sql/legacy/parser/FieldMaker.java:347-351 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `legacy/src/main/java/org/opensearch/sql/legacy/parser/FieldMaker.java:301` 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) legacy/src/main/java/org/opensearch/sql/legacy/rewriter/subquery/SubQueryRewriteRule.java:47 — legacy/src/main/java/org/opensearch/sql/legacy/rewriter/subquery/SubQueryRewriteRule.java:47-53 | legacy/src/main/java/org/opensearch/sql/legacy/rewriter/subquery/SubQueryRewriter.java:85-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 `legacy/src/main/java/org/opensearch/sql/legacy/rewriter/subquery/SubQueryRewriteRule.java:47` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) core/src/main/java/org/opensearch/sql/data/model/ExprTupleValue.java:61 — core/src/main/java/org/opensearch/sql/data/model/ExprTupleValue.java:61-65 | legacy/src/main/java/org/opensearch/sql/legacy/expression/model/ExprTupleValue.java:29-33 — 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) ppl/src/main/java/org/opensearch/sql/ppl/parser/AstExpressionBuilder.java:720 — ppl/src/main/java/org/opensearch/sql/ppl/parser/AstExpressionBuilder.java:720-724 | sql/src/main/java/org/opensearch/sql/sql/parser/AstExpressionBuilder.java:218-222 — 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 `ppl/src/main/java/org/opensearch/sql/ppl/parser/AstExpressionBuilder.java:720` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `ctx` to `OpenSearchPPLParser.PositionFunctionCallContext` in one and `PositionFunctionContext` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (5 lines × 2) prometheus/src/main/java/org/opensearch/sql/prometheus/functions/response/QueryExemplarsFunctionResponseHandle.java:63 — prometheus/src/main/java/org/opensearch/sql/prometheus/functions/response/QueryExemplarsFunctionResponseHandle.java:63-69 | prometheus/src/main/java/org/opensearch/sql/prometheus/functions/response/QueryRangeFunctionResponseHandle.java:90-94 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) core/src/main/java/org/opensearch/sql/data/model/ExprValueUtils.java:100 — core/src/main/java/org/opensearch/sql/data/model/ExprValueUtils.java:100-104 | legacy/src/main/java/org/opensearch/sql/legacy/expression/model/ExprValueFactory.java:43-47 — 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) legacy/src/main/java/org/opensearch/sql/legacy/antlr/OpenSearchLegacySqlAnalyzer.java:61 — legacy/src/main/java/org/opensearch/sql/legacy/antlr/OpenSearchLegacySqlAnalyzer.java:61-65 | ppl/src/main/java/org/opensearch/sql/ppl/antlr/PPLSyntaxParser.java:21-25 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: `SyntaxAnalysisErrorListener` names `org.opensearch.sql.common.antlr.SyntaxAnalysisErrorListener` in one and `org.opensearch.sql.legacy.antlr.syntax.SyntaxAnalysisErrorListener` 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 · Edited copy of a member (11 corresponding lines) · ×9
  • Edited copy of a member (11 corresponding lines) core/src/main/java/org/opensearch/sql/analysis/Analyzer.java:945 — core/src/main/java/org/opensearch/sql/analysis/Analyzer.java:945-955 | core/src/main/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java:860-870 — 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/java/org/opensearch/sql/expression/function/udf/condition/EarliestFunction.java:60 — core/src/main/java/org/opensearch/sql/expression/function/udf/condition/EarliestFunction.java:60-70 | core/src/main/java/org/opensearch/sql/expression/function/udf/condition/LatestFunction.java:60-70 — 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) opensearch/src/main/java/org/opensearch/sql/opensearch/client/OpenSearchNodeClient.java:307 — opensearch/src/main/java/org/opensearch/sql/opensearch/client/OpenSearchNodeClient.java:307-317 | opensearch/src/main/java/org/opensearch/sql/opensearch/client/OpenSearchRestClient.java:159-172 — 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) legacy/src/main/java/org/opensearch/sql/legacy/domain/SearchResult.java:84 — legacy/src/main/java/org/opensearch/sql/legacy/domain/SearchResult.java:84-94 | legacy/src/main/java/org/opensearch/sql/legacy/executor/join/ElasticJoinExecutor.java:144-154 — 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) ppl/src/main/java/org/opensearch/sql/ppl/parser/AstBuilder.java:1346 — ppl/src/main/java/org/opensearch/sql/ppl/parser/AstBuilder.java:1346-1356 | ppl/src/main/java/org/opensearch/sql/ppl/parser/AstBuilder.java:1360-1371 — 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/java/org/opensearch/sql/ast/expression/Let.java:26 — core/src/main/java/org/opensearch/sql/ast/expression/Let.java:26-36 | core/src/main/java/org/opensearch/sql/ast/expression/Let.java:39-49 — 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) legacy/src/main/java/org/opensearch/sql/legacy/parser/SqlParser.java:458 — legacy/src/main/java/org/opensearch/sql/legacy/parser/SqlParser.java:458-469 | legacy/src/main/java/org/opensearch/sql/legacy/parser/SqlParser.java:532-542 — 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) async-query-core/src/main/java/org/opensearch/sql/spark/validator/SQLQueryValidator.java:29 — async-query-core/src/main/java/org/opensearch/sql/spark/validator/SQLQueryValidator.java:29-39 | async-query-core/src/main/java/org/opensearch/sql/spark/validator/PPLQueryValidator.java:31-41 — 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) async-query-core/src/main/java/org/opensearch/sql/spark/flint/operation/FlintIndexOpAlter.java:59 — async-query-core/src/main/java/org/opensearch/sql/spark/flint/operation/FlintIndexOpAlter.java:59-70 | async-query-core/src/main/java/org/opensearch/sql/spark/flint/operation/FlintIndexOpDrop.java:52-62 — 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 (13 corresponding lines) · ×9
  • Edited copy of a member (13 corresponding lines) legacy/src/main/java/org/opensearch/sql/legacy/executor/AsyncRestExecutor.java:149 — legacy/src/main/java/org/opensearch/sql/legacy/executor/AsyncRestExecutor.java:149-161 | legacy/src/main/java/org/opensearch/sql/legacy/executor/cursor/CursorAsyncRestExecutor.java:92-104 — 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/opensearch/sql/calcite/utils/CalciteToolsHelper.java:137 — core/src/main/java/org/opensearch/sql/calcite/utils/CalciteToolsHelper.java:137-149 | core/src/main/java/org/opensearch/sql/calcite/utils/CalciteToolsHelper.java:165-179 — 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) async-query-core/src/main/java/org/opensearch/sql/spark/flint/FlintIndexStateModel.java:29 — async-query-core/src/main/java/org/opensearch/sql/spark/flint/FlintIndexStateModel.java:29-41 | async-query-core/src/main/java/org/opensearch/sql/spark/flint/FlintIndexStateModel.java:44-56 — 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) legacy/src/main/java/org/opensearch/sql/legacy/request/SqlRequestParam.java:42 — legacy/src/main/java/org/opensearch/sql/legacy/request/SqlRequestParam.java:42-54 | plugin/src/main/java/org/opensearch/sql/plugin/request/PPLQueryRequestFactory.java:162-175 — 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) ppl/src/main/java/org/opensearch/sql/ppl/domain/PPLQueryRequest.java:299 — ppl/src/main/java/org/opensearch/sql/ppl/domain/PPLQueryRequest.java:299-311 | ppl/src/main/java/org/opensearch/sql/ppl/domain/PPLQueryRequest.java:319-332 — 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) async-query/src/main/java/org/opensearch/sql/spark/execution/statestore/OpenSearchSessionStorageService.java:27 — async-query/src/main/java/org/opensearch/sql/spark/execution/statestore/OpenSearchSessionStorageService.java:27-39 | async-query/src/main/java/org/opensearch/sql/spark/execution/statestore/OpenSearchStatementStorageService.java:28-40 — 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) opensearch/src/main/java/org/opensearch/sql/opensearch/executor/protector/ResourceMonitorPlan.java:59 — opensearch/src/main/java/org/opensearch/sql/opensearch/executor/protector/ResourceMonitorPlan.java:59-71 | opensearch/src/main/java/org/opensearch/sql/opensearch/executor/protector/ResourceMonitorPlan.java:89-106 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) core/src/main/java/org/opensearch/sql/calcite/utils/PlanUtils.java:520 — core/src/main/java/org/opensearch/sql/calcite/utils/PlanUtils.java:520-532 | core/src/main/java/org/opensearch/sql/calcite/utils/PlanUtils.java:534-548 — 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) legacy/src/main/java/org/opensearch/sql/legacy/executor/format/OpenSearchErrorMessage.java:28 — legacy/src/main/java/org/opensearch/sql/legacy/executor/format/OpenSearchErrorMessage.java:28-40 | opensearch/src/main/java/org/opensearch/sql/opensearch/response/error/OpenSearchErrorMessage.java:30-42 — 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 (5 corresponding lines) · ×9
  • Edited copy of a member (5 corresponding lines) core/src/main/java/org/opensearch/sql/data/model/ExprValueUtils.java:92 — core/src/main/java/org/opensearch/sql/data/model/ExprValueUtils.java:92-97 | legacy/src/main/java/org/opensearch/sql/legacy/expression/model/ExprValueFactory.java:37-41 — 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) opensearch/src/main/java/org/opensearch/sql/opensearch/data/type/OpenSearchDataType.java:277 — opensearch/src/main/java/org/opensearch/sql/opensearch/data/type/OpenSearchDataType.java:277-284 | opensearch/src/main/java/org/opensearch/sql/opensearch/request/system/OpenSearchDescribeIndexRequest.java:119-123 — 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/java/org/opensearch/sql/expression/aggregation/StdDevAggregator.java:88 — core/src/main/java/org/opensearch/sql/expression/aggregation/StdDevAggregator.java:88-92 | core/src/main/java/org/opensearch/sql/expression/aggregation/VarianceAggregator.java: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.
  • Edited copy of a member (5 corresponding lines) ppl/src/main/java/org/opensearch/sql/ppl/parser/AstBuilder.java:1661 — ppl/src/main/java/org/opensearch/sql/ppl/parser/AstBuilder.java:1661-1665 | sql/src/main/java/org/opensearch/sql/sql/parser/ParserUtils.java:23-27 — 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) plugin/src/main/java/org/opensearch/sql/plugin/rest/RestPPLQueryAction.java:74 — plugin/src/main/java/org/opensearch/sql/plugin/rest/RestPPLQueryAction.java:74-79 | plugin/src/main/java/org/opensearch/sql/plugin/rest/RestPPLStatsAction.java: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) core/src/main/java/org/opensearch/sql/planner/optimizer/rule/EvalPushDown.java:55 — core/src/main/java/org/opensearch/sql/planner/optimizer/rule/EvalPushDown.java:55-59 | core/src/main/java/org/opensearch/sql/planner/optimizer/rule/read/TableScanPushDown.java:79-83 — 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/java/org/opensearch/sql/ast/expression/Function.java:38 — core/src/main/java/org/opensearch/sql/ast/expression/Function.java:38-42 | core/src/main/java/org/opensearch/sql/ast/expression/LambdaFunction.java:41-46 — 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) legacy/src/main/java/org/opensearch/sql/legacy/plugin/RestSqlAction.java:106 — legacy/src/main/java/org/opensearch/sql/legacy/plugin/RestSqlAction.java:106-111 | plugin/src/main/java/org/opensearch/sql/plugin/rest/RestPPLQueryAction.java:62-66 — 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/java/org/opensearch/sql/planner/optimizer/rule/EvalPushDown.java:72 — core/src/main/java/org/opensearch/sql/planner/optimizer/rule/EvalPushDown.java:72-76 | core/src/main/java/org/opensearch/sql/planner/optimizer/rule/read/TableScanPushDown.java:104-108 — 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.
X17 · Uncapped recursion over a caller-supplied document · Recursive walk over a caller-supplied document has no depth cap · ×8
  • Recursive walk over a caller-supplied document has no depth cap opensearch/src/main/java/org/opensearch/sql/opensearch/response/agg/TopHitsParser.java:203 — `parse` is not private, takes a value from its caller (line 57) and hands it on to `getLeafValue`, which calls itself at line 203 with a piece of `object` — and nowhere in the walk is a depth or nesting counter compared with a bound, nor is the parser that builds the document given a nesting limit in this file. The walk therefore spends one stack frame (more through a lambda or a stream) per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes; javac turns no recursive call into a loop. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25). org.json, the W3C DOM, dom4j and StAX set no nesting limit of their own, Jackson before 2.15 none and 2.15+ 1,000 — on a cold JVM past the point the walk fails — and a `Map<String, Object>` tree is as deep as whatever built it. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (Exception e)` around the call does not stop it, and the request or the thread dies with it. Thread a depth argument through `getLeafValue` and reject the value past a fixed maximum, configure the parser's nesting limit (`StreamReadConstraints.maxNestingDepth`, SnakeYAML's `setNestingDepthLimit`), or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap opensearch/src/main/java/org/opensearch/sql/opensearch/executor/OpenSearchExecutionEngine.java:405 — `buildResultSet` is not private, takes a value from its caller (line 435) and hands it on to `processValue`, which calls itself at line 405 with a piece of `value` (and at line 415, line 427) — and nowhere in the walk is a depth or nesting counter compared with a bound, nor is the parser that builds the document given a nesting limit in this file. The walk therefore spends one stack frame (more through a lambda or a stream) per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes; javac turns no recursive call into a loop. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25). org.json, the W3C DOM, dom4j and StAX set no nesting limit of their own, Jackson before 2.15 none and 2.15+ 1,000 — on a cold JVM past the point the walk fails — and a `Map<String, Object>` tree is as deep as whatever built it. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (Exception e)` around the call does not stop it, and the request or the thread dies with it. Thread a depth argument through `processValue` and reject the value past a fixed maximum, configure the parser's nesting limit (`StreamReadConstraints.maxNestingDepth`, SnakeYAML's `setNestingDepthLimit`), or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap opensearch/src/main/java/org/opensearch/sql/opensearch/data/type/OpenSearchDataType.java:134 — `parseMapping` is not private and takes `Map<String, Object> indexMapping` from its caller, and it recurses at line 134 through `of` and back with a piece of `indexMapping` (and at line 160, line 168) — and nowhere in the walk is a depth or nesting counter compared with a bound, nor is the parser that builds the document given a nesting limit in this file. The walk therefore spends one stack frame (more through a lambda or a stream) per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes; javac turns no recursive call into a loop. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25). org.json, the W3C DOM, dom4j and StAX set no nesting limit of their own, Jackson before 2.15 none and 2.15+ 1,000 — on a cold JVM past the point the walk fails — and a `Map<String, Object>` tree is as deep as whatever built it. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (Exception e)` around the call does not stop it, and the request or the thread dies with it. Thread a depth argument through `parseMapping` and reject the value past a fixed maximum, configure the parser's nesting limit (`StreamReadConstraints.maxNestingDepth`, SnakeYAML's `setNestingDepthLimit`), or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap legacy/src/main/java/org/opensearch/sql/legacy/utils/Util.java:230 — `clearEmptyPaths` is not private and takes `Map<String, Object> map` from its caller, and it calls itself at line 230 with a piece of `map` — and nowhere in the walk is a depth or nesting counter compared with a bound, nor is the parser that builds the document given a nesting limit in this file. The walk therefore spends one stack frame (more through a lambda or a stream) per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes; javac turns no recursive call into a loop. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25). org.json, the W3C DOM, dom4j and StAX set no nesting limit of their own, Jackson before 2.15 none and 2.15+ 1,000 — on a cold JVM past the point the walk fails — and a `Map<String, Object>` tree is as deep as whatever built it. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (Exception e)` around the call does not stop it, and the request or the thread dies with it. Thread a depth argument through `clearEmptyPaths` and reject the value past a fixed maximum, configure the parser's nesting limit (`StreamReadConstraints.maxNestingDepth`, SnakeYAML's `setNestingDepthLimit`), or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap legacy/src/main/java/org/opensearch/sql/legacy/expression/model/ExprValueFactory.java:39 — `tupleValue` is not private and takes `Map<String, Object> map` from its caller, and it recurses at line 39 through `collectionValue`, `from` and back with a piece of `map` (and at line 45) — and nowhere in the walk is a depth or nesting counter compared with a bound, nor is the parser that builds the document given a nesting limit in this file. The walk therefore spends one stack frame (more through a lambda or a stream) per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes; javac turns no recursive call into a loop. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25). org.json, the W3C DOM, dom4j and StAX set no nesting limit of their own, Jackson before 2.15 none and 2.15+ 1,000 — on a cold JVM past the point the walk fails — and a `Map<String, Object>` tree is as deep as whatever built it. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (Exception e)` around the call does not stop it, and the request or the thread dies with it. Thread a depth argument through `tupleValue` and reject the value past a fixed maximum, configure the parser's nesting limit (`StreamReadConstraints.maxNestingDepth`, SnakeYAML's `setNestingDepthLimit`), or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap legacy/src/main/java/org/opensearch/sql/legacy/executor/csv/CSVResultsExtractor.java:354 — `mergeHeaders` is not private, takes a value from its caller (line 341) and hands it on to `mergeFieldNamesRecursive`, which calls itself at line 354 with a piece of `doc` — and nowhere in the walk is a depth or nesting counter compared with a bound, nor is the parser that builds the document given a nesting limit in this file. The walk therefore spends one stack frame (more through a lambda or a stream) per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes; javac turns no recursive call into a loop. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25). org.json, the W3C DOM, dom4j and StAX set no nesting limit of their own, Jackson before 2.15 none and 2.15+ 1,000 — on a cold JVM past the point the walk fails — and a `Map<String, Object>` tree is as deep as whatever built it. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (Exception e)` around the call does not stop it, and the request or the thread dies with it. Thread a depth argument through `mergeFieldNamesRecursive` and reject the value past a fixed maximum, configure the parser's nesting limit (`StreamReadConstraints.maxNestingDepth`, SnakeYAML's `setNestingDepthLimit`), or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap core/src/main/java/org/opensearch/sql/utils/JsonUtils.java:95 — `castJson` is not private, takes a value from its caller (line 69) and hands it on to `processJsonNode`, which calls itself at line 95 with a piece of `jsonNode` — and nowhere in the walk is a depth or nesting counter compared with a bound, nor is the parser that builds the document given a nesting limit in this file. The walk therefore spends one stack frame (more through a lambda or a stream) per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes; javac turns no recursive call into a loop. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25). org.json, the W3C DOM, dom4j and StAX set no nesting limit of their own, Jackson before 2.15 none and 2.15+ 1,000 — on a cold JVM past the point the walk fails — and a `Map<String, Object>` tree is as deep as whatever built it. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (Exception e)` around the call does not stop it, and the request or the thread dies with it. Thread a depth argument through `processJsonNode` and reject the value past a fixed maximum, configure the parser's nesting limit (`StreamReadConstraints.maxNestingDepth`, SnakeYAML's `setNestingDepthLimit`), or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap core/src/main/java/org/opensearch/sql/data/model/ExprValueUtils.java:95 — `tupleValue` is not private and takes `Map<String, Object> map` from its caller, and it recurses at line 95 through `collectionValue`, `fromObjectValue` and back with a piece of `map` (and at line 102) — and nowhere in the walk is a depth or nesting counter compared with a bound, nor is the parser that builds the document given a nesting limit in this file. The walk therefore spends one stack frame (more through a lambda or a stream) per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes; javac turns no recursive call into a loop. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25). org.json, the W3C DOM, dom4j and StAX set no nesting limit of their own, Jackson before 2.15 none and 2.15+ 1,000 — on a cold JVM past the point the walk fails — and a `Map<String, Object>` tree is as deep as whatever built it. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (Exception e)` around the call does not stop it, and the request or the thread dies with it. Thread a depth argument through `tupleValue` and reject the value past a fixed maximum, configure the parser's nesting limit (`StreamReadConstraints.maxNestingDepth`, SnakeYAML's `setNestingDepthLimit`), or rewrite the descent with an explicit stack.
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/opensearch/sql/expression/function/jsonUDF/JsonAppendFunctionImpl.java:56 — core/src/main/java/org/opensearch/sql/expression/function/jsonUDF/JsonAppendFunctionImpl.java:56-78 | core/src/main/java/org/opensearch/sql/expression/function/jsonUDF/JsonSetFunctionImpl.java:55-68 — 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) ppl/src/main/java/org/opensearch/sql/ppl/utils/PPLQueryDataAnonymizer.java:353 — ppl/src/main/java/org/opensearch/sql/ppl/utils/PPLQueryDataAnonymizer.java:353-366 | ppl/src/main/java/org/opensearch/sql/ppl/utils/PPLQueryDataAnonymizer.java:525-538 — 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) legacy/src/main/java/org/opensearch/sql/legacy/executor/ElasticResultHandler.java:17 — legacy/src/main/java/org/opensearch/sql/legacy/executor/ElasticResultHandler.java:17-35 | legacy/src/main/java/org/opensearch/sql/legacy/utils/Util.java:199-212 — 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/java/org/opensearch/sql/expression/function/PatternParserFunctionImpl.java:143 — core/src/main/java/org/opensearch/sql/expression/function/PatternParserFunctionImpl.java:143-156 | core/src/main/java/org/opensearch/sql/expression/function/PatternParserFunctionImpl.java:160-175 — 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) api/src/main/java/org/opensearch/sql/api/parser/PPLQueryParser.java:29 — api/src/main/java/org/opensearch/sql/api/parser/PPLQueryParser.java:29-42 | api/src/main/java/org/opensearch/sql/api/parser/SqlV2QueryParser.java:60-73 — 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) datasources/src/main/java/org/opensearch/sql/datasources/model/transport/DeleteDataSourceActionRequest.java:33 — datasources/src/main/java/org/opensearch/sql/datasources/model/transport/DeleteDataSourceActionRequest.java:33-46 | datasources/src/main/java/org/opensearch/sql/datasources/model/transport/PatchDataSourceActionRequest.java:35-48 — 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) common/src/main/java/org/opensearch/sql/common/antlr/SyntaxAnalysisErrorListener.java:36 — common/src/main/java/org/opensearch/sql/common/antlr/SyntaxAnalysisErrorListener.java:36-49 | legacy/src/main/java/org/opensearch/sql/legacy/antlr/syntax/SyntaxAnalysisErrorListener.java:29-42 — 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 (8 corresponding lines) · ×7
  • Edited copy of a member (8 corresponding lines) core/src/main/java/org/opensearch/sql/calcite/ForeachPlanner.java:378 — core/src/main/java/org/opensearch/sql/calcite/ForeachPlanner.java:378-386 | core/src/main/java/org/opensearch/sql/calcite/ForeachPlanner.java:608-615 — 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) legacy/src/main/java/org/opensearch/sql/legacy/antlr/semantic/scope/SymbolTable.java:45 — legacy/src/main/java/org/opensearch/sql/legacy/antlr/semantic/scope/SymbolTable.java:45-52 | core/src/main/java/org/opensearch/sql/analysis/symbol/SymbolTable.java:71-78 — 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/java/org/opensearch/sql/expression/function/udf/RexExtractMultiFunction.java:64 — core/src/main/java/org/opensearch/sql/expression/function/udf/RexExtractMultiFunction.java:64-77 | core/src/main/java/org/opensearch/sql/expression/function/udf/RexExtractFunction.java:52-59 — 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) prometheus/src/main/java/org/opensearch/sql/prometheus/planner/logical/rules/MergeAggAndIndexScan.java:40 — prometheus/src/main/java/org/opensearch/sql/prometheus/planner/logical/rules/MergeAggAndIndexScan.java:40-48 | prometheus/src/main/java/org/opensearch/sql/prometheus/planner/logical/rules/MergeAggAndRelation.java:40-47 — 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/java/org/opensearch/sql/analysis/NamedExpressionAnalyzer.java:37 — core/src/main/java/org/opensearch/sql/analysis/NamedExpressionAnalyzer.java:37-44 | core/src/main/java/org/opensearch/sql/analysis/SelectExpressionAnalyzer.java:157-164 — 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) prometheus/src/main/java/org/opensearch/sql/prometheus/storage/implementor/PrometheusDefaultImplementor.java:126 — prometheus/src/main/java/org/opensearch/sql/prometheus/storage/implementor/PrometheusDefaultImplementor.java:126-133 | prometheus/src/main/java/org/opensearch/sql/prometheus/storage/querybuilder/StepParameterResolver.java:46-54 — 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/java/org/opensearch/sql/planner/DefaultImplementor.java:83 — core/src/main/java/org/opensearch/sql/planner/DefaultImplementor.java:83-90 | opensearch/src/main/java/org/opensearch/sql/opensearch/executor/protector/OpenSearchExecutionProtector.java:120-127 — 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.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×7
  • Duplicated block (8 lines × 3) core/src/main/java/org/opensearch/sql/expression/function/FunctionDSL.java:209 — core/src/main/java/org/opensearch/sql/expression/function/FunctionDSL.java:209-216 | core/src/main/java/org/opensearch/sql/expression/function/FunctionDSL.java:301-308 | core/src/main/java/org/opensearch/sql/expression/function/FunctionDSL.java:353-360 — 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 `core/src/main/java/org/opensearch/sql/expression/function/FunctionDSL.java:209` it does not close everything it opens, so those 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/java/org/opensearch/sql/expression/function/FunctionDSL.java:361` calls `get`, `valueOf` and `core/src/main/java/org/opensearch/sql/expression/function/FunctionDSL.java:217` 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 (8 lines × 3) legacy/src/main/java/org/opensearch/sql/legacy/query/maker/AggMaker.java:312 — legacy/src/main/java/org/opensearch/sql/legacy/query/maker/AggMaker.java:312-319 | legacy/src/main/java/org/opensearch/sql/legacy/query/maker/AggMaker.java:564-571 | legacy/src/main/java/org/opensearch/sql/legacy/query/maker/AggMaker.java:627-634 — 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 `legacy/src/main/java/org/opensearch/sql/legacy/query/maker/AggMaker.java:312` it does not close everything it opens, so those 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, `legacy/src/main/java/org/opensearch/sql/legacy/query/maker/AggMaker.java:635` calls `interval`, `parseLong` and `legacy/src/main/java/org/opensearch/sql/legacy/query/maker/AggMaker.java:320` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 3) opensearch/src/main/java/org/opensearch/sql/opensearch/storage/scan/context/AggPushDownAction.java:135 — opensearch/src/main/java/org/opensearch/sql/opensearch/storage/scan/context/AggPushDownAction.java:135-142 | opensearch/src/main/java/org/opensearch/sql/opensearch/storage/scan/context/AggPushDownAction.java:194-201 | opensearch/src/main/java/org/opensearch/sql/opensearch/storage/scan/context/AggPushDownAction.java:417-424 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 3) async-query/src/main/java/org/opensearch/sql/spark/transport/format/AsyncQueryResultResponseFormatter.java:77 — async-query/src/main/java/org/opensearch/sql/spark/transport/format/AsyncQueryResultResponseFormatter.java:77-84 | protocol/src/main/java/org/opensearch/sql/protocol/response/format/JdbcResponseFormatter.java:70-77 | protocol/src/main/java/org/opensearch/sql/protocol/response/format/SimpleJsonResponseFormatter.java:69-76 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `protocol/src/main/java/org/opensearch/sql/protocol/response/format/JdbcResponseFormatter.java:79` calls `getStatus` and `async-query/src/main/java/org/opensearch/sql/spark/transport/format/AsyncQueryResultResponseFormatter.java:87` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 3) datasources/src/main/java/org/opensearch/sql/datasources/exceptions/ErrorMessage.java:28 — datasources/src/main/java/org/opensearch/sql/datasources/exceptions/ErrorMessage.java:28-35 | legacy/src/main/java/org/opensearch/sql/legacy/executor/format/ErrorMessage.java:20-27 | opensearch/src/main/java/org/opensearch/sql/opensearch/response/error/ErrorMessage.java:27-34 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `exception` to `Throwable` in one and `E` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (8 lines × 3) async-query-core/src/main/java/org/opensearch/sql/spark/asyncquery/model/QueryState.java:33 — async-query-core/src/main/java/org/opensearch/sql/spark/asyncquery/model/QueryState.java:33-40 | async-query-core/src/main/java/org/opensearch/sql/spark/execution/session/SessionState.java:35-42 | async-query-core/src/main/java/org/opensearch/sql/spark/execution/statement/StatementState.java:34-41 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
  • Duplicated block (8 lines × 3) opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/filter/lucene/relevance/MultiMatchQuery.java:22 — opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/filter/lucene/relevance/MultiMatchQuery.java:22-29 | opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/filter/lucene/relevance/QueryStringQuery.java:31-38 | opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/filter/lucene/relevance/SimpleQueryStringQuery.java:23-30 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 `opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/filter/lucene/relevance/QueryStringQuery.java:31` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Edited copy of a member (18 corresponding lines) · ×6
  • Edited copy of a member (18 corresponding lines) async-query-core/src/main/java/org/opensearch/sql/spark/execution/statement/StatementModel.java:37 — async-query-core/src/main/java/org/opensearch/sql/spark/execution/statement/StatementModel.java:37-54 | async-query-core/src/main/java/org/opensearch/sql/spark/execution/statement/StatementModel.java:57-74 — 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/java/org/opensearch/sql/calcite/utils/binning/handlers/CountBinHandler.java:68 — core/src/main/java/org/opensearch/sql/calcite/utils/binning/handlers/CountBinHandler.java:68-85 | core/src/main/java/org/opensearch/sql/calcite/utils/binning/handlers/MinSpanBinHandler.java:75-92 — 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/java/org/opensearch/sql/expression/function/CoercionUtils.java:94 — core/src/main/java/org/opensearch/sql/expression/function/CoercionUtils.java:94-112 | core/src/main/java/org/opensearch/sql/expression/function/CoercionUtils.java:272-289 — 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) async-query/src/main/java/org/opensearch/sql/spark/rest/RestAsyncQueryManagementAction.java:111 — async-query/src/main/java/org/opensearch/sql/spark/rest/RestAsyncQueryManagementAction.java:111-128 | datasources/src/main/java/org/opensearch/sql/datasources/rest/RestDataSourceQueryAction.java:125-146 — 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) datasources/src/main/java/org/opensearch/sql/datasources/encryptor/EncryptorImpl.java:26 — datasources/src/main/java/org/opensearch/sql/datasources/encryptor/EncryptorImpl.java:26-43 | datasources/src/main/java/org/opensearch/sql/datasources/encryptor/EncryptorImpl.java:46-63 — 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) ppl/src/main/java/org/opensearch/sql/ppl/utils/MakeResultsDataParser.java:267 — ppl/src/main/java/org/opensearch/sql/ppl/utils/MakeResultsDataParser.java:267-285 | ppl/src/main/java/org/opensearch/sql/ppl/utils/MakeResultsDataParser.java:302-319 — 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 (10 corresponding lines) · ×6
  • Edited copy of a member (10 corresponding lines) ppl/src/main/java/org/opensearch/sql/ppl/parser/AstExpressionBuilder.java:479 — ppl/src/main/java/org/opensearch/sql/ppl/parser/AstExpressionBuilder.java:479-488 | sql/src/main/java/org/opensearch/sql/sql/parser/AstExpressionBuilder.java:453-469 — 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) opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/aggregation/dsl/MetricAggregationBuilder.java:181 — opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/aggregation/dsl/MetricAggregationBuilder.java:181-190 | opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/aggregation/dsl/MetricAggregationBuilder.java:198-207 — 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/java/org/opensearch/sql/analysis/Analyzer.java:323 — core/src/main/java/org/opensearch/sql/analysis/Analyzer.java:323-336 | sql/src/main/java/org/opensearch/sql/sql/parser/AstBuilder.java:188-197 — 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) common/src/main/java/org/opensearch/sql/common/patterns/BrainLogParser.java:499 — common/src/main/java/org/opensearch/sql/common/patterns/BrainLogParser.java:499-509 | legacy/src/main/java/org/opensearch/sql/legacy/antlr/semantic/types/base/OpenSearchIndex.java:53-62 — 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) async-query-core/src/main/java/org/opensearch/sql/spark/asyncquery/AsyncQueryExecutorServiceImpl.java:204 — async-query-core/src/main/java/org/opensearch/sql/spark/asyncquery/AsyncQueryExecutorServiceImpl.java:204-213 | core/src/main/java/org/opensearch/sql/job/QueryJobId.java:69-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) opensearch/src/main/java/org/opensearch/sql/opensearch/response/agg/PercentilesParser.java:28 — opensearch/src/main/java/org/opensearch/sql/opensearch/response/agg/PercentilesParser.java:28-39 | opensearch/src/main/java/org/opensearch/sql/opensearch/response/agg/SinglePercentileParser.java:26-35 — 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 (6 corresponding lines) · ×5
  • Edited copy of a member (6 corresponding lines) core/src/main/java/org/opensearch/sql/expression/function/CollectionUDF/ReduceFunctionImpl.java:80 — core/src/main/java/org/opensearch/sql/expression/function/CollectionUDF/ReduceFunctionImpl.java:80-85 | core/src/main/java/org/opensearch/sql/expression/function/CollectionUDF/TransformFunctionImpl.java:62-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.
  • Edited copy of a member (6 corresponding lines) ppl/src/main/java/org/opensearch/sql/ppl/parser/AstExpressionBuilder.java:886 — ppl/src/main/java/org/opensearch/sql/ppl/parser/AstExpressionBuilder.java:886-891 | sql/src/main/java/org/opensearch/sql/sql/parser/AstExpressionBuilder.java:339-345 — 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) protocol/src/main/java/org/opensearch/sql/protocol/response/format/VisualizationResponseFormatter.java:72 — protocol/src/main/java/org/opensearch/sql/protocol/response/format/VisualizationResponseFormatter.java:72-78 | protocol/src/main/java/org/opensearch/sql/protocol/response/format/JdbcResponseFormatter.java:51-56 — 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) prometheus/src/main/java/org/opensearch/sql/prometheus/planner/logical/rules/MergeAggAndIndexScan.java:32 — prometheus/src/main/java/org/opensearch/sql/prometheus/planner/logical/rules/MergeAggAndIndexScan.java:32-37 | prometheus/src/main/java/org/opensearch/sql/prometheus/planner/logical/rules/MergeAggAndRelation.java:32-37 — 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) legacy/src/main/java/org/opensearch/sql/legacy/executor/csv/CSVResult.java:63 — legacy/src/main/java/org/opensearch/sql/legacy/executor/csv/CSVResult.java:63-68 | protocol/src/main/java/org/opensearch/sql/protocol/response/format/FlatResponseWithSanitizer.java:28-33 — 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 · Duplicated block (12 lines × 2) · ×5
  • Duplicated block (12 lines × 2) core/src/main/java/org/opensearch/sql/expression/function/FunctionDSL.java:312 — core/src/main/java/org/opensearch/sql/expression/function/FunctionDSL.java:312-323 | core/src/main/java/org/opensearch/sql/expression/function/FunctionDSL.java:365-376 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/main/java/org/opensearch/sql/expression/function/FunctionDSL.java:312` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `core/src/main/java/org/opensearch/sql/expression/function/FunctionDSL.java:377` calls `get`, `toString` and `core/src/main/java/org/opensearch/sql/expression/function/FunctionDSL.java:324` 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 (12 lines × 2) core/src/main/java/org/opensearch/sql/expression/function/PPLFuncImpTable.java:1561 — core/src/main/java/org/opensearch/sql/expression/function/PPLFuncImpTable.java:1561-1572 | core/src/main/java/org/opensearch/sql/expression/function/PPLFuncImpTable.java:1574-1585 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/opensearch/sql/expression/function/PPLFuncImpTable.java:1561` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 2) direct-query/src/main/java/org/opensearch/sql/directquery/rest/RestDirectQueryManagementAction.java:172 — direct-query/src/main/java/org/opensearch/sql/directquery/rest/RestDirectQueryManagementAction.java:172-183 | direct-query/src/main/java/org/opensearch/sql/directquery/rest/RestDirectQueryResourcesManagementAction.java:207-218 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting 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) opensearch/src/main/java/org/opensearch/sql/opensearch/storage/VectorSearchTableFunctionImplementation.java:206 — opensearch/src/main/java/org/opensearch/sql/opensearch/storage/VectorSearchTableFunctionImplementation.java:206-217 | opensearch/src/main/java/org/opensearch/sql/opensearch/storage/VectorSearchTableFunctionResolver.java:80-91 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (12 lines × 2) legacy/src/main/java/org/opensearch/sql/legacy/query/AggregationQueryAction.java:458 — legacy/src/main/java/org/opensearch/sql/legacy/query/AggregationQueryAction.java:458-469 | legacy/src/main/java/org/opensearch/sql/legacy/query/DefaultQueryAction.java:212-223 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D6 · Cohesion (LCOM4) · Low cohesion · ×5
  • Low cohesion: ClusterPluginsTests (LCOM4 6) integ-test/src/test/java/org/opensearch/sql/util/ClusterPluginsTests.java:42 — ClusterPluginsTests's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Config (LCOM4 6) legacy/src/main/java/org/opensearch/sql/legacy/query/planner/core/Config.java:13 — Config's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: PPLIntegTestCase (LCOM4 5) integ-test/src/test/java/org/opensearch/sql/ppl/PPLIntegTestCase.java:45 — PPLIntegTestCase'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: CalcitePlanContext (LCOM4 4) core/src/main/java/org/opensearch/sql/calcite/CalcitePlanContext.java:37 — CalcitePlanContext'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: QueryAction (LCOM4 4) legacy/src/main/java/org/opensearch/sql/legacy/query/QueryAction.java:37 — QueryAction'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.
D36 · Supply-chain Provenance & Signing · REDACTED · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (17 corresponding lines) · ×4
  • Edited copy of a member (17 corresponding lines) ppl/src/main/java/org/opensearch/sql/ppl/parser/AstBuilder.java:1792 — ppl/src/main/java/org/opensearch/sql/ppl/parser/AstBuilder.java:1792-1808 | ppl/src/main/java/org/opensearch/sql/ppl/parser/AstBuilder.java:1812-1828 — 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:767 — REDACTED:767-788 | REDACTED:797-813 — 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) opensearch/src/main/java/org/opensearch/sql/opensearch/storage/scan/context/AggPushDownAction.java:259 — opensearch/src/main/java/org/opensearch/sql/opensearch/storage/scan/context/AggPushDownAction.java:259-275 | opensearch/src/main/java/org/opensearch/sql/opensearch/storage/scan/context/AggPushDownAction.java:323-339 — 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) plugin/src/main/java/org/opensearch/sql/plugin/transport/TransportPPLQueryRequest.java:124 — plugin/src/main/java/org/opensearch/sql/plugin/transport/TransportPPLQueryRequest.java:124-140 | plugin/src/main/java/org/opensearch/sql/plugin/transport/TransportPPLQueryResponse.java:45-61 — 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 (22 corresponding lines) · ×4
  • Edited copy of a member (22 corresponding lines) core/src/main/java/org/opensearch/sql/calcite/SchemaUnifier.java:115 — core/src/main/java/org/opensearch/sql/calcite/SchemaUnifier.java:115-136 | core/src/main/java/org/opensearch/sql/calcite/SchemaUnifier.java:208-229 — 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) legacy/src/main/java/org/opensearch/sql/legacy/query/join/JoinRequestBuilder.java:49 — legacy/src/main/java/org/opensearch/sql/legacy/query/join/JoinRequestBuilder.java:49-72 | legacy/src/main/java/org/opensearch/sql/legacy/query/multi/MultiQueryRequestBuilder.java:48-69 — 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) legacy/src/main/java/org/opensearch/sql/legacy/plugin/RestSqlStatsAction.java:60 — legacy/src/main/java/org/opensearch/sql/legacy/plugin/RestSqlStatsAction.java:60-81 | plugin/src/main/java/org/opensearch/sql/plugin/rest/RestPPLStatsAction.java:54-75 — 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) direct-query-core/src/main/java/org/opensearch/sql/directquery/DirectQueryExecutorServiceImpl.java:74 — direct-query-core/src/main/java/org/opensearch/sql/directquery/DirectQueryExecutorServiceImpl.java:74-95 | direct-query-core/src/main/java/org/opensearch/sql/directquery/DirectQueryExecutorServiceImpl.java:99-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.
D4 · Code Duplication · Edited copy of a member (16 corresponding lines) · ×4
  • Edited copy of a member (16 corresponding lines) legacy/src/main/java/org/opensearch/sql/legacy/executor/format/SelectResultSet.java:629 — legacy/src/main/java/org/opensearch/sql/legacy/executor/format/SelectResultSet.java:629-648 | legacy/src/main/java/org/opensearch/sql/legacy/executor/format/SelectResultSet.java:656-671 — 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) REDACTED:718 — REDACTED:718-733 | REDACTED:742-757 — 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) opensearch/src/main/java/org/opensearch/sql/opensearch/client/OpenSearchNodeClient.java:387 — opensearch/src/main/java/org/opensearch/sql/opensearch/client/OpenSearchNodeClient.java:387-404 | opensearch/src/main/java/org/opensearch/sql/opensearch/client/OpenSearchNodeClient.java:407-422 — 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/opensearch/sql/calcite/utils/binning/handlers/DefaultBinHandler.java:27 — core/src/main/java/org/opensearch/sql/calcite/utils/binning/handlers/DefaultBinHandler.java:27-43 | core/src/main/java/org/opensearch/sql/calcite/utils/binning/handlers/SpanBinHandler.java:28-43 — 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 (13 lines × 2) · ×4
  • Duplicated block (13 lines × 2) core/src/main/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java:3006 — core/src/main/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java:3006-3018 | core/src/main/java/org/opensearch/sql/calcite/plan/rule/PPLDedupConvertRule.java:199-211 — 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/opensearch/sql/calcite/CalciteRelNodeVisitor.java:3006` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (13 lines × 2) core/src/main/java/org/opensearch/sql/calcite/plan/rule/PPLAggregateConvertRule.java:123 — core/src/main/java/org/opensearch/sql/calcite/plan/rule/PPLAggregateConvertRule.java:123-135 | core/src/main/java/org/opensearch/sql/calcite/plan/rule/PPLAggregateConvertRule.java:147-159 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/main/java/org/opensearch/sql/calcite/plan/rule/PPLAggregateConvertRule.java:123` 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) direct-query/src/main/java/org/opensearch/sql/directquery/transport/format/DirectQueryResourcesRequestConverter.java:40 — direct-query/src/main/java/org/opensearch/sql/directquery/transport/format/DirectQueryResourcesRequestConverter.java:40-52 | direct-query/src/main/java/org/opensearch/sql/directquery/transport/format/DirectQueryResourcesRequestConverter.java:95-107 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `direct-query/src/main/java/org/opensearch/sql/directquery/transport/format/DirectQueryResourcesRequestConverter.java:40` 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, `direct-query/src/main/java/org/opensearch/sql/directquery/transport/format/DirectQueryResourcesRequestConverter.java:92` calls `setResourceName`, `param` and `direct-query/src/main/java/org/opensearch/sql/directquery/transport/format/DirectQueryResourcesRequestConverter.java:37` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (13 lines × 2) legacy/src/main/java/org/opensearch/sql/legacy/executor/AsyncRestExecutor.java:132 — legacy/src/main/java/org/opensearch/sql/legacy/executor/AsyncRestExecutor.java:132-144 | legacy/src/main/java/org/opensearch/sql/legacy/executor/cursor/CursorAsyncRestExecutor.java:76-88 — before extracting anything, compare `legacy/src/main/java/org/opensearch/sql/legacy/executor/AsyncRestExecutor.java` and `legacy/src/main/java/org/opensearch/sql/legacy/executor/cursor/CursorAsyncRestExecutor.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. Read the line range as the matched WINDOW rather than a finished unit: at `legacy/src/main/java/org/opensearch/sql/legacy/executor/AsyncRestExecutor.java:132` 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, `legacy/src/main/java/org/opensearch/sql/legacy/executor/cursor/CursorAsyncRestExecutor.java:75` calls `printStackTrace` and `legacy/src/main/java/org/opensearch/sql/legacy/executor/AsyncRestExecutor.java:131` 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 × 3) · ×4
  • Duplicated block (7 lines × 3) direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:321 — direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:321-327 | direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:335-341 | direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:413-419 — 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 `direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:321` it does not close everything it opens, so those exact lines 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) ppl/src/main/java/org/opensearch/sql/ppl/parser/AstExpressionBuilder.java:958 — ppl/src/main/java/org/opensearch/sql/ppl/parser/AstExpressionBuilder.java:958-964 | sql/src/main/java/org/opensearch/sql/sql/parser/AstExpressionBuilder.java:589-595 | sql/src/main/java/org/opensearch/sql/sql/parser/AstExpressionBuilder.java:604-610 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `ctx` to `SingleFieldRelevanceFunctionContext` in one and `AltSingleFieldRelevanceFunctionContext` 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 × 3) direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:168 — direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:168-174 | direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:203-209 | direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:225-231 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (7 lines × 3) ppl/src/main/java/org/opensearch/sql/ppl/parser/AstBuilder.java:1218 — ppl/src/main/java/org/opensearch/sql/ppl/parser/AstBuilder.java:1218-1224 | ppl/src/main/java/org/opensearch/sql/ppl/parser/AstBuilder.java:1800-1806 | ppl/src/main/java/org/opensearch/sql/ppl/parser/AstBuilder.java:1820-1826 — 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 `ppl/src/main/java/org/opensearch/sql/ppl/parser/AstBuilder.java:1218` 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.
D17 · Explicit Debt · FixmeComment · ×3
  • FixmeComment core/src/main/java/org/opensearch/sql/calcite/MapPathPreMaterializer.java:104 — // FIXME: QualifiedNameResolver throws error for dotted path on non-map 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.
  • FixmeComment async-query-core/src/test/java/org/opensearch/sql/spark/flint/IndexQueryDetailsTest.java:78 — // FIXME: should not use ctx.getText which is hard to split — 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 api/src/test/java/org/opensearch/sql/api/UnifiedRelevanceSearchSqlTest.java:147 — // FIXME: Calcite's SQL parser does not support V2 bracket field list syntax ['field1', 'field2']. — 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.
D36 · Supply-chain Provenance & Signing · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (34 corresponding lines) · ×3
  • Edited copy of a member (34 corresponding lines) core/src/main/java/org/opensearch/sql/expression/function/FunctionDSL.java:296 — core/src/main/java/org/opensearch/sql/expression/function/FunctionDSL.java:296-329 | core/src/main/java/org/opensearch/sql/expression/function/FunctionDSL.java:347-383 — 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) legacy/src/main/java/org/opensearch/sql/legacy/domain/Condition.java:208 — legacy/src/main/java/org/opensearch/sql/legacy/domain/Condition.java:208-247 | legacy/src/main/java/org/opensearch/sql/legacy/domain/Condition.java:257-290 — 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) async-query/src/main/java/org/opensearch/sql/spark/scheduler/OpenSearchAsyncQueryScheduler.java:168 — async-query/src/main/java/org/opensearch/sql/spark/scheduler/OpenSearchAsyncQueryScheduler.java:168-201 | datasources/src/main/java/org/opensearch/sql/datasources/storage/OpenSearchDataSourceMetadataStorage.java:209-242 — 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 · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×3
  • Members sharing a duplicated core (5 members, 50+ identical tokens) direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:290 — direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:290-302 | direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:305-317 | direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:320-331 | direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:334-345 | direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:412-437 — 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) direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:348 — direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:348-379 | direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:382-409 | direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:412-437 | direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:631-645 | direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:672-712 — 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) opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/aggregation/CalciteAggregationScriptLeafFactory.java:43 — opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/aggregation/CalciteAggregationScriptLeafFactory.java:43-52 | opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/field/CalciteFieldScriptLeafFactory.java:44-52 | opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/filter/CalciteFilterScriptLeafFactory.java:45-53 | opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/sort/CalciteNumberSortScriptLeafFactory.java:41-49 | opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/sort/CalciteStringSortScriptLeafFactory.java:42-50 — 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 (20 corresponding lines) · ×3
  • Edited copy of a member (20 corresponding lines) legacy/src/main/java/org/opensearch/sql/legacy/executor/cursor/CursorCloseExecutor.java:40 — legacy/src/main/java/org/opensearch/sql/legacy/executor/cursor/CursorCloseExecutor.java:40-59 | legacy/src/main/java/org/opensearch/sql/legacy/executor/cursor/CursorResultExecutor.java:54-81 — 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) legacy/src/main/java/org/opensearch/sql/legacy/executor/cursor/CursorCloseExecutor.java:61 — legacy/src/main/java/org/opensearch/sql/legacy/executor/cursor/CursorCloseExecutor.java:61-80 | legacy/src/main/java/org/opensearch/sql/legacy/executor/cursor/CursorResultExecutor.java:83-106 — 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) legacy/src/main/java/org/opensearch/sql/legacy/executor/format/DataRows.java:40 — legacy/src/main/java/org/opensearch/sql/legacy/executor/format/DataRows.java:40-59 | legacy/src/main/java/org/opensearch/sql/legacy/executor/format/Schema.java:70-89 — 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 · Edited copy of a member (19 corresponding lines) · ×3
  • Edited copy of a member (19 corresponding lines) core/src/main/java/org/opensearch/sql/expression/aggregation/AggregatorFunctions.java:63 — core/src/main/java/org/opensearch/sql/expression/aggregation/AggregatorFunctions.java:63-81 | core/src/main/java/org/opensearch/sql/expression/aggregation/AggregatorFunctions.java:99-117 — 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/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java:2997 — core/src/main/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java:2997-3018 | core/src/main/java/org/opensearch/sql/calcite/plan/rule/PPLDedupConvertRule.java:193-211 — 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) async-query/src/main/java/org/opensearch/sql/spark/scheduler/OpenSearchAsyncQueryScheduler.java:146 — async-query/src/main/java/org/opensearch/sql/spark/scheduler/OpenSearchAsyncQueryScheduler.java:146-164 | datasources/src/main/java/org/opensearch/sql/datasources/storage/OpenSearchDataSourceMetadataStorage.java:184-207 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 15+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 15+ corresponding lines) async-query/src/main/java/org/opensearch/sql/spark/execution/xcontent/AsyncQueryJobMetadataXContentSerializer.java:37 — async-query/src/main/java/org/opensearch/sql/spark/execution/xcontent/AsyncQueryJobMetadataXContentSerializer.java:37-51 | async-query/src/main/java/org/opensearch/sql/spark/execution/xcontent/FlintIndexStateModelXContentSerializer.java:36-50 | async-query/src/main/java/org/opensearch/sql/spark/execution/xcontent/SessionModelXContentSerializer.java:36-51 — 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) core/src/main/java/org/opensearch/sql/expression/function/CollectionUDF/ExistsFunctionImpl.java:54 — core/src/main/java/org/opensearch/sql/expression/function/CollectionUDF/ExistsFunctionImpl.java:54-68 | core/src/main/java/org/opensearch/sql/expression/function/CollectionUDF/FilterFunctionImpl.java:54-69 | core/src/main/java/org/opensearch/sql/expression/function/CollectionUDF/ForallFunctionImpl.java:53-67 — 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) opensearch/src/main/java/org/opensearch/sql/opensearch/data/utils/OpenSearchJsonContent.java:179 — opensearch/src/main/java/org/opensearch/sql/opensearch/data/utils/OpenSearchJsonContent.java:179-194 | opensearch/src/main/java/org/opensearch/sql/opensearch/data/utils/OpenSearchJsonContent.java:197-212 | opensearch/src/main/java/org/opensearch/sql/opensearch/data/utils/OpenSearchJsonContent.java:215-229 — 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 · Duplicated block (16 lines × 2) · ×3
  • Duplicated block (16 lines × 2) core/src/main/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java:2324 — core/src/main/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java:2324-2339 | core/src/main/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java:2443-2458 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/opensearch/sql/calcite/CalciteRelNodeVisitor.java:2324` 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) core/src/main/java/org/opensearch/sql/calcite/utils/binning/handlers/CountBinHandler.java:70 — core/src/main/java/org/opensearch/sql/calcite/utils/binning/handlers/CountBinHandler.java:70-85 | core/src/main/java/org/opensearch/sql/calcite/utils/binning/handlers/MinSpanBinHandler.java:77-92 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (16 lines × 2) legacy/src/main/java/org/opensearch/sql/legacy/parser/WhereParser.java:368 — legacy/src/main/java/org/opensearch/sql/legacy/parser/WhereParser.java:368-383 | legacy/src/main/java/org/opensearch/sql/legacy/parser/WhereParser.java:602-617 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `legacy/src/main/java/org/opensearch/sql/legacy/parser/WhereParser.java:368` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×3
  • Duplicated block (14 lines × 2) async-query-core/src/main/java/org/opensearch/sql/spark/execution/statement/StatementModel.java:41 — async-query-core/src/main/java/org/opensearch/sql/spark/execution/statement/StatementModel.java:41-54 | async-query-core/src/main/java/org/opensearch/sql/spark/execution/statement/StatementModel.java:61-74 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `async-query-core/src/main/java/org/opensearch/sql/spark/execution/statement/StatementModel.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 (14 lines × 2) datasources/src/main/java/org/opensearch/sql/datasources/encryptor/EncryptorImpl.java:27 — datasources/src/main/java/org/opensearch/sql/datasources/encryptor/EncryptorImpl.java:27-40 | datasources/src/main/java/org/opensearch/sql/datasources/encryptor/EncryptorImpl.java:47-60 — both copies are in the same file, so extract the block into 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) legacy/src/main/java/org/opensearch/sql/legacy/rewriter/alias/TableAliasPrefixRemoveRule.java:88 — legacy/src/main/java/org/opensearch/sql/legacy/rewriter/alias/TableAliasPrefixRemoveRule.java:88-101 | legacy/src/main/java/org/opensearch/sql/legacy/rewriter/join/JoinRewriteRule.java:173-187 — 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 (10–11 lines × 2) · ×3
  • Duplicated block (10–11 lines × 2) async-query/src/main/java/org/opensearch/sql/spark/execution/statestore/StateStore.java:253 — async-query/src/main/java/org/opensearch/sql/spark/execution/statestore/StateStore.java:253-262 | datasources/src/main/java/org/opensearch/sql/datasources/storage/OpenSearchDataSourceMetadataStorage.java:253-263 — 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 `async-query/src/main/java/org/opensearch/sql/spark/execution/statestore/StateStore.java:253` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10–11 lines × 2) async-query/src/main/java/org/opensearch/sql/spark/scheduler/OpenSearchAsyncQueryScheduler.java:81 — async-query/src/main/java/org/opensearch/sql/spark/scheduler/OpenSearchAsyncQueryScheduler.java:81-90 | datasources/src/main/java/org/opensearch/sql/datasources/storage/OpenSearchDataSourceMetadataStorage.java:139-149 — 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 `async-query/src/main/java/org/opensearch/sql/spark/scheduler/OpenSearchAsyncQueryScheduler.java:81` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10–11 lines × 2) ppl/src/main/java/org/opensearch/sql/ppl/parser/AstExpressionBuilder.java:1237 — ppl/src/main/java/org/opensearch/sql/ppl/parser/AstExpressionBuilder.java:1237-1246 | ppl/src/main/java/org/opensearch/sql/ppl/parser/AstExpressionBuilder.java:1250-1260 — both copies are in the same file, so extract the 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 `ctx` to `OpenSearchPPLParser.RowSplitContext` in one and `OpenSearchPPLParser.ColumnSplitContext` 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 (19 lines × 2) · ×3
  • Duplicated block (19 lines × 2) datasources/src/main/java/org/opensearch/sql/datasources/model/transport/CreateDataSourceActionRequest.java:24 — datasources/src/main/java/org/opensearch/sql/datasources/model/transport/CreateDataSourceActionRequest.java:24-42 | datasources/src/main/java/org/opensearch/sql/datasources/model/transport/UpdateDataSourceActionRequest.java:24-42 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (19 lines × 2) core/src/main/java/org/opensearch/sql/calcite/plan/rel/LogicalGraphLookup.java:40 — core/src/main/java/org/opensearch/sql/calcite/plan/rel/LogicalGraphLookup.java:40-58 | opensearch/src/main/java/org/opensearch/sql/opensearch/storage/scan/CalciteEnumerableGraphLookup.java:121-139 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/main/java/org/opensearch/sql/calcite/plan/rel/LogicalGraphLookup.java:40` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: `Nullable` names `javax.annotation.Nullable` in one and `org.checkerframework.checker.nullness.qual.Nullable` 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) core/src/main/java/org/opensearch/sql/calcite/plan/rel/LogicalGraphLookup.java:97 — core/src/main/java/org/opensearch/sql/calcite/plan/rel/LogicalGraphLookup.java:97-115 | opensearch/src/main/java/org/opensearch/sql/opensearch/storage/scan/CalciteEnumerableGraphLookup.java:142-160 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
GD1 · Unfinished & placeholder code · Unfinished stub · ×3
  • Unfinished stub — empty body under a TODO marker core/src/main/java/org/opensearch/sql/monitor/profile/ProfileContext.java:31 — `setEnginePlan` is a shipped method whose body is empty except for a TODO/FIXME — scaffolding that was never completed. Implement it or remove it.
  • Unfinished stub — returns a placeholder under a TODO marker core/src/main/java/org/opensearch/sql/storage/Table.java:74 — `createScanBuilder` is a shipped method whose whole body returns a default value under a TODO/FIXME — a placeholder standing in for the implementation. Implement it or remove it.
  • Unfinished stub — throws a "not implemented" exception legacy/src/main/java/org/opensearch/sql/legacy/antlr/visitor/UnsupportedSemanticVerifier.java:80 — `verify` is a shipped method whose whole body only throws `SqlFeatureNotImplementedException` saying it is not implemented — scaffolding that was never completed. Implement it or remove the dead surface.
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D35 · Change Coupling · Change coupling · ×2
  • Change coupling: Analyzer.java ↔ AstBuilder.java core/src/main/java/org/opensearch/sql/analysis/Analyzer.java:1 — `core/src/main/java/org/opensearch/sql/analysis/Analyzer.java` and `ppl/src/main/java/org/opensearch/sql/ppl/parser/AstBuilder.java` change together 59% of the time (30 of the 51 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 30 shared commits counted here, the most recent 3 are `6d3c58d6` Xyseries command implementation (#5343); `e5a0bc30` [Feature] Add PPL `makeresults` command (#5622); `0cfe5424` [FEATURE] Add Union command in PPL (#5240) — run `git show` on any of them.
  • Change coupling: OpenSearchIndex.java ↔ OpenSearchIndexEnumerator.java opensearch/src/main/java/org/opensearch/sql/opensearch/storage/OpenSearchIndex.java:1 — `opensearch/src/main/java/org/opensearch/sql/opensearch/storage/OpenSearchIndex.java` and `opensearch/src/main/java/org/opensearch/sql/opensearch/storage/scan/OpenSearchIndexEnumerator.java` change together 58% of the time (7 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `d28c2261` Implement one-batch lookahead for index enumerators (#4345); `0398f685` ResourceMonitor only checks the memory health by calculating the memo…; `435a1242` Support ResourceMonitor with Calcite (#3738) — run `git show` on any of them.
D4 · Code Duplication · Edited copy of a member (29 corresponding lines) · ×2
  • Edited copy of a member (29 corresponding lines) async-query/src/main/java/org/opensearch/sql/spark/scheduler/OpenSearchAsyncQueryScheduler.java:62 — async-query/src/main/java/org/opensearch/sql/spark/scheduler/OpenSearchAsyncQueryScheduler.java:62-90 | datasources/src/main/java/org/opensearch/sql/datasources/storage/OpenSearchDataSourceMetadataStorage.java:116-149 — 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) core/src/main/java/org/opensearch/sql/expression/function/udf/datetime/ExtractFunction.java:58 — core/src/main/java/org/opensearch/sql/expression/function/udf/datetime/ExtractFunction.java:58-86 | core/src/main/java/org/opensearch/sql/expression/function/udf/datetime/FormatFunction.java:70-99 — 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 (24 corresponding lines) · ×2
  • Edited copy of a member (24 corresponding lines) core/src/main/java/org/opensearch/sql/expression/datetime/DateTimeFunctions.java:1021 — core/src/main/java/org/opensearch/sql/expression/datetime/DateTimeFunctions.java:1021-1045 | core/src/main/java/org/opensearch/sql/expression/datetime/DateTimeFunctions.java:1073-1096 — 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) legacy/src/main/java/org/opensearch/sql/legacy/query/maker/AggMaker.java:282 — legacy/src/main/java/org/opensearch/sql/legacy/query/maker/AggMaker.java:282-305 | legacy/src/main/java/org/opensearch/sql/legacy/query/maker/AggMaker.java:487-516 — 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 (26 corresponding lines) · ×2
  • Edited copy of a member (26 corresponding lines) core/src/main/java/org/opensearch/sql/executor/analyze/ExpensiveSortRule.java:25 — core/src/main/java/org/opensearch/sql/executor/analyze/ExpensiveSortRule.java:25-62 | core/src/main/java/org/opensearch/sql/executor/analyze/IneffectiveFilterRule.java:22-47 — 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) core/src/main/java/org/opensearch/sql/expression/function/udf/Dur2SecConvertFunction.java:29 — core/src/main/java/org/opensearch/sql/expression/function/udf/Dur2SecConvertFunction.java:29-54 | core/src/main/java/org/opensearch/sql/expression/function/udf/MsTimeConvertFunction.java:32-65 — 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, 14+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 14+ corresponding lines) core/src/main/java/org/opensearch/sql/expression/function/udf/binning/MinspanBucketFunction.java:59 — core/src/main/java/org/opensearch/sql/expression/function/udf/binning/MinspanBucketFunction.java:59-72 | core/src/main/java/org/opensearch/sql/expression/function/udf/binning/RangeBucketFunction.java:63-78 | core/src/main/java/org/opensearch/sql/expression/function/udf/binning/WidthBucketFunction.java:76-89 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) prometheus/src/main/java/org/opensearch/sql/prometheus/functions/scan/QueryExemplarsFunctionTableScanOperator.java:36 — prometheus/src/main/java/org/opensearch/sql/prometheus/functions/scan/QueryExemplarsFunctionTableScanOperator.java:36-49 | prometheus/src/main/java/org/opensearch/sql/prometheus/functions/scan/QueryRangeFunctionTableScanOperator.java:36-52 | prometheus/src/main/java/org/opensearch/sql/prometheus/storage/PrometheusMetricScan.java:52-68 — 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, 9+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 9+ corresponding lines) core/src/main/java/org/opensearch/sql/utils/DateTimeUtils.java:66 — core/src/main/java/org/opensearch/sql/utils/DateTimeUtils.java:66-78 | core/src/main/java/org/opensearch/sql/utils/DateTimeUtils.java:87-99 | core/src/main/java/org/opensearch/sql/utils/DateTimeUtils.java:108-116 — 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) core/src/main/java/org/opensearch/sql/expression/function/PPLTypeChecker.java:194 — core/src/main/java/org/opensearch/sql/expression/function/PPLTypeChecker.java:194-202 | core/src/main/java/org/opensearch/sql/expression/function/PPLTypeChecker.java:252-265 | core/src/main/java/org/opensearch/sql/expression/function/PPLTypeChecker.java:427-445 — 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, 11+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 11+ corresponding lines) legacy/src/main/java/org/opensearch/sql/legacy/spatial/WktToGeoJsonConverter.java:61 — legacy/src/main/java/org/opensearch/sql/legacy/spatial/WktToGeoJsonConverter.java:61-71 | legacy/src/main/java/org/opensearch/sql/legacy/spatial/WktToGeoJsonConverter.java:88-99 | legacy/src/main/java/org/opensearch/sql/legacy/spatial/WktToGeoJsonConverter.java:109-125 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 11+ corresponding lines) core/src/main/java/org/opensearch/sql/expression/function/FunctionDSL.java:401 — core/src/main/java/org/opensearch/sql/expression/function/FunctionDSL.java:401-411 | core/src/main/java/org/opensearch/sql/expression/function/FunctionDSL.java:415-425 | core/src/main/java/org/opensearch/sql/expression/function/FunctionDSL.java:452-462 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 10+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 10+ corresponding lines) core/src/main/java/org/opensearch/sql/calcite/utils/PPLHintUtils.java:56 — core/src/main/java/org/opensearch/sql/calcite/utils/PPLHintUtils.java:56-65 | core/src/main/java/org/opensearch/sql/calcite/utils/PPLHintUtils.java:71-80 | core/src/main/java/org/opensearch/sql/calcite/utils/PPLHintUtils.java:108-121 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) sql/src/main/java/org/opensearch/sql/sql/parser/AstExpressionBuilder.java:574 — sql/src/main/java/org/opensearch/sql/sql/parser/AstExpressionBuilder.java:574-583 | sql/src/main/java/org/opensearch/sql/sql/parser/AstExpressionBuilder.java:586-598 | sql/src/main/java/org/opensearch/sql/sql/parser/AstExpressionBuilder.java:601-613 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 8+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 8+ corresponding lines) legacy/src/main/java/org/opensearch/sql/legacy/executor/csv/CSVResult.java:70 — legacy/src/main/java/org/opensearch/sql/legacy/executor/csv/CSVResult.java:70-80 | protocol/src/main/java/org/opensearch/sql/protocol/response/format/FlatResponseBase.java:76-83 | protocol/src/main/java/org/opensearch/sql/protocol/response/format/FlatResponseWithSanitizer.java:36-46 — 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) async-query-core/src/main/java/org/opensearch/sql/spark/dispatcher/model/JobType.java:30 — async-query-core/src/main/java/org/opensearch/sql/spark/dispatcher/model/JobType.java:30-37 | async-query-core/src/main/java/org/opensearch/sql/spark/rest/model/LangType.java:29-36 | core/src/main/java/org/opensearch/sql/datasource/model/DataSourceStatus.java:29-36 — 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 copy of a member (4 corresponding lines) · ×2
  • Edited copy of a member (4 corresponding lines) common/src/main/java/org/opensearch/sql/common/setting/Settings.java:106 — common/src/main/java/org/opensearch/sql/common/setting/Settings.java:106-109 | core/src/main/java/org/opensearch/sql/protocol/response/format/Format.java:67-70 — 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) ppl/src/main/java/org/opensearch/sql/ppl/parser/AstExpressionBuilder.java:585 — ppl/src/main/java/org/opensearch/sql/ppl/parser/AstExpressionBuilder.java:585-588 | sql/src/main/java/org/opensearch/sql/sql/parser/AstExpressionBuilder.java:536-539 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (3 corresponding lines) · ×2
  • Edited copy of a member (3 corresponding lines) core/src/main/java/org/opensearch/sql/data/model/ExprCollectionValue.java:42 — core/src/main/java/org/opensearch/sql/data/model/ExprCollectionValue.java:42-44 | legacy/src/main/java/org/opensearch/sql/legacy/expression/model/ExprCollectionValue.java:31-33 — 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) ppl/src/main/java/org/opensearch/sql/ppl/parser/AstExpressionBuilder.java:814 — ppl/src/main/java/org/opensearch/sql/ppl/parser/AstExpressionBuilder.java:814-817 | sql/src/main/java/org/opensearch/sql/sql/parser/AstExpressionBuilder.java:412-414 — 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 · Duplicated block (15 lines × 2) · ×2
  • Duplicated block (15 lines × 2) core/src/main/java/org/opensearch/sql/calcite/utils/UserDefinedFunctionUtils.java:245 — core/src/main/java/org/opensearch/sql/calcite/utils/UserDefinedFunctionUtils.java:245-259 | core/src/main/java/org/opensearch/sql/calcite/utils/UserDefinedFunctionUtils.java:277-291 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/opensearch/sql/calcite/utils/UserDefinedFunctionUtils.java:245` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `core/src/main/java/org/opensearch/sql/calcite/utils/UserDefinedFunctionUtils.java:276` calls `prependFunctionProperties` and `core/src/main/java/org/opensearch/sql/calcite/utils/UserDefinedFunctionUtils.java:244` 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 (15 lines × 2) async-query/src/main/java/org/opensearch/sql/spark/transport/model/CancelAsyncQueryActionRequest.java:23 — async-query/src/main/java/org/opensearch/sql/spark/transport/model/CancelAsyncQueryActionRequest.java:23-37 | async-query/src/main/java/org/opensearch/sql/spark/transport/model/GetAsyncQueryResultActionRequest.java:22-36 — before extracting anything, compare `async-query/src/main/java/org/opensearch/sql/spark/transport/model/CancelAsyncQueryActionRequest.java` and `async-query/src/main/java/org/opensearch/sql/spark/transport/model/GetAsyncQueryResultActionRequest.java` as WHOLE FILES: 84% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, 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 (11–12 lines × 2) · ×2
  • Duplicated block (11–12 lines × 2) async-query/src/main/java/org/opensearch/sql/spark/scheduler/OpenSearchAsyncQueryScheduler.java:132 — async-query/src/main/java/org/opensearch/sql/spark/scheduler/OpenSearchAsyncQueryScheduler.java:132-142 | datasources/src/main/java/org/opensearch/sql/datasources/storage/OpenSearchDataSourceMetadataStorage.java:170-181 — 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 `async-query/src/main/java/org/opensearch/sql/spark/scheduler/OpenSearchAsyncQueryScheduler.java:132` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11–12 lines × 2) core/src/main/java/org/opensearch/sql/calcite/utils/TimewrapUtils.java:166 — core/src/main/java/org/opensearch/sql/calcite/utils/TimewrapUtils.java:166-177 | core/src/main/java/org/opensearch/sql/calcite/utils/TimewrapUtils.java:179-189 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/main/java/org/opensearch/sql/calcite/utils/TimewrapUtils.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.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×2
  • Duplicated block (11 lines × 3) core/src/main/java/org/opensearch/sql/expression/function/OpenSearchFunctions.java:164 — core/src/main/java/org/opensearch/sql/expression/function/OpenSearchFunctions.java:164-174 | prometheus/src/main/java/org/opensearch/sql/prometheus/functions/implementation/QueryExemplarFunctionImplementation.java:68-78 | prometheus/src/main/java/org/opensearch/sql/prometheus/functions/implementation/QueryRangeFunctionImplementation.java:69-79 — 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.
  • Duplicated block (11 lines × 3) async-query/src/main/java/org/opensearch/sql/spark/rest/RestAsyncQueryManagementAction.java:315 — async-query/src/main/java/org/opensearch/sql/spark/rest/RestAsyncQueryManagementAction.java:315-326 | direct-query/src/main/java/org/opensearch/sql/directquery/rest/RestDirectQueryManagementAction.java:201-211 | direct-query/src/main/java/org/opensearch/sql/directquery/rest/RestDirectQueryResourcesManagementAction.java:236-246 — 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 (7–9 lines × 2) · ×2
  • Duplicated block (7–9 lines × 2) legacy/src/main/java/org/opensearch/sql/legacy/executor/cursor/CursorCloseExecutor.java:41 — legacy/src/main/java/org/opensearch/sql/legacy/executor/cursor/CursorCloseExecutor.java:41-47 | legacy/src/main/java/org/opensearch/sql/legacy/executor/cursor/CursorResultExecutor.java:55-63 — before extracting anything, compare `legacy/src/main/java/org/opensearch/sql/legacy/executor/cursor/CursorCloseExecutor.java` and `legacy/src/main/java/org/opensearch/sql/legacy/executor/cursor/CursorResultExecutor.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `legacy/src/main/java/org/opensearch/sql/legacy/executor/cursor/CursorCloseExecutor.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.
  • Duplicated block (7–9 lines × 2) legacy/src/main/java/org/opensearch/sql/legacy/parser/ElasticSqlExprParser.java:350 — legacy/src/main/java/org/opensearch/sql/legacy/parser/ElasticSqlExprParser.java:350-356 | legacy/src/main/java/org/opensearch/sql/legacy/parser/ElasticSqlExprParser.java:384-392 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `legacy/src/main/java/org/opensearch/sql/legacy/parser/ElasticSqlExprParser.java:350` it does not close everything it opens, so those 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 × 5) · ×2
  • Duplicated block (7 lines × 5) opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/aggregation/CalciteAggregationScriptLeafFactory.java:46 — opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/aggregation/CalciteAggregationScriptLeafFactory.java:46-52 | opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/field/CalciteFieldScriptLeafFactory.java:46-52 | opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/filter/CalciteFilterScriptLeafFactory.java:47-53 | opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/sort/CalciteNumberSortScriptLeafFactory.java:43-49 | opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/sort/CalciteStringSortScriptLeafFactory.java:44-50 — 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 `opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/aggregation/CalciteAggregationScriptLeafFactory.java:46` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 5) common/src/main/java/org/opensearch/sql/common/utils/QueryContext.java:59 — common/src/main/java/org/opensearch/sql/common/utils/QueryContext.java:59-65 | datasources/src/main/java/org/opensearch/sql/datasources/utils/Scheduler.java:33-39 | legacy/src/main/java/org/opensearch/sql/legacy/plugin/RestSqlStatsAction.java:97-103 | opensearch/src/main/java/org/opensearch/sql/opensearch/executor/OpenSearchQueryManager.java:165-171 | plugin/src/main/java/org/opensearch/sql/plugin/rest/RestUnifiedQueryAction.java:499-505 — 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.
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×2
  • Duplicated block (7 lines × 4) core/src/main/java/org/opensearch/sql/expression/function/FunctionDSL.java:159 — core/src/main/java/org/opensearch/sql/expression/function/FunctionDSL.java:159-165 | core/src/main/java/org/opensearch/sql/expression/function/FunctionDSL.java:209-215 | core/src/main/java/org/opensearch/sql/expression/function/FunctionDSL.java:301-307 | core/src/main/java/org/opensearch/sql/expression/function/FunctionDSL.java:353-359 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/main/java/org/opensearch/sql/expression/function/FunctionDSL.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `core/src/main/java/org/opensearch/sql/expression/function/FunctionDSL.java:308` calls `get`, `valueOf` and `core/src/main/java/org/opensearch/sql/expression/function/FunctionDSL.java:166` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 4) core/src/main/java/org/opensearch/sql/expression/function/udf/binning/MinspanBucketFunction.java:114 — core/src/main/java/org/opensearch/sql/expression/function/udf/binning/MinspanBucketFunction.java:114-120 | core/src/main/java/org/opensearch/sql/expression/function/udf/binning/RangeBucketFunction.java:145-151 | core/src/main/java/org/opensearch/sql/expression/function/udf/binning/SpanBucketFunction.java:87-93 | core/src/main/java/org/opensearch/sql/expression/function/udf/binning/WidthBucketFunction.java:156-162 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 (6 lines × 3) · ×2
  • Duplicated block (6 lines × 3) async-query/src/main/java/org/opensearch/sql/spark/execution/xcontent/FlintIndexStateModelXContentSerializer.java:56 — async-query/src/main/java/org/opensearch/sql/spark/execution/xcontent/FlintIndexStateModelXContentSerializer.java:56-61 | async-query/src/main/java/org/opensearch/sql/spark/execution/xcontent/SessionModelXContentSerializer.java:57-62 | async-query/src/main/java/org/opensearch/sql/spark/execution/xcontent/StatementModelXContentSerializer.java:65-70 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `async-query/src/main/java/org/opensearch/sql/spark/execution/xcontent/FlintIndexStateModelXContentSerializer.java:56` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 3) ppl/src/main/java/org/opensearch/sql/ppl/utils/PPLQueryDataAnonymizer.java:424 — ppl/src/main/java/org/opensearch/sql/ppl/utils/PPLQueryDataAnonymizer.java:424-429 | ppl/src/main/java/org/opensearch/sql/ppl/utils/PPLQueryDataAnonymizer.java:433-438 | ppl/src/main/java/org/opensearch/sql/ppl/utils/PPLQueryDataAnonymizer.java:441-446 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `ppl/src/main/java/org/opensearch/sql/ppl/utils/PPLQueryDataAnonymizer.java:423` calls `visitExpression`, `getMinspan` and `ppl/src/main/java/org/opensearch/sql/ppl/utils/PPLQueryDataAnonymizer.java:440` 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.
D5 · Coupling · Unstable project · ×2
  • Unstable project :async-query — :async-query has instability 0.83 with 1 dependents.
  • Unstable project :direct-query — :direct-query has instability 0.86 with 1 dependents.
D1 · Cyclomatic Complexity · SQLFunctions.function (cyclomatic 84) · ×1
  • SQLFunctions.function (cyclomatic 84) legacy/src/main/java/org/opensearch/sql/legacy/utils/SQLFunctions.java:130 — SQLFunctions.function has cyclomatic complexity 84 (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 · ElasticSqlExprParser.primaryRest (cyclomatic 62) · ×1
  • ElasticSqlExprParser.primaryRest (cyclomatic 62) legacy/src/main/java/org/opensearch/sql/legacy/parser/ElasticSqlExprParser.java:298 — ElasticSqlExprParser.primaryRest has cyclomatic complexity 62 (threshold 15). To reduce it, separate the cases: extract each independent 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 · WhereParser.explainCond (cyclomatic 54) · ×1
  • WhereParser.explainCond (cyclomatic 54) legacy/src/main/java/org/opensearch/sql/legacy/parser/WhereParser.java:229 — WhereParser.explainCond has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent 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 · Maker.make (cyclomatic 53) · ×1
  • Maker.make (cyclomatic 53) legacy/src/main/java/org/opensearch/sql/legacy/query/maker/Maker.java:193 — Maker.make has cyclomatic complexity 53 (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 · HintFactory.getHintFromString (cyclomatic 38) · ×1
  • HintFactory.getHintFromString (cyclomatic 38) legacy/src/main/java/org/opensearch/sql/legacy/domain/hints/HintFactory.java:23 — HintFactory.getHintFromString has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AggregateAnalyzer.createRegularAggregation (cyclomatic 36) · ×1
  • AggregateAnalyzer.createRegularAggregation (cyclomatic 36) opensearch/src/main/java/org/opensearch/sql/opensearch/request/AggregateAnalyzer.java:483 — AggregateAnalyzer.createRegularAggregation 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 · AggregationQueryAction.explain (cyclomatic 33) · ×1
  • AggregationQueryAction.explain (cyclomatic 33) legacy/src/main/java/org/opensearch/sql/legacy/query/AggregationQueryAction.java:53 — AggregationQueryAction.explain has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Visitor.supportedRexCall (cyclomatic 33) · ×1
  • Visitor.supportedRexCall (cyclomatic 33) opensearch/src/main/java/org/opensearch/sql/opensearch/request/PredicateAnalyzer.java:285 — Visitor.supportedRexCall 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 · ExtendedRelJson.toRex (cyclomatic 29) · ×1
  • ExtendedRelJson.toRex (cyclomatic 29) opensearch/src/main/java/org/opensearch/sql/opensearch/storage/serde/ExtendedRelJson.java:394 — ExtendedRelJson.toRex has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OpenSearchTypeFactory.convertExprTypeToRelDataType (cyclomatic 28) · ×1
  • OpenSearchTypeFactory.convertExprTypeToRelDataType (cyclomatic 28) core/src/main/java/org/opensearch/sql/calcite/utils/OpenSearchTypeFactory.java:152 — OpenSearchTypeFactory.convertExprTypeToRelDataType has cyclomatic complexity 28 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: OpenSearchTypeFactory.convertSqlTypeNameToExprType (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 · FieldMaker.makeMethodField (cyclomatic 28) · ×1
  • FieldMaker.makeMethodField (cyclomatic 28) legacy/src/main/java/org/opensearch/sql/legacy/parser/FieldMaker.java:280 — FieldMaker.makeMethodField 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 · AggMaker.termsAgg (cyclomatic 25) · ×1
  • AggMaker.termsAgg (cyclomatic 25) legacy/src/main/java/org/opensearch/sql/legacy/query/maker/AggMaker.java:307 — AggMaker.termsAgg has cyclomatic complexity 25 (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 · Visitor.flatObjectLeafPredicate (cyclomatic 25) · ×1
  • Visitor.flatObjectLeafPredicate (cyclomatic 25) opensearch/src/main/java/org/opensearch/sql/opensearch/request/PredicateAnalyzer.java:422 — Visitor.flatObjectLeafPredicate has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TimewrapPivot.pivot (cyclomatic 24) · ×1
  • TimewrapPivot.pivot (cyclomatic 24) core/src/main/java/org/opensearch/sql/calcite/utils/TimewrapPivot.java:61 — TimewrapPivot.pivot has cyclomatic complexity 24 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · ExprValueUtils.fromObjectValue (cyclomatic 24) · ×1
  • ExprValueUtils.fromObjectValue (cyclomatic 24) core/src/main/java/org/opensearch/sql/data/model/ExprValueUtils.java:115 — ExprValueUtils.fromObjectValue 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 · Visitor.binary (cyclomatic 24) · ×1
  • Visitor.binary (cyclomatic 24) opensearch/src/main/java/org/opensearch/sql/opensearch/request/PredicateAnalyzer.java:882 — Visitor.binary 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 · CalciteRelNodeVisitor.buildAddRowTotalAggregate (cyclomatic 23) · ×1
  • CalciteRelNodeVisitor.buildAddRowTotalAggregate (cyclomatic 23) core/src/main/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java:3645 — CalciteRelNodeVisitor.buildAddRowTotalAggregate 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 · OpenSearchRelOptUtil.getOrderEquivalentInputInfo (cyclomatic 23) · ×1
  • OpenSearchRelOptUtil.getOrderEquivalentInputInfo (cyclomatic 23) opensearch/src/main/java/org/opensearch/sql/opensearch/util/OpenSearchRelOptUtil.java:48 — OpenSearchRelOptUtil.getOrderEquivalentInputInfo 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 · OpenSearchRelOptUtil.isOrderPreservingCast (cyclomatic 23) · ×1
  • OpenSearchRelOptUtil.isOrderPreservingCast (cyclomatic 23) opensearch/src/main/java/org/opensearch/sql/opensearch/util/OpenSearchRelOptUtil.java:143 — OpenSearchRelOptUtil.isOrderPreservingCast has cyclomatic complexity 23 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · AnonymizerListener.visitTerminal (cyclomatic 21) · ×1
  • AnonymizerListener.visitTerminal (cyclomatic 21) sql/src/main/java/org/opensearch/sql/sql/antlr/AnonymizerListener.java:46 — AnonymizerListener.visitTerminal 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 · JsonExtractAllFunctionImpl.parseJson (cyclomatic 20) · ×1
  • JsonExtractAllFunctionImpl.parseJson (cyclomatic 20) core/src/main/java/org/opensearch/sql/expression/function/jsonUDF/JsonExtractAllFunctionImpl.java:106 — JsonExtractAllFunctionImpl.parseJson has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · ElasticSqlSelectParser.query (cyclomatic 20) · ×1
  • ElasticSqlSelectParser.query (cyclomatic 20) legacy/src/main/java/org/opensearch/sql/legacy/parser/ElasticSqlSelectParser.java:38 — ElasticSqlSelectParser.query 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 · FieldMaker.makeFieldImpl (cyclomatic 20) · ×1
  • FieldMaker.makeFieldImpl (cyclomatic 20) legacy/src/main/java/org/opensearch/sql/legacy/parser/FieldMaker.java:60 — FieldMaker.makeFieldImpl 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 · AggregateAnalyzer.createTopHitsBuilder (cyclomatic 20) · ×1
  • AggregateAnalyzer.createTopHitsBuilder (cyclomatic 20) opensearch/src/main/java/org/opensearch/sql/opensearch/request/AggregateAnalyzer.java:876 — AggregateAnalyzer.createTopHitsBuilder 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 · CalciteRelNodeVisitor.buildLiteralValues (cyclomatic 19) · ×1
  • CalciteRelNodeVisitor.buildLiteralValues (cyclomatic 19) core/src/main/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java:4873 — CalciteRelNodeVisitor.buildLiteralValues 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 · CalciteRelNodeVisitor.visitJoin (cyclomatic 19) · ×1
  • CalciteRelNodeVisitor.visitJoin (cyclomatic 19) core/src/main/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java:1987 — CalciteRelNodeVisitor.visitJoin 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 · ExtendedRexBuilder.makeCast (cyclomatic 19) · ×1
  • ExtendedRexBuilder.makeCast (cyclomatic 19) core/src/main/java/org/opensearch/sql/calcite/ExtendedRexBuilder.java:121 — ExtendedRexBuilder.makeCast 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. This is NOT this file's highest cyclomatic complexity: ExtendedRexBuilder.createIntervalUntil (cyclomatic 38) 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 · OperatorUtils.patternToRegex (cyclomatic 19) · ×1
  • OperatorUtils.patternToRegex (cyclomatic 19) core/src/main/java/org/opensearch/sql/utils/OperatorUtils.java:62 — OperatorUtils.patternToRegex 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 · DirectQueryRequestValidator.validateRequest (cyclomatic 19) · ×1
  • DirectQueryRequestValidator.validateRequest (cyclomatic 19) direct-query-core/src/main/java/org/opensearch/sql/directquery/validator/DirectQueryRequestValidator.java:19 — DirectQueryRequestValidator.validateRequest 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 · AggMaker.scriptedMetric (cyclomatic 19) · ×1
  • AggMaker.scriptedMetric (cyclomatic 19) legacy/src/main/java/org/opensearch/sql/legacy/query/maker/AggMaker.java:403 — AggMaker.scriptedMetric 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 · AstBuilder.visitJoinCommand (cyclomatic 19) · ×1
  • AstBuilder.visitJoinCommand (cyclomatic 19) ppl/src/main/java/org/opensearch/sql/ppl/parser/AstBuilder.java:398 — AstBuilder.visitJoinCommand 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 · Match.capture (cyclomatic 18) · ×1
  • Match.capture (cyclomatic 18) common/src/main/java/org/opensearch/sql/common/grok/Match.java:96 — Match.capture 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 · WhereParser.parseSQLBinaryOpExprWhoIsConditionInWhere (cyclomatic 18) · ×1
  • WhereParser.parseSQLBinaryOpExprWhoIsConditionInWhere (cyclomatic 18) legacy/src/main/java/org/opensearch/sql/legacy/parser/WhereParser.java:671 — WhereParser.parseSQLBinaryOpExprWhoIsConditionInWhere 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 · SortExprIndexScanRule.onMatchImpl (cyclomatic 18) · ×1
  • SortExprIndexScanRule.onMatchImpl (cyclomatic 18) opensearch/src/main/java/org/opensearch/sql/opensearch/planner/rules/SortExprIndexScanRule.java:49 — SortExprIndexScanRule.onMatchImpl 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 · AggPushDownAction.rePushDownRareTop (cyclomatic 18) · ×1
  • AggPushDownAction.rePushDownRareTop (cyclomatic 18) opensearch/src/main/java/org/opensearch/sql/opensearch/storage/scan/context/AggPushDownAction.java:193 — AggPushDownAction.rePushDownRareTop 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 · SchemaUnifier.coerceUnionTypes (cyclomatic 17) · ×1
  • SchemaUnifier.coerceUnionTypes (cyclomatic 17) core/src/main/java/org/opensearch/sql/calcite/SchemaUnifier.java:232 — SchemaUnifier.coerceUnionTypes 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 · Paramer.parseParamer (cyclomatic 17) · ×1
  • Paramer.parseParamer (cyclomatic 17) legacy/src/main/java/org/opensearch/sql/legacy/domain/Paramer.java:40 — Paramer.parseParamer 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 · SelectResultSet.populateColumns (cyclomatic 17) · ×1
  • SelectResultSet.populateColumns (cyclomatic 17) legacy/src/main/java/org/opensearch/sql/legacy/executor/format/SelectResultSet.java:373 — SelectResultSet.populateColumns 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 · HashJoinElasticExecutor.createCombinedResults (cyclomatic 17) · ×1
  • HashJoinElasticExecutor.createCombinedResults (cyclomatic 17) legacy/src/main/java/org/opensearch/sql/legacy/executor/join/HashJoinElasticExecutor.java:115 — HashJoinElasticExecutor.createCombinedResults 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 · ElasticSqlExprParser.primary2 (cyclomatic 17) · ×1
  • ElasticSqlExprParser.primary2 (cyclomatic 17) legacy/src/main/java/org/opensearch/sql/legacy/parser/ElasticSqlExprParser.java:239 — ElasticSqlExprParser.primary2 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 · AggMaker.dateHistogram (cyclomatic 17) · ×1
  • AggMaker.dateHistogram (cyclomatic 17) legacy/src/main/java/org/opensearch/sql/legacy/query/maker/AggMaker.java:558 — AggMaker.dateHistogram 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 · AggMaker.histogram (cyclomatic 17) · ×1
  • AggMaker.histogram (cyclomatic 17) legacy/src/main/java/org/opensearch/sql/legacy/query/maker/AggMaker.java:623 — AggMaker.histogram 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 · SpatialParamsFactory.generateSpatialParamsObject (cyclomatic 17) · ×1
  • SpatialParamsFactory.generateSpatialParamsObject (cyclomatic 17) legacy/src/main/java/org/opensearch/sql/legacy/spatial/SpatialParamsFactory.java:32 — SpatialParamsFactory.generateSpatialParamsObject 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 · ExtendedRelJson.toJson (cyclomatic 17) · ×1
  • ExtendedRelJson.toJson (cyclomatic 17) opensearch/src/main/java/org/opensearch/sql/opensearch/storage/serde/ExtendedRelJson.java:182 — ExtendedRelJson.toJson 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 · VectorSearchTableFunctionImplementation.validateOptions (cyclomatic 17) · ×1
  • VectorSearchTableFunctionImplementation.validateOptions (cyclomatic 17) opensearch/src/main/java/org/opensearch/sql/opensearch/storage/VectorSearchTableFunctionImplementation.java:284 — VectorSearchTableFunctionImplementation.validateOptions has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · PPLQueryDataAnonymizer.visitChart (cyclomatic 17) · ×1
  • PPLQueryDataAnonymizer.visitChart (cyclomatic 17) ppl/src/main/java/org/opensearch/sql/ppl/utils/PPLQueryDataAnonymizer.java:699 — PPLQueryDataAnonymizer.visitChart 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 · EmptySourcePropagateVisitor.visitJoin (cyclomatic 16) · ×1
  • EmptySourcePropagateVisitor.visitJoin (cyclomatic 16) core/src/main/java/org/opensearch/sql/ast/EmptySourcePropagateVisitor.java:84 — EmptySourcePropagateVisitor.visitJoin 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 · JsonUtils.expand (cyclomatic 16) · ×1
  • JsonUtils.expand (cyclomatic 16) core/src/main/java/org/opensearch/sql/expression/function/jsonUDF/JsonUtils.java:103 — JsonUtils.expand 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 · ElasticSqlExprParser.primary (cyclomatic 16) · ×1
  • ElasticSqlExprParser.primary (cyclomatic 16) legacy/src/main/java/org/opensearch/sql/legacy/parser/ElasticSqlExprParser.java:113 — ElasticSqlExprParser.primary 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 · AggMaker.addFieldToAgg (cyclomatic 16) · ×1
  • AggMaker.addFieldToAgg (cyclomatic 16) legacy/src/main/java/org/opensearch/sql/legacy/query/maker/AggMaker.java:192 — AggMaker.addFieldToAgg 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 · SqlRequestFactory.parseParameters (cyclomatic 16) · ×1
  • SqlRequestFactory.parseParameters (cyclomatic 16) legacy/src/main/java/org/opensearch/sql/legacy/request/SqlRequestFactory.java:86 — SqlRequestFactory.parseParameters 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 · ADOperator.convertArgumentToMLParameter (cyclomatic 16) · ×1
  • ADOperator.convertArgumentToMLParameter (cyclomatic 16) opensearch/src/main/java/org/opensearch/sql/opensearch/planner/physical/ADOperator.java:121 — ADOperator.convertArgumentToMLParameter 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 · ElasticSqlExprParser.primaryRest (cognitive 132) · ×1
  • ElasticSqlExprParser.primaryRest (cognitive 132) legacy/src/main/java/org/opensearch/sql/legacy/parser/ElasticSqlExprParser.java:298 — ElasticSqlExprParser.primaryRest has cognitive complexity 132 (threshold 15). Drivers by points: if/else 59 (120 pts), boolean chains 6, loops 2 (6 pts) (nesting depth added 65). 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 · WhereParser.explainCond (cognitive 124) · ×1
  • WhereParser.explainCond (cognitive 124) legacy/src/main/java/org/opensearch/sql/legacy/parser/WhereParser.java:229 — WhereParser.explainCond has cognitive complexity 124 (threshold 15). Drivers by points: if/else 51 (95 pts), ternaries 9 (27 pts), boolean chains 2 (nesting depth added 62). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AggregationQueryAction.explain (cognitive 97) · ×1
  • AggregationQueryAction.explain (cognitive 97) legacy/src/main/java/org/opensearch/sql/legacy/query/AggregationQueryAction.java:53 — AggregationQueryAction.explain has cognitive complexity 97 (threshold 15). Drivers by points: if/else 29 (78 pts), loops 4 (12 pts), match/switch 1 (4 pts), boolean chains 3 (nesting depth added 60). 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 · ExtendedRelJson.toRex (cognitive 71) · ×1
  • ExtendedRelJson.toRex (cognitive 71) opensearch/src/main/java/org/opensearch/sql/opensearch/storage/serde/ExtendedRelJson.java:394 — ExtendedRelJson.toRex has cognitive complexity 71 (threshold 15). Drivers by points: if/else 32 (69 pts), boolean chains 2 (nesting depth added 37). 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 · HintFactory.getHintFromString (cognitive 64) · ×1
  • HintFactory.getHintFromString (cognitive 64) legacy/src/main/java/org/opensearch/sql/legacy/domain/hints/HintFactory.java:23 — HintFactory.getHintFromString has cognitive complexity 64 (threshold 15). Drivers by points: if/else 26 (39 pts), loops 4 (9 pts), boolean chains 7, error handling 2 (6 pts), ternaries 1 (3 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FieldMaker.makeMethodField (cognitive 54) · ×1
  • FieldMaker.makeMethodField (cognitive 54) legacy/src/main/java/org/opensearch/sql/legacy/parser/FieldMaker.java:280 — FieldMaker.makeMethodField has cognitive complexity 54 (threshold 15). Drivers by points: if/else 27 (46 pts), boolean chains 3, loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AggMaker.termsAgg (cognitive 46) · ×1
  • AggMaker.termsAgg (cognitive 46) legacy/src/main/java/org/opensearch/sql/legacy/query/maker/AggMaker.java:307 — AggMaker.termsAgg has cognitive complexity 46 (threshold 15). Drivers by points: if/else 9 (23 pts), error handling 3 (13 pts), loops 2 (7 pts), match/switch 1 (3 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 · Maker.make (cognitive 46) · ×1
  • Maker.make (cognitive 46) legacy/src/main/java/org/opensearch/sql/legacy/query/maker/Maker.java:193 — Maker.make has cognitive complexity 46 (threshold 15). Drivers by points: if/else 14 (25 pts), loops 5 (11 pts), boolean chains 7, error handling 1 (2 pts), match/switch 1 (nesting depth added 18). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · HashJoinElasticExecutor.createCombinedResults (cognitive 45) · ×1
  • HashJoinElasticExecutor.createCombinedResults (cognitive 45) legacy/src/main/java/org/opensearch/sql/legacy/executor/join/HashJoinElasticExecutor.java:115 — HashJoinElasticExecutor.createCombinedResults has cognitive complexity 45 (threshold 15). Drivers by points: if/else 11 (29 pts), loops 4 (11 pts), boolean chains 4, ternaries 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CalciteRelNodeVisitor.buildAddRowTotalAggregate (cognitive 44) · ×1
  • CalciteRelNodeVisitor.buildAddRowTotalAggregate (cognitive 44) core/src/main/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java:3645 — CalciteRelNodeVisitor.buildAddRowTotalAggregate has cognitive complexity 44 (threshold 15). Drivers by points: if/else 17 (36 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Visitor.flatObjectLeafPredicate (cognitive 37) · ×1
  • Visitor.flatObjectLeafPredicate (cognitive 37) opensearch/src/main/java/org/opensearch/sql/opensearch/request/PredicateAnalyzer.java:422 — Visitor.flatObjectLeafPredicate has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 4 (16 pts), if/else 6 (14 pts), boolean chains 4, loops 1 (2 pts), match/switch 1 (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 · CalciteRelNodeVisitor.visitJoin (cognitive 36) · ×1
  • CalciteRelNodeVisitor.visitJoin (cognitive 36) core/src/main/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java:1987 — CalciteRelNodeVisitor.visitJoin has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (27 pts), boolean chains 5, ternaries 2 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DefaultQueryAction.setFields (cognitive 33) · ×1
  • DefaultQueryAction.setFields (cognitive 33) legacy/src/main/java/org/opensearch/sql/legacy/query/DefaultQueryAction.java:145 — DefaultQueryAction.setFields has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 3 (12 pts), boolean chains 1 (nesting depth added 21). 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 · ElasticSqlSelectParser.parseInto (cognitive 32) · ×1
  • ElasticSqlSelectParser.parseInto (cognitive 32) legacy/src/main/java/org/opensearch/sql/legacy/parser/ElasticSqlSelectParser.java:154 — ElasticSqlSelectParser.parseInto has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (31 pts), boolean chains 1 (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · DirectQueryRequestValidator.validateRequest (cognitive 31) · ×1
  • DirectQueryRequestValidator.validateRequest (cognitive 31) direct-query-core/src/main/java/org/opensearch/sql/directquery/validator/DirectQueryRequestValidator.java:19 — DirectQueryRequestValidator.validateRequest has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (19 pts), error handling 2 (6 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SelectResultSet.populateColumns (cognitive 31) · ×1
  • SelectResultSet.populateColumns (cognitive 31) legacy/src/main/java/org/opensearch/sql/legacy/executor/format/SelectResultSet.java:373 — SelectResultSet.populateColumns has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (26 pts), boolean chains 4, 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 · AggPushDownAction.rePushDownRareTop (cognitive 31) · ×1
  • AggPushDownAction.rePushDownRareTop (cognitive 31) opensearch/src/main/java/org/opensearch/sql/opensearch/storage/scan/context/AggPushDownAction.java:193 — AggPushDownAction.rePushDownRareTop has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 4, loops 1 (3 pts), ternaries 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Match.capture (cognitive 30) · ×1
  • Match.capture (cognitive 30) common/src/main/java/org/opensearch/sql/common/grok/Match.java:96 — Match.capture has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (24 pts), boolean chains 3, error handling 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SchemaUnifier.coerceUnionTypes (cognitive 30) · ×1
  • SchemaUnifier.coerceUnionTypes (cognitive 30) core/src/main/java/org/opensearch/sql/calcite/SchemaUnifier.java:232 — SchemaUnifier.coerceUnionTypes has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 8 (12 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 · JsonUtils.expand (cognitive 30) · ×1
  • JsonUtils.expand (cognitive 30) core/src/main/java/org/opensearch/sql/expression/function/jsonUDF/JsonUtils.java:103 — JsonUtils.expand has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 4, loops 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 · ElasticSqlExprParser.primary (cognitive 30) · ×1
  • ElasticSqlExprParser.primary (cognitive 30) legacy/src/main/java/org/opensearch/sql/legacy/parser/ElasticSqlExprParser.java:113 — ElasticSqlExprParser.primary has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (22 pts), loops 2 (5 pts), boolean chains 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ElasticSqlSelectParser.query (cognitive 30) · ×1
  • ElasticSqlSelectParser.query (cognitive 30) legacy/src/main/java/org/opensearch/sql/legacy/parser/ElasticSqlSelectParser.java:38 — ElasticSqlSelectParser.query has cognitive complexity 30 (threshold 15). Drivers by points: if/else 19 (30 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 · TimewrapPivot.pivot (cognitive 29) · ×1
  • TimewrapPivot.pivot (cognitive 29) core/src/main/java/org/opensearch/sql/calcite/utils/TimewrapPivot.java:61 — TimewrapPivot.pivot has cognitive complexity 29 (threshold 15). Drivers by points: loops 11 (13 pts), if/else 8 (12 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GraphLookupEnumerator.performBfs (cognitive 29) · ×1
  • GraphLookupEnumerator.performBfs (cognitive 29) opensearch/src/main/java/org/opensearch/sql/opensearch/storage/scan/CalciteEnumerableGraphLookup.java:413 — GraphLookupEnumerator.performBfs has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 4 (7 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 · CalciteRelNodeVisitor.buildLiteralValues (cognitive 28) · ×1
  • CalciteRelNodeVisitor.buildLiteralValues (cognitive 28) core/src/main/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java:4873 — CalciteRelNodeVisitor.buildLiteralValues has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 7 (10 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AggregateAnalyzer.createTopHitsBuilder (cognitive 28) · ×1
  • AggregateAnalyzer.createTopHitsBuilder (cognitive 28) opensearch/src/main/java/org/opensearch/sql/opensearch/request/AggregateAnalyzer.java:876 — AggregateAnalyzer.createTopHitsBuilder has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 6, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PPLTypeChecker.matchedFamilies (cognitive 27) · ×1
  • PPLTypeChecker.matchedFamilies (cognitive 27) core/src/main/java/org/opensearch/sql/expression/function/PPLTypeChecker.java:85 — PPLTypeChecker.matchedFamilies has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (6 pts), ternaries 2 (5 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NestedLoopsElasticExecutor.innerRun (cognitive 27) · ×1
  • NestedLoopsElasticExecutor.innerRun (cognitive 27) legacy/src/main/java/org/opensearch/sql/legacy/executor/join/NestedLoopsElasticExecutor.java:48 — NestedLoopsElasticExecutor.innerRun has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FieldMaker.makeFieldImpl (cognitive 27) · ×1
  • FieldMaker.makeFieldImpl (cognitive 27) legacy/src/main/java/org/opensearch/sql/legacy/parser/FieldMaker.java:60 — FieldMaker.makeFieldImpl has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17 (24 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 · AggMaker.addFieldToAgg (cognitive 27) · ×1
  • AggMaker.addFieldToAgg (cognitive 27) legacy/src/main/java/org/opensearch/sql/legacy/query/maker/AggMaker.java:192 — AggMaker.addFieldToAgg has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 6 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AggregateAnalyzer.createRegularAggregation (cognitive 27) · ×1
  • AggregateAnalyzer.createRegularAggregation (cognitive 27) opensearch/src/main/java/org/opensearch/sql/opensearch/request/AggregateAnalyzer.java:483 — AggregateAnalyzer.createRegularAggregation has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (17 pts), ternaries 5 (7 pts), loops 2, boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GrokCompiler.compile (cognitive 26) · ×1
  • GrokCompiler.compile (cognitive 26) common/src/main/java/org/opensearch/sql/common/grok/GrokCompiler.java:134 — GrokCompiler.compile has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 2 (4 pts), ternaries 1 (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 · ExprValueUtils.fromObjectValue (cognitive 26) · ×1
  • ExprValueUtils.fromObjectValue (cognitive 26) core/src/main/java/org/opensearch/sql/data/model/ExprValueUtils.java:115 — ExprValueUtils.fromObjectValue has cognitive complexity 26 (threshold 15). Drivers by points: if/else 24 (26 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 · CalciteRelNodeVisitor.expandProjectFields (cognitive 25) · ×1
  • CalciteRelNodeVisitor.expandProjectFields (cognitive 25) core/src/main/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java:573 — CalciteRelNodeVisitor.expandProjectFields has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (17 pts), ternaries 1 (4 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NestedType.tryFillFromExpr (cognitive 25) · ×1
  • NestedType.tryFillFromExpr (cognitive 25) legacy/src/main/java/org/opensearch/sql/legacy/parser/NestedType.java:29 — NestedType.tryFillFromExpr has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (22 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 · PreparedStatementRequest.substituteParameters (cognitive 25) · ×1
  • PreparedStatementRequest.substituteParameters (cognitive 25) legacy/src/main/java/org/opensearch/sql/legacy/request/PreparedStatementRequest.java:46 — PreparedStatementRequest.substituteParameters has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AbstractCalciteIndexScan.pushDownSort (cognitive 25) · ×1
  • AbstractCalciteIndexScan.pushDownSort (cognitive 25) opensearch/src/main/java/org/opensearch/sql/opensearch/storage/scan/AbstractCalciteIndexScan.java:335 — AbstractCalciteIndexScan.pushDownSort has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (18 pts), ternaries 1 (3 pts), loops 1 (2 pts), boolean chains 1, error handling 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 · DateTimeUtils.getRelativeZonedDateTime (cognitive 24) · ×1
  • DateTimeUtils.getRelativeZonedDateTime (cognitive 24) core/src/main/java/org/opensearch/sql/utils/DateTimeUtils.java:176 — DateTimeUtils.getRelativeZonedDateTime has cognitive complexity 24 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 5 (6 pts), boolean chains 5, ternaries 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TermFieldRewriter.visit (cognitive 24) · ×1
  • TermFieldRewriter.visit (cognitive 24) legacy/src/main/java/org/opensearch/sql/legacy/rewriter/matchtoterm/TermFieldRewriter.java:105 — TermFieldRewriter.visit has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (23 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 · OpenSearchDateType.getExprTypeFromCustomFormats (cognitive 24) · ×1
  • OpenSearchDateType.getExprTypeFromCustomFormats (cognitive 24) opensearch/src/main/java/org/opensearch/sql/opensearch/data/type/OpenSearchDateType.java:349 — OpenSearchDateType.getExprTypeFromCustomFormats has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 3 (7 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 · MakeResultsDataParser.parseCsv (cognitive 24) · ×1
  • MakeResultsDataParser.parseCsv (cognitive 24) ppl/src/main/java/org/opensearch/sql/ppl/utils/MakeResultsDataParser.java:171 — MakeResultsDataParser.parseCsv has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 2 (6 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OperatorUtils.patternToRegex (cognitive 22) · ×1
  • OperatorUtils.patternToRegex (cognitive 22) core/src/main/java/org/opensearch/sql/utils/OperatorUtils.java:62 — OperatorUtils.patternToRegex has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 2 (7 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Paramer.parseParamer (cognitive 22) · ×1
  • Paramer.parseParamer (cognitive 22) legacy/src/main/java/org/opensearch/sql/legacy/domain/Paramer.java:40 — Paramer.parseParamer has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (5 pts), match/switch 1 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ThreadPoolExecutionDispatcher.dispatchInternal (cognitive 22) · ×1
  • ThreadPoolExecutionDispatcher.dispatchInternal (cognitive 22) opensearch/src/main/java/org/opensearch/sql/opensearch/executor/ThreadPoolExecutionDispatcher.java:64 — ThreadPoolExecutionDispatcher.dispatchInternal has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (16 pts), error handling 3 (5 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PPLQueryDataAnonymizer.visitGraphLookup (cognitive 22) · ×1
  • PPLQueryDataAnonymizer.visitGraphLookup (cognitive 22) ppl/src/main/java/org/opensearch/sql/ppl/utils/PPLQueryDataAnonymizer.java:255 — PPLQueryDataAnonymizer.visitGraphLookup has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (17 pts), loops 1 (3 pts), boolean chains 1, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SearchLiteral.toQueryString (cognitive 21) · ×1
  • SearchLiteral.toQueryString (cognitive 21) core/src/main/java/org/opensearch/sql/ast/expression/SearchLiteral.java:59 — SearchLiteral.toQueryString has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 2 (7 pts), boolean chains 3 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · JsonExtendFunctionImpl.eval (cognitive 21) · ×1
  • JsonExtendFunctionImpl.eval (cognitive 21) core/src/main/java/org/opensearch/sql/expression/function/jsonUDF/JsonExtendFunctionImpl.java:56 — JsonExtendFunctionImpl.eval has cognitive complexity 21 (threshold 15). Drivers by points: loops 4 (11 pts), if/else 4 (6 pts), error handling 1 (4 pts) (nesting depth added 12). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · JsonUtils.convertToJsonPath (cognitive 21) · ×1
  • JsonUtils.convertToJsonPath (cognitive 21) core/src/main/java/org/opensearch/sql/expression/function/jsonUDF/JsonUtils.java:23 — JsonUtils.convertToJsonPath has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 2 (4 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 · IndexStatement.parseQuery (cognitive 21) · ×1
  • IndexStatement.parseQuery (cognitive 21) legacy/src/main/java/org/opensearch/sql/legacy/domain/IndexStatement.java:23 — IndexStatement.parseQuery has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (15 pts), boolean chains 2, match/switch 1 (2 pts), error handling 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ElasticLexer.scanIdentifier (cognitive 21) · ×1
  • ElasticLexer.scanIdentifier (cognitive 21) legacy/src/main/java/org/opensearch/sql/legacy/parser/ElasticLexer.java:26 — ElasticLexer.scanIdentifier has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SqlParser.addOrderByToSelect (cognitive 21) · ×1
  • SqlParser.addOrderByToSelect (cognitive 21) legacy/src/main/java/org/opensearch/sql/legacy/parser/SqlParser.java:234 — SqlParser.addOrderByToSelect has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 2, 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 · AggregationQueryAction.getGroupAgg (cognitive 21) · ×1
  • AggregationQueryAction.getGroupAgg (cognitive 21) legacy/src/main/java/org/opensearch/sql/legacy/query/AggregationQueryAction.java:237 — AggregationQueryAction.getGroupAgg has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (6 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 · AggregateAnalyzer.analyze (cognitive 21) · ×1
  • AggregateAnalyzer.analyze (cognitive 21) opensearch/src/main/java/org/opensearch/sql/opensearch/request/AggregateAnalyzer.java:215 — AggregateAnalyzer.analyze has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 1, error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpenSearchQueryRequest.searchWithPIT (cognitive 21) · ×1
  • OpenSearchQueryRequest.searchWithPIT (cognitive 21) opensearch/src/main/java/org/opensearch/sql/opensearch/request/OpenSearchQueryRequest.java:246 — OpenSearchQueryRequest.searchWithPIT has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (18 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 · ExtendedRelJson.toJson (cognitive 21) · ×1
  • ExtendedRelJson.toJson (cognitive 21) opensearch/src/main/java/org/opensearch/sql/opensearch/storage/serde/ExtendedRelJson.java:182 — ExtendedRelJson.toJson has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (12 pts), match/switch 2 (4 pts), loops 1 (3 pts), ternaries 1 (2 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 · AggPushDownAction.rePushDownSortAggMeasure (cognitive 21) · ×1
  • AggPushDownAction.rePushDownSortAggMeasure (cognitive 21) opensearch/src/main/java/org/opensearch/sql/opensearch/storage/scan/context/AggPushDownAction.java:133 — AggPushDownAction.rePushDownSortAggMeasure has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpenSearchRelOptUtil.getOrderEquivalentInputInfo (cognitive 21) · ×1
  • OpenSearchRelOptUtil.getOrderEquivalentInputInfo (cognitive 21) opensearch/src/main/java/org/opensearch/sql/opensearch/util/OpenSearchRelOptUtil.java:48 — OpenSearchRelOptUtil.getOrderEquivalentInputInfo has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 4 (9 pts), if/else 4 (8 pts), boolean chains 3, 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 · CalciteRelNodeVisitor.visitAppendCol (cognitive 20) · ×1
  • CalciteRelNodeVisitor.visitAppendCol (cognitive 20) core/src/main/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java:3035 — CalciteRelNodeVisitor.visitAppendCol has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 2 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CalciteRelNodeVisitor.visitRename (cognitive 20) · ×1
  • CalciteRelNodeVisitor.visitRename (cognitive 20) core/src/main/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java:776 — CalciteRelNodeVisitor.visitRename has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CalciteRelNodeVisitor.visitReverse (cognitive 20) · ×1
  • CalciteRelNodeVisitor.visitReverse (cognitive 20) core/src/main/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java:930 — CalciteRelNodeVisitor.visitReverse has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 4, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpenSearchTypeFactory.leastRestrictive (cognitive 20) · ×1
  • OpenSearchTypeFactory.leastRestrictive (cognitive 20) core/src/main/java/org/opensearch/sql/calcite/utils/OpenSearchTypeFactory.java:466 — OpenSearchTypeFactory.leastRestrictive has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 1 (3 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 · DirectQueryResourcesRequestConverter.toWriteDirectRestRequest (cognitive 20) · ×1
  • DirectQueryResourcesRequestConverter.toWriteDirectRestRequest (cognitive 20) direct-query/src/main/java/org/opensearch/sql/directquery/transport/format/DirectQueryResourcesRequestConverter.java:78 — DirectQueryResourcesRequestConverter.toWriteDirectRestRequest has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (19 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 · CSVResultsExtractor.handleNumericMetricAggregation (cognitive 20) · ×1
  • CSVResultsExtractor.handleNumericMetricAggregation (cognitive 20) legacy/src/main/java/org/opensearch/sql/legacy/executor/csv/CSVResultsExtractor.java:181 — CSVResultsExtractor.handleNumericMetricAggregation has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 1 (3 pts), ternaries 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 · ElasticSqlExprParser.parseForeignKey (cognitive 20) · ×1
  • ElasticSqlExprParser.parseForeignKey (cognitive 20) legacy/src/main/java/org/opensearch/sql/legacy/parser/ElasticSqlExprParser.java:954 — ElasticSqlExprParser.parseForeignKey has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15 (20 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 · ADOperator.convertArgumentToMLParameter (cognitive 20) · ×1
  • ADOperator.convertArgumentToMLParameter (cognitive 20) opensearch/src/main/java/org/opensearch/sql/opensearch/planner/physical/ADOperator.java:121 — ADOperator.convertArgumentToMLParameter has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 14 (19 pts), if/else 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 · VectorSearchTableFunctionImplementation.validateOptions (cognitive 20) · ×1
  • VectorSearchTableFunctionImplementation.validateOptions (cognitive 20) opensearch/src/main/java/org/opensearch/sql/opensearch/storage/VectorSearchTableFunctionImplementation.java:284 — VectorSearchTableFunctionImplementation.validateOptions has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 3, boolean chains 2, 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.
D2 · Cognitive Complexity · AstBuilder.visitBinCommand (cognitive 20) · ×1
  • AstBuilder.visitBinCommand (cognitive 20) ppl/src/main/java/org/opensearch/sql/ppl/parser/AstBuilder.java:765 — AstBuilder.visitBinCommand has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 1, loops 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 · AstBuilder.visitGraphLookupCommand (cognitive 20) · ×1
  • AstBuilder.visitGraphLookupCommand (cognitive 20) ppl/src/main/java/org/opensearch/sql/ppl/parser/AstBuilder.java:1831 — AstBuilder.visitGraphLookupCommand has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (17 pts), 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 · AstBuilder.visitJoinCommand (cognitive 20) · ×1
  • AstBuilder.visitJoinCommand (cognitive 20) ppl/src/main/java/org/opensearch/sql/ppl/parser/AstBuilder.java:398 — AstBuilder.visitJoinCommand has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 7, ternaries 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PPLQueryDataAnonymizer.visitBin (cognitive 20) · ×1
  • PPLQueryDataAnonymizer.visitBin (cognitive 20) ppl/src/main/java/org/opensearch/sql/ppl/utils/PPLQueryDataAnonymizer.java:409 — PPLQueryDataAnonymizer.visitBin has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (20 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 · AbstractBuilder.populate (cognitive 19) · ×1
  • AbstractBuilder.populate (cognitive 19) core/src/main/java/org/opensearch/sql/expression/function/PPLFuncImpTable.java:1027 — AbstractBuilder.populate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, error handling 1 (3 pts), ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WhereParser.parseSQLBinaryOpExprWhoIsConditionInWhere (cognitive 19) · ×1
  • WhereParser.parseSQLBinaryOpExprWhoIsConditionInWhere (cognitive 19) legacy/src/main/java/org/opensearch/sql/legacy/parser/WhereParser.java:671 — WhereParser.parseSQLBinaryOpExprWhoIsConditionInWhere has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 3, ternaries 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.
D2 · Cognitive Complexity · SpatialParamsFactory.generateSpatialParamsObject (cognitive 19) · ×1
  • SpatialParamsFactory.generateSpatialParamsObject (cognitive 19) legacy/src/main/java/org/opensearch/sql/legacy/spatial/SpatialParamsFactory.java:32 — SpatialParamsFactory.generateSpatialParamsObject has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 2, 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 · OpenSearchExprValueFactory.parse (cognitive 19) · ×1
  • OpenSearchExprValueFactory.parse (cognitive 19) opensearch/src/main/java/org/opensearch/sql/opensearch/data/value/OpenSearchExprValueFactory.java:198 — OpenSearchExprValueFactory.parse has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (10 pts), error handling 3 (6 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 · OpenSearchExecutionEngine.processValue (cognitive 19) · ×1
  • OpenSearchExecutionEngine.processValue (cognitive 19) opensearch/src/main/java/org/opensearch/sql/opensearch/executor/OpenSearchExecutionEngine.java:394 — OpenSearchExecutionEngine.processValue has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (7 pts), loops 3 (7 pts), boolean chains 3, ternaries 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.
D2 · Cognitive Complexity · SortExprIndexScanRule.onMatchImpl (cognitive 19) · ×1
  • SortExprIndexScanRule.onMatchImpl (cognitive 19) opensearch/src/main/java/org/opensearch/sql/opensearch/planner/rules/SortExprIndexScanRule.java:49 — SortExprIndexScanRule.onMatchImpl has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 6, 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 · Visitor.binary (cognitive 19) · ×1
  • Visitor.binary (cognitive 19) opensearch/src/main/java/org/opensearch/sql/opensearch/request/PredicateAnalyzer.java:882 — Visitor.binary has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 2 (4 pts), match/switch 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 · AggPushDownAction.pushDownLimitIntoBucketSize (cognitive 19) · ×1
  • AggPushDownAction.pushDownLimitIntoBucketSize (cognitive 19) opensearch/src/main/java/org/opensearch/sql/opensearch/storage/scan/context/AggPushDownAction.java:487 — AggPushDownAction.pushDownLimitIntoBucketSize has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15 (19 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 · CalciteLogicalIndexScan.pushDownLimit (cognitive 19) · ×1
  • CalciteLogicalIndexScan.pushDownLimit (cognitive 19) opensearch/src/main/java/org/opensearch/sql/opensearch/storage/scan/CalciteLogicalIndexScan.java:434 — CalciteLogicalIndexScan.pushDownLimit has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, 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 · StringUtils.convert (cognitive 19) · ×1
  • StringUtils.convert (cognitive 19) opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/StringUtils.java:38 — StringUtils.convert has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 1 (2 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 · DefaultSparkSqlFunctionResponseHandle.extractRow (cognitive 18) · ×1
  • DefaultSparkSqlFunctionResponseHandle.extractRow (cognitive 18) async-query-core/src/main/java/org/opensearch/sql/spark/functions/response/DefaultSparkSqlFunctionResponseHandle.java:65 — DefaultSparkSqlFunctionResponseHandle.extractRow has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14 (17 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 · Match.cleanString (cognitive 18) · ×1
  • Match.cleanString (cognitive 18) common/src/main/java/org/opensearch/sql/common/grok/Match.java:205 — Match.cleanString has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TransformFunctionImpl.eval (cognitive 18) · ×1
  • TransformFunctionImpl.eval (cognitive 18) core/src/main/java/org/opensearch/sql/expression/function/CollectionUDF/TransformFunctionImpl.java:72 — TransformFunctionImpl.eval has cognitive complexity 18 (threshold 15). Drivers by points: loops 3 (8 pts), if/else 5 (6 pts), error handling 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 · JsonExtractAllFunctionImpl.parseJson (cognitive 18) · ×1
  • JsonExtractAllFunctionImpl.parseJson (cognitive 18) core/src/main/java/org/opensearch/sql/expression/function/jsonUDF/JsonExtractAllFunctionImpl.java:106 — JsonExtractAllFunctionImpl.parseJson has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (12 pts), boolean chains 2, match/switch 1 (2 pts), error handling 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 · OpenSearchJoinQueryAction.updateRequestWithHints (cognitive 18) · ×1
  • OpenSearchJoinQueryAction.updateRequestWithHints (cognitive 18) legacy/src/main/java/org/opensearch/sql/legacy/query/join/OpenSearchJoinQueryAction.java:58 — OpenSearchJoinQueryAction.updateRequestWithHints has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (15 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpenSearchExecutionEngine.buildResultSet (cognitive 18) · ×1
  • OpenSearchExecutionEngine.buildResultSet (cognitive 18) opensearch/src/main/java/org/opensearch/sql/opensearch/executor/OpenSearchExecutionEngine.java:435 — OpenSearchExecutionEngine.buildResultSet has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 4 (5 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PushDownContext.cloneForAggregate (cognitive 18) · ×1
  • PushDownContext.cloneForAggregate (cognitive 18) opensearch/src/main/java/org/opensearch/sql/opensearch/storage/scan/context/PushDownContext.java:80 — PushDownContext.cloneForAggregate has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (7 pts), loops 2 (4 pts), ternaries 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 · BackgroundSearchScanner.getCurrentResponse (cognitive 18) · ×1
  • BackgroundSearchScanner.getCurrentResponse (cognitive 18) opensearch/src/main/java/org/opensearch/sql/opensearch/storage/scan/BackgroundSearchScanner.java:156 — BackgroundSearchScanner.getCurrentResponse has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), error handling 3 (6 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MakeResultsDataParser.parse (cognitive 18) · ×1
  • MakeResultsDataParser.parse (cognitive 18) ppl/src/main/java/org/opensearch/sql/ppl/utils/MakeResultsDataParser.java:36 — MakeResultsDataParser.parse has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 2 (5 pts), boolean chains 2, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MakeResultsDataParser.parseJson (cognitive 18) · ×1
  • MakeResultsDataParser.parseJson (cognitive 18) ppl/src/main/java/org/opensearch/sql/ppl/utils/MakeResultsDataParser.java:115 — MakeResultsDataParser.parseJson has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 5 (7 pts), boolean chains 1, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExtendedRexBuilder.makeCast (cognitive 17) · ×1
  • ExtendedRexBuilder.makeCast (cognitive 17) core/src/main/java/org/opensearch/sql/calcite/ExtendedRexBuilder.java:121 — ExtendedRexBuilder.makeCast has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 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.
D2 · Cognitive Complexity · GraphLookup.deriveRowType (cognitive 17) · ×1
  • GraphLookup.deriveRowType (cognitive 17) core/src/main/java/org/opensearch/sql/calcite/plan/rel/GraphLookup.java:127 — GraphLookup.deriveRowType has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 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 · SpanParser.extractTimeUnit (cognitive 17) · ×1
  • SpanParser.extractTimeUnit (cognitive 17) core/src/main/java/org/opensearch/sql/calcite/utils/binning/SpanParser.java:147 — SpanParser.extractTimeUnit has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 3, loops 1, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DateFieldFormatter.parseDateString (cognitive 17) · ×1
  • DateFieldFormatter.parseDateString (cognitive 17) legacy/src/main/java/org/opensearch/sql/legacy/executor/format/DateFieldFormatter.java:142 — DateFieldFormatter.parseDateString has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), error handling 1 (2 pts), match/switch 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 · SQLFunctions.function (cognitive 17) · ×1
  • SQLFunctions.function (cognitive 17) legacy/src/main/java/org/opensearch/sql/legacy/utils/SQLFunctions.java:130 — SQLFunctions.function has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 1 (2 pts), ternaries 1 (2 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 · AggregateIndexScanRule.onMatchImpl (cognitive 17) · ×1
  • AggregateIndexScanRule.onMatchImpl (cognitive 17) opensearch/src/main/java/org/opensearch/sql/opensearch/planner/rules/AggregateIndexScanRule.java:42 — AggregateIndexScanRule.onMatchImpl has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (17 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 · Visitor.andOr (cognitive 17) · ×1
  • Visitor.andOr (cognitive 17) opensearch/src/main/java/org/opensearch/sql/opensearch/request/PredicateAnalyzer.java:1053 — Visitor.andOr has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), error handling 1 (2 pts), loops 1, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AbstractCalciteIndexScan.pushdownSortExpr (cognitive 17) · ×1
  • AbstractCalciteIndexScan.pushdownSortExpr (cognitive 17) opensearch/src/main/java/org/opensearch/sql/opensearch/storage/scan/AbstractCalciteIndexScan.java:429 — AbstractCalciteIndexScan.pushdownSortExpr has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), ternaries 1 (2 pts), boolean chains 1, error handling 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 · OpenSearchRelOptUtil.canScanProvideSortCollation (cognitive 17) · ×1
  • OpenSearchRelOptUtil.canScanProvideSortCollation (cognitive 17) opensearch/src/main/java/org/opensearch/sql/opensearch/util/OpenSearchRelOptUtil.java:293 — OpenSearchRelOptUtil.canScanProvideSortCollation has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 4, 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 · TransportPPLQueryAction.doExecute (cognitive 17) · ×1
  • TransportPPLQueryAction.doExecute (cognitive 17) plugin/src/main/java/org/opensearch/sql/plugin/transport/TransportPPLQueryAction.java:200 — TransportPPLQueryAction.doExecute has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (11 pts), error handling 2 (4 pts), boolean chains 1, ternaries 1 (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 · AstBuilder.visitForeachCommand (cognitive 17) · ×1
  • AstBuilder.visitForeachCommand (cognitive 17) ppl/src/main/java/org/opensearch/sql/ppl/parser/AstBuilder.java:999 — AstBuilder.visitForeachCommand has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 2 (3 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AstBuilder.visitRexCommand (cognitive 17) · ×1
  • AstBuilder.visitRexCommand (cognitive 17) ppl/src/main/java/org/opensearch/sql/ppl/parser/AstBuilder.java:1607 — AstBuilder.visitRexCommand has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 2 (3 pts), boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MakeResultsDataParser.splitCsvLine (cognitive 17) · ×1
  • MakeResultsDataParser.splitCsvLine (cognitive 17) ppl/src/main/java/org/opensearch/sql/ppl/utils/MakeResultsDataParser.java:219 — MakeResultsDataParser.splitCsvLine has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 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 · EmptySourcePropagateVisitor.visitJoin (cognitive 16) · ×1
  • EmptySourcePropagateVisitor.visitJoin (cognitive 16) core/src/main/java/org/opensearch/sql/ast/EmptySourcePropagateVisitor.java:84 — EmptySourcePropagateVisitor.visitJoin has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 3 (6 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 · CalciteRelNodeVisitor.visitAggregation (cognitive 16) · ×1
  • CalciteRelNodeVisitor.visitAggregation (cognitive 16) core/src/main/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java:1833 — CalciteRelNodeVisitor.visitAggregation has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 2, ternaries 2, 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 · PPLSimplifyDedupRule.apply (cognitive 16) · ×1
  • PPLSimplifyDedupRule.apply (cognitive 16) core/src/main/java/org/opensearch/sql/calcite/plan/rule/PPLSimplifyDedupRule.java:79 — PPLSimplifyDedupRule.apply has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (13 pts), loops 2, boolean chains 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · AnalyticsExecutionEngine.toExprValue (cognitive 16) · ×1
  • AnalyticsExecutionEngine.toExprValue (cognitive 16) core/src/main/java/org/opensearch/sql/executor/analytics/AnalyticsExecutionEngine.java:238 — AnalyticsExecutionEngine.toExprValue has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), error handling 1 (3 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PPLFuncImpTable.resolveWithCoercion (cognitive 16) · ×1
  • PPLFuncImpTable.resolveWithCoercion (cognitive 16) core/src/main/java/org/opensearch/sql/expression/function/PPLFuncImpTable.java:833 — PPLFuncImpTable.resolveWithCoercion has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AddSubDateImplementor.implement (cognitive 16) · ×1
  • AddSubDateImplementor.implement (cognitive 16) core/src/main/java/org/opensearch/sql/expression/function/udf/datetime/AddSubDateFunction.java:88 — AddSubDateImplementor.implement has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 5 (6 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NestedOperator.flatten (cognitive 16) · ×1
  • NestedOperator.flatten (cognitive 16) core/src/main/java/org/opensearch/sql/planner/physical/NestedOperator.java:157 — NestedOperator.flatten has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (7 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 · Select.fillSubQueriesFromWhereRecursive (cognitive 16) · ×1
  • Select.fillSubQueriesFromWhereRecursive (cognitive 16) legacy/src/main/java/org/opensearch/sql/legacy/domain/Select.java:149 — Select.fillSubQueriesFromWhereRecursive has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (5 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SqlParser.findGroupBy (cognitive 16) · ×1
  • SqlParser.findGroupBy (cognitive 16) legacy/src/main/java/org/opensearch/sql/legacy/parser/SqlParser.java:132 — SqlParser.findGroupBy has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, 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 · TermFieldRewriter.collect (cognitive 16) · ×1
  • TermFieldRewriter.collect (cognitive 16) legacy/src/main/java/org/opensearch/sql/legacy/rewriter/matchtoterm/TermFieldRewriter.java:158 — TermFieldRewriter.collect has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (16 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 · ExtendedRelJson.toJson (cognitive 16) · ×1
  • ExtendedRelJson.toJson (cognitive 16) opensearch/src/main/java/org/opensearch/sql/opensearch/storage/serde/ExtendedRelJson.java:280 — ExtendedRelJson.toJson 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 · OpenSearchRelOptUtil.isOrderPreservingCast (cognitive 16) · ×1
  • OpenSearchRelOptUtil.isOrderPreservingCast (cognitive 16) opensearch/src/main/java/org/opensearch/sql/opensearch/util/OpenSearchRelOptUtil.java:143 — OpenSearchRelOptUtil.isOrderPreservingCast has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 10, if/else 6. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · PPLQueryRequestFactory.parsePPLRequestFromPayload (cognitive 16) · ×1
  • PPLQueryRequestFactory.parsePPLRequestFromPayload (cognitive 16) plugin/src/main/java/org/opensearch/sql/plugin/request/PPLQueryRequestFactory.java:71 — PPLQueryRequestFactory.parsePPLRequestFromPayload has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 4, 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 · AstBuilder.visitMakeresultsCommand (cognitive 16) · ×1
  • AstBuilder.visitMakeresultsCommand (cognitive 16) ppl/src/main/java/org/opensearch/sql/ppl/parser/AstBuilder.java:347 — AstBuilder.visitMakeresultsCommand has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), error handling 1 (3 pts), boolean chains 2, 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.
D2 · Cognitive Complexity · ArgumentFactory.getArgumentList (cognitive 16) · ×1
  • ArgumentFactory.getArgumentList (cognitive 16) ppl/src/main/java/org/opensearch/sql/ppl/utils/ArgumentFactory.java:209 — ArgumentFactory.getArgumentList has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member family (3 members, 16 shared lines) · ×1
  • Near-duplicate member family (3 members, 16 shared lines) core/src/main/java/org/opensearch/sql/expression/function/FunctionDSL.java:108 — core/src/main/java/org/opensearch/sql/expression/function/FunctionDSL.java:108-137 | core/src/main/java/org/opensearch/sql/expression/function/FunctionDSL.java:154-184 | core/src/main/java/org/opensearch/sql/expression/function/FunctionDSL.java:204-235 — These 3 members are variants of one another: a block of 16 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
D4 · Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (6 members, 50+ identical tokens) legacy/src/main/java/org/opensearch/sql/legacy/executor/join/ElasticJoinExecutor.java:232 — legacy/src/main/java/org/opensearch/sql/legacy/executor/join/ElasticJoinExecutor.java:232-254 | legacy/src/main/java/org/opensearch/sql/legacy/executor/join/HashJoinElasticExecutor.java:115-217 | legacy/src/main/java/org/opensearch/sql/legacy/executor/join/HashJoinElasticExecutor.java:227-266 | legacy/src/main/java/org/opensearch/sql/legacy/executor/join/NestedLoopsElasticExecutor.java:204-231 | legacy/src/main/java/org/opensearch/sql/legacy/executor/multi/MinusExecutor.java:167-205 | legacy/src/main/java/org/opensearch/sql/legacy/executor/multi/UnionExecutor.java:55-77 — 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) · ×1
  • Members sharing a duplicated core (4 members, 50+ identical tokens) direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:167 — direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:167-180 | direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:184-198 | direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:202-216 | direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:224-238 — 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 (57 corresponding lines) · ×1
  • Edited copy of a member (57 corresponding lines) opensearch/src/main/java/org/opensearch/sql/opensearch/storage/scan/context/AggPushDownAction.java:134 — opensearch/src/main/java/org/opensearch/sql/opensearch/storage/scan/context/AggPushDownAction.java:134-190 | opensearch/src/main/java/org/opensearch/sql/opensearch/storage/scan/context/AggPushDownAction.java:193-255 — 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 copies of one member (3 members, 58+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 58+ corresponding lines) core/src/main/java/org/opensearch/sql/expression/operator/arthmetic/ArithmeticFunctions.java:121 — core/src/main/java/org/opensearch/sql/expression/operator/arthmetic/ArithmeticFunctions.java:121-178 | core/src/main/java/org/opensearch/sql/expression/operator/arthmetic/ArithmeticFunctions.java:195-252 | REDACTED:348-406 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 58 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 (56 corresponding lines) · ×1
  • Edited copy of a member (56 corresponding lines) datasources/src/main/java/org/opensearch/sql/datasources/utils/XContentParserUtils.java:46 — datasources/src/main/java/org/opensearch/sql/datasources/utils/XContentParserUtils.java:46-101 | datasources/src/main/java/org/opensearch/sql/datasources/utils/XContentParserUtils.java:103-159 — These two members are one piece of code written twice and then edited apart: 56 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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) · ×1
  • Edited copy of a member (31 corresponding lines) core/src/main/java/org/opensearch/sql/expression/aggregation/AggregatorFunctions.java:119 — core/src/main/java/org/opensearch/sql/expression/aggregation/AggregatorFunctions.java:119-149 | core/src/main/java/org/opensearch/sql/expression/aggregation/AggregatorFunctions.java:151-181 — 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 copy of a member (43 corresponding lines) · ×1
  • Edited copy of a member (43 corresponding lines) legacy/src/main/java/org/opensearch/sql/legacy/executor/AsyncRestExecutor.java:102 — legacy/src/main/java/org/opensearch/sql/legacy/executor/AsyncRestExecutor.java:102-144 | legacy/src/main/java/org/opensearch/sql/legacy/executor/cursor/CursorAsyncRestExecutor.java:43-88 — 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 copy of a member (46 corresponding lines) · ×1
  • Edited copy of a member (46 corresponding lines) async-query/src/main/java/org/opensearch/sql/spark/execution/xcontent/SessionModelXContentSerializer.java:55 — async-query/src/main/java/org/opensearch/sql/spark/execution/xcontent/SessionModelXContentSerializer.java:55-100 | async-query/src/main/java/org/opensearch/sql/spark/execution/xcontent/StatementModelXContentSerializer.java:63-119 — 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 (41 corresponding lines) · ×1
  • Edited copy of a member (41 corresponding lines) async-query-core/src/main/java/org/opensearch/sql/spark/dispatcher/BatchQueryHandler.java:89 — async-query-core/src/main/java/org/opensearch/sql/spark/dispatcher/BatchQueryHandler.java:89-129 | async-query-core/src/main/java/org/opensearch/sql/spark/dispatcher/StreamingQueryHandler.java:61-108 — 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 (3 members, 38+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 38+ corresponding lines) core/src/main/java/org/opensearch/sql/expression/operator/arthmetic/ArithmeticFunctions.java:67 — core/src/main/java/org/opensearch/sql/expression/operator/arthmetic/ArithmeticFunctions.java:67-104 | core/src/main/java/org/opensearch/sql/expression/operator/arthmetic/ArithmeticFunctions.java:273-310 | core/src/main/java/org/opensearch/sql/expression/operator/arthmetic/ArithmeticFunctions.java:327-364 — These 3 members are one piece of code written 3 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 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (39 corresponding lines) · ×1
  • Edited copy of a member (39 corresponding lines) ppl/src/main/java/org/opensearch/sql/ppl/PPLService.java:129 — ppl/src/main/java/org/opensearch/sql/ppl/PPLService.java:129-171 | ppl/src/main/java/org/opensearch/sql/ppl/PPLService.java:177-215 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (40 corresponding lines) · ×1
  • Edited copy of a member (40 corresponding lines) core/src/main/java/org/opensearch/sql/calcite/utils/binning/handlers/CountBinHandler.java:26 — core/src/main/java/org/opensearch/sql/calcite/utils/binning/handlers/CountBinHandler.java:26-65 | core/src/main/java/org/opensearch/sql/calcite/utils/binning/handlers/MinSpanBinHandler.java:28-72 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (30 corresponding lines) · ×1
  • Edited copy of a member (30 corresponding lines) legacy/src/main/java/org/opensearch/sql/legacy/plugin/RestSQLQueryAction.java:168 — legacy/src/main/java/org/opensearch/sql/legacy/plugin/RestSQLQueryAction.java:168-197 | plugin/src/main/java/org/opensearch/sql/plugin/transport/TransportPPLQueryAction.java:461-493 — 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 (25 corresponding lines) · ×1
  • Edited copy of a member (25 corresponding lines) prometheus/src/main/java/org/opensearch/sql/prometheus/functions/implementation/QueryExemplarFunctionImplementation.java:85 — prometheus/src/main/java/org/opensearch/sql/prometheus/functions/implementation/QueryExemplarFunctionImplementation.java:85-109 | prometheus/src/main/java/org/opensearch/sql/prometheus/functions/implementation/QueryRangeFunctionImplementation.java:86-113 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (35 corresponding lines) · ×1
  • Edited copy of a member (35 corresponding lines) core/src/main/java/org/opensearch/sql/expression/function/UDFOperandMetadata.java:29 — core/src/main/java/org/opensearch/sql/expression/function/UDFOperandMetadata.java:29-63 | core/src/main/java/org/opensearch/sql/expression/function/UDFOperandMetadata.java:65-106 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 19+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 19+ corresponding lines) core/src/main/java/org/opensearch/sql/expression/function/PPLTypeChecker.java:391 — core/src/main/java/org/opensearch/sql/expression/function/PPLTypeChecker.java:391-409 | core/src/main/java/org/opensearch/sql/expression/function/PPLTypeChecker.java:448-470 | core/src/main/java/org/opensearch/sql/expression/function/PPLTypeChecker.java:473-494 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (27 corresponding lines) · ×1
  • Edited copy of a member (27 corresponding lines) core/src/main/java/org/opensearch/sql/expression/function/OpenSearchFunctions.java:97 — core/src/main/java/org/opensearch/sql/expression/function/OpenSearchFunctions.java:97-123 | core/src/main/java/org/opensearch/sql/expression/system/SystemFunctions.java:36-67 — 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 (21 corresponding lines) · ×1
  • Edited copy of a member (21 corresponding lines) core/src/main/java/org/opensearch/sql/calcite/utils/UserDefinedFunctionUtils.java:239 — core/src/main/java/org/opensearch/sql/calcite/utils/UserDefinedFunctionUtils.java:239-259 | core/src/main/java/org/opensearch/sql/calcite/utils/UserDefinedFunctionUtils.java:270-291 — 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 copies of one member (3 members, 12+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 12+ corresponding lines) direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:103 — direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:103-122 | direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:241-257 | direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:260-271 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 15+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 15+ corresponding lines) direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:441 — direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:441-457 | direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:460-479 | direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:482-496 | direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:499-514 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (8 members, 27+ corresponding lines) · ×1
  • Edited copies of one member (8 members, 27+ corresponding lines) async-query/src/main/java/org/opensearch/sql/spark/rest/RestAsyncQueryManagementAction.java:165 — async-query/src/main/java/org/opensearch/sql/spark/rest/RestAsyncQueryManagementAction.java:165-191 | datasources/src/main/java/org/opensearch/sql/datasources/rest/RestDataSourceQueryAction.java:149-176 | datasources/src/main/java/org/opensearch/sql/datasources/rest/RestDataSourceQueryAction.java:178-204 | datasources/src/main/java/org/opensearch/sql/datasources/rest/RestDataSourceQueryAction.java:207-234 | datasources/src/main/java/org/opensearch/sql/datasources/rest/RestDataSourceQueryAction.java:237-263 | datasources/src/main/java/org/opensearch/sql/datasources/rest/RestDataSourceQueryAction.java:265-291 | direct-query/src/main/java/org/opensearch/sql/directquery/rest/RestDirectQueryResourcesManagementAction.java:148-174 | direct-query/src/main/java/org/opensearch/sql/directquery/rest/RestDirectQueryResourcesManagementAction.java:177-203 — These 8 members are one piece of code written 8 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 8 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 19+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 19+ corresponding lines) opensearch/src/main/java/org/opensearch/sql/opensearch/client/OpenSearchNodeClient.java:334 — opensearch/src/main/java/org/opensearch/sql/opensearch/client/OpenSearchNodeClient.java:334-352 | opensearch/src/main/java/org/opensearch/sql/opensearch/client/OpenSearchNodeClient.java:355-373 | opensearch/src/main/java/org/opensearch/sql/opensearch/client/OpenSearchRestClient.java:198-218 | opensearch/src/main/java/org/opensearch/sql/opensearch/client/OpenSearchRestClient.java:221-241 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 13+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 13+ corresponding lines) core/src/main/java/org/opensearch/sql/expression/datetime/DateTimeFunctions.java:548 — core/src/main/java/org/opensearch/sql/expression/datetime/DateTimeFunctions.java:548-560 | core/src/main/java/org/opensearch/sql/expression/datetime/DateTimeFunctions.java:566-578 | core/src/main/java/org/opensearch/sql/expression/datetime/DateTimeFunctions.java:581-593 | core/src/main/java/org/opensearch/sql/expression/datetime/DateTimeFunctions.java:698-710 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 13+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 13+ corresponding lines) core/src/main/java/org/opensearch/sql/expression/operator/predicate/BinaryPredicateOperators.java:304 — core/src/main/java/org/opensearch/sql/expression/operator/predicate/BinaryPredicateOperators.java:304-316 | core/src/main/java/org/opensearch/sql/expression/operator/predicate/BinaryPredicateOperators.java:318-330 | core/src/main/java/org/opensearch/sql/expression/operator/predicate/BinaryPredicateOperators.java:332-344 | core/src/main/java/org/opensearch/sql/expression/operator/predicate/BinaryPredicateOperators.java:346-358 | core/src/main/java/org/opensearch/sql/expression/operator/predicate/BinaryPredicateOperators.java:360-372 | core/src/main/java/org/opensearch/sql/expression/operator/predicate/BinaryPredicateOperators.java:374-386 — 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 (6 members, 9+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 9+ corresponding lines) legacy/src/main/java/org/opensearch/sql/legacy/utils/SQLFunctions.java:465 — legacy/src/main/java/org/opensearch/sql/legacy/utils/SQLFunctions.java:465-477 | legacy/src/main/java/org/opensearch/sql/legacy/utils/SQLFunctions.java:479-491 | legacy/src/main/java/org/opensearch/sql/legacy/utils/SQLFunctions.java:555-567 | legacy/src/main/java/org/opensearch/sql/legacy/utils/SQLFunctions.java:809-822 | legacy/src/main/java/org/opensearch/sql/legacy/utils/SQLFunctions.java:833-841 | legacy/src/main/java/org/opensearch/sql/legacy/utils/SQLFunctions.java:849-861 — 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 (3 members, 13+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 13+ corresponding lines) opensearch/src/main/java/org/opensearch/sql/opensearch/planner/rules/FilterIndexScanRule.java:29 — opensearch/src/main/java/org/opensearch/sql/opensearch/planner/rules/FilterIndexScanRule.java:29-41 | opensearch/src/main/java/org/opensearch/sql/opensearch/planner/rules/ProjectIndexScanRule.java:38-50 | opensearch/src/main/java/org/opensearch/sql/opensearch/planner/rules/RelevanceFunctionPushdownRule.java:40-54 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 10+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 10+ corresponding lines) core/src/main/java/org/opensearch/sql/expression/aggregation/AggregatorFunctions.java:183 — core/src/main/java/org/opensearch/sql/expression/aggregation/AggregatorFunctions.java:183-192 | core/src/main/java/org/opensearch/sql/expression/aggregation/AggregatorFunctions.java:194-203 | core/src/main/java/org/opensearch/sql/expression/aggregation/AggregatorFunctions.java:205-214 | core/src/main/java/org/opensearch/sql/expression/aggregation/AggregatorFunctions.java:216-225 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 17+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 17+ corresponding lines) core/src/main/java/org/opensearch/sql/expression/function/udf/RexExtractFunction.java:95 — core/src/main/java/org/opensearch/sql/expression/function/udf/RexExtractFunction.java:95-111 | core/src/main/java/org/opensearch/sql/expression/function/udf/RexExtractMultiFunction.java:118-135 | core/src/main/java/org/opensearch/sql/expression/parse/RegexCommonUtils.java:178-194 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 7+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 7+ corresponding lines) opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/aggregation/CalciteAggregationScript.java:48 — opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/aggregation/CalciteAggregationScript.java:48-54 | opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/sort/CalciteNumberSortScript.java:36-43 | opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/sort/CalciteStringSortScript.java:41-48 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 6+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 6+ corresponding lines) core/src/main/java/org/opensearch/sql/planner/optimizer/rule/MergeFilterAndFilter.java:31 — core/src/main/java/org/opensearch/sql/planner/optimizer/rule/MergeFilterAndFilter.java:31-36 | core/src/main/java/org/opensearch/sql/planner/optimizer/rule/PushFilterUnderSort.java:34-39 | prometheus/src/main/java/org/opensearch/sql/prometheus/planner/logical/rules/MergeFilterAndRelation.java:27-32 — 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 (3 members, 4+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 4+ corresponding lines) core/src/main/java/org/opensearch/sql/expression/window/frame/CurrentRowWindowFrame.java:66 — core/src/main/java/org/opensearch/sql/expression/window/frame/CurrentRowWindowFrame.java:66-69 | core/src/main/java/org/opensearch/sql/expression/window/frame/PeerRowsWindowFrame.java:141-144 | core/src/main/java/org/opensearch/sql/expression/window/ranking/RankingWindowFunction.java:89-92 — 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 (17–27 lines × 2) · ×1
  • Duplicated block (17–27 lines × 2) core/src/main/java/org/opensearch/sql/expression/function/udf/RelevanceQueryFunction.java:45 — core/src/main/java/org/opensearch/sql/expression/function/udf/RelevanceQueryFunction.java:45-61 | core/src/main/java/org/opensearch/sql/expression/function/udf/RelevanceQueryFunction.java:63-89 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/opensearch/sql/expression/function/udf/RelevanceQueryFunction.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 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 (24 lines × 2) · ×1
  • Duplicated block (24 lines × 2) legacy/src/main/java/org/opensearch/sql/legacy/domain/Condition.java:217 — legacy/src/main/java/org/opensearch/sql/legacy/domain/Condition.java:217-240 | legacy/src/main/java/org/opensearch/sql/legacy/domain/Condition.java:266-289 — both copies are in the same file, so extract the 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 (21 lines × 2) · ×1
  • Duplicated block (21 lines × 2) core/src/main/java/org/opensearch/sql/expression/operator/arthmetic/ArithmeticFunctions.java:198 — core/src/main/java/org/opensearch/sql/expression/operator/arthmetic/ArithmeticFunctions.java:198-218 | REDACTED:351-371 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/main/java/org/opensearch/sql/expression/operator/arthmetic/ArithmeticFunctions.java:198` it does not close everything it opens, so those 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) core/src/main/java/org/opensearch/sql/calcite/utils/binning/time/AlignmentHandler.java:34 — core/src/main/java/org/opensearch/sql/calcite/utils/binning/time/AlignmentHandler.java:34-53 | core/src/main/java/org/opensearch/sql/calcite/utils/binning/time/AlignmentHandler.java:109-127 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/main/java/org/opensearch/sql/calcite/utils/binning/time/AlignmentHandler.java:34` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. 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 (20 lines × 2) · ×1
  • Duplicated block (20 lines × 2) core/src/main/java/org/opensearch/sql/expression/function/UDFOperandMetadata.java:30 — core/src/main/java/org/opensearch/sql/expression/function/UDFOperandMetadata.java:30-49 | core/src/main/java/org/opensearch/sql/expression/function/UDFOperandMetadata.java:73-92 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/opensearch/sql/expression/function/UDFOperandMetadata.java: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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `typeChecker` to `FamilyOperandTypeChecker` in one and `CompositeOperandTypeChecker` 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 (16 lines × 3) · ×1
  • Duplicated block (16 lines × 3) core/src/main/java/org/opensearch/sql/expression/function/FunctionDSL.java:122 — core/src/main/java/org/opensearch/sql/expression/function/FunctionDSL.java:122-137 | core/src/main/java/org/opensearch/sql/expression/function/FunctionDSL.java:169-184 | core/src/main/java/org/opensearch/sql/expression/function/FunctionDSL.java:220-235 — 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 `core/src/main/java/org/opensearch/sql/expression/function/FunctionDSL.java:122` 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 lines × 2) · ×1
  • Duplicated block (18 lines × 2) legacy/src/main/java/org/opensearch/sql/legacy/executor/ElasticResultHandler.java:18 — legacy/src/main/java/org/opensearch/sql/legacy/executor/ElasticResultHandler.java:18-35 | legacy/src/main/java/org/opensearch/sql/legacy/executor/join/ElasticJoinExecutor.java:178-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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting 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 (15–16 lines × 2) · ×1
  • Duplicated block (15–16 lines × 2) legacy/src/main/java/org/opensearch/sql/legacy/plugin/RestSqlStatsAction.java:66 — legacy/src/main/java/org/opensearch/sql/legacy/plugin/RestSqlStatsAction.java:66-81 | plugin/src/main/java/org/opensearch/sql/plugin/rest/RestPPLStatsAction.java:61-75 — 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 `legacy/src/main/java/org/opensearch/sql/legacy/plugin/RestSqlStatsAction.java:66` 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 (14–16 lines × 2) · ×1
  • Duplicated block (14–16 lines × 2) ppl/src/main/java/org/opensearch/sql/ppl/parser/AstExpressionBuilder.java:962 — ppl/src/main/java/org/opensearch/sql/ppl/parser/AstExpressionBuilder.java:962-975 | ppl/src/main/java/org/opensearch/sql/ppl/parser/AstExpressionBuilder.java:998-1013 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `ppl/src/main/java/org/opensearch/sql/ppl/parser/AstExpressionBuilder.java:962` 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 `ctx` to `SingleFieldRelevanceFunctionContext` in one and `MultiFieldRelevanceFunctionContext` 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 (23 lines × 2) · ×1
  • Duplicated block (23 lines × 2) core/src/main/java/org/opensearch/sql/ast/dsl/AstDSL.java:736 — core/src/main/java/org/opensearch/sql/ast/dsl/AstDSL.java:736-758 | ppl/src/main/java/org/opensearch/sql/ppl/parser/AstBuilder.java:818-840 — 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/opensearch/sql/ast/dsl/AstDSL.java: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.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×1
  • Duplicated block (13–14 lines × 2) core/src/main/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java:5300 — core/src/main/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java:5300-5313 | core/src/main/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java:5365-5377 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/opensearch/sql/calcite/CalciteRelNodeVisitor.java:5300` it does not close everything it opens, so those 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/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java:5315` calls `substring` and `core/src/main/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java:5379` 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 (4–14 lines × 3) · ×1
  • Duplicated block (4–14 lines × 3) core/src/main/java/org/opensearch/sql/calcite/utils/binning/handlers/CountBinHandler.java:46 — core/src/main/java/org/opensearch/sql/calcite/utils/binning/handlers/CountBinHandler.java:46-59 | core/src/main/java/org/opensearch/sql/calcite/utils/binning/handlers/DefaultBinHandler.java:48-51 | core/src/main/java/org/opensearch/sql/calcite/utils/binning/handlers/MinSpanBinHandler.java:53-66 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 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/opensearch/sql/calcite/utils/binning/handlers/CountBinHandler.java:46` it does not close everything it opens, so those 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.
D4 · Code Duplication · Duplicated block (10–13 lines × 5) · ×1
  • Duplicated block (10–13 lines × 5) direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:366 — direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:366-378 | direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:396-408 | direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:424-436 | direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:636-645 | direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:703-712 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:366` 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 (13 lines × 3) · ×1
  • Duplicated block (13 lines × 3) legacy/src/main/java/org/opensearch/sql/legacy/executor/ElasticResultHandler.java:20 — legacy/src/main/java/org/opensearch/sql/legacy/executor/ElasticResultHandler.java:20-32 | legacy/src/main/java/org/opensearch/sql/legacy/executor/join/ElasticJoinExecutor.java:180-192 | legacy/src/main/java/org/opensearch/sql/legacy/utils/Util.java:200-212 — 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 `legacy/src/main/java/org/opensearch/sql/legacy/executor/ElasticResultHandler.java:20` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (10–13 lines × 2) · ×1
  • Duplicated block (10–13 lines × 2) api/src/main/java/org/opensearch/sql/api/compiler/UnifiedQueryCompiler.java:65 — api/src/main/java/org/opensearch/sql/api/compiler/UnifiedQueryCompiler.java:65-74 | core/src/main/java/org/opensearch/sql/calcite/utils/CalciteToolsHelper.java:530-542 — 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 (9–12 lines × 6) · ×1
  • Duplicated block (9–12 lines × 6) legacy/src/main/java/org/opensearch/sql/legacy/executor/join/ElasticJoinExecutor.java:235 — legacy/src/main/java/org/opensearch/sql/legacy/executor/join/ElasticJoinExecutor.java:235-243 | legacy/src/main/java/org/opensearch/sql/legacy/executor/join/HashJoinElasticExecutor.java:175-185 | legacy/src/main/java/org/opensearch/sql/legacy/executor/join/HashJoinElasticExecutor.java:246-254 | legacy/src/main/java/org/opensearch/sql/legacy/executor/join/NestedLoopsElasticExecutor.java:209-220 | legacy/src/main/java/org/opensearch/sql/legacy/executor/multi/MinusExecutor.java:174-184 | legacy/src/main/java/org/opensearch/sql/legacy/executor/multi/UnionExecutor.java:57-65 — there are 6 copies across 5 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `legacy/src/main/java/org/opensearch/sql/legacy/executor/join/NestedLoopsElasticExecutor.java:209` it does not close everything it opens, so those 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 (9–12 lines × 2) · ×1
  • Duplicated block (9–12 lines × 2) legacy/src/main/java/org/opensearch/sql/legacy/executor/join/ElasticUtils.java:90 — legacy/src/main/java/org/opensearch/sql/legacy/executor/join/ElasticUtils.java:90-101 | legacy/src/main/java/org/opensearch/sql/legacy/executor/join/ElasticUtils.java:114-122 — both copies are in the same file, so extract the 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 (9–10 lines × 2) · ×1
  • Duplicated block (9–10 lines × 2) legacy/src/main/java/org/opensearch/sql/legacy/parser/WhereParser.java:304 — legacy/src/main/java/org/opensearch/sql/legacy/parser/WhereParser.java:304-313 | legacy/src/main/java/org/opensearch/sql/legacy/parser/WhereParser.java:315-323 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `legacy/src/main/java/org/opensearch/sql/legacy/parser/WhereParser.java:304` it does not close everything it opens, so those 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 (6–9 lines × 2) · ×1
  • Duplicated block (6–9 lines × 2) core/src/main/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java:377 — core/src/main/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java:377-382 | core/src/main/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java:3144-3152 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/opensearch/sql/calcite/CalciteRelNodeVisitor.java:377` 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 `node` to `AppendPipe` in one and `Append` 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 (3–9 lines × 3) · ×1
  • Duplicated block (3–9 lines × 3) core/src/main/java/org/opensearch/sql/expression/function/jsonUDF/JsonAppendFunctionImpl.java:57 — core/src/main/java/org/opensearch/sql/expression/function/jsonUDF/JsonAppendFunctionImpl.java:57-65 | core/src/main/java/org/opensearch/sql/expression/function/jsonUDF/JsonExtendFunctionImpl.java:57-65 | core/src/main/java/org/opensearch/sql/expression/function/jsonUDF/JsonSetFunctionImpl.java:58-60 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 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/opensearch/sql/expression/function/jsonUDF/JsonAppendFunctionImpl.java:57` it does not close everything it opens, so those 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 × 4) · ×1
  • Duplicated block (8 lines × 4) direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:295 — direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:295-302 | direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:310-317 | direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:324-331 | direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:338-345 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:295` 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 (7–8 lines × 3) · ×1
  • Duplicated block (7–8 lines × 3) core/src/main/java/org/opensearch/sql/calcite/plan/rel/GraphLookup.java:136 — core/src/main/java/org/opensearch/sql/calcite/plan/rel/GraphLookup.java:136-142 | core/src/main/java/org/opensearch/sql/calcite/plan/rel/GraphLookup.java:155-162 | core/src/main/java/org/opensearch/sql/calcite/plan/rel/GraphLookup.java:174-181 — 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 `core/src/main/java/org/opensearch/sql/calcite/plan/rel/GraphLookup.java:136` 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 (6–7 lines × 2) · ×1
  • Duplicated block (6–7 lines × 2) core/src/main/java/org/opensearch/sql/expression/function/udf/datetime/AddSubDateFunction.java:90 — core/src/main/java/org/opensearch/sql/expression/function/udf/datetime/AddSubDateFunction.java:90-96 | core/src/main/java/org/opensearch/sql/expression/function/udf/datetime/DateAddSubFunction.java:61-66 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/main/java/org/opensearch/sql/expression/function/udf/datetime/AddSubDateFunction.java:90` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5 lines × 5) · ×1
  • Duplicated block (5 lines × 5) direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:295 — direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:295-299 | direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:310-314 | direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:324-328 | direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:338-342 | direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:416-420 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:295` it does not close everything it opens, so those 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) · ×1
  • Duplicated block (5 lines × 3) direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:174 — direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:174-178 | direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:192-196 | direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:231-235 — 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.
D4 · Code Duplication · Duplicated block (52 lines × 2) · ×1
  • Duplicated block (52 lines × 2) common/src/main/java/org/opensearch/sql/common/antlr/CaseInsensitiveCharStream.java:21 — common/src/main/java/org/opensearch/sql/common/antlr/CaseInsensitiveCharStream.java:21-72 | legacy/src/main/java/org/opensearch/sql/legacy/antlr/syntax/CaseInsensitiveCharStream.java:21-72 — before extracting anything, compare `common/src/main/java/org/opensearch/sql/common/antlr/CaseInsensitiveCharStream.java` and `legacy/src/main/java/org/opensearch/sql/legacy/antlr/syntax/CaseInsensitiveCharStream.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.
D4 · Code Duplication · Duplicated block (40 lines × 2) · ×1
  • Duplicated block (40 lines × 2) core/src/main/java/org/opensearch/sql/ast/expression/SearchAnd.java:1 — core/src/main/java/org/opensearch/sql/ast/expression/SearchAnd.java:1-40 | core/src/main/java/org/opensearch/sql/ast/expression/SearchOr.java:1-40 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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/opensearch/sql/ast/expression/SearchAnd.java:1` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (105 lines × 2) · ×1
  • Duplicated block (105 lines × 2) core/src/main/java/org/opensearch/sql/planner/logical/LogicalPlanNodeVisitor.java:1 — core/src/main/java/org/opensearch/sql/planner/logical/LogicalPlanNodeVisitor.java:1-121 | core/src/main/java/org/opensearch/sql/planner/physical/PhysicalPlanNodeVisitor.java:1-105 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/main/java/org/opensearch/sql/planner/logical/LogicalPlanNodeVisitor.java:1` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, 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 (22 lines × 3) · ×1
  • Duplicated block (22 lines × 3) legacy/src/main/java/org/opensearch/sql/legacy/antlr/semantic/types/function/AggregateFunction.java:29 — legacy/src/main/java/org/opensearch/sql/legacy/antlr/semantic/types/function/AggregateFunction.java:29-50 | legacy/src/main/java/org/opensearch/sql/legacy/antlr/semantic/types/function/OpenSearchScalarFunction.java:65-86 | legacy/src/main/java/org/opensearch/sql/legacy/antlr/semantic/types/function/ScalarFunction.java:92-113 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (5 lines × 4) · ×1
  • Duplicated block (5 lines × 4) core/src/main/java/org/opensearch/sql/expression/function/udf/binning/MinspanBucketFunction.java:133 — core/src/main/java/org/opensearch/sql/expression/function/udf/binning/MinspanBucketFunction.java:133-137 | core/src/main/java/org/opensearch/sql/expression/function/udf/binning/RangeBucketFunction.java:164-168 | core/src/main/java/org/opensearch/sql/expression/function/udf/binning/SpanBucketFunction.java:106-110 | core/src/main/java/org/opensearch/sql/expression/function/udf/binning/WidthBucketFunction.java:175-179 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 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.
D4 · Code Duplication · Duplicated block (11 lines × 4) · ×1
  • Duplicated block (11 lines × 4) core/src/main/java/org/opensearch/sql/expression/function/udf/binning/MinspanBucketFunction.java:140 — core/src/main/java/org/opensearch/sql/expression/function/udf/binning/MinspanBucketFunction.java:140-150 | core/src/main/java/org/opensearch/sql/expression/function/udf/binning/RangeBucketFunction.java:171-181 | core/src/main/java/org/opensearch/sql/expression/function/udf/binning/SpanBucketFunction.java:113-123 | core/src/main/java/org/opensearch/sql/expression/function/udf/binning/WidthBucketFunction.java:182-192 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×1
  • Duplicated block (9 lines × 3) plugin/src/main/java/org/opensearch/sql/plugin/transport/TransportPPLQueryRequest.java:183 — plugin/src/main/java/org/opensearch/sql/plugin/transport/TransportPPLQueryRequest.java:183-191 | ppl/src/main/java/org/opensearch/sql/ppl/domain/PPLQueryRequest.java:169-177 | sql/src/main/java/org/opensearch/sql/sql/domain/SQLQueryRequest.java:135-143 — 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 (7 lines × 12) · ×1
  • Duplicated block (7 lines × 12) core/src/main/java/org/opensearch/sql/expression/function/CollectionUDF/ExistsFunctionImpl.java:45 — core/src/main/java/org/opensearch/sql/expression/function/CollectionUDF/ExistsFunctionImpl.java:45-51 | core/src/main/java/org/opensearch/sql/expression/function/CollectionUDF/FilterFunctionImpl.java:45-51 | core/src/main/java/org/opensearch/sql/expression/function/CollectionUDF/ForallFunctionImpl.java:44-50 | core/src/main/java/org/opensearch/sql/expression/function/jsonUDF/JsonAppendFunctionImpl.java:47-53 | core/src/main/java/org/opensearch/sql/expression/function/jsonUDF/JsonArrayLengthFunctionImpl.java:44-50 | core/src/main/java/org/opensearch/sql/expression/function/jsonUDF/JsonDeleteFunctionImpl.java:45-51 | core/src/main/java/org/opensearch/sql/expression/function/jsonUDF/JsonExtendFunctionImpl.java:47-53 | core/src/main/java/org/opensearch/sql/expression/function/jsonUDF/JsonExtractAllFunctionImpl.java:68-74 | core/src/main/java/org/opensearch/sql/expression/function/jsonUDF/JsonExtractFunctionImpl.java:50-56 | core/src/main/java/org/opensearch/sql/expression/function/jsonUDF/JsonFunctionImpl.java:45-51 | core/src/main/java/org/opensearch/sql/expression/function/jsonUDF/JsonKeysFunctionImpl.java:42-48 | core/src/main/java/org/opensearch/sql/expression/function/jsonUDF/JsonSetFunctionImpl.java:46-52 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 12 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 12 times. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/main/java/org/opensearch/sql/expression/function/CollectionUDF/ExistsFunctionImpl.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.
D4 · Code Duplication · Duplicated block (6 lines × 4) · ×1
  • Duplicated block (6 lines × 4) core/src/main/java/org/opensearch/sql/expression/function/udf/datetime/TimestampFunction.java:66 — core/src/main/java/org/opensearch/sql/expression/function/udf/datetime/TimestampFunction.java:66-71 | core/src/main/java/org/opensearch/sql/expression/function/udf/datetime/ToSecondsFunction.java:60-65 | core/src/main/java/org/opensearch/sql/expression/function/udf/datetime/UnixTimestampFunction.java:58-63 | core/src/main/java/org/opensearch/sql/expression/function/udf/datetime/YearweekFunction.java:60-65 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 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/opensearch/sql/expression/function/udf/datetime/TimestampFunction.java:66` 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.
D4 · Code Duplication · Duplicated block (6–8 lines × 2) · ×1
  • Duplicated block (6–8 lines × 2) scripts/docs_exporter/convert_rst_to_md.py:33 — scripts/docs_exporter/convert_rst_to_md.py:33-40 | scripts/docs_exporter/convert_rst_to_md.py:320-325 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D5 · Coupling · Off the main sequence · ×1
  • Off the main sequence: :core — :core: abstractness 0.13, instability 0.09, distance 0.78 — zone of pain — concrete and depended on by 10 project(s), so it's rigid to change.
X19 · Unrestored process-global state · Process-global state is restored only on the happy path · ×1
  • Process-global state is restored only on the happy path legacy/src/main/java/org/opensearch/sql/legacy/executor/format/DateFieldFormatter.java:142 — `parseDateString` changes state that belongs to the whole JVM and changes it back at the end of the same body — the JVM's default `TimeZone` (changed at line 149, put back at line 198) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, not a `finally`, so it is skipped by any exception thrown in between: the JVM then keeps the overwritten value for the rest of its life, and every later property lookup, formatter, date conversion or console write in ANY class reads it. That failure is silent and remote from its cause — the method that breaks is not the method that moved the value. The window is not private while it is open either: system properties, the default `Locale` and `TimeZone` and the standard streams are per-JVM, not per-thread, so a concurrent thread reads the moved value too. The durable fix is not to widen the restore but to stop mutating the global: pass the value to the operation that needs it — an explicit `Locale` to `String.format`/`NumberFormat`/`DateTimeFormatter`, a `ZoneId` to `java.time`, the setting to the component that reads the property, a `PrintStream` to the code that writes, `ProcessBuilder.environment()`/`directory()` for a child. Where the global genuinely must move, wrap it `try`/`finally` so the restore runs on every path.
X3 · Exception handling · Swallowed exception (empty catch) · ×1
  • Swallowed exception (empty catch) core/src/main/java/org/opensearch/sql/expression/function/udf/ToNumberFunction.java:97 — 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.
Minor — 396 finding(s)
D34 · Knowledge Freshness · Orphaned file · ×240
  • Orphaned file core/src/main/java/org/opensearch/sql/expression/datetime/DateTimeFormatterUtil.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file opensearch/src/main/java/org/opensearch/sql/opensearch/data/type/OpenSearchDateType.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file legacy/src/main/java/org/opensearch/sql/legacy/executor/join/HashJoinElasticExecutor.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file legacy/src/main/java/org/opensearch/sql/legacy/executor/join/NestedLoopsElasticExecutor.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file core/src/main/java/org/opensearch/sql/expression/text/TextFunctions.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file async-query-core/src/main/java/org/opensearch/sql/spark/validator/FunctionType.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file datasources/src/main/java/org/opensearch/sql/datasources/storage/OpenSearchDataSourceMetadataStorage.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file async-query/src/main/java/org/opensearch/sql/spark/transport/config/AsyncExecutorServiceModule.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file datasources/src/main/java/org/opensearch/sql/datasources/rest/RestDataSourceQueryAction.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file async-query/src/main/java/org/opensearch/sql/spark/rest/RestAsyncQueryManagementAction.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file opensearch/src/main/java/org/opensearch/sql/opensearch/planner/rules/AggregateIndexScanRule.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file opensearch/src/main/java/org/opensearch/sql/opensearch/planner/physical/MLCommonsOperatorActions.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file core/src/main/java/org/opensearch/sql/planner/physical/TrendlineOperator.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file core/src/main/java/org/opensearch/sql/expression/datetime/StrftimeFormatterUtil.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file legacy/src/main/java/org/opensearch/sql/legacy/executor/join/ElasticJoinExecutor.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file opensearch/src/main/java/org/opensearch/sql/opensearch/planner/rules/SortExprIndexScanRule.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file async-query/src/main/java/org/opensearch/sql/spark/parameter/S3GlueDataSourceSparkParameterComposer.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file opensearch/src/main/java/org/opensearch/sql/opensearch/request/CaseRangeAnalyzer.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file direct-query/src/main/java/org/opensearch/sql/directquery/rest/RestDirectQueryResourcesManagementAction.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file doctest/markdown_parser.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/java/org/opensearch/sql/calcite/plan/rule/PPLDedupConvertRule.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file core/src/main/java/org/opensearch/sql/planner/physical/NestedOperator.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file datasources/src/main/java/org/opensearch/sql/datasources/service/DataSourceServiceImpl.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file opensearch/src/main/java/org/opensearch/sql/opensearch/planner/rules/ExpandCollationOnProjectExprRule.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file async-query-core/src/main/java/org/opensearch/sql/spark/parameter/SparkSubmitParametersBuilder.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • + 215 more in this group — see findings.md.
IC1 · Incompleteness & stubs · Disabled test · ×40
  • Disabled test api/src/test/java/org/opensearch/sql/api/UnifiedFunctionSpecTest.java:26 — 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 api/src/test/java/org/opensearch/sql/api/UnifiedQueryPlannerSqlTest.java:19 — 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 api/src/test/java/org/opensearch/sql/api/UnifiedRelevanceSearchSqlTest.java:17 — 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 api/src/test/java/org/opensearch/sql/api/UnifiedSqlSpecTest.java:15 — 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 async-query/src/test/java/org/opensearch/sql/spark/asyncquery/AsyncQueryExecutorServiceImplSpecTest.java:49 — 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 async-query/src/test/java/org/opensearch/sql/spark/asyncquery/AsyncQueryExecutorServiceImplSpecTest.java:81 — 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 async-query/src/test/java/org/opensearch/sql/spark/asyncquery/AsyncQueryExecutorServiceImplSpecTest.java:106 — 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 async-query/src/test/java/org/opensearch/sql/spark/asyncquery/AsyncQueryExecutorServiceImplSpecTest.java:231 — 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 async-query/src/test/java/org/opensearch/sql/spark/asyncquery/AsyncQueryExecutorServiceImplSpecTest.java:263 — 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 integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteBinCommandIT.java:548 — 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 integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteBinCommandIT.java:561 — 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 integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteBinCommandIT.java:576 — 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 integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteBinCommandIT.java:589 — 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 integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteBinCommandIT.java:602 — 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 integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteBinCommandIT.java:616 — 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 integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteBinCommandIT.java:631 — 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 integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteBinCommandIT.java:646 — 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 integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteBinCommandIT.java:660 — 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 integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteBinCommandIT.java:685 — 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 integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteBinCommandIT.java:697 — 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 integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteBinCommandIT.java:711 — 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 integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteBinCommandIT.java:723 — 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 integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteBinCommandIT.java:735 — 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 integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteBinCommandIT.java:749 — 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 integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteBinCommandIT.java:761 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • + 15 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×29
  • Duplicated predicate ppl/src/main/java/org/opensearch/sql/ppl/parser/AstBuilder.java:1675 — `(plan instanceof Project) && !((Project) plan).isExcluded()` appears character-identically in 3 files — ppl/src/main/java/org/opensearch/sql/ppl/parser/AstBuilder.java, ppl/src/main/java/org/opensearch/sql/ppl/parser/AstStatementBuilder.java, ppl/src/main/java/org/opensearch/sql/ppl/utils/UnresolvedPlanHelper.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 ppl/src/main/java/org/opensearch/sql/ppl/parser/AstExpressionBuilder.java:827 — `Integer.MIN_VALUE <= number && number <= Integer.MAX_VALUE` appears character-identically in 2 files — ppl/src/main/java/org/opensearch/sql/ppl/parser/AstExpressionBuilder.java, sql/src/main/java/org/opensearch/sql/sql/parser/AstExpressionBuilder.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/opensearch/sql/executor/QueryService.java:709 — `cause != null && cause != cause.getCause()` appears character-identically in 2 files — core/src/main/java/org/opensearch/sql/executor/QueryService.java, opensearch/src/main/java/org/opensearch/sql/opensearch/executor/OpenSearchExecutionEngine.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/opensearch/sql/calcite/utils/binning/time/StandardTimeSpanHandler.java:185 — `config == TimeUnitConfig.MICROSECONDS || config == TimeUnitConfig.MILLISECONDS || config == TimeUnitConfig.CENTISECONDS || config == TimeUni…` appears character-identically in 2 files — core/src/main/java/org/opensearch/sql/calcite/utils/binning/time/StandardTimeSpanHandler.java, core/src/main/java/org/opensearch/sql/calcite/utils/binning/time/TimeUnitRegistry.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 direct-query/src/main/java/org/opensearch/sql/directquery/rest/RestDirectQueryManagementAction.java:191 — `e instanceof IllegalArgumentException || e instanceof IllegalStateException || e instanceof DataSourceClientException || e instanceof Illega…` appears character-identically in 2 files — direct-query/src/main/java/org/opensearch/sql/directquery/rest/RestDirectQueryManagementAction.java, direct-query/src/main/java/org/opensearch/sql/directquery/rest/RestDirectQueryResourcesManagementAction.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 legacy/src/main/java/org/opensearch/sql/legacy/parser/FieldMaker.java:62 — `expr instanceof SQLIdentifierExpr || expr instanceof SQLPropertyExpr || expr instanceof SQLVariantRefExpr` appears character-identically in 3 files — legacy/src/main/java/org/opensearch/sql/legacy/parser/FieldMaker.java, legacy/src/main/java/org/opensearch/sql/legacy/utils/SQLFunctions.java, legacy/src/main/java/org/opensearch/sql/legacy/utils/Util.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 legacy/src/main/java/org/opensearch/sql/legacy/query/multi/MultiQueryAction.java:73 — `field.getAlias() != null && !field.getAlias().isEmpty()` appears character-identically in 2 files — legacy/src/main/java/org/opensearch/sql/legacy/query/multi/MultiQueryAction.java, legacy/src/main/java/org/opensearch/sql/legacy/query/multi/MultiQueryRequestBuilder.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/opensearch/sql/expression/function/udf/RexExtractFunction.java:79 — `groupIndex > 0 && groupIndex <= matcher.groupCount()` appears character-identically in 2 files — core/src/main/java/org/opensearch/sql/expression/function/udf/RexExtractFunction.java, core/src/main/java/org/opensearch/sql/expression/function/udf/RexExtractMultiFunction.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 legacy/src/main/java/org/opensearch/sql/legacy/executor/join/HashJoinElasticExecutor.java:123 — `hintLimit != null && hintLimit < MAX_RESULTS_ON_ONE_FETCH` appears character-identically in 2 files — legacy/src/main/java/org/opensearch/sql/legacy/executor/join/HashJoinElasticExecutor.java, legacy/src/main/java/org/opensearch/sql/legacy/executor/join/NestedLoopsElasticExecutor.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 opensearch/src/main/java/org/opensearch/sql/opensearch/planner/physical/ADOperator.java:90 — `inputRowIter == null || !inputRowIter.hasNext()` appears character-identically in 2 files — opensearch/src/main/java/org/opensearch/sql/opensearch/planner/physical/ADOperator.java, opensearch/src/main/java/org/opensearch/sql/opensearch/planner/physical/MLOperator.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/opensearch/sql/expression/function/udf/binning/MinspanBucketFunction.java:115 — `isIntegerSpan(span) && isIntegerValue(binStart) && isIntegerValue(binEnd)` appears character-identically in 4 files — core/src/main/java/org/opensearch/sql/expression/function/udf/binning/MinspanBucketFunction.java, core/src/main/java/org/opensearch/sql/expression/function/udf/binning/RangeBucketFunction.java, core/src/main/java/org/opensearch/sql/expression/function/udf/binning/SpanBucketFunction.java, core/src/main/java/org/opensearch/sql/expression/function/udf/binning/WidthBucketFunction.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/opensearch/sql/calcite/plan/rule/PPLDedupConvertRule.java:99 — `oldIdx < 0 || oldIdx >= originalNames.size()` appears character-identically in 2 files — core/src/main/java/org/opensearch/sql/calcite/plan/rule/PPLDedupConvertRule.java, opensearch/src/main/java/org/opensearch/sql/opensearch/planner/rules/DedupPushdownRule.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 opensearch/src/main/java/org/opensearch/sql/opensearch/functions/GeoIpFunction.java:118 — `options.isEmpty() || options.contains(entry.getKey())` appears character-identically in 2 files — opensearch/src/main/java/org/opensearch/sql/opensearch/functions/GeoIpFunction.java, opensearch/src/main/java/org/opensearch/sql/opensearch/planner/physical/OpenSearchEvalProcessor.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 async-query/src/main/java/org/opensearch/sql/spark/transport/TransportCancelAsyncQueryRequestAction.java:61 — `parsed.isPresent() && !clusterService.localNode().getId().equals(parsed.get().ownerNodeId())` appears character-identically in 2 files — async-query/src/main/java/org/opensearch/sql/spark/transport/TransportCancelAsyncQueryRequestAction.java, async-query/src/main/java/org/opensearch/sql/spark/transport/TransportGetAsyncQueryResultAction.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 plugin/src/main/java/org/opensearch/sql/plugin/request/PPLQueryRequestFactory.java:178 — `path != null && path.endsWith("/_explain")` appears character-identically in 2 files — plugin/src/main/java/org/opensearch/sql/plugin/request/PPLQueryRequestFactory.java, plugin/src/main/java/org/opensearch/sql/plugin/transport/TransportPPLQueryRequest.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 legacy/src/main/java/org/opensearch/sql/legacy/query/OpenSearchActionFactory.java:188 — `query.getFrom() instanceof SQLJoinTableSource && ((SQLJoinTableSource) query.getFrom()).getJoinType() != SQLJoinTableSource.JoinType.COMMA` appears character-identically in 2 files — legacy/src/main/java/org/opensearch/sql/legacy/query/OpenSearchActionFactory.java, legacy/src/main/java/org/opensearch/sql/legacy/rewriter/join/JoinRewriteRule.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/opensearch/sql/calcite/plan/rule/PPLSimplifyDedupRule.java:95 — `rex.getType().getSqlTypeName() == SqlTypeName.MAP || rex.getType().getSqlTypeName() == SqlTypeName.ARRAY` appears character-identically in 2 files — core/src/main/java/org/opensearch/sql/calcite/plan/rule/PPLSimplifyDedupRule.java, opensearch/src/main/java/org/opensearch/sql/opensearch/planner/rules/DedupPushdownRule.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 api/src/main/java/org/opensearch/sql/api/compiler/UnifiedQueryCompiler.java:69 — `scan instanceof LogicalTableScan && Bindables.BindableTableScan.canHandle(table)` appears character-identically in 2 files — api/src/main/java/org/opensearch/sql/api/compiler/UnifiedQueryCompiler.java, core/src/main/java/org/opensearch/sql/calcite/utils/CalciteToolsHelper.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 legacy/src/main/java/org/opensearch/sql/legacy/parser/ChildrenType.java:48 — `secondParameter instanceof SQLTextLiteralExpr || secondParameter instanceof SQLIdentifierExpr || secondParameter instanceof SQLPropertyExpr` appears character-identically in 2 files — legacy/src/main/java/org/opensearch/sql/legacy/parser/ChildrenType.java, legacy/src/main/java/org/opensearch/sql/legacy/parser/NestedType.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/opensearch/sql/calcite/CalciteRelNodeVisitor.java:916 — `sort.getCollation() != null && !sort.getCollation().getFieldCollations().isEmpty()` appears character-identically in 2 files — core/src/main/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java, core/src/main/java/org/opensearch/sql/calcite/utils/PlanUtils.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/opensearch/sql/expression/function/udf/binning/MinspanBucketFunction.java:124 — `span == Math.floor(span) && !Double.isInfinite(span)` appears character-identically in 4 files — core/src/main/java/org/opensearch/sql/expression/function/udf/binning/MinspanBucketFunction.java, core/src/main/java/org/opensearch/sql/expression/function/udf/binning/RangeBucketFunction.java, core/src/main/java/org/opensearch/sql/expression/function/udf/binning/SpanBucketFunction.java, core/src/main/java/org/opensearch/sql/expression/function/udf/binning/WidthBucketFunction.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 protocol/src/main/java/org/opensearch/sql/protocol/response/format/JdbcResponseFormatter.java:80 — `t instanceof SyntaxCheckException || t instanceof QueryEngineException` appears character-identically in 2 files — protocol/src/main/java/org/opensearch/sql/protocol/response/format/JdbcResponseFormatter.java, protocol/src/main/java/org/opensearch/sql/protocol/response/format/VisualizationResponseFormatter.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/opensearch/sql/expression/function/udf/RexExtractFunction.java:96 — `text == null || pattern == null || groupName == null` appears character-identically in 3 files — core/src/main/java/org/opensearch/sql/expression/function/udf/RexExtractFunction.java, core/src/main/java/org/opensearch/sql/expression/function/udf/RexExtractMultiFunction.java, core/src/main/java/org/opensearch/sql/expression/parse/RegexCommonUtils.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/opensearch/sql/data/model/ExprCollectionValue.java:55 — `thisIterator.hasNext() && otherIterator.hasNext()` appears character-identically in 2 files — core/src/main/java/org/opensearch/sql/data/model/ExprCollectionValue.java, core/src/main/java/org/opensearch/sql/data/model/ExprTupleValue.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/opensearch/sql/data/model/ExprCollectionValue.java:62 — `thisIterator.hasNext() || otherIterator.hasNext()` appears character-identically in 2 files — core/src/main/java/org/opensearch/sql/data/model/ExprCollectionValue.java, core/src/main/java/org/opensearch/sql/data/model/ExprTupleValue.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.
  • + 4 more in this group — see findings.md.
X4 · Structured logging · Interpolated log message defeats structured logging · ×26
  • Interpolated log message defeats structured logging opensearch/src/main/java/org/opensearch/sql/opensearch/executor/OpenSearchExecutionEngine.java:218 — `warn` at line 218 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 legacy/src/main/java/org/opensearch/sql/legacy/query/planner/physical/node/pointInTime/PointInTime.java:82 — `info` 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.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 legacy/src/main/java/org/opensearch/sql/legacy/plugin/RestSqlAction.java:197 — `info` at line 197 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 legacy/src/main/java/org/opensearch/sql/legacy/plugin/RestSqlAction.java:277 — `error` at line 277 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 legacy/src/main/java/org/opensearch/sql/legacy/plugin/RestSqlAction.java:280 — `error` at line 280 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 legacy/src/main/java/org/opensearch/sql/legacy/executor/format/DateFieldFormatter.java:192 — `warn` at line 192 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 direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:172 — `debug` at line 172 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.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 direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:190 — `debug` at line 190 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 direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:207 — `debug` at line 207 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 direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:229 — `debug` at line 229 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 direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:249 — `debug` at line 249 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 direct-query-core/src/main/java/org/opensearch/sql/datasource/client/DataSourceClientFactory.java:61 — `error` at line 61 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 core/src/main/java/org/opensearch/sql/expression/function/PPLFuncImpTable.java:1926 — `debug` at line 1926 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 async-query-core/src/main/java/org/opensearch/sql/spark/validator/PPLQueryValidator.java:38 — `error` at line 38 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 async-query-core/src/main/java/org/opensearch/sql/spark/validator/SQLQueryValidator.java:36 — `error` at line 36 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 async-query-core/src/main/java/org/opensearch/sql/spark/flint/operation/FlintIndexOp.java:136 — `info` at line 136 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 async-query-core/src/main/java/org/opensearch/sql/spark/client/EmrServerlessClientImpl.java:74 — `info` at line 74 is handed a message assembled at the call — a string concatenated with a value, or `String.format` — through SLF4J or log4j 2, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or `log.atInfo().addKeyValue("order_id", orderId).log("order moved")` with SLF4J 2's fluent API. An exception goes last, as the throwable argument, not into the text.
  • Interpolated log message defeats structured logging async-query-core/src/main/java/org/opensearch/sql/spark/client/EmrServerlessClientImpl.java:90 — `info` at line 90 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 async-query-core/src/main/java/org/opensearch/sql/spark/client/EmrServerlessClientImpl.java:107 — `error` at line 107 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 async-query-core/src/main/java/org/opensearch/sql/spark/client/EmrServerlessClientImpl.java:115 — `info` at line 115 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 async-query/src/main/java/org/opensearch/sql/spark/scheduler/job/ScheduledAsyncQueryJobRunner.java:108 — `info` at line 108 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 async-query/src/main/java/org/opensearch/sql/spark/scheduler/job/ScheduledAsyncQueryJobRunner.java:115 — `info` at line 115 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 async-query/src/main/java/org/opensearch/sql/spark/response/OpenSearchJobExecutionResponseReader.java:65 — `info` at line 65 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 async-query/src/main/java/org/opensearch/sql/spark/cluster/FlintIndexRetention.java:115 — `error` at line 115 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 async-query/src/main/java/org/opensearch/sql/spark/cluster/FlintIndexRetention.java:137 — `error` at line 137 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.
  • + 1 more in this group — see findings.md.
P10 · Library API & versioning · Implementation type on the public API · ×15
  • Implementation type on the public API async-query-core/src/main/java/org/opensearch/sql/spark/asyncquery/AsyncQueryExecutorServiceImpl.java:49 — 1 public type in `org.opensearch.sql.spark.asyncquery` is marked as implementation by its own namespace, folder or name: `AsyncQueryExecutorServiceImpl` (async-query-core/src/main/java/org/opensearch/sql/spark/asyncquery/AsyncQueryExecutorServiceImpl.java:49, name ends in `Impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers.
  • Implementation type on the public API async-query-core/src/main/java/org/opensearch/sql/spark/client/EMRServerlessClientFactoryImpl.java:20 — 2 public types in `org.opensearch.sql.spark.client` are marked as implementation by their own namespace, folder or name: `EMRServerlessClientFactoryImpl` (async-query-core/src/main/java/org/opensearch/sql/spark/client/EMRServerlessClientFactoryImpl.java:20, name ends in `Impl`), `EmrServerlessClientImpl` (async-query-core/src/main/java/org/opensearch/sql/spark/client/EmrServerlessClientImpl.java:31, name ends in `Impl`). While they are public, every consumer of the library can bind to them, so changing them is a breaking change for those consumers.
  • Implementation type on the public API async-query/src/main/java/org/opensearch/sql/spark/config/SparkExecutionEngineConfigSupplierImpl.java:16 — 1 public type in `org.opensearch.sql.spark.config` is marked as implementation by its own namespace, folder or name: `SparkExecutionEngineConfigSupplierImpl` (async-query/src/main/java/org/opensearch/sql/spark/config/SparkExecutionEngineConfigSupplierImpl.java:16, name ends in `Impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers.
  • Implementation type on the public API async-query/src/main/java/org/opensearch/sql/spark/flint/FlintIndexMetadataServiceImpl.java:31 — 1 public type in `org.opensearch.sql.spark.flint` is marked as implementation by its own namespace, folder or name: `FlintIndexMetadataServiceImpl` (async-query/src/main/java/org/opensearch/sql/spark/flint/FlintIndexMetadataServiceImpl.java:31, name ends in `Impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers.
  • Implementation type on the public API core/src/main/java/org/opensearch/sql/calcite/utils/CalciteToolsHelper.java:229 — 1 public type in `org.opensearch.sql.calcite.utils` is marked as implementation by its own namespace, folder or name: `OpenSearchPrepareImpl` (core/src/main/java/org/opensearch/sql/calcite/utils/CalciteToolsHelper.java:229, name ends in `Impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers.
  • Implementation type on the public API core/src/main/java/org/opensearch/sql/expression/function/CollectionUDF/ArrayFunctionImpl.java:35 — 14 public types in `org.opensearch.sql.expression.function.CollectionUDF` are marked as implementation by their own namespace, folder or name: `ArrayFunctionImpl` (core/src/main/java/org/opensearch/sql/expression/function/CollectionUDF/ArrayFunctionImpl.java:35, name ends in `Impl`), `ExistsFunctionImpl` (core/src/main/java/org/opensearch/sql/expression/function/CollectionUDF/ExistsFunctionImpl.java:27, name ends in `Impl`), `FilterFunctionImpl` (core/src/main/java/org/opensearch/sql/expression/function/CollectionUDF/FilterFunctionImpl.java:27, name ends in `Impl`), `ForallFunctionImpl` (core/src/main/java/org/opensearch/sql/expression/function/CollectionUDF/ForallFunctionImpl.java:26, name ends in `Impl`), `ForeachPairCollectionFunctionImpl` (core/src/main/java/org/opensearch/sql/expression/function/CollectionUDF/ForeachPairCollectionFunctionImpl.java:26, name ends in `Impl`), `ForeachPairItemFunctionImpl` (core/src/main/java/org/opensearch/sql/expression/function/CollectionUDF/ForeachPairItemFunctionImpl.java:26, name ends in `Impl`), `ForeachStateFunctionImpl` (core/src/main/java/org/opensearch/sql/expression/function/CollectionUDF/ForeachStateFunctionImpl.java:25, name ends in `Impl`), `MVAppendFunctionImpl` (core/src/main/java/org/opensearch/sql/expression/function/CollectionUDF/MVAppendFunctionImpl.java:33, name ends in `Impl`), and 6 more. While they are public, every consumer of the library can bind to them, so changing them is a breaking change for those consumers.
  • Implementation type on the public API core/src/main/java/org/opensearch/sql/expression/function/PatternParserFunctionImpl.java:39 — 1 public type in `org.opensearch.sql.expression.function` is marked as implementation by its own namespace, folder or name: `PatternParserFunctionImpl` (core/src/main/java/org/opensearch/sql/expression/function/PatternParserFunctionImpl.java:39, name ends in `Impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers.
  • Implementation type on the public API core/src/main/java/org/opensearch/sql/expression/function/jsonUDF/ForeachJsonArrayFunctionImpl.java:30 — 10 public types in `org.opensearch.sql.expression.function.jsonUDF` are marked as implementation by their own namespace, folder or name: `ForeachJsonArrayFunctionImpl` (core/src/main/java/org/opensearch/sql/expression/function/jsonUDF/ForeachJsonArrayFunctionImpl.java:30, name ends in `Impl`), `JsonAppendFunctionImpl` (core/src/main/java/org/opensearch/sql/expression/function/jsonUDF/JsonAppendFunctionImpl.java:29, name ends in `Impl`), `JsonArrayLengthFunctionImpl` (core/src/main/java/org/opensearch/sql/expression/function/jsonUDF/JsonArrayLengthFunctionImpl.java:26, name ends in `Impl`), `JsonDeleteFunctionImpl` (core/src/main/java/org/opensearch/sql/expression/function/jsonUDF/JsonDeleteFunctionImpl.java:27, name ends in `Impl`), `JsonExtendFunctionImpl` (core/src/main/java/org/opensearch/sql/expression/function/jsonUDF/JsonExtendFunctionImpl.java:29, name ends in `Impl`), `JsonExtractAllFunctionImpl` (core/src/main/java/org/opensearch/sql/expression/function/jsonUDF/JsonExtractAllFunctionImpl.java:43, name ends in `Impl`), `JsonExtractFunctionImpl` (core/src/main/java/org/opensearch/sql/expression/function/jsonUDF/JsonExtractFunctionImpl.java:32, name ends in `Impl`), `JsonFunctionImpl` (core/src/main/java/org/opensearch/sql/expression/function/jsonUDF/JsonFunctionImpl.java:27, name ends in `Impl`), and 2 more. While they are public, every consumer of the library can bind to them, so changing them is a breaking change for those consumers.
  • Implementation type on the public API datasources/src/main/java/org/opensearch/sql/datasources/auth/DataSourceUserAuthorizationHelperImpl.java:20 — 1 public type in `org.opensearch.sql.datasources.auth` is marked as implementation by its own namespace, folder or name: `DataSourceUserAuthorizationHelperImpl` (datasources/src/main/java/org/opensearch/sql/datasources/auth/DataSourceUserAuthorizationHelperImpl.java:20, name ends in `Impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers.
  • Implementation type on the public API datasources/src/main/java/org/opensearch/sql/datasources/encryptor/EncryptorImpl.java:21 — 1 public type in `org.opensearch.sql.datasources.encryptor` is marked as implementation by its own namespace, folder or name: `EncryptorImpl` (datasources/src/main/java/org/opensearch/sql/datasources/encryptor/EncryptorImpl.java:21, name ends in `Impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers.
  • Implementation type on the public API datasources/src/main/java/org/opensearch/sql/datasources/service/DataSourceLoaderCacheImpl.java:19 — 2 public types in `org.opensearch.sql.datasources.service` are marked as implementation by their own namespace, folder or name: `DataSourceLoaderCacheImpl` (datasources/src/main/java/org/opensearch/sql/datasources/service/DataSourceLoaderCacheImpl.java:19, name ends in `Impl`), `DataSourceServiceImpl` (datasources/src/main/java/org/opensearch/sql/datasources/service/DataSourceServiceImpl.java:31, name ends in `Impl`). While they are public, every consumer of the library can bind to them, so changing them is a breaking change for those consumers.
  • Implementation type on the public API direct-query-core/src/main/java/org/opensearch/sql/directquery/DirectQueryExecutorServiceImpl.java:25 — 1 public type in `org.opensearch.sql.directquery` is marked as implementation by its own namespace, folder or name: `DirectQueryExecutorServiceImpl` (direct-query-core/src/main/java/org/opensearch/sql/directquery/DirectQueryExecutorServiceImpl.java:25, name ends in `Impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers.
  • Implementation type on the public API direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:37 — 1 public type in `org.opensearch.sql.prometheus.client` is marked as implementation by its own namespace, folder or name: `PrometheusClientImpl` (direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClientImpl.java:37, name ends in `Impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers.
  • Implementation type on the public API legacy/src/main/java/org/opensearch/sql/legacy/pit/PointInTimeHandlerImpl.java:29 — 1 public type in `org.opensearch.sql.legacy.pit` is marked as implementation by its own namespace, folder or name: `PointInTimeHandlerImpl` (legacy/src/main/java/org/opensearch/sql/legacy/pit/PointInTimeHandlerImpl.java:29, name ends in `Impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers.
  • Implementation type on the public API prometheus/src/main/java/org/opensearch/sql/prometheus/functions/implementation/QueryExemplarFunctionImplementation.java:31 — 2 public types in `org.opensearch.sql.prometheus.functions.implementation` are marked as implementation by their own namespace, folder or name: `QueryExemplarFunctionImplementation` (prometheus/src/main/java/org/opensearch/sql/prometheus/functions/implementation/QueryExemplarFunctionImplementation.java:31, `implementation`), `QueryRangeFunctionImplementation` (prometheus/src/main/java/org/opensearch/sql/prometheus/functions/implementation/QueryRangeFunctionImplementation.java:32, `implementation`). While they are public, every consumer of the library can bind to them, so changing them is a breaking change for those consumers.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×4
  • Projects may be oversized for their cohesion core/build.gradle:1 — `core` (63411 LoC, 792 module-visible types across 88 directories) overshoots its size bounds. 4 of 18 build unit(s) (Gradle) overshoot their size bounds, lowering Project Cohesion to 5.6/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 legacy/build.gradle:1 — `legacy` (29381 LoC, 326 module-visible types across 70 directories) overshoots its size bounds. 4 of 18 build unit(s) (Gradle) overshoot their size bounds, lowering Project Cohesion to 5.6/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 opensearch/build.gradle:1 — `opensearch` (28165 LoC, 257 module-visible types across 38 directories) overshoots its size bounds. 4 of 18 build unit(s) (Gradle) overshoot their size bounds, lowering Project Cohesion to 5.6/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 async-query-core/build.gradle:1 — `async-query-core` (6668 LoC, 116 module-visible types across 27 directories) overshoots its size bounds. 4 of 18 build unit(s) (Gradle) overshoot their size bounds, lowering Project Cohesion to 5.6/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.
AX6 · Interface segregation · Fat interface · ×2
  • Fat interface: PrometheusClient (23 abstract methods) direct-query-core/src/main/java/org/opensearch/sql/prometheus/client/PrometheusClient.java:19 — `PrometheusClient` declares 23 abstract methods: `createAlertmanagerSilences`, `createOrUpdateRuleGroup`, `deleteAlertmanagerSilence`, `deleteRuleGroup`, `deleteRuleNamespace`, `getAlertmanagerAlertGroups`, `getAlertmanagerAlerts`, `getAlertmanagerReceivers`, `getAlertmanagerSilences`, `getAlertmanagerStatus`, `getAlerts`, `getAllMetrics`, `getAllMetrics`, `getLabel`, `getLabels`, `getLabels`, `getRules`, `getRulesByNamespace`, `getSeries`, `query`, `queryExemplars`, `queryRange`, `queryRange`. 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 23 declarations carry 20 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 20 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: Content (24 abstract methods) opensearch/src/main/java/org/opensearch/sql/opensearch/data/utils/Content.java:21 — `Content` declares 24 abstract methods: `array`, `booleanValue`, `byteValue`, `doubleValue`, `floatValue`, `geoValue`, `intValue`, `isArray`, `isBoolean`, `isByte`, `isDouble`, `isFloat`, `isInt`, `isLong`, `isNull`, `isNumber`, `isObject`, `isShort`, `isString`, `longValue`, `map`, `objectValue`, `shortValue`, `stringValue`. 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.
D16 · Bus Factor · Off-boarding risk · ×1
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 5 significant file(s) lose their only recent owner: opensearch/src/main/java/org/opensearch/sql/job/OpenSearchQueryJobService.java, core/src/main/java/org/opensearch/sql/job/QueryJobId.java, async-query/src/main/java/org/opensearch/sql/spark/transport/AsyncQueryOwnerRouting.java, core/src/main/java/org/opensearch/sql/job/QueryFailure.java, core/src/main/java/org/opensearch/sql/job/QueryJobService.java. Pair on, review, or document these before any departure.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 6 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (16 single-owned of 702 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 702 of the 1587 production source files in this repository met that bar). They are anonymized user #2 (4 file(s)), anonymized user #3 (2 file(s)), anonymized user #4 (2 file(s)), anonymized user #5 (1 file(s)), anonymized user #6 (1 file(s)), anonymized user #7 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: api/src/main/java/org/opensearch/sql/api/parser/SqlV2QueryParser.java, core/src/main/java/org/opensearch/sql/calcite/MapPathPreMaterializer.java, benchmarks/src/jmh/java/org/opensearch/sql/api/UnifiedQueryBenchmark.java, api/src/main/java/org/opensearch/sql/api/compiler/UnifiedQueryCompiler.java, core/src/main/java/org/opensearch/sql/expression/function/jsonUDF/ForeachJsonArrayFunctionImpl.java, core/src/main/java/org/opensearch/sql/calcite/udf/udaf/DistinctCountApproxLogicalAggFunction.java, opensearch/src/main/java/org/opensearch/sql/opensearch/data/value/FlatObjectValues.java, opensearch/src/main/java/org/opensearch/sql/opensearch/storage/serde/RexLiteralSafetyValidator.java (+3 more).
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found ppl/build.gradle:136 — 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 `ppl/build.gradle` makes this repository a deployable product (line 136).
D21 · Naming Consistency · `stID` spells `ID` where 63 names in the project spell it `Id` · ×1
  • `stID` spells `ID` where 63 names in the project spell it `Id` async-query-core/src/main/java/org/opensearch/sql/spark/execution/session/Session.java:38 — 63 of 65 names in project async-query-core spell the token `Id` (63 of 65; unit: names in project async-query-core containing `Id`). Peers: AsyncQueryExecutorService.getAsyncQueryResults(queryId) (async-query-core/src/main/java/org/opensearch/sql/spark/asyncquery/AsyncQueryExecutorService.java:34); AsyncQueryExecutorService.cancelQuery(queryId) (async-query-core/src/main/java/org/opensearch/sql/spark/asyncquery/AsyncQueryExecutorService.java:43); AsyncQueryExecutorServiceImpl.getAsyncQueryResults(queryId) (async-query-core/src/main/java/org/opensearch/sql/spark/asyncquery/AsyncQueryExecutorServiceImpl.java:135); AsyncQueryExecutorServiceImpl.cancelQuery(queryId) (async-query-core/src/main/java/org/opensearch/sql/spark/asyncquery/AsyncQueryExecutorServiceImpl.java:183); AsyncQueryExecutorServiceImpl.asJobId (async-query-core/src/main/java/org/opensearch/sql/spark/asyncquery/AsyncQueryExecutorServiceImpl.java:204). Rename to `stId`. [rule N6]
D21 · Naming Consistency · `testFilterBooleanFieldWithTRUE` spells `TRUE` where 17 names in the project spell it `True` · ×1
  • `testFilterBooleanFieldWithTRUE` spells `TRUE` where 17 names in the project spell it `True` integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteExplainIT.java:2862 — 17 of 18 names in project integ-test spell the token `True` (17 of 18; unit: names in project integ-test containing `True`). Peers: CalciteChartCommandIT.testChartUseNullTrueWithNullStr (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteChartCommandIT.java:327); CalciteExplainIT.testFilterBooleanFieldNotTrue (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteExplainIT.java:2900); CalciteExplainIT.testFilterBooleanFieldOnlyTrue (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteExplainIT.java:2927); CalciteExplainIT.testFilterBooleanFieldOnlyNotTrue (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteExplainIT.java:2949); CalciteTimechartCommandIT.testTimechartWithUseNullTrueAndNullStr (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteTimechartCommandIT.java:425). Rename to `testFilterBooleanFieldWithTrue`. [rule N6]
D21 · Naming Consistency · `CalciteMVAppendFunctionIT` spells `MV` where 39 names in the project spell it `Mv` · ×1
  • `CalciteMVAppendFunctionIT` spells `MV` where 39 names in the project spell it `Mv` integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteMVAppendFunctionIT.java:19 — 39 of 40 names in project integ-test spell the token `Mv` (39 of 40; unit: names in project integ-test containing `Mv`). Peers: CalciteExplainIT.testExplainMvCombine (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteExplainIT.java:2748); CalciteExplainIT.testExplainNoMv (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteExplainIT.java:2760); CalciteExplainIT.testNoMvBasic (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteExplainIT.java:2960); CalciteExplainIT.testNoMvWithEval (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteExplainIT.java:2976); org.opensearch.sql.calcite.remote.CalciteMvCombineCommandIT (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteMvCombineCommandIT.java:27). Rename to `CalciteMvAppendFunctionIT`. [rule N6]
D21 · Naming Consistency · `testDATEInvalid` spells `DATE` where 169 names in the project spell it `Date` · ×1
  • `testDATEInvalid` spells `DATE` where 169 names in the project spell it `Date` integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalcitePPLBuiltinDatetimeFunctionInvalidIT.java:101 — 169 of 170 names in project integ-test spell the token `Date` (169 of 170; unit: names in project integ-test containing `Date`). Peers: CalciteAliasFieldAggregationIT.testMinWithDateAliasField (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteAliasFieldAggregationIT.java:85); CalciteAliasFieldAggregationIT.testMaxWithDateAliasField (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteAliasFieldAggregationIT.java:93); CalciteAnalyticsDatetimeWireFormatIT.testDateRootColumnYmdFormat (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteAnalyticsDatetimeWireFormatIT.java:97); org.opensearch.sql.calcite.remote.CalciteDateTimeComparisonIT (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteDateTimeComparisonIT.java:10); org.opensearch.sql.calcite.remote.CalciteDateTimeFunctionIT (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteDateTimeFunctionIT.java:23). Rename to `testDateInvalid`. [rule N6]
D21 · Naming Consistency · `testTIMEInvalid` spells `TIME` where 170 names in the project spell it `Time` · ×1
  • `testTIMEInvalid` spells `TIME` where 170 names in the project spell it `Time` integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalcitePPLBuiltinDatetimeFunctionInvalidIT.java:128 — 170 of 171 names in project integ-test spell the token `Time` (170 of 171; unit: names in project integ-test containing `Time`). Peers: CalciteAnalyticsDatetimeWireFormatIT.testTimeRootColumnHmsFormat (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteAnalyticsDatetimeWireFormatIT.java:107); org.opensearch.sql.calcite.remote.CalciteDateTimeComparisonIT (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteDateTimeComparisonIT.java:10); org.opensearch.sql.calcite.remote.CalciteDateTimeFunctionIT (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteDateTimeFunctionIT.java:23); org.opensearch.sql.calcite.remote.CalciteDateTimeImplementationIT (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteDateTimeImplementationIT.java:10); CalciteExplainIT.testExplainStatsWithBinsOnTimeField (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteExplainIT.java:648). Rename to `testTimeInvalid`. [rule N6]
D21 · Naming Consistency · `testDAYInvalid` spells `DAY` where 53 names in the project spell it `Day` · ×1
  • `testDAYInvalid` spells `DAY` where 53 names in the project spell it `Day` integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalcitePPLBuiltinDatetimeFunctionInvalidIT.java:157 — 53 of 54 names in project integ-test spell the token `Day` (53 of 54; unit: names in project integ-test containing `Day`). Peers: CalciteChartCommandIT.testChartMaxValueByTimestampSpanDayAndWeek (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteChartCommandIT.java:159); CalciteChartCommandIT.testChartLimitZeroByTimestampSpanDayAndWeek (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteChartCommandIT.java:182); CalciteExplainIT.testExplainTimechartPerDay (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteExplainIT.java:583); CalcitePPLBuiltinFunctionsNullIT.testWeekDayInvalid (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalcitePPLBuiltinFunctionsNullIT.java:104); CalcitePPLBuiltinFunctionsNullIT.testWeekDayNull (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalcitePPLBuiltinFunctionsNullIT.java:132). Rename to `testDayInvalid`. [rule N6]
D21 · Naming Consistency · `testHOURInvalid` spells `HOUR` where 24 names in the project spell it `Hour` · ×1
  • `testHOURInvalid` spells `HOUR` where 24 names in the project spell it `Hour` integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalcitePPLBuiltinDatetimeFunctionInvalidIT.java:437 — 24 of 25 names in project integ-test spell the token `Hour` (24 of 25; unit: names in project integ-test containing `Hour`). Peers: CalciteBinCommandIT.testBinTimestampAligntimeHour (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteBinCommandIT.java:473); CalciteExplainIT.testExplainTimechartPerHour (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteExplainIT.java:573); CalcitePPLBuiltinFunctionsNullIT.testHourNull (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalcitePPLBuiltinFunctionsNullIT.java:377); CalcitePPLBuiltinFunctionsNullIT.testHourInvalid (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalcitePPLBuiltinFunctionsNullIT.java:388); CalcitePPLBuiltinFunctionsNullIT.testHourOfDayNull (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalcitePPLBuiltinFunctionsNullIT.java:498). Rename to `testHourInvalid`. [rule N6]
D21 · Naming Consistency · `testMINUTEInvalid` spells `MINUTE` where 23 names in the project spell it `Minute` · ×1
  • `testMINUTEInvalid` spells `MINUTE` where 23 names in the project spell it `Minute` integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalcitePPLBuiltinDatetimeFunctionInvalidIT.java:527 — 23 of 24 names in project integ-test spell the token `Minute` (23 of 24; unit: names in project integ-test containing `Minute`). Peers: CalciteExplainIT.testExplainTimechartPerMinute (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteExplainIT.java:563); CalcitePPLBuiltinFunctionsNullIT.testMinuteNull (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalcitePPLBuiltinFunctionsNullIT.java:700); CalcitePPLBuiltinFunctionsNullIT.testMinuteOfDayNull (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalcitePPLBuiltinFunctionsNullIT.java:711); CalcitePPLBuiltinFunctionsNullIT.testMinuteOfHourNull (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalcitePPLBuiltinFunctionsNullIT.java:723); CalcitePPLBuiltinFunctionsNullIT.testSecondOfMinuteNull (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalcitePPLBuiltinFunctionsNullIT.java:817). Rename to `testMinuteInvalid`. [rule N6]
D21 · Naming Consistency · `testMONTHInvalid` spells `MONTH` where 26 names in the project spell it `Month` · ×1
  • `testMONTHInvalid` spells `MONTH` where 26 names in the project spell it `Month` integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalcitePPLBuiltinDatetimeFunctionInvalidIT.java:620 — 26 of 27 names in project integ-test spell the token `Month` (26 of 27; unit: names in project integ-test containing `Month`). Peers: CalciteExplainIT.testExplainTimewrapMonth (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteExplainIT.java:605); CalcitePPLBuiltinFunctionsNullIT.testDayOfMonthNull (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalcitePPLBuiltinFunctionsNullIT.java:676); CalcitePPLBuiltinFunctionsNullIT.testMonthNull (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalcitePPLBuiltinFunctionsNullIT.java:735); CalcitePPLBuiltinFunctionsNullIT.testMonthOfYearNull (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalcitePPLBuiltinFunctionsNullIT.java:746); CalciteTimechartPerFunctionIT.testTimechartPerSecondWithVariableMonthLengths (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteTimechartPerFunctionIT.java:102). Rename to `testMonthInvalid`. [rule N6]
D21 · Naming Consistency · `testSECONDInvalid` spells `SECOND` where 23 names in the project spell it `Second` · ×1
  • `testSECONDInvalid` spells `SECOND` where 23 names in the project spell it `Second` integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalcitePPLBuiltinDatetimeFunctionInvalidIT.java:747 — 23 of 24 names in project integ-test spell the token `Second` (23 of 24; unit: names in project integ-test containing `Second`). Peers: CalciteExplainIT.testExplainTimechartPerSecond (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteExplainIT.java:553); CalcitePPLBuiltinFunctionsNullIT.testSecondNull (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalcitePPLBuiltinFunctionsNullIT.java:806); CalcitePPLBuiltinFunctionsNullIT.testSecondOfMinuteNull (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalcitePPLBuiltinFunctionsNullIT.java:817); CalciteTimechartPerFunctionIT.testTimechartPerSecondWithDefaultSpan (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteTimechartPerFunctionIT.java:34); CalciteTimechartPerFunctionIT.testTimechartPerSecondWithSpecifiedSpan (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteTimechartPerFunctionIT.java:49). Rename to `testSecondInvalid`. [rule N6]
D21 · Naming Consistency · `testTIMESTAMPInvalid` spells `TIMESTAMP` where 85 names in the project spell it `Timestamp` · ×1
  • `testTIMESTAMPInvalid` spells `TIMESTAMP` where 85 names in the project spell it `Timestamp` integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalcitePPLBuiltinDatetimeFunctionInvalidIT.java:840 — 85 of 86 names in project integ-test spell the token `Timestamp` (85 of 86; unit: names in project integ-test containing `Timestamp`). Peers: CalciteAliasFieldAggregationIT.normalizeTimestamp (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteAliasFieldAggregationIT.java:220); CalciteAliasFieldAggregationIT.assertTimestampMember (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteAliasFieldAggregationIT.java:224); CalciteAliasFieldAggregationIT.assertTimestampTakeMembers (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteAliasFieldAggregationIT.java:230); CalciteAnalyticsDatetimeWireFormatIT.testTimestampRootColumnSpaceFormat (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteAnalyticsDatetimeWireFormatIT.java:87); CalciteAnalyticsDatetimeWireFormatIT.testEvalDerivedTimestampSpaceFormat (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteAnalyticsDatetimeWireFormatIT.java:117). Rename to `testTimestampInvalid`. [rule N6]
D21 · Naming Consistency · `testYEARInvalid` spells `YEAR` where 35 names in the project spell it `Year` · ×1
  • `testYEARInvalid` spells `YEAR` where 35 names in the project spell it `Year` integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalcitePPLBuiltinDatetimeFunctionInvalidIT.java:956 — 35 of 36 names in project integ-test spell the token `Year` (35 of 36; unit: names in project integ-test containing `Year`). Peers: CalcitePPLBuiltinDatetimeFunctionInvalidIT.testYearWeekInvalid (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalcitePPLBuiltinDatetimeFunctionInvalidIT.java:26); CalcitePPLBuiltinDatetimeFunctionInvalidIT.testYearInvalid (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalcitePPLBuiltinDatetimeFunctionInvalidIT.java:39); CalcitePPLBuiltinFunctionsNullIT.testYearWeekInvalid (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalcitePPLBuiltinFunctionsNullIT.java:38); CalcitePPLBuiltinFunctionsNullIT.testYearWeekNull (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalcitePPLBuiltinFunctionsNullIT.java:50); CalcitePPLBuiltinFunctionsNullIT.testYearInvalid (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalcitePPLBuiltinFunctionsNullIT.java:66). Rename to `testYearInvalid`. [rule N6]
D21 · Naming Consistency · `testWEEKInvalid` spells `WEEK` where 42 names in the project spell it `Week` · ×1
  • `testWEEKInvalid` spells `WEEK` where 42 names in the project spell it `Week` integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalcitePPLBuiltinDatetimeFunctionInvalidIT.java:985 — 42 of 43 names in project integ-test spell the token `Week` (42 of 43; unit: names in project integ-test containing `Week`). Peers: CalciteChartCommandIT.testChartMaxValueOverTimestampSpanWeekByCategory (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteChartCommandIT.java:112); CalciteChartCommandIT.testChartMaxValueOverCategoryByTimestampSpanWeek (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteChartCommandIT.java:133); CalciteChartCommandIT.testChartMaxValueByTimestampSpanDayAndWeek (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteChartCommandIT.java:159); CalciteChartCommandIT.testChartLimitZeroByTimestampSpanDayAndWeek (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteChartCommandIT.java:182); CalcitePPLBuiltinDatetimeFunctionInvalidIT.testYearWeekInvalid (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalcitePPLBuiltinDatetimeFunctionInvalidIT.java:26). Rename to `testWeekInvalid`. [rule N6]
D21 · Naming Consistency · `testCastBOOLEAN` spells `BOOLEAN` where 26 names in the project spell it `Boolean` · ×1
  • `testCastBOOLEAN` spells `BOOLEAN` where 26 names in the project spell it `Boolean` integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalcitePPLCastFunctionIT.java:122 — 26 of 27 names in project integ-test spell the token `Boolean` (26 of 27; unit: names in project integ-test containing `Boolean`). Peers: CalciteExplainIT.testFilterQueryStringWithBooleanFieldPushDown (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteExplainIT.java:2849); CalciteExplainIT.testFilterBooleanFieldWithTRUE (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteExplainIT.java:2862); CalciteExplainIT.testFilterBooleanFieldWithStringLiteral (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteExplainIT.java:2874); CalciteExplainIT.testFilterBooleanFieldFalse (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteExplainIT.java:2887); CalciteExplainIT.testFilterBooleanFieldNotTrue (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteExplainIT.java:2900). Rename to `testCastBoolean`. [rule N6]
D21 · Naming Consistency · `testUidASIdName` spells `AS` where 58 names in the project spell it `As` · ×1
  • `testUidASIdName` spells `AS` where 58 names in the project spell it `As` integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalcitePPLLookupIT.java:195 — 58 of 59 names in project integ-test spell the token `As` (58 of 59; unit: names in project integ-test containing `As`). Peers: AnalyticsEngineProfileIT.entityAsString (integ-test/src/test/java/org/opensearch/sql/analytics/AnalyticsEngineProfileIT.java:241); CalciteScriptEngineInjectionIT.wrapAsCompoundedScriptBody (integ-test/src/test/java/org/opensearch/sql/calcite/CalciteScriptEngineInjectionIT.java:182); CalciteAnalyzeIT.analyzeTimingsInSameOrderOfMagnitudeAsProfile (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteAnalyzeIT.java:263); CalciteExplainIT.testCasePushdownAsRangeQueryExplain (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteExplainIT.java:2014); CalciteGeoIpFunctionsIT.testGeoIpEnrichmentWithIpFieldAsInput (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteGeoIpFunctionsIT.java:43). Rename to `testUidAsIdName`. [rule N6]
D21 · Naming Consistency · `deleteOfFailedJobReturnsFailedAndRemovesIt` spells `It` where 356 names in the project spell it `IT` · ×1
  • `deleteOfFailedJobReturnsFailedAndRemovesIt` spells `It` where 356 names in the project spell it `IT` integ-test/src/test/java/org/opensearch/sql/ppl/AsyncPPLMultiNodeRoutingIT.java:321 — 356 of 357 names in project integ-test spell the token `IT` (356 of 357; unit: names in project integ-test containing `IT`). Peers: org.opensearch.sql.analytics.AnalyticsEngineProfileIT (integ-test/src/test/java/org/opensearch/sql/analytics/AnalyticsEngineProfileIT.java:26); org.opensearch.sql.api.UnifiedQueryOpenSearchIT (integ-test/src/test/java/org/opensearch/sql/api/UnifiedQueryOpenSearchIT.java:37); org.opensearch.sql.asyncquery.AsyncQueryIT (integ-test/src/test/java/org/opensearch/sql/asyncquery/AsyncQueryIT.java:23); org.opensearch.sql.bwc.SQLBackwardsCompatibilityIT (integ-test/src/test/java/org/opensearch/sql/bwc/SQLBackwardsCompatibilityIT.java:36); org.opensearch.sql.calcite.CalciteComplexPoolIT (integ-test/src/test/java/org/opensearch/sql/calcite/CalciteComplexPoolIT.java:29). Rename to `deleteOfFailedJobReturnsFailedAndRemovesIT`. [rule N6]
D21 · Naming Consistency · `testCastINT` spells `INT` where 25 names in the project spell it `Int` · ×1
  • `testCastINT` spells `INT` where 25 names in the project spell it `Int` integ-test/src/test/java/org/opensearch/sql/ppl/CastFunctionIT.java:111 — 25 of 26 names in project integ-test spell the token `Int` (25 of 26; unit: names in project integ-test containing `Int`). Peers: CalciteExplainIT.testExplainOnAggregationWithSumEnhancementOnNarrowInt (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteExplainIT.java:871); CalciteFillNullCommandIT.testFillNullWithLargeIntegerOnIntField (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteFillNullCommandIT.java:147); CalciteMVAppendFunctionIT.testMvappendWithIntAndDouble (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteMVAppendFunctionIT.java:98); CalcitePPLAggregationIT.testSumWithLiteralOnNarrowInt (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalcitePPLAggregationIT.java:1523); CalcitePPLAggregationIT.testSumWithLiteralOnNarrowIntWithNulls (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalcitePPLAggregationIT.java:1542). Rename to `testCastInt`. [rule N6]
D21 · Naming Consistency · `testCastLONG` spells `LONG` where 21 names in the project spell it `Long` · ×1
  • `testCastLONG` spells `LONG` where 21 names in the project spell it `Long` integ-test/src/test/java/org/opensearch/sql/ppl/CastFunctionIT.java:149 — 21 of 22 names in project integ-test spell the token `Long` (21 of 22; unit: names in project integ-test containing `Long`). Peers: CalciteAnalyzeIT.analyzeLongArithmeticOverflowReturnsError (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteAnalyzeIT.java:170); CalciteArrayFunctionIT.testMvindexWithCastLongIndex (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteArrayFunctionIT.java:642); CalciteMathematicalFunctionIT.testRoundWithCastLongPrecision (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteMathematicalFunctionIT.java:52); CalciteMultiValueStatsIT.testListFunctionWithLong (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteMultiValueStatsIT.java:83); CalcitePPLAggregationIT.testSumAvgLongOverflow (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalcitePPLAggregationIT.java:179). Rename to `testCastLong`. [rule N6]
D21 · Naming Consistency · `testCastDOUBLE` spells `DOUBLE` where 56 names in the project spell it `Double` · ×1
  • `testCastDOUBLE` spells `DOUBLE` where 56 names in the project spell it `Double` integ-test/src/test/java/org/opensearch/sql/ppl/CastFunctionIT.java:211 — 56 of 57 names in project integ-test spell the token `Double` (56 of 57; unit: names in project integ-test containing `Double`). Peers: CalciteArrayFunctionIT.testTransformForWithDouble (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteArrayFunctionIT.java:195); CalciteExplainIT.testExplainWithDoubleReverseIgnored (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteExplainIT.java:504); CalciteExplainIT.testExplainWithDoubleReversePushdown (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteExplainIT.java:513); CalciteExplainIT.testExplainWithDoubleReversePushdownMultipleFields (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteExplainIT.java:521); CalciteMVAppendFunctionIT.testMvappendWithIntAndDouble (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteMVAppendFunctionIT.java:98). Rename to `testCastDouble`. [rule N6]
D21 · Naming Consistency · `testCastNumericSTRING` spells `STRING` where 124 names in the project spell it `String` · ×1
  • `testCastNumericSTRING` spells `STRING` where 124 names in the project spell it `String` integ-test/src/test/java/org/opensearch/sql/ppl/CastFunctionIT.java:242 — 124 of 125 names in project integ-test spell the token `String` (124 of 125; unit: names in project integ-test containing `String`). Peers: AnalyticsEngineProfileIT.entityAsString (integ-test/src/test/java/org/opensearch/sql/analytics/AnalyticsEngineProfileIT.java:241); AsyncQueryIT.executeAsyncQueryToString (integ-test/src/test/java/org/opensearch/sql/asyncquery/AsyncQueryIT.java:80); CalciteScriptEngineInjectionIT.wrapAsCompoundedScriptBody(relJsonString) (integ-test/src/test/java/org/opensearch/sql/calcite/CalciteScriptEngineInjectionIT.java:182); CalciteArrayFunctionIT.testArrayWithString (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteArrayFunctionIT.java:49); CalciteArrayFunctionIT.testMvjoinWithStringArray (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteArrayFunctionIT.java:310). Rename to `testCastNumericString`. [rule N6]
D21 · Naming Consistency · `testSearchWithOROperator` spells `OR` where 36 names in the project spell it `Or` · ×1
  • `testSearchWithOROperator` spells `OR` where 36 names in the project spell it `Or` integ-test/src/test/java/org/opensearch/sql/ppl/SearchCommandIT.java:138 — 36 of 37 names in project integ-test spell the token `Or` (36 of 37; unit: names in project integ-test containing `Or`). Peers: AnalyticsUnsupportedFieldStripVerifyIT.liveDocCountOrNull (integ-test/src/test/java/org/opensearch/sql/calcite/remote/AnalyticsUnsupportedFieldStripVerifyIT.java:334); CalciteExplainIT.testExplainIsEmptyOrOthers (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteExplainIT.java:392); CalciteExplainIT.testExplainIsNullOrOthers (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteExplainIT.java:404); CalciteExplainIT.testPushDownMinOrMaxAggOnDerivedField (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteExplainIT.java:1937); CalciteHighlightIT.testHighlightBooleanOrSearch (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteHighlightIT.java:223). Rename to `testSearchWithOrOperator`. [rule N6]
D21 · Naming Consistency · `testSearchWithANDOperator` spells `AND` where 269 names in the project spell it `And` · ×1
  • `testSearchWithANDOperator` spells `AND` where 269 names in the project spell it `And` integ-test/src/test/java/org/opensearch/sql/ppl/SearchCommandIT.java:149 — 269 of 270 names in project integ-test spell the token `And` (269 of 270; unit: names in project integ-test containing `And`). Peers: AnalyticsEngineProfileIT.testPplProfileTasksHaveNodeAndTiming (integ-test/src/test/java/org/opensearch/sql/analytics/AnalyticsEngineProfileIT.java:182); CalciteAddColTotalsCommandIT.testAddColTotalsWithLabelAndLabelField (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteAddColTotalsCommandIT.java:177); CalciteAddTotalsCommandIT.testAddTotalsWithLabelAndLabelField (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteAddTotalsCommandIT.java:302); CalciteAddTotalsCommandIT.testAddTotalsWithFieldnameAndSpecificFields (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteAddTotalsCommandIT.java:326); CalciteAnalyzeIT.analyzeIncludesLogicalAndPhysicalPlan (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteAnalyzeIT.java:127). Rename to `testSearchWithAndOperator`. [rule N6]
D21 · Naming Consistency · `testDifferenceBetweenNOTAndNotEquals` spells `NOT` where 134 names in the project spell it `Not` · ×1
  • `testDifferenceBetweenNOTAndNotEquals` spells `NOT` where 134 names in the project spell it `Not` integ-test/src/test/java/org/opensearch/sql/ppl/SearchCommandIT.java:162 — 134 of 135 names in project integ-test spell the token `Not` (134 of 135; unit: names in project integ-test containing `Not`). Peers: CalciteScriptEngineInjectionIT.calciteScriptEngineMustNotExecuteInjectedJava (integ-test/src/test/java/org/opensearch/sql/calcite/CalciteScriptEngineInjectionIT.java:73); CalciteScriptEngineInjectionIT.calciteScriptEngineMustNotExecuteInjectedJavaViaSarg (integ-test/src/test/java/org/opensearch/sql/calcite/CalciteScriptEngineInjectionIT.java:83); CalciteBinChartNullIT.testBinThenChartWithNullValuesShouldNotCauseNPE (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteBinChartNullIT.java:29); CalciteErrorReportStageIT.testFieldNotFoundErrorIncludesStage (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteErrorReportStageIT.java:35); CalciteErrorReportStageIT.testIndexNotFoundErrorIncludesStage (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteErrorReportStageIT.java:75). Rename to `testDifferenceBetweenNotAndNotEquals`. [rule N6]
D21 · Naming Consistency · `testSearchWithJSONSpecialChars` spells `JSON` where 77 names in the project spell it `Json` · ×1
  • `testSearchWithJSONSpecialChars` spells `JSON` where 77 names in the project spell it `Json` integ-test/src/test/java/org/opensearch/sql/ppl/SearchCommandIT.java:552 — 77 of 78 names in project integ-test spell the token `Json` (77 of 78; unit: names in project integ-test containing `Json`). Peers: CalciteScriptEngineInjectionIT.wrapAsCompoundedScriptBody(relJsonString) (integ-test/src/test/java/org/opensearch/sql/calcite/CalciteScriptEngineInjectionIT.java:182); CalciteExplainIT.testExplainJsonTreeFormat (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteExplainIT.java:3148); CalciteForeachCommandIT.testForeachJsonArrayMode (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteForeachCommandIT.java:140); CalciteForeachCommandIT.testForeachJsonArrayFunctionWithoutMode (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteForeachCommandIT.java:151); CalciteForeachCommandIT.testForeachJsonArrayStringElements (integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalciteForeachCommandIT.java:162). Rename to `testSearchWithJsonSpecialChars`. [rule N6]
D21 · Naming Consistency · `getOPERATOR` spells `OPERATOR` where 21 names in the project spell it `Operator` · ×1
  • `getOPERATOR` spells `OPERATOR` where 21 names in the project spell it `Operator` legacy/src/main/java/org/opensearch/sql/legacy/domain/Condition.java:332 — 21 of 23 names in project legacy spell the token `Operator` (21 of 23; unit: names in project legacy containing `Operator`). Peers: org.opensearch.sql.legacy.antlr.semantic.types.operator.ComparisonOperator (legacy/src/main/java/org/opensearch/sql/legacy/antlr/semantic/types/operator/ComparisonOperator.java:15); org.opensearch.sql.legacy.antlr.semantic.types.operator.JoinOperator (legacy/src/main/java/org/opensearch/sql/legacy/antlr/semantic/types/operator/JoinOperator.java:16); org.opensearch.sql.legacy.antlr.semantic.types.operator.SetOperator (legacy/src/main/java/org/opensearch/sql/legacy/antlr/semantic/types/operator/SetOperator.java:14); SemanticAnalyzer.visitOperator (legacy/src/main/java/org/opensearch/sql/legacy/antlr/semantic/visitor/SemanticAnalyzer.java:82); TypeChecker.visitOperator (legacy/src/main/java/org/opensearch/sql/legacy/antlr/semantic/visitor/TypeChecker.java:137). Rename to `getOperator`. [rule N6]
D21 · Naming Consistency · `setOPERATOR` spells `OPERATOR` where 21 names in the project spell it `Operator` · ×1
  • `setOPERATOR` spells `OPERATOR` where 21 names in the project spell it `Operator` legacy/src/main/java/org/opensearch/sql/legacy/domain/Condition.java:336 — 21 of 23 names in project legacy spell the token `Operator` (21 of 23; unit: names in project legacy containing `Operator`). Peers: org.opensearch.sql.legacy.antlr.semantic.types.operator.ComparisonOperator (legacy/src/main/java/org/opensearch/sql/legacy/antlr/semantic/types/operator/ComparisonOperator.java:15); org.opensearch.sql.legacy.antlr.semantic.types.operator.JoinOperator (legacy/src/main/java/org/opensearch/sql/legacy/antlr/semantic/types/operator/JoinOperator.java:16); org.opensearch.sql.legacy.antlr.semantic.types.operator.SetOperator (legacy/src/main/java/org/opensearch/sql/legacy/antlr/semantic/types/operator/SetOperator.java:14); SemanticAnalyzer.visitOperator (legacy/src/main/java/org/opensearch/sql/legacy/antlr/semantic/visitor/SemanticAnalyzer.java:82); TypeChecker.visitOperator (legacy/src/main/java/org/opensearch/sql/legacy/antlr/semantic/visitor/TypeChecker.java:137). Rename to `setOperator`. [rule N6]
D21 · Naming Consistency · `collectToJSON` spells `JSON` where 21 names in the project spell it `Json` · ×1
  • `collectToJSON` spells `JSON` where 21 names in the project spell it `Json` legacy/src/main/java/org/opensearch/sql/legacy/metrics/Metrics.java:73 — 21 of 22 names in project legacy spell the token `Json` (21 of 22; unit: names in project legacy containing `Json`). Peers: DefaultCursor.setSearchRequestString(cursorJson) (legacy/src/main/java/org/opensearch/sql/legacy/cursor/DefaultCursor.java:154); DefaultCursor.getIndicesFromJson (legacy/src/main/java/org/opensearch/sql/legacy/cursor/DefaultCursor.java:190); DefaultCursor.getSortFieldsFromJson (legacy/src/main/java/org/opensearch/sql/legacy/cursor/DefaultCursor.java:223); DefaultCursor.getSchemaAsJson (legacy/src/main/java/org/opensearch/sql/legacy/cursor/DefaultCursor.java:231); DefaultCursor.encodeCursor(cursorJson) (legacy/src/main/java/org/opensearch/sql/legacy/cursor/DefaultCursor.java:251). Rename to `collectToJson`. [rule N6]
D21 · Naming Consistency · `searchWithPIT` spells `PIT` where 15 names in the project spell it `Pit` · ×1
  • `searchWithPIT` spells `PIT` where 15 names in the project spell it `Pit` opensearch/src/main/java/org/opensearch/sql/opensearch/request/OpenSearchQueryRequest.java:246 — 15 of 16 names in project opensearch spell the token `Pit` (15 of 16; unit: names in project opensearch containing `Pit`). Peers: OpenSearchClient.createPit (opensearch/src/main/java/org/opensearch/sql/opensearch/client/OpenSearchClient.java:122); OpenSearchClient.createPit(createPitRequest) (opensearch/src/main/java/org/opensearch/sql/opensearch/client/OpenSearchClient.java:122); OpenSearchClient.deletePit (opensearch/src/main/java/org/opensearch/sql/opensearch/client/OpenSearchClient.java:129); OpenSearchClient.deletePit(deletePitRequest) (opensearch/src/main/java/org/opensearch/sql/opensearch/client/OpenSearchClient.java:129); OpenSearchNodeClient.createPit (opensearch/src/main/java/org/opensearch/sql/opensearch/client/OpenSearchNodeClient.java:387). Rename to `searchWithPit`. [rule N6]
D34 · Knowledge Freshness · Further orphaned files (smaller) · ×1
  • Further orphaned files (smaller) — 240 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: core/src/main/java/org/opensearch/sql/expression/datetime/DateTimeFormatterUtil.java, legacy/src/main/java/org/opensearch/sql/legacy/executor/join/HashJoinElasticExecutor.java, legacy/src/main/java/org/opensearch/sql/legacy/executor/join/NestedLoopsElasticExecutor.java, core/src/main/java/org/opensearch/sql/expression/text/TextFunctions.java, async-query-core/src/main/java/org/opensearch/sql/spark/validator/FunctionType.java, datasources/src/main/java/org/opensearch/sql/datasources/storage/OpenSearchDataSourceMetadataStorage.java, datasources/src/main/java/org/opensearch/sql/datasources/rest/RestDataSourceQueryAction.java, async-query/src/main/java/org/opensearch/sql/spark/rest/RestAsyncQueryManagementAction.java (and 232 more) (251 orphaned of 702 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 702 of the 1587 production source files in this repository met that bar). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
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.
P3 · Security & performance tooling · Dependabot does not watch github-actions/pip · ×1
  • Dependabot does not watch github-actions/pip REDACTED:2 — `REDACTED` schedules updates, but no `package-ecosystem` entry covers `github-actions`, `pip`, which this tree depends on — so those dependencies get no update pull requests and no advisory pressure, however complete the dep-scan credit looks. Add the missing entries to the `updates:` list.
P4 · Deployment & Rollback · No release approval gate · ×1
  • No release approval gate — The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release.
PF1 · Benchmark discipline · Benchmarks don't track allocations · ×1
  • Benchmarks don't track allocations benchmarks/src/jmh/java/org/opensearch/sql/opensearch/executor/BuildResultSetBenchmark.java — A JMH/Jetpack Benchmark suite exists but nothing turns on its allocation measurement — allocations (the main way hot code pressures a garbage collector or allocator) aren't being measured.
X5 · Nullable reference types · Java packages are not null-marked everywhere · ×1
  • Java packages are not null-marked everywhere — 0/325 of this repository's Java package directories are under a non-null default: a `package-info.java` declaring `@NullMarked` (JSpecify) or `@NonNullApi`, `@ParametersAreNonnullByDefault`, `@NonNullByDefault`, `@DefaultQualifier(NonNull.class)`; a `module-info.java` declaring `@NullMarked`; every type in it `@NullMarked`; or a build that runs NullAway with the package in `AnnotatedPackages`, or the Checker Framework's `NullnessChecker`. Elsewhere every reference admits null and no checker warns on the dereference that throws a `NullPointerException`.
X7 · Silent fallback defaults · Silent fallback default on parse failure · ×1
  • Silent fallback default on parse failure core/src/main/java/org/opensearch/sql/expression/function/jsonUDF/ForeachJsonArrayFunctionImpl.java:81 — `eval` returns `List.of()` when `JsonSyntaxException` 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 or in the Javadoc, and the row stops firing.
X7 · Silent fallback defaults · Silent fallback default in catch · ×1
  • Silent fallback default in catch core/src/main/java/org/opensearch/sql/job/QueryJob.java:310 — `sampleRunnerProgress` swallows every exception into `return 0D` — 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.
Minor — 30 finding(s)
D10 · Test Quality · Skipped (documented) · ×29
  • Skipped (documented): datasourceWithBasicAuth async-query/src/test/java/org/opensearch/sql/spark/asyncquery/AsyncQueryExecutorServiceImplSpecTest.java:267 — Skipped with a documented reason — a deferral, not lazy debt: switched off by @Ignore
  • Skipped (documented): subBaseTypeShouldBeCompatibleWithParentBaseType legacy/src/test/java/org/opensearch/sql/legacy/antlr/semantic/types/BaseTypeTest.java:74 — Skipped with a documented reason — a deferral, not lazy debt: switched off by @Ignore
  • Skipped (documented): useAggregateFunctionInWhereClauseShouldFail legacy/src/test/java/org/opensearch/sql/legacy/antlr/semantic/SemanticAnalyzerAggregateFunctionTest.java:16 — Skipped with a documented reason — a deferral, not lazy debt: switched off by @Ignore
  • Skipped (documented): duplicateFieldNameFromDifferentIndexShouldFail legacy/src/test/java/org/opensearch/sql/legacy/antlr/semantic/SemanticAnalyzerFromClauseTest.java:133 — Skipped with a documented reason — a deferral, not lazy debt: switched off by @Ignore
  • Skipped (documented): duplicateIndexNameAliasInFromClauseShouldFail legacy/src/test/java/org/opensearch/sql/legacy/antlr/semantic/SemanticAnalyzerFromClauseTest.java:125 — Skipped with a documented reason — a deferral, not lazy debt: switched off by @Ignore
  • Skipped (documented): nonExistingIndexNameShouldFail legacy/src/test/java/org/opensearch/sql/legacy/antlr/semantic/SemanticAnalyzerFromClauseTest.java:20 — Skipped with a documented reason — a deferral, not lazy debt: switched off by @Ignore
  • Skipped (documented): duplicateFieldAliasInSelectClauseShouldFail legacy/src/test/java/org/opensearch/sql/legacy/antlr/semantic/SemanticAnalyzerIdentifierTest.java:16 — Skipped with a documented reason — a deferral, not lazy debt: switched off by @Ignore
  • Skipped (documented): useFieldNameWithSpaceShouldPass legacy/src/test/java/org/opensearch/sql/legacy/antlr/semantic/SemanticAnalyzerIdentifierTest.java:37 — Skipped with a documented reason — a deferral, not lazy debt: switched off by @Ignore
  • Skipped (documented): unionSelectFieldWithExtraStarOfTwoQueriesShouldFail legacy/src/test/java/org/opensearch/sql/legacy/antlr/semantic/SemanticAnalyzerMultiQueryTest.java:85 — Skipped with a documented reason — a deferral, not lazy debt: switched off by @Ignore
  • Skipped (documented): logFunctionCallWithMoreNestedFunctionCallWithOneNumberShouldPass legacy/src/test/java/org/opensearch/sql/legacy/antlr/semantic/SemanticAnalyzerScalarFunctionTest.java:103 — Skipped with a documented reason — a deferral, not lazy debt: switched off by @Ignore
  • Skipped (documented): logFunctionCallWithResultOfAbsFunctionCallWithOneNumberShouldPass legacy/src/test/java/org/opensearch/sql/legacy/antlr/semantic/SemanticAnalyzerScalarFunctionTest.java:95 — Skipped with a documented reason — a deferral, not lazy debt: switched off by @Ignore
  • Skipped (documented): logFunctionCallWithResultOfSubstringFunctionCallShouldFail legacy/src/test/java/org/opensearch/sql/legacy/antlr/semantic/SemanticAnalyzerScalarFunctionTest.java:130 — Skipped with a documented reason — a deferral, not lazy debt: switched off by @Ignore
  • Skipped (documented): substringFunctionCallWithResultOfAnotherSubstringAndAbsFunctionCallShouldPass legacy/src/test/java/org/opensearch/sql/legacy/antlr/semantic/SemanticAnalyzerScalarFunctionTest.java:111 — Skipped with a documented reason — a deferral, not lazy debt: switched off by @Ignore
  • Skipped (documented): substringFunctionCallWithResultOfMathFunctionCallShouldFail legacy/src/test/java/org/opensearch/sql/legacy/antlr/semantic/SemanticAnalyzerScalarFunctionTest.java:119 — Skipped with a documented reason — a deferral, not lazy debt: switched off by @Ignore
  • Skipped (documented): substringWithLogFunctionCallWithUnknownFieldShouldPass legacy/src/test/java/org/opensearch/sql/legacy/antlr/semantic/SemanticAnalyzerScalarFunctionTest.java:84 — Skipped with a documented reason — a deferral, not lazy debt: switched off by @Ignore
  • Skipped (documented): failingQueryWithHavingTest2 legacy/src/test/java/org/opensearch/sql/legacy/unittest/parser/SqlParserTest.java:151 — Skipped with a documented reason — a deferral, not lazy debt: switched off by @Ignore
  • Skipped (documented): groupByWithAndAlias legacy/src/test/java/org/opensearch/sql/legacy/unittest/DateFormatTest.java:135 — Skipped with a documented reason — a deferral, not lazy debt: switched off by @Ignore
  • Skipped (documented): singleConditionWithHavingTwoAggExpr legacy/src/test/java/org/opensearch/sql/legacy/unittest/HavingTest.java:81 — Skipped with a documented reason — a deferral, not lazy debt: switched off by @Ignore
  • Skipped (documented): singleConditionWithTwoAggExpr legacy/src/test/java/org/opensearch/sql/legacy/unittest/HavingTest.java:64 — Skipped with a documented reason — a deferral, not lazy debt: switched off by @Ignore
  • Skipped (documented): aggregationQuery legacy/src/test/java/org/opensearch/sql/legacy/unittest/JSONRequestTest.java:351 — Skipped with a documented reason — a deferral, not lazy debt: switched off by @Ignore
  • Skipped (documented): testGenerateSqlRequest_fromUrlParams legacy/src/test/java/org/opensearch/sql/legacy/unittest/SqlRequestFactoryTest.java:47 — Skipped with a documented reason — a deferral, not lazy debt: switched off by @Ignore
  • Skipped (documented): testSearchWithoutTimestampShouldThrow ppl/src/test/java/org/opensearch/sql/ppl/calcite/CalcitePPLSearchTest.java:59 — Skipped with a documented reason — a deferral, not lazy debt: switched off by @Ignore
  • Skipped (documented): test_function_call_fsp ppl/src/test/java/org/opensearch/sql/ppl/parser/AstNowLikeFunctionTest.java:104 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a JUnit assumption
  • Skipped (documented): test_shortcut_eval ppl/src/test/java/org/opensearch/sql/ppl/parser/AstNowLikeFunctionTest.java:83 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a JUnit assumption
  • Skipped (documented): test_shortcut_where ppl/src/test/java/org/opensearch/sql/ppl/parser/AstNowLikeFunctionTest.java:96 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a JUnit assumption
  • + 4 more in this group — see findings.md.
D5 · Coupling · Off the main sequence · ×1
  • Off the main sequence: :common — :common: abstractness 0.14, instability 0.00, distance 0.86 — the shape a shared-kernel / building-block library has BY DESIGN — concrete and widely depended-on is what makes it useful, and this dimension does not penalise it (the distance is reported for completeness, not as a defect). Worth a look only if it has grown past one coherent kernel into an everything-bucket.

Appendix B — Reproduction & audit trail

Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.

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-098e7c4596dd4b5b88c7fcfe9589522e/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-098e7c4596dd4b5b88c7fcfe9589522e/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=2261" --report-format json --report-path /tmp/watchdog-gitleaks-098e7c4596dd4b5b88c7fcfe9589522e/history-2.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-2.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-098e7c4596dd4b5b88c7fcfe9589522e/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 .20artifacts/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 .0artifacts/raw/osv-scanner.json
D31 · IaC & Container Securitytrivy—trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.0—
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 6 file(s) — `core/src/main/java/org/opensearch/sql/calcite/CalciteRelNodeVisitor.java`, `core/src/main/java/org/opensearch/sql/calcite/MapPathPreMaterializer.java`, `core/src/main/java/org/opensearch/sql/calcite/utils/datetime/DateTimeConversionUtils.java`, `core/src/main/java/org/opensearch/sql/executor/QueryService.java`, `plugin/src/main/java/org/opensearch/sql/plugin/transport/TransportPPLQueryAction.java`, … (+1 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.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 01a1eb3b-2041-72aa-bfba-808868ab4876 · 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