Public report — presto, published 6 Aug 2026. Concrete security findings (CVE IDs, secret matches, dependency versions) are hidden in this version; ask the repo owner for the full report.
Watchdog 06-08-2026 @ 14:57 UTC Public
Code Health Audit

Prestodb/presto

43% Weak
CriticalWeakAdequateStrongExemplary
upper third — near Adequate

Very large · 904,521 LoC · rebuild ~10.7 person-years · weakest lens: Accessibility (32%)

Grounded in facts. Every number here is computed, not narrated — reproducible, tool-backed, and traceable to a line of code. How to trust this ▸

41/43dimensions tool-verifieddeterministic · confidence 1.0 · 2 LLM-assisted, advisory
1811findings with an exact file:lineof 1834 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
43/106dimensions across the health lenses904521 LoC — wide & deep

Executive summary

Read through the Production lens — the standard calibration. *Green* means good enough to run in production. The score is absolute and comparable across repos.

prestodb/presto carries serious gaps (43%). Several issues below can materially affect correctness, security, or the cost of changing it — and propagate to everything that depends on it.

It is strongest in Architecture (99%) — the structure is clean and changes stay contained.

The area that most needs attention is Accessibility (32%) — it raises ongoing delivery and operational cost. Readiness (44%) is the next concern — releases are harder to depend on — versioning, release notes and dependency hygiene are thin, so consumers can't easily tell what changed or trust an upgrade.

Leadership focus, highest impact first: text alternative — alt on images (alt="" for purely decorative… (Text alternatives); Make custom controls keyboard-operable (role + tabindex + key handler) (Keyboard semantics); accessibility in the toolchain (A11y enforcement).

For scale: Very large (~904,521 production lines); rebuilding it from scratch would take roughly ~10.7 person-years (~6–21 engineers). Approximate, ±~30%.

It builds on a genuinely strong Architecture foundation (99%); the priorities above are the highest-leverage way to bring the rest up to that level.

How the score is built — each lens's share of the headline Width is the lens's weight in the worst-heaviest fold (the weakest area pulls hardest); colour is that lens's own band. A lens fixes the score in proportion to its width.
Accessibility 32% · 46% weightReadiness 44% · 25% weightCode Health 55% · 14% weightSecurity 57% · 8% weightMaturity 70% · 4% weightArchitecture 99% · 2% weight

Raise Accessibility 32 → 70 (the Healthy floor) ⇒ headline 43 → ~53.

Code composition — where the lines go
Tests 100%
New since the last scan (20+)

20 finding(s) are new versus the previous scan (2026-08-02) — surfaced by this scheduled scan itself, no pull request required.

  • D1 · TaskContext.getTaskStats (cyclomatic 17) presto-main-base/src/main/java/com/facebook/presto/operator/TaskContext.java
  • D4 · Duplicated block (5 lines × 2) presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/ExpressionAnalyzer.java
  • D15 · Hotspot: presto-cassandra/src/main/java/com/facebook/presto/cassandra/CassandraType.java presto-cassandra/src/main/java/com/facebook/presto/cassandra/CassandraType.java
  • D31 · Medium IaC: CKV_DOCKER_9 presto-native-execution/scripts/dockerfiles/ubuntu-22.04-dependency.dockerfile
  • D31 · Medium IaC: CKV_DOCKER_3 presto-native-execution/scripts/dockerfiles/ubuntu-22.04-dependency.dockerfile
  • D31 · Medium IaC: CKV_DOCKER_3 presto-native-execution/scripts/dockerfiles/centos-dependency.dockerfile
  • D31 · Medium IaC: CKV_DOCKER_3 docker/Dockerfile
  • D31 · Medium IaC: CKV_DOCKER_3 presto-native-execution/scripts/dockerfiles/prestissimo-runtime.dockerfile
  • D35 · Boundary-crossing change coupling: Metadata.java ↔ ClassLoaderSafeConnectorMetadata.java presto-main-base/src/main/java/com/facebook/presto/metadata/Metadata.java
  • D35 · Boundary-crossing change coupling: Metadata.java ↔ ConnectorMetadata.java presto-main-base/src/main/java/com/facebook/presto/metadata/Metadata.java
  • D35 · Boundary-crossing change coupling: QueryInfo.java ↔ QueryCompletedEvent.java presto-main-base/src/main/java/com/facebook/presto/execution/QueryInfo.java
  • D35 · Boundary-crossing change coupling: QueryStateMachine.java ↔ QueryCompletedEvent.java presto-main-base/src/main/java/com/facebook/presto/execution/QueryStateMachine.java
  • D35 · Boundary-crossing change coupling: PrestoSparkQueryExecutionFactory.java ↔ QueryCompletedEvent.java presto-spark-base/src/main/java/com/facebook/presto/spark/PrestoSparkQueryExecutionFactory.java
  • D35 · Boundary-crossing change coupling: PrestoSparkServiceFactory.java ↔ PrestoSparkLauncherCommand.java presto-spark-base/src/main/java/com/facebook/presto/spark/PrestoSparkServiceFactory.java
  • D38 · High CVE: [GHSA redacted] presto-ui/src/yarn.lock
  • D38 · High CVE: [GHSA redacted] presto-ui/src/yarn.lock
  • D38 · High CVE: [GHSA redacted] presto-ui/src/yarn.lock
  • R10 · Duplicated block (15 lines × 6 locations) presto-ui/src/components/ClusterHUD.jsx
  • R10 · Duplicated block (15 lines × 2 locations) presto-ui/src/components/PageTitle.tsx
  • AC3 · Data table has no header cells presto-ui/src/components/ResourceGroupView.jsx

A full-fidelity diff against the previous run's complete recorded findings — line-move tolerant: a finding that only shifted line counts as unchanged, only genuinely new titles/files surface here.

Rebuild cost & value ~ Modeled — €520,000–€2,600,000
Cost to rebuild€520,000–€2,600,000 (5.1–16.3 person-years (8,652–27,447 h), ~6–21 engineers)
Domain complexityStandard — harder problems cost more per line
Quality factor0.7× (at 43% quality) — the last 20% of quality is most of the work
Size & shapeVery large · effort split not classified (source measured from disk; the effort-tier breakdown is a C#-only syntax walk)

This codebase represents roughly ~10.7 person-years of build effort (about ~€1,600,000 to rebuild). Its weakest lens is Accessibility at 32% — the part of that asset most exposed by the findings below.

How we model this: boilerplate at a scaffolding rate + logic × domain Standard (×1.2) — CQRS × a 0.7× quality factor, at €60–95/h; indicative, ±~30% · size measured directly from source · effort from total production LoC as straight-line logic (the tier split is a C#-only syntax walk), a conservative lower bound. Indicative only — most sensitive to the hourly rate and the domain tier (both tunable in config).

Top priorities

The highest-leverage moves; the full ranked list is in the Roadmap below.

1
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
+10.8 pts · Medium effort · Text alternatives
2
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
+10.8 pts · Medium effort · Keyboard semantics
3
Enforce accessibility in the toolchain: add eslint-plugin-jsx-a11y, then assert with jest-axe in tests, then gate axe/pa11y/Lighthouse in CI.
+10.5 pts · Medium effort · A11y enforcement

Diagnosis — what's actually going on

Value concentrated against a weak lens · High · Value at risk
This is a Very large asset (~10.7 person-years to rebuild), and its weakest lens is Accessibility at 32%. The operational and business risk on an asset this size concentrates there — that's where remediation buys the most protection.
Evidence: valuation: Very large, ~10.7 person-years rebuild (904,521 LoC) · weakest lens: Accessibility 32%
→ Direct remediation budget at Accessibility first — highest risk-reduction per euro on an asset this size.
The top fix pays for itself · High · Economics
The top-ranked fix costs roughly 3–10 engineer-days once. Not doing it costs about 23.5–140.7 engineer-days every year, paid as drag on the ~369,595 lines this team changes annually — a bill that arrives whether or not anyone books it. On those figures the fix breaks even in roughly 1–5 months and is free after that. Method, stated so this is not read as a quotation: debt from the ranked task's effort band; interest = annual changed lines (measured, annualised from the 90-day window) ÷ an ASSUMED 150–400 lines per engineer-day × the 3–6% drag implied by the code-quality signals; breaking point = debt ÷ annual interest. A modelled planning range built from measured inputs and one named assumption — not a quotation, a valuation, or a certified figure.
Evidence: D15 churn: 91,133 line(s) changed over a 90-day window ⇒ ~369,595/year · D1/D2/D4 code quality: averaging 7.0/10 ⇒ a 3–6% drag on each change · top-ranked remediation: Medium effort ⇒ about 3–10 engineer-day(s)
→ Do the top-ranked fix now if this code will still be yours in 5 months.
Highest-leverage move · Medium · Leverage
Of everything flagged, the best return on effort is: Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video. The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
A velocity tax on every change · Medium · Economics
The code-quality signals (complexity, duplication, cohesion) average 7.0/10, which acts as a tax on every change in the weaker areas: modifications there plausibly cost on the order of 3–6% more than in clean code, and the tax compounds as the codebase grows. (A modelled estimate, not a measured fact.)
Evidence: D1/D2/D4 code quality: averaging 7.0/10 across the code-quality signals actually measured
→ Pay it down where churn is highest — the hotspots — not everywhere; that's where the tax is actually paid.

Architecture — module dependency matrix

507 modules, 2944 dependencies — 25 dependency cycles, shown as the red cell(s) above the diagonal. Rows and columns are the same modules, ordered so that a module only depends on ones above it. A cell means the row depends on the column, and its number is how many type pairs create that dependency. Read one thing: is anything above the diagonal? A mark there is a dependency cycle. (A cycle is all this shows — an unusual but cycle-free dependency sits below the diagonal like any other.)

(global)…k.presto.spi.schedule…resto.spi.transaction…ok.presto.common.type…resto.common.function…k.presto.common.block…acebook.presto.common…esto.common.predicate…k.presto.spi.function…k.presto.spi.security…ok.presto.spi.session…k.presto.spi.relation…presto.spi.statistics…ebook.presto.sql.tree…ebook.presto.spi.plan…cebook.presto.sql.gen…ook.presto.sql.parser….operator.aggregation….presto.spi.connector…m.facebook.presto.spi…presto.hive.metastore…planner.optimizations….facebook.presto.util….facebook.presto.hive…ebook.presto.operator…cebook.presto.iceberg…ok.presto.sql.planner…k.presto.sql.analyzer…book.presto.connector…acebook.presto.server…ebook.presto.metadata…o.execution.scheduler…book.presto.execution….facebook.presto.costcom.facebook.presto….spark.execution.task…cebook.presto.testing…resto.spark.execution…facebook.presto.tests…facebook.presto.spark(global)1…k.presto.spi.schedule2…resto.spi.transaction3…ok.presto.common.type4…resto.common.function5…k.presto.common.block6…acebook.presto.common7…esto.common.predicate8…k.presto.spi.function9…k.presto.spi.security10…ok.presto.spi.session11…k.presto.spi.relation12…presto.spi.statistics13…ebook.presto.sql.tree14…ebook.presto.spi.plan15…cebook.presto.sql.gen16…ook.presto.sql.parser17….operator.aggregation18….presto.spi.connector19…m.facebook.presto.spi20…presto.hive.metastore21…planner.optimizations22….facebook.presto.util23….facebook.presto.hive24…ebook.presto.operator25…cebook.presto.iceberg26…ok.presto.sql.planner27…k.presto.sql.analyzer28…book.presto.connector29…acebook.presto.server30…ebook.presto.metadata31…o.execution.scheduler32…book.presto.execution33….facebook.presto.cost34com.facebook.presto35….spark.execution.task36…cebook.presto.testing37…resto.spark.execution38…facebook.presto.tests39…facebook.presto.spark404311027213713279129513216912114192411271221331613323852832232267438422312422495611111127356112013211313515111415349133178181121417104535179128337189420471321121411416288211075835717681228313271331361953276141741874444414861773401981204485361167544428037833382119142194274811822205561653918313679302759419981641716997351222643810932413223131033394913515111214122214115222151235654322251511632811110159128357103195813136114118929132112212415261113749817152185771103212917422342561174209533821302529711141213134735318109612292212052236214137232245164311223151461531541113641120132111316994461312116127113431555321495413113168216121431323223163533434183831+467 more modules (most-connected shown)

At a glance — Code Health · 55% · Adequate · gated by R1, R3

At a glance — Architecture · 99% · Exemplary

At a glance — Maturity · 70% · Adequate

At a glance — Readiness · 44% · Weak · gated by R4

At a glance — Security · 57% · Adequate · gated by D29, D36

At a glance — Accessibility · 32% · Weak · gated by AC1, AC4

Security & Compliance — OWASP Top-10 mapping

Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).

OWASP categoryFindingsSeverity
A03:2021 — Injection50High / Critical
A05:2021 — Security Misconfiguration11High / Critical
A06:2021 — Vulnerable & Outdated Components11High / Critical
A02:2021 — Cryptographic Failures3High / Critical

Roadmap

Begin by adding text alternatives for all images, media, and video content to ensure screen reader compatibility. Next, make all custom controls keyboard-operable and ensure all interactive elements have proper semantic roles and valid links. Then, implement automated accessibility enforcement using eslint-plugin-jsx-a11y and jest-axe, and integrate these checks into the CI pipeline. Finally, improve page structure by adding language attributes, titles, and landmarks, while ensuring all form controls have programmatic labels.

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

Do thisHelpsEffortDimension
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.+10.8 ptsMediumText alternatives
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.+10.8 ptsMediumKeyboard semantics
Enforce accessibility in the toolchain: add eslint-plugin-jsx-a11y, then assert with jest-axe in tests, then gate axe/pa11y/Lighthouse in CI.+10.5 ptsMediumA11y enforcement
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.+10.3 ptsMediumPage structure
Resolve the 1 Leaked secret finding(s) in Secret Scanning — start with sqlserver.properties.+5.1 ptsLowSecret Scanning
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.+9.9 ptsMediumForms & labels
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.+8.5 ptsMediumVisual & motion safety
Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).+5.3 ptsMediumDR & Backup

File quality

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

FileScoreBandWorst signal
presto-ui/src/yarn.lock0.6SlopOSV Dependency Vulnerabilities: High CVE: [GHSA redacted]
presto-native-execution/scripts/dockerfiles/ubuntu-22.04-dependency.dockerfile4.1MixedIaC & Container Security: High IaC: DS-0002
.github/workflows/presto-release-publish.yml4.4MixedStatic Analysis (SAST): High: github-actions-mutable-action-tag
docker/Dockerfile4.4MixedIaC & Container Security: High IaC: DS-0002
.github/workflows/owasp-dependency-check.yml4.6MixedStatic Analysis (SAST): High: github-actions-mutable-action-tag
.github/workflows/owasp-nvd-cache.yml4.8MixedStatic Analysis (SAST): High: github-actions-mutable-action-tag
.github/workflows/presto-release-prepare.yml4.8MixedStatic Analysis (SAST): High: github-actions-mutable-action-tag
.github/workflows/codenotify.yml5.1MixedStatic Analysis (SAST): High: github-actions-mutable-action-tag
presto-native-execution/scripts/dockerfiles/prestissimo-runtime.dockerfile5.1MixedIaC & Container Security: High IaC: DS-0002
presto-main-base/src/main/java/com/facebook/presto/metadata/MetadataManager.java5.2MixedChange Coupling: Boundary-crossing change coupling: MetadataManager.java ↔ ClassLoaderSafeConnectorMetadata.java
presto-spark-base/src/main/java/com/facebook/presto/spark/PrestoSparkQueryExecutionFactory.java5.4MixedChange Coupling: Boundary-crossing change coupling: PrestoSparkQueryExecutionFactory.java ↔ QueryCompletedEvent.java
presto-main-base/src/main/java/com/facebook/presto/execution/QueryStateMachine.java5.8MixedChange Coupling: Boundary-crossing change coupling: QueryStateMachine.java ↔ QueryCompletedEvent.java
.github/workflows/dependency-review.yml5.8MixedStatic Analysis (SAST): High: github-actions-mutable-action-tag
.github/workflows/docs.yml5.8MixedStatic Analysis (SAST): High: github-actions-mutable-action-tag
.github/workflows/kudu.yml5.8MixedStatic Analysis (SAST): High: github-actions-mutable-action-tag
.github/workflows/maven-checks.yml5.8MixedStatic Analysis (SAST): High: github-actions-mutable-action-tag
presto-main-base/src/main/java/com/facebook/presto/execution/QueryInfo.java6.5MixedChange Coupling: Boundary-crossing change coupling: QueryInfo.java ↔ QueryCompletedEvent.java
presto-spark-base/src/main/java/com/facebook/presto/spark/PrestoSparkServiceFactory.java6.5MixedChange Coupling: Boundary-crossing change coupling: PrestoSparkServiceFactory.java ↔ PrestoSparkDistribution.java
presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/ExpressionAnalyzer.java7.0MixedCyclomatic Complexity: Visitor.visitFunctionCall (cyclomatic 57)
presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/PredicatePushDown.java7.0MixedCyclomatic Complexity: Rewriter.visitJoin (cyclomatic 33)

Methodology & how to trust this report

Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 41 of 43 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 2 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.6 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.

Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.

What we checked — 43 dimensions across the health lenses
D1D2D3D4D13D15D16D19D21D28D29D31D33D34D35D36D38AC1AC2AC3AC4AC5AC6AC7AX5M1M2M3M4P1P3P4P5P6R1R10R2R3R4R6R7R8R9

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, 1811 of 1834 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, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — 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
jscpdCode duplication✓ deterministic
Coverage (coverlet / dotnet-coverage)Line & branch coverage10.0.302✓ deterministic
NuGet / dotnetOutdated, vulnerable & deprecated dependencies10.0.302✓ deterministic
git / LibGit2SharpChurn hotspots, knowledge concentration, history2.43.0 · 0.31.0✓ deterministic
gitleaks · semgrep · trivy · checkovSecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3 · 3.2.533✓ deterministic
LLM (sampled · advisory)Documentation quality, ADR conformance, naming — sampled over a bounded sample; advisory, never a deterministic measurementLocal LLM◐ LLM · sampled · advisory

Every finding is locatable in findings.md. Run 019fd794-409e-7446-b8e7-9f6cdcbb934e.

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.

  • D30 Dependency Vulnerabilities — scanner not present in this environment — The backing tool was not installed where this scan ran, so this dimension was not scored. Install the tool (or run in the hosted environment, where it is always present) for a graded result.

Repo exclusion declarations: 16 pattern(s) declared (.gitattributes linguist-generated/vendored, .editorconfig generated_code) excluded 0 source file(s) from code-quality scoring. Declarations are the repo's own visible statement that a tree is machine-written or vendored — auditable in any diff, honored by GitHub the same way.

Limitations & what we did not check

Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.

Per-dimension blind spots

For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity (jscpd) — 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.
  • 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").
  • 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.
  • D19 Documentation Quality: Documentation quality is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement.
  • D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
  • 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").
  • D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
  • D33 JS/npm Dependency Vulnerabilities: JS/npm CVE matching reads package manifests and lockfiles — risk from how a dependency is used, and advisories not yet published, fall outside this scan.
  • 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.
  • AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
  • AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A clean result is "no unlabelled native control found", not a labelling proof.
  • AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
  • AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
  • AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them.
  • AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
  • AC7 A11y enforcement: Enforcement is scored from in-repo config/CI evidence only — an a11y gate enforced in external tooling with no in-repo trace can't be credited, and a configured linter is presence, not proof the rules actually run or block a merge.
  • M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

The LLM boundary

LLM-set scores this run (3): D19, D21, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score (documentation, ADR quality, naming, comment value, onboarding) — D25 sets the ADR-conformance fraction over sampled code, D22 judges API accuracy over a sample. These are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.

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: DocumentedVerifiedPrevented · effective 6.2 / 10 · rule-coverage 100% · ceiling Prevented

251 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was TypeCoercer.coerceTypeBase at 82. A further 39 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 StandardReadMappings.jdbcTypeToPrestoType at 35 — they are counted neither in the figure above nor in this dimension's score.

BooleanInputStream.getSetBits (cyclomatic 19) · ×2presto-orc/src/main/java/com/facebook/presto/orc/stream/BooleanInputStream.java:217
TypeCoercer.coerceTypeBase (cyclomatic 82)presto-main-base/src/main/java/com/facebook/presto/type/TypeCoercer.java:131
Visitor.visitSpecialForm (cyclomatic 74)presto-main-base/src/main/java/com/facebook/presto/sql/planner/RowExpressionInterpreter.java:341
CastBytecodeExpression.castPrimitiveToPrimitive (cyclomatic 60)presto-bytecode/src/main/java/com/facebook/presto/bytecode/expression/CastBytecodeExpression.java:105
BlockInputDecoders.createForPrimitive (cyclomatic 60)presto-hive-function-namespace/src/main/java/com/facebook/presto/hive/functions/type/BlockInputDecoders.java:115

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

What to do

  1. Resolve the 2 BooleanInputStream.getSetBits (cyclomatic 19) finding(s) in Cyclomatic Complexity — start with BooleanInputStream.java (2). — One of this dimension's main actionable groups (2 warning-level).
  2. Resolve the 1 TypeCoercer.coerceTypeBase (cyclomatic 82) finding(s) in Cyclomatic Complexity — start with TypeCoercer.java. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 Visitor.visitSpecialForm (cyclomatic 74) finding(s) in Cyclomatic Complexity — start with RowExpressionInterpreter.java. — One of this dimension's main actionable groups (1 warning-level).
  4. Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D2 · Cognitive Complexity5.0 / 10Weak✓ 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: DocumentedVerifiedPrevented · effective 5.0 / 10 · rule-coverage 100% · ceiling Prevented

602 method(s) exceeded the cognitive complexity threshold of 15; the worst was 1.getValue at 270.

ArrayPositionWithIndexFunction.arrayPositionWithIndex (cognitive 17) · ×5presto-main-base/src/main/java/com/facebook/presto/operator/scalar/ArrayPositionWithIndexFunction.java:42
QueryBuilder.toPredicate (cognitive 30) · ×2presto-base-jdbc/src/main/java/com/facebook/presto/plugin/jdbc/QueryBuilder.java:250
LongInputStreamV1.next (cognitive 20) · ×2presto-orc/src/main/java/com/facebook/presto/orc/stream/LongInputStreamV1.java:120
ExactTypeSignature.equals (cognitive 17) · ×2presto-main-base/src/main/java/com/facebook/presto/metadata/BuiltInTypeAndFunctionNamespaceManager.java:1447
1.getValue (cognitive 270)presto-tests/src/main/java/com/facebook/presto/tests/H2QueryRunner.java:248

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

What to do

  1. Resolve the 5 ArrayPositionWithIndexFunction.arrayPositionWithIndex (cognitive 17) finding(s) in Cognitive Complexity — start with ArrayPositionWithIndexFunction.java (5). — One of this dimension's main actionable groups (5 warning-level).
  2. Resolve the 2 QueryBuilder.toPredicate (cognitive 30) finding(s) in Cognitive Complexity — start with QueryBuilder.java (2). — One of this dimension's main actionable groups (2 warning-level).
  3. Resolve the 2 LongInputStreamV1.next (cognitive 20) finding(s) in Cognitive Complexity — start with LongInputStreamV1.java (2). — One of this dimension's main actionable groups (2 warning-level).
  4. Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D3 · God Classes8.4 / 10Strong✓ Tool-verified

What it measures: Over-large classes that try to do too much ("god classes").

Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.

Maturity: DocumentedVerifiedPrevented · effective 8.4 / 10 · rule-coverage 100% · ceiling Prevented

376 god class(es) detected.

TooManyMethods: FeaturesConfig · ×243presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/FeaturesConfig.java:73
FileTooLong: analyzer/StatementAnalyzer.java · ×133presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java:0

What to do

  1. Resolve the 243 TooManyMethods finding(s) in God Classes — start with ExpressionAnalyzer.java (2), AccessControlManager.java (2), AllowAllAccessControl.java (2). — One of this dimension's main actionable groups (243 warning-level).
  2. Resolve the 133 FileTooLong finding(s) in God Classes — start with AccumulatorCompiler.java (2), StatementAnalyzer.java, SystemSessionProperties.java. — One of this dimension's main actionable groups (133 warning-level).
  3. Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D4 · Code Duplication9.8 / 10Exemplary✓ Tool-verified

What it measures: Copy-pasted code that should be shared instead.

Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.

Maturity: DocumentedVerifiedPrevented · effective 9.8 / 10 · rule-coverage 100% · ceiling Verified

427 duplicated block group(s) detected.

Duplicated block (6 lines × 2) · ×64presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/ExpressionAnalyzer.java:271
Duplicated block (8 lines × 2) · ×51presto-accumulo/src/main/java/com/facebook/presto/accumulo/serializers/LexicoderRowSerializer.java:110
Duplicated block (7 lines × 2) · ×48presto-accumulo/src/main/java/com/facebook/presto/accumulo/iterators/MaxByteArrayCombiner.java:35
Duplicated block (9 lines × 2) · ×43presto-accumulo/src/main/java/com/facebook/presto/accumulo/AccumuloMetadata.java:398
Duplicated block (10 lines × 2) · ×42presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/ExpressionAnalyzer.java:677

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

✓ On the Gold path — maintain.

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

D13 · Secret Scanning5.0 / 10Adequate✓ Tool-verified

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: DocumentedVerifiedPrevented · effective 5.0 / 10 · rule-coverage 100% · ceiling Prevented

1 secret(s) detected.

Leaked secret: hardcoded-credentialpresto-main/etc/catalog/sqlserver.properties:4

What to do

  1. Resolve the 1 Leaked secret finding(s) in Secret Scanning — start with sqlserver.properties. — One of this dimension's main actionable groups (1 issue-level).
  2. Enforce Secret Scanning in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D15 · Churn × Complexity Hotspots9.9 / 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: DocumentedVerifiedPrevented · effective 9.9 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java (12×28=336); presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergAbstractMetadata.java (11×19=209); presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergUtil.java (11×19=209)

Hotspot: presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java · ×10presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java

✓ On the Gold path — maintain.

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

D16 · Bus Factor9.6 / 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: DocumentedVerifiedPrevented · effective 9.6 / 10 · rule-coverage 100% · ceiling Documented

105 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/materializedview/DifferentialPlanRewriter.java.

Off-boarding risk: anonymized user #1 · ×12
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.

D19 · Documentation Quality / 10Strong◐ Sampled · advisory

What it measures: Whether the project's documentation is clear, complete, and useful.

Method: Judged by language model at low temperature (0.0-0.1) on a deterministic doc sample (READMEs plus first 25 architecture docs), with two-pass stability filtering. Advisory, sampled.

Maturity: DocumentedVerifiedPrevented · effective Strong / 10 · rule-coverage 100% · ceiling Documented

Clear and comprehensive documentation for Presto covering installation (Presto docs, Presto Verifier tool), a detailed Thrift Connector guide, SQL helpers modules, the router service with IDE run configuration, Docker-based product tests, native tests, and an in-depth Velox C++ worker implementation. The README files are well-organized and each document body is clipped mid-sentence by the scanner; no section is omitted from the outline despite truncation. The documentation is comprehensive and well-structured for a large project: three README files (one building docs, one Presto Benchto benchmarks, one functional testing with containers) plus architecture/design markdowns cover the breadth of topics. The main strengths are clear prerequisites/installation steps (venv, LaTeX on Mac/Ubuntu), manual/maven/build commands, and detailed test-setup guides for both Java and C++ development via containers, plus a dedicated Presto UI test guide that is clipped only mid-table-of-contents section and is otherwise complete.

The dev-container setup notes the Smart Builder thread count option but does not explain what happens when tests are skipped.presto-native-execution/.devcontainer/README.md

What to do

  1. Resolve the 1 The dev-container setup notes the Smart Builder thread count option but… finding(s) in Documentation Quality — start with README.md. — One of this dimension's main actionable groups (1 recommendation-level).

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

D21 · Naming Consistency / 10Exemplary◐ Sampled · advisory

What it measures: Whether names — types, methods, variables — are clear and consistent.

Method: Judged by language model at low temperature (0.0-0.1) on a deterministic random symbol sample (fixed size, not exhaustive), with disclosed confidence band. Advisory, sampled.

Maturity: DocumentedVerifiedPrevented · effective Exemplary / 10 · rule-coverage 100% · ceiling Verified

0 naming inconsistencies across 0 sampled symbols.

✓ On the Gold path — maintain.

Detailed fixes: d21_recommendation.md.

D28 · Secrets (history)9.0 / 10Exemplary✓ Tool-verified

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

Method: Git-history secret scan via gitleaks detect over full history in an isolated checkout; each match flagged High. Exhaustive; degrades cleanly when tool absent.

Maturity: DocumentedVerifiedPrevented · effective 9.0 / 10 · rule-coverage 100% · ceiling Documented

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

Secret: generic-api-keypresto-docs/src/main/sphinx/connector/larksheets.rst:106detected by gitleaks finding
Rotate the exposed credentials — git history can't be un-committed

✓ On the Gold path — maintain.

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

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

What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.

Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.

Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).

Maturity: DocumentedVerifiedPrevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

99 finding(s): 0 critical, 55 high, 38 medium, 6 low.

High: github-actions-mutable-action-tag · ×50.github/workflows/codenotify.yml:17detected by semgrep finding

What to do

  1. Resolve the 50 High finding(s) in Static Analysis (SAST) — start with presto-release-publish.yml (22), owasp-dependency-check.yml (5), owasp-nvd-cache.yml (4). — One of this dimension's main actionable groups (50 issue-level).

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

D31 · IaC & Container Security8.4 / 10Strong✓ Tool-verified

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

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

Maturity: DocumentedVerifiedPrevented · effective 8.4 / 10 · rule-coverage 100% · ceiling Documented

11 finding(s): 0 critical, 3 high, 5 medium, 3 low.

High IaC: DS-0002 · ×3docker/Dockerfiledetected by trivy finding
Medium IaC: CKV_DOCKER_9 · ×5presto-native-execution/scripts/dockerfiles/ubuntu-22.04-dependency.dockerfile:45detected by trivy finding
Low IaC: DS-0002 · ×3.devcontainer/Dockerfiledetected by trivy finding

What to do

  1. Resolve the 3 High IaC finding(s) in IaC & Container Security — start with Dockerfile, prestissimo-runtime.dockerfile, ubuntu-22.04-dependency.dockerfile. — One of this dimension's main actionable groups (3 issue-level).
  2. Resolve the 5 Medium IaC finding(s) in IaC & Container Security — start with ubuntu-22.04-dependency.dockerfile (2), centos-dependency.dockerfile, Dockerfile. — One of this dimension's main actionable groups (5 warning-level).
  3. Resolve the 3 Low IaC finding(s) in IaC & Container Security — start with Dockerfile (3). — One of this dimension's main actionable groups (3 recommendation-level).

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

D33 · JS/npm Dependency Vulnerabilities10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether JavaScript/npm dependencies have known published vulnerabilities (CVEs) — the npm ecosystem's biggest risk.

Method: JS/npm CVE scan via trivy fs --scanners vuln over JS manifests (package.json/yarn.lock/pnpm-lock/bun.lockb); 0-10 tight normalizer. NotApplicable without JS manifests. Exhaustive, deterministic.

Maturity: DocumentedVerifiedPrevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

No known-vulnerable JS/npm dependencies.

✓ On the Gold path — maintain.

Detailed fixes: d33_recommendation.md.

D34 · Knowledge Freshness6.1 / 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: DocumentedVerifiedPrevented · effective 6.1 / 10 · rule-coverage 100% · ceiling Documented

1161 of 2992 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is presto-ui/src/components/QueryOverview.tsx.

Orphaned knowledge · ×60presto-ui/src/components/QueryOverview.tsx
Further orphaned files (smaller)

What to do

  1. Resolve the 60 Orphaned knowledge finding(s) in Knowledge Freshness — start with QueryOverview.tsx, PrestoS3FileSystem.java, UnscaledDecimal128Arithmetic.java. — One of this dimension's main actionable groups (60 issue-level).
  2. 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 Coupling9.8 / 10Exemplary✓ Tool-verified

What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.

Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.

Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling; coupling through a build step, config, or non-source file isn't seen.

Maturity: DocumentedVerifiedPrevented · effective 9.8 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: PrestoSparkServiceFactory.java↔PrestoSparkDistribution.java 100%; DataDefinitionExecution.java↔SqlQueryExecution.java 100%; MetadataManager.java↔ClassLoaderSafeConnectorMetadata.java 97%

Boundary-crossing change coupling: PrestoSparkServiceFactory.java ↔ PrestoSparkDistribution.java · ×10presto-spark-base/src/main/java/com/facebook/presto/spark/PrestoSparkServiceFactory.java

✓ On the Gold path — maintain.

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

D36 · Supply-chain Provenance & Signing2.5 / 10Weak✓ Tool-verified

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

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

Maturity: DocumentedVerifiedPrevented · effective 2.5 / 10 · rule-coverage 100% · ceiling Documented

1/4 supply-chain integrity signals present (provenance, signing, SBOM, pinned actions).

Unpinned build actions
Secret passed as a command-line argument
No build provenance
No SBOM

What to do

  1. Resolve the 1 Unpinned build actions finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 Secret passed as a command-line argument finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 No build provenance finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).

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

D38 · OSV Dependency Vulnerabilities4.6 / 10Weak✓ Tool-verified

What it measures: Whether dependencies have known published vulnerabilities (CVEs) per the OSV database — read natively from whatever lockfile the repository ships (Cargo, npm, Go, Python, Maven, RubyGems, …). D33 and D30 add ecosystem-specific scanners on top for npm and .NET.

Method: Multi-ecosystem dependency-CVE scan via osv-scanner --recursive (queries the osv.dev database + parses lockfiles natively across ecosystems: npm package-lock/yarn/pnpm/bun, Go go.mod, Rust Cargo.lock, Maven/Gradle pom.xml/gradle.lockfile, PyPI requirements.txt/poetry.lock/Pipfile.lock, Composer composer.lock, RubyGems Gemfile.lock, Hex mix.lock, pub pubspec.lock, Swift Package.resolved); severity tally (Critical/High/Medium/Low) to 0-10 tight normalizer (8.0). NotApplicable only when the repo declares no supported non-.NET dependency lockfile (a NuGet-only repo stays NotApplicable — .NET CVEs are D30's domain); coverage needs a resolved lockfile. Additive to D33 (trivy fs); exhaustive + deterministic, DB kept fresh.

Maturity: DocumentedVerifiedPrevented · effective 4.6 / 10 · rule-coverage 100% · ceiling Documented

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

High CVE: [GHSA redacted] · ×8presto-ui/src/yarn.lockdetected by osv-scanner finding
Medium CVE: [GHSA redacted] · ×2presto-ui/src/yarn.lockdetected by osv-scanner finding
Low CVE: [GHSA redacted]presto-ui/src/yarn.lockdetected by osv-scanner finding

What to do

  1. Resolve the 8 High CVE finding(s) in OSV Dependency Vulnerabilities — start with yarn.lock (8). — One of this dimension's main actionable groups (8 issue-level).
  2. Resolve the 2 Medium CVE finding(s) in OSV Dependency Vulnerabilities — start with yarn.lock (2). — One of this dimension's main actionable groups (2 warning-level).
  3. Resolve the 1 Low CVE finding(s) in OSV Dependency Vulnerabilities — start with yarn.lock. — One of this dimension's main actionable groups (1 recommendation-level).

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

Frontend & cross-cutting dimensions

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

AC1 · Text alternatives1.0 / 10Critical✓ Tool-verified

Other · Accessibility — Whether non-text content carries a text alternative — img/area/input[type=image] have alt, a meaningful svg has a title or aria-label, video has a captions track, and object/embed/canvas have a name or fallback content. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: every img/area/input[type=image] checked for alt, svg[role=img] for a title/aria-label, video for a captions <track>. Components skipped, spreads suppressed. Deterministic, hard fact per element.

  • An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative. (×2) — PageTitle.tsx:160, PageTitle.tsx:87

What to do

  • Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
AC2 · Forms & labels5.5 / 10Adequate✓ Tool-verified

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

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

  • This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label. (×3) — QueryList.jsx:876, SessionProps.jsx:74, QueryList.jsx:749
  • This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. — QueryViewer.jsx:30
  • This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. (×5) — presto-connector.html:305, presto-connector.html:308, presto-connector.html:311, …

What to do

  • Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
AC3 · Page structure4.4 / 10Weak✓ Tool-verified

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

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

  • A <table> with data cells but no <th> gives assistive technology no way to associate cells with their headers. Mark the header row/column cells as <th> (with a scope). (×25) — PageTitle.tsx:155, QueryDetail.jsx:609, QueryDetail.jsx:842, …

What to do

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

Other · Accessibility — Whether interactive behaviour is keyboard-reachable — no click handler on a non-interactive element lacking a role, tabindex and key handler, no positive tabindex, no href-less anchor, no placeholder-href (#/javascript) link acting as a button. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: click handlers on non-interactive elements lacking role+tabindex+key handler, positive tabindex values, and href-less anchors. Components skipped, spreads suppressed. Deterministic, hard fact per element.

  • An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action. (×15) — QueryDetail.jsx:453, QueryDetail.jsx:829, QueryDetail.jsx:1318, …
  • An <a href="#"> (or javascript:) with a click handler is a button dressed as a link — it announces the wrong role and stops working without JS. Use a <button> for an action. (×10) — QueryDetail.jsx:593, QueryList.jsx:675, QueryList.jsx:696, …

What to do

  • Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
AC5 · ARIA correctness10.0 / 10Exemplary○ Nothing flagged

Other · Accessibility — Whether ARIA is used correctly — valid non-abstract roles, the ARIA state a role requires, valid (non-misspelled) aria-* attribute names, in-enum values for token-typed aria-* attributes, and no aria-hidden on (or wrapping) a focusable element. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: role values checked against the WAI-ARIA role set (abstract/invalid flagged), required ARIA state for a role, and aria-hidden on a focusable element. Deterministic, role/attribute level.

AC6 · Visual & motion safety7.5 / 10Strong✓ Tool-verified

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

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

  • `.dropdown-menu > li > a:hover` sets color: #fff on background-color: #d7d4d4 — 1.5:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — presto.css:210

What to do

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

Other · Accessibility — Whether accessibility is ENFORCED in the toolchain — an accessibility checker configured over the markup (an a11y lint rule set, e.g. eslint-plugin-jsx-a11y or vuejs-accessibility where the project lints JavaScript) and an automated accessibility assertion wired into tests or CI (axe/pa11y/Lighthouse or an equivalent) — on the Documented→Verified→Prevented ladder.

Method: Repo config/CI scan: an accessibility checker configured over the markup (an a11y lint rule set such as eslint-plugin-jsx-a11y / vuejs-accessibility where JavaScript is linted) and an automated accessibility assertion in tests or CI (axe/pa11y/Lighthouse or equivalent), graded on the Documented→Verified→Prevented rungs. Deterministic, presence/rung detection.

  • No accessibility enforcement found — no a11y linter (eslint-plugin-jsx-a11y) and no axe/pa11y/Lighthouse in tests or CI. Start with the linter to catch issues at author time.

What to do

  • Enforce accessibility in the toolchain: add eslint-plugin-jsx-a11y, then assert with jest-axe in tests, then gate axe/pa11y/Lighthouse in CI.
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.

M1 · Documentation (README)7.6 / 10Strong✓ Tool-verified

Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.

Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.

What to do

  • Add a 'Testing' section to the root README — how to run the test suite.
  • Add a README to the 108 of 125 project(s) that lack one — worth up to 1.7 pts.
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 `NNNN-title.md` documents 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 significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree with `NNNN-title.md` names is the most discoverable form).
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

Maturity · Maturity — Whether the repo is organised deliberately — src/test separation and consistent project naming.

Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.

M4 · Documentation accuracy7.0 / 10Strong◐ Sampled · advisory

Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).

Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.

  • README omits the Presto native and Velox subprojects

What to do

  • Reconcile the README with reality: README omits the Presto native and Velox subprojects.
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.

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.

What to do

  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback7.0 / 10Strong✓ 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.

  • Deployment is orchestrated by compose, but no service declares a `healthcheck:` and nothing pins a previous image to fall back to — the runtime can tell that the container is up, not that it is serving, so a bad release is harder to detect and reverse.

What to do

  • Add a `healthcheck:` to the served compose service — probing the endpoint it already answers on where it has one — with `depends_on: condition: service_healthy` on whatever waits for it, and keep the deployed image tag immutable and recorded so rolling back is re-pointing at the previous tag rather than rebuilding.
P5 · DR & Backup4.0 / 10Weak✓ Tool-verified

Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.

Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.

What to do

  • Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).
  • No persistence guard on critical data stores — use Docker named volumes (or your orchestrator's persistent-volume equivalent) so the data store can't be wiped by a container recreate (or, in cloud, set purge-protection / soft-delete / prevent_destroy).
P6 · Release Hygiene5.0 / 10Adequate✓ Tool-verified

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

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

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

What to do

  • Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
R1 · Type Safety3.9 / 10Weak✓ Tool-verified

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

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

  • 22 typed · 35 plain JS — the untyped files are presto-ui/src/components/ClusterHUD.jsx, presto-ui/src/components/ClusterOverview.jsx, presto-ui/src/components/Plan.jsx, presto-ui/src/components/Query.jsx, presto-ui/src/components/QueryDetail.jsx, presto-ui/src/components/QueryHeader.jsx (+29 more).

What to do

  • Migrate the remaining .js/.jsx files to TypeScript.
R10 · Code Duplication6.4 / 10Adequate✓ Tool-verified

React / JS · Code Health — Copy-pasted token-identical blocks across the frontend (the D4 clone algorithm over JS/TS tokens, D-386).

Method: Copy-pasted token-identical blocks across the frontend (the D4 clone algorithm run over JS/TS tokens). Deterministic.

  • presto-ui/src/components/QueryDetail.jsx:266 · presto-ui/src/components/QueryOverview.tsx:440 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — QueryDetail.jsx:266
  • presto-ui/src/components/QueryHeader.jsx:56 · presto-ui/src/components/StaticQueryHeader.jsx:82 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — QueryHeader.jsx:56
  • presto-ui/src/components/ClusterHUD.jsx:15 · presto-ui/src/router/ClusterHUD.jsx:15 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — ClusterHUD.jsx:15
  • presto-ui/src/components/QueryDetail.jsx:113 · presto-ui/src/components/QueryOverview.tsx:288 — the 2 copies are spread across 2 files, and what repeats is a LIST OF ENTRIES rather than behaviour — the same names written out more than once. Extract them into one shared, exported constant and spread that constant into each site, rather than into a function the sites call: a list like this often lives in declarative metadata (a decorator's options object, a static configuration table) that a build step must be able to read statically, where a function call is not allowed. Adding an entry to one copy and not the other is the failure this prevents. — QueryDetail.jsx:113
  • presto-ui/src/components/ClusterHUD.jsx:76 · presto-ui/src/router/ClusterHUD.jsx:76 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — ClusterHUD.jsx:76
  • presto-ui/src/components/LivePlan.tsx:236 · presto-ui/src/components/QueryPlanView.tsx:64 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — LivePlan.tsx:236
  • presto-ui/src/components/ClusterHUD.jsx:210 · presto-ui/src/components/ClusterHUD.jsx:276 · presto-ui/src/components/ClusterHUD.jsx:344 · presto-ui/src/router/ClusterHUD.jsx:216 · +2 more site(s) not listed — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — ClusterHUD.jsx:210
  • presto-ui/src/components/PageTitle.tsx:167 · presto-ui/src/router/PageTitle.tsx:92 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — PageTitle.tsx:167

What to do

  • Extract the duplicated blocks into shared functions/components.
R2 · Cyclomatic Complexity9.9 / 10Exemplary✓ Tool-verified

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

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

  • Branch-heavy code is where defects cluster — extract decisions into smaller functions. (×8) — QueryList.jsx:121, QueryStageView.jsx:370, StageDetail.jsx:312, …

What to do

  • Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
R3 · Large Files2.9 / 10Weak✓ Tool-verified

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

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

  • 8 file(s) over 400 lines (counted as significant lines — blank lines excluded — over production source only, tests excluded), largest first: presto-ui/src/components/QueryDetail.jsx (1725), presto-ui/src/components/QueryOverview.tsx (1640), presto-ui/src/components/QueryList.jsx (911), presto-ui/src/router/QueryList.jsx (799), presto-ui/src/components/StageDetail.jsx (602), presto-ui/src/components/QueryStageView.jsx (516) (+2 more).

What to do

  • Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
R4 · Test Coverage0.9 / 10Critical✓ Tool-verified

React / JS · Readiness — Static test reachability (D-386): the share of production files reachable from any test via the import graph — measured without running anything.

Method: Static test reachability: the share of production files reachable from any test via the import graph — measured without running anything. Deterministic.

  • No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×8) — QueryDetail.jsx, QueryOverview.tsx, QueryList.jsx, …

What to do

  • Add tests that import the unreached modules (directly or through their public entry).
R6 · Tooling10.0 / 10Exemplary✓ Tool-verified

React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each package.json script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.

Method: package.json scanned for test/lint/typecheck script wiring. Deterministic presence check.

R7 · Dead Code9.9 / 10Exemplary✓ Tool-verified

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

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

  • Nothing imports this binding — it is safe to review for removal. — utils.ts:195
R8 · Dependency Hygiene7.0 / 10Strong✓ Tool-verified

React / JS · Readiness — npm dependency truthfulness (D-386): unused dependencies, imports not declared anywhere, and type-/test-only packages shipped as production deps.

Method: npm dependency truthfulness: unused dependencies, imports declared nowhere, and type-/test-only packages shipped as production deps — from the manifest + import graph. Deterministic.

  • Imported but not declared in any reachable package.json — installs work only by hoisting accident. — eslint.config.mjs:1
  • Declared in presto-ui/src/package.json but never imported anywhere in that package or its workspace members — dead weight and attack surface. Verify against build tooling before removing. (×2)

What to do

  • Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
R9 · Circular Imports10.0 / 10Exemplary✓ Tool-verified

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

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

WCAG coverage — what static analysis assessed

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

DimensionWCAG 2.2 A/AA criteriaCoverage
AC1 · Text alternatives1.1.1, 1.2.2, 1.2.5Partial signal
AC2 · Forms & labels1.3.1, 3.3.2, 4.1.2Partial signal
AC3 · Page structure1.4.4, 2.2.1, 2.4.1, 2.4.2, 3.1.1, 4.1.2Partial signal
AC4 · Keyboard semantics2.1.1, 2.4.3Partial signal
AC5 · ARIA correctness4.1.2Partial signal
AC6 · Visual & motion safety1.4.3, 2.4.7Partial — literal CSS only
AC7 · A11y enforcementenforcement — no page criterionEnforcement posture (process)

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

Reference — by lens

The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.

LensScoreRatingImpact
Code Health55%Adequate — gated by R1, R3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture99%ExemplaryStrongest area.
Maturity70%AdequateAcceptable, with room to improve.
Readiness44%Weak — gated by R4Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security57%Adequate — gated by D29, D36Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Accessibility32%Weak — gated by AC1, AC4Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Not included — 63 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.

  • AX1 Captive dependencies — no DI registrations detected
  • AX10 Code composition — not assessed — code composition is computed by ROLE over a document set that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX2 Stateful singletons — no singleton implementations detected
  • AX3 Project dependency cycles — not assessed — project cycles and dependency direction are computed over a project-reference graph that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX4 Dependency direction — not applicable to a CQRS architecture (the inward-dependency rule is for layered/clean styles)
  • AX6 Interface segregation — not assessed — interface segregation is computed over a type surface that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — not assessed — test isolation is computed from a project graph (which projects are test projects, and what they reference) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • 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.
  • 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.
  • D10 Test Quality — ~591589 lines of test source are present (.java, .ts, .tsx, .jsx) but the test-quality collector reads C# only, so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • D11 Test Reliability — Test reliability not included
  • D12 Dependency Hygiene — Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
  • D14 License Compliance — Not scored — this repository's package manifest is not parsed for licence data yet. A gap in the analyzer's language coverage, NOT a finding that the repository's licenses are compliant (a Maven POM and a Python pyproject.toml/requirements.txt (pip/uv/Poetry)), which this pass does not parse yet — so this dimension asserts nothing about this repository's licensing in either direction.
  • D17 Explicit Debt — explicit-debt markers are read through a C# workspace today, so they were not read for this repository's language — this asserts nothing about how many markers the code carries. Not scored — this is a gap in the analyzer, not a finding about this repository
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D20 ADR Quality — N/A — ADRs are expected on deployable products with a user-facing host, not consumed libraries; no ADR log is required here.
  • D22 Internal API Consistency — No exposed public API
  • D23 Boundary Type-Coupling — Production source is present (.java, .py, .ts, .tsx) but bounded contexts are resolved over the C#/VB project set, which exposed none, so context scope could not be assessed. Not scored — this is a gap in the analyzer, not a verdict about this repository. Declaring the codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed — see the recommendation on this dimension for where. 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 — No inline comments to assess — comment value is not applicable here.
  • D25 ADR Conformance — no ADRs to check
  • D26 Project Cohesion — Project cohesion is assessed over the .NET project set; this target exposed no projects, so project size and spread could not be assessed. Not scored — this is a gap in the analyzer's reach, not a verdict about this repository.
  • D27 Navigability — No calls could be sampled, so navigability was not assessed — tracing effort is measured over resolved call sites and this target exposed none. Not scored — this is a gap in the analyzer's reach, not a verdict about this repository.
  • D30 Dependency Vulnerabilities — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Maven POM and a Python pyproject.toml/requirements.txt (pip/uv/Poetry) — not scanned yet) — where an OSV-supported manifest exists, dependency vulnerabilities for this repository are reported under D38 instead.
  • D32 Data Compliance (PII/GDPR) — No PII/GDPR-handling patterns detected (p/gdpr ruleset) — no data-compliance surface to assess.
  • D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
  • D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D5 Coupling — Inter-project coupling could not be assessed — no analyzable project graph was found for this repository. Not scored: a gap in the analyzer's reach, not a verdict about this repository. (Coupling here is Martin afferent/efferent/instability plus reference cycles across a project-reference graph, read today from .NET project files; other ecosystems' module graphs are not read yet.)
  • D6 Cohesion (LCOM4) — Cohesion (LCOM4) is measured over a C#/VB class graph, and this repository's production source is .java, .py, .ts, .tsx, which this pass does not read — so no class could be assessed. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • D8 Code Coverage — Coverage not included — suite not readable by the collector
  • D9 Test Distribution — Test source is present (.java, .ts, .tsx, .jsx) but the test-pyramid classifier reads C# only, so its unit/integration/BDD/E2E split couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • DM1 Domain Modelling — applicable but not scored (2 of 3 signals for this style — below the bar we score at): 2095 value object(s); 5 domain event(s)
  • ED1 Event-Driven — not scored — this repository shows only 1 of the 3 signals this check looks for (12 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 check looks for
  • GD1 Unfinished & placeholder code — no source files
  • IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • P2 Observability — Observability was not assessed: this check reads a source model that does not carry this repository's product — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of a logging idiom this check recognises is NOT evidence that this repo lacks structured logging (it may log through its own ecosystem's logger). This is a gap in the analyzer, not a finding about this repository.
  • P7 Outbound HTTP resilience — not measured — the application kind could not be determined for this repo
  • P8 Schema migrations — not assessed — schema-migration practice is read from a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (JaCoCo XML — `mvn jacoco:report`) into the repo working tree before the scan — a CI step is the usual place, since the artefact is commonly gitignored, or wire coverage collection into CI, to enable this cross-layer check
  • PF1 Benchmark discipline — Performance was not assessed: this lens reads a source model that was not loaded for this repository, because the repository is written in a language this lens does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository — in particular it is NOT a statement that this repo is unpackaged or performance-careless.
  • PF2 Allocation hygiene — Performance was not assessed: this lens reads a source model that was not loaded for this repository, because the repository is written in a language this lens does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository — in particular it is NOT a statement that this repo is unpackaged or performance-careless.
  • PF3 Async & latency hygiene — Performance was not assessed: this lens reads a source model that was not loaded for this repository, because the repository is written in a language this lens does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository — in particular it is NOT a statement that this repo is unpackaged or performance-careless.
  • R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
  • R5 Dependency Freshness — uses a yarn lockfile — dependency freshness not measured here; JS/npm CVEs are scored in D33 (JS/npm Dependency Vulnerabilities)
  • 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.
  • SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X1 Async correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X2 Cancellation propagation — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X3 Exception handling — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X4 Structured logging — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository

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.

Issue — 133 finding(s)
D34 · Knowledge Freshness · Orphaned knowledge · ×60
  • Orphaned knowledge presto-ui/src/components/QueryOverview.tsx — 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 presto-hive/src/main/java/com/facebook/presto/hive/s3/PrestoS3FileSystem.java — 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 presto-common/src/main/java/com/facebook/presto/common/type/UnscaledDecimal128Arithmetic.java — 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 presto-orc/src/main/java/com/facebook/presto/orc/OrcWriteValidation.java — 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 presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java — 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 presto-orc/src/main/java/com/facebook/presto/orc/stream/LongOutputStreamV2.java — 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 presto-hive-function-namespace/src/main/java/com/facebook/presto/hive/functions/gen/AccumulatorCompiler.java — 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 presto-hive/src/main/java/com/facebook/presto/hive/statistics/MetastoreHiveStatisticsProvider.java — 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 presto-accumulo/src/main/java/com/facebook/presto/accumulo/AccumuloClient.java — 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 presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/GroupInnerJoinsByConnectorRuleSet.java — 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 presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoDatabaseMetaData.java — 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 presto-expressions/src/main/java/com/facebook/presto/expressions/LogicalRowExpressions.java — 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 presto-common/src/main/java/com/facebook/presto/common/type/TypeSignature.java — 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 presto-main/src/main/java/com/facebook/presto/memory/ClusterMemoryManager.java — 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 presto-pinot-toolkit/src/main/java/com/facebook/presto/pinot/query/PinotQueryGenerator.java — 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 presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoPreparedStatement.java — 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 presto-pinot-toolkit/src/main/java/com/facebook/presto/pinot/query/PinotFilterExpressionConverter.java — 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 presto-orc/src/main/java/com/facebook/presto/orc/metadata/OrcMetadataReader.java — 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 presto-kudu/src/main/java/com/facebook/presto/kudu/properties/KuduTableProperties.java — 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 presto-orc/src/main/java/com/facebook/presto/orc/DictionaryCompressionOptimizer.java — 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 presto-orc/src/main/java/com/facebook/presto/orc/writer/MapFlatColumnWriter.java — 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 presto-common/src/main/java/com/facebook/presto/common/block/DictionaryBlock.java — 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 presto-rcfile/src/main/java/com/facebook/presto/rcfile/RcFileReader.java — 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 presto-bytecode/src/main/java/com/facebook/presto/bytecode/BytecodeBlock.java — 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 presto-pinot-toolkit/src/main/java/com/facebook/presto/pinot/query/PinotQueryGeneratorContext.java — 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.
  • + 35 more in this group — see findings.md.
D29 · Static Analysis (SAST) · High · ×50
  • High: github-actions-mutable-action-tag .github/workflows/codenotify.yml:17 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v6`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v6 --jq .sha`.
  • High: pull-request-target-code-checkout .github/workflows/codenotify.yml:17 — This GitHub Actions workflow file uses `pull_request_target` and checks out code from the incoming pull request. When using `pull_request_target`, the Action runs in the context of the target repository, which includes access to all repository secrets. Normally, this is safe because the Action only runs code from the target repository, not the incoming PR. However, by checking out the incoming PR code, you're now using the incoming code for the rest of the action. You may be inadvertently executing arbitrary code from the incoming PR with access to repository secrets, which would let an attacker steal repository secrets. This normally happens by running build scripts (e.g., `npm build` and `make`) or dependency installation scripts (e.g., `python setup.py install`). Audit your workflow file to make sure no code from the incoming PR is executed. Please see https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ for additional mitigations.
  • High: github-actions-mutable-action-tag .github/workflows/codenotify.yml:26 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/labeler@<40-character SHA>`. This step references `actions/labeler@v4.3.0`; resolve the SHA it points at today with `gh api repos/actions/labeler/commits/v4.3.0 --jq .sha`. Note that `v4.3.0` is an exact release tag rather than a floating major: it is still mutable (a tag can be repointed), but by convention it moves only on a force-push, so pin the floating-major and branch references in this file first.
  • High: github-actions-mutable-action-tag .github/workflows/dependency-review.yml:13 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v6`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v6 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/dependency-review.yml:18 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/dependency-review-action@<40-character SHA>`. This step references `actions/dependency-review-action@v4`; resolve the SHA it points at today with `gh api repos/actions/dependency-review-action/commits/v4 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/docs.yml:37 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v6`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v6 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/docs.yml:45 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/setup-java@<40-character SHA>`. This step references `actions/setup-java@v5`; resolve the SHA it points at today with `gh api repos/actions/setup-java/commits/v5 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/kudu.yml:49 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v6`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v6 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/kudu.yml:54 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/setup-java@<40-character SHA>`. This step references `actions/setup-java@v5`; resolve the SHA it points at today with `gh api repos/actions/setup-java/commits/v5 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/maven-checks.yml:36 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v6`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v6 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/maven-checks.yml:40 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/setup-java@<40-character SHA>`. This step references `actions/setup-java@v5`; resolve the SHA it points at today with `gh api repos/actions/setup-java/commits/v5 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/owasp-dependency-check.yml:46 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v6`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v6 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/owasp-dependency-check.yml:67 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v6`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v6 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/owasp-dependency-check.yml:75 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/setup-java@<40-character SHA>`. This step references `actions/setup-java@v5`; resolve the SHA it points at today with `gh api repos/actions/setup-java/commits/v5 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/owasp-dependency-check.yml:84 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/cache/restore@<40-character SHA>`. This step references `actions/cache/restore@v4`; resolve the SHA it points at today with `gh api repos/actions/cache/commits/v4 --jq .sha`. `actions/cache/restore` is hosted INSIDE the `actions/cache` repository (a subdirectory action or a reusable workflow), so the SHA to pin is that repository's commit — keep the full `actions/cache/restore` path in `uses:` and query only `actions/cache`.
  • High: github-actions-mutable-action-tag .github/workflows/owasp-dependency-check.yml:183 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/upload-artifact@<40-character SHA>`. This step references `actions/upload-artifact@v4`; resolve the SHA it points at today with `gh api repos/actions/upload-artifact/commits/v4 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/owasp-nvd-cache.yml:20 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v4`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v4 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/owasp-nvd-cache.yml:25 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/setup-java@<40-character SHA>`. This step references `actions/setup-java@v4`; resolve the SHA it points at today with `gh api repos/actions/setup-java/commits/v4 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/owasp-nvd-cache.yml:33 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/cache/restore@<40-character SHA>`. This step references `actions/cache/restore@v4`; resolve the SHA it points at today with `gh api repos/actions/cache/commits/v4 --jq .sha`. `actions/cache/restore` is hosted INSIDE the `actions/cache` repository (a subdirectory action or a reusable workflow), so the SHA to pin is that repository's commit — keep the full `actions/cache/restore` path in `uses:` and query only `actions/cache`.
  • High: github-actions-mutable-action-tag .github/workflows/owasp-nvd-cache.yml:63 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/cache/save@<40-character SHA>`. This step references `actions/cache/save@v4`; resolve the SHA it points at today with `gh api repos/actions/cache/commits/v4 --jq .sha`. `actions/cache/save` is hosted INSIDE the `actions/cache` repository (a subdirectory action or a reusable workflow), so the SHA to pin is that repository's commit — keep the full `actions/cache/save` path in `uses:` and query only `actions/cache`.
  • High: github-actions-mutable-action-tag .github/workflows/presto-release-prepare.yml:35 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v6`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v6 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/presto-release-prepare.yml:55 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/setup-java@<40-character SHA>`. This step references `actions/setup-java@v5`; resolve the SHA it points at today with `gh api repos/actions/setup-java/commits/v5 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/presto-release-prepare.yml:193 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v6`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v6 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/presto-release-prepare.yml:201 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/setup-java@<40-character SHA>`. This step references `actions/setup-java@v5`; resolve the SHA it points at today with `gh api repos/actions/setup-java/commits/v5 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/presto-release-publish.yml:81 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v6`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v6 --jq .sha`.
  • + 25 more in this group — see findings.md.
D35 · Change Coupling · Boundary-crossing change coupling · ×10
  • Boundary-crossing change coupling: PrestoSparkServiceFactory.java ↔ PrestoSparkDistribution.java presto-spark-base/src/main/java/com/facebook/presto/spark/PrestoSparkServiceFactory.java — `presto-spark-base/src/main/java/com/facebook/presto/spark/PrestoSparkServiceFactory.java` (context presto-spark-base) and `presto-spark-launcher/src/main/java/com/facebook/presto/spark/launcher/PrestoSparkDistribution.java` (context presto-spark-launcher) sit in DIFFERENT parts of the tree yet change together 100% of the time (11 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) — 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.
  • Boundary-crossing change coupling: MetadataManager.java ↔ ClassLoaderSafeConnectorMetadata.java presto-main-base/src/main/java/com/facebook/presto/metadata/MetadataManager.java — `presto-main-base/src/main/java/com/facebook/presto/metadata/MetadataManager.java` (context presto-main-base) and `presto-spi/src/main/java/com/facebook/presto/spi/connector/classloader/ClassLoaderSafeConnectorMetadata.java` (context presto-spi) sit in DIFFERENT parts of the tree yet change together 97% of the time (34 of the 35 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) — 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.
  • Boundary-crossing change coupling: Metadata.java ↔ ClassLoaderSafeConnectorMetadata.java presto-main-base/src/main/java/com/facebook/presto/metadata/Metadata.java — `presto-main-base/src/main/java/com/facebook/presto/metadata/Metadata.java` (context presto-main-base) and `presto-spi/src/main/java/com/facebook/presto/spi/connector/classloader/ClassLoaderSafeConnectorMetadata.java` (context presto-spi) sit in DIFFERENT parts of the tree yet change together 86% of the time (30 of the 35 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) — 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.
  • Boundary-crossing change coupling: Metadata.java ↔ ConnectorMetadata.java presto-main-base/src/main/java/com/facebook/presto/metadata/Metadata.java — `presto-main-base/src/main/java/com/facebook/presto/metadata/Metadata.java` (context presto-main-base) and `presto-spi/src/main/java/com/facebook/presto/spi/connector/ConnectorMetadata.java` (context presto-spi) sit in DIFFERENT parts of the tree yet change together 81% of the time (30 of the 37 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) — 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.
  • Boundary-crossing change coupling: SqlFunctionProperties.java ↔ SystemSessionProperties.java presto-common/src/main/java/com/facebook/presto/common/function/SqlFunctionProperties.java — `presto-common/src/main/java/com/facebook/presto/common/function/SqlFunctionProperties.java` (context presto-common) and `presto-main-base/src/main/java/com/facebook/presto/SystemSessionProperties.java` (context presto-main-base) sit in DIFFERENT parts of the tree yet change together 76% of the time (13 of the 17 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) — 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.
  • Boundary-crossing change coupling: PrestoSparkServiceFactory.java ↔ PrestoSparkRunner.java presto-spark-base/src/main/java/com/facebook/presto/spark/PrestoSparkServiceFactory.java — `presto-spark-base/src/main/java/com/facebook/presto/spark/PrestoSparkServiceFactory.java` (context presto-spark-base) and `presto-spark-launcher/src/main/java/com/facebook/presto/spark/launcher/PrestoSparkRunner.java` (context presto-spark-launcher) sit in DIFFERENT parts of the tree yet change together 76% of the time (16 of the 21 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) — 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.
  • Boundary-crossing change coupling: QueryInfo.java ↔ QueryCompletedEvent.java presto-main-base/src/main/java/com/facebook/presto/execution/QueryInfo.java — `presto-main-base/src/main/java/com/facebook/presto/execution/QueryInfo.java` (context presto-main-base) and `presto-spi/src/main/java/com/facebook/presto/spi/eventlistener/QueryCompletedEvent.java` (context presto-spi) sit in DIFFERENT parts of the tree yet change together 73% of the time (11 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) — 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.
  • Boundary-crossing change coupling: QueryStateMachine.java ↔ QueryCompletedEvent.java presto-main-base/src/main/java/com/facebook/presto/execution/QueryStateMachine.java — `presto-main-base/src/main/java/com/facebook/presto/execution/QueryStateMachine.java` (context presto-main-base) and `presto-spi/src/main/java/com/facebook/presto/spi/eventlistener/QueryCompletedEvent.java` (context presto-spi) sit in DIFFERENT parts of the tree yet change together 73% of the time (11 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) — 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.
  • Boundary-crossing change coupling: PrestoSparkQueryExecutionFactory.java ↔ QueryCompletedEvent.java presto-spark-base/src/main/java/com/facebook/presto/spark/PrestoSparkQueryExecutionFactory.java — `presto-spark-base/src/main/java/com/facebook/presto/spark/PrestoSparkQueryExecutionFactory.java` (context presto-spark-base) and `presto-spi/src/main/java/com/facebook/presto/spi/eventlistener/QueryCompletedEvent.java` (context presto-spi) sit in DIFFERENT parts of the tree yet change together 73% of the time (11 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) — 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.
  • Boundary-crossing change coupling: PrestoSparkServiceFactory.java ↔ PrestoSparkLauncherCommand.java presto-spark-base/src/main/java/com/facebook/presto/spark/PrestoSparkServiceFactory.java — `presto-spark-base/src/main/java/com/facebook/presto/spark/PrestoSparkServiceFactory.java` (context presto-spark-base) and `presto-spark-launcher/src/main/java/com/facebook/presto/spark/launcher/PrestoSparkLauncherCommand.java` (context presto-spark-launcher) sit in DIFFERENT parts of the tree yet change together 71% of the time (15 of the 21 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) — 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.
D38 · OSV Dependency Vulnerabilities · High CVE · ×8
  • High CVE: [GHSA redacted] presto-ui/src/yarn.lock — brace-expansion 1.1.12: [GHSA redacted] — brace-expansion is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (or pin brace-expansion to 1.1.16 with a `resolutions` entry). This is 1 of 4 advisories with a published fix this scan raises against brace-expansion 1.1.12, and their fixed versions do not agree — anything below 1.1.18 still leaves at least one of them open. Take this package to 1.1.18 or later: that is the floor for the package, not this row's target alone. This one row stands for the 4 advisories this scan raises against brace-expansion 1.1.12: [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted].
  • High CVE: [GHSA redacted] presto-ui/src/yarn.lock — brace-expansion 2.0.2: [GHSA redacted] — brace-expansion is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (or pin brace-expansion to 2.1.2 with a `resolutions` entry). This is 1 of 4 advisories with a published fix this scan raises against brace-expansion 2.0.2, and their fixed versions do not agree — anything below 2.1.4 still leaves at least one of them open. Take this package to 2.1.4 or later: that is the floor for the package, not this row's target alone. This one row stands for the 4 advisories this scan raises against brace-expansion 2.0.2: [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted].
  • High CVE: [GHSA redacted] presto-ui/src/yarn.lock — fast-uri 3.1.4: [GHSA redacted] — upgrade to 3.1.5
  • High CVE: [GHSA redacted] presto-ui/src/yarn.lock — js-yaml 3.14.2: [GHSA redacted] — js-yaml is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (or pin js-yaml to 3.15.0 with a `resolutions` entry). This one row stands for the 2 advisories this scan raises against js-yaml 3.14.2: [GHSA redacted], [GHSA redacted].
  • High CVE: [GHSA redacted] presto-ui/src/yarn.lock — js-yaml 4.1.0: [GHSA redacted] — js-yaml is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (or pin js-yaml to 4.3.0 with a `resolutions` entry). This is 1 of 3 advisories with a published fix this scan raises against js-yaml 4.1.0, and their fixed versions do not agree — anything below 4.3.0 still leaves at least one of them open. Take this package to 4.3.0 or later: that is the floor for the package, not this row's target alone. This one row stands for the 3 advisories this scan raises against js-yaml 4.1.0: [GHSA redacted], [GHSA redacted], [GHSA redacted].
  • High CVE: [GHSA redacted] presto-ui/src/yarn.lock — minimatch 3.1.2: [GHSA redacted] — minimatch is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (or pin minimatch to 3.1.4 with a `resolutions` entry). This is 1 of 3 advisories with a published fix this scan raises against minimatch 3.1.2, and their fixed versions do not agree — anything below 3.1.4 still leaves at least one of them open. Take this package to 3.1.4 or later: that is the floor for the package, not this row's target alone. This one row stands for the 3 advisories this scan raises against minimatch 3.1.2: [GHSA redacted], [GHSA redacted], [GHSA redacted].
  • High CVE: [GHSA redacted] presto-ui/src/yarn.lock — minimatch 9.0.5: [GHSA redacted] — minimatch is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (or pin minimatch to 9.0.7 with a `resolutions` entry). This is 1 of 3 advisories with a published fix this scan raises against minimatch 9.0.5, and their fixed versions do not agree — anything below 9.0.7 still leaves at least one of them open. Take this package to 9.0.7 or later: that is the floor for the package, not this row's target alone. This one row stands for the 3 advisories this scan raises against minimatch 9.0.5: [GHSA redacted], [GHSA redacted], [GHSA redacted].
  • High CVE: [GHSA redacted] presto-ui/src/yarn.lock — picomatch 4.0.3: [GHSA redacted] — picomatch is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (or pin picomatch to 4.0.4 with a `resolutions` entry). This one row stands for the 2 advisories this scan raises against picomatch 4.0.3: [GHSA redacted], [GHSA redacted].
D31 · IaC & Container Security · High IaC · ×3
  • High IaC: DS-0002 docker/Dockerfile — Image user should not be 'root' A container that starts as root runs your process with root's capabilities inside the namespace, so a compromise of the process starts from there. The step: create an unprivileged account in the image (`RUN useradd -r -M app`), give it ownership of the paths the process writes at runtime (`COPY --chown=` on those layers, or a `RUN chown -R`), and end the final stage with `USER app` so it is the default at start. Build stages that only compile can stay root; it is the stage that RUNS that needs the account. If the process genuinely requires root — it manages the container runtime, ptraces another process or opens raw devices — say so here rather than making a change that breaks it.
  • High IaC: DS-0002 presto-native-execution/scripts/dockerfiles/prestissimo-runtime.dockerfile — Image user should not be 'root' A container that starts as root runs your process with root's capabilities inside the namespace, so a compromise of the process starts from there. The step: create an unprivileged account in the image (`RUN useradd -r -M app` — or whatever this base image's account tooling is, `adduser` and `useradd` are not both present everywhere`), give it ownership of the paths the process writes at runtime (`COPY --chown=` on those layers, or a `RUN chown -R`), and end the final stage with `USER app` so it is the default at start. Build stages that only compile can stay root; it is the stage that RUNS that needs the account. If the process genuinely requires root — it manages the container runtime, ptraces another process or opens raw devices — say so here rather than making a change that breaks it.
  • High IaC: DS-0002 presto-native-execution/scripts/dockerfiles/ubuntu-22.04-dependency.dockerfile — Image user should not be 'root' A container that starts as root runs your process with root's capabilities inside the namespace, so a compromise of the process starts from there. The step: create an unprivileged account in the image (`RUN useradd -r -M app` — or whatever this base image's account tooling is, `adduser` and `useradd` are not both present everywhere`), give it ownership of the paths the process writes at runtime (`COPY --chown=` on those layers, or a `RUN chown -R`), and end the final stage with `USER app` so it is the default at start. Build stages that only compile can stay root; it is the stage that RUNS that needs the account. If the process genuinely requires root — it manages the container runtime, ptraces another process or opens raw devices — say so here rather than making a change that breaks it.
D13 · Secret Scanning · Leaked secret · ×1
  • Leaked secret: hardcoded-credential presto-main/etc/catalog/sqlserver.properties:4 — hardcoded-credential detected. Treat the value as compromised: it is readable by everyone who has ever had the repository, and deleting the line does not un-publish it. In order — (1) REVOKE it at whatever issued it and issue a replacement, which is the only step that actually closes the exposure; (2) load the replacement at run time from your platform's secret store or the process environment instead of from the tree, so no future value is committable; (3) remove the file or line and add its path to the repository's ignore rules, so it cannot come back; (4) if the value was ever live, purge it from the history as well, since a clone taken before the deletion still carries it. If this is instead a FIXTURE — key material generated for tests and valid nowhere — then the exposure is nil and the fix is to make that legible: generate it in test setup, or keep it under a test-data path, so a reader (and this scan) can tell it from the real thing.
D28 · Secrets (history) · Secret · ×1
  • Secret: generic-api-key presto-docs/src/main/sphinx/connector/larksheets.rst:106 — matched rule 'generic-api-key'
Warning — 1675 finding(s)
D3 · God Classes · TooManyMethods · ×243
  • TooManyMethods: FeaturesConfig presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/FeaturesConfig.java:73 — TooManyMethods — 524 methods. 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: MetadataManagerStats presto-main-base/src/main/java/com/facebook/presto/metadata/MetadataManagerStats.java:23 — TooManyMethods — 343 methods. 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: SystemSessionProperties presto-main-base/src/main/java/com/facebook/presto/SystemSessionProperties.java:99 — TooManyMethods — 326 methods. 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: HiveClientConfig presto-hive/src/main/java/com/facebook/presto/hive/HiveClientConfig.java:60 — TooManyMethods — 245 methods. 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 presto-parser/src/main/java/com/facebook/presto/sql/parser/AstBuilder.java:252 — TooManyMethods — 243 methods. 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: PrestoResultSet presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java:74 — TooManyMethods — 212 methods. 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: AstVisitor presto-parser/src/main/java/com/facebook/presto/sql/tree/AstVisitor.java:18 — TooManyMethods — 191 methods. 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: PrestoDatabaseMetaData presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoDatabaseMetaData.java:33 — TooManyMethods — 188 methods. 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: Analysis presto-analyzer/src/main/java/com/facebook/presto/sql/analyzer/Analysis.java:117 — TooManyMethods — 186 methods. 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 presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java:471 — TooManyMethods — 171 methods. 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: HiveMetadata presto-hive/src/main/java/com/facebook/presto/hive/HiveMetadata.java:400 — TooManyMethods — 149 methods. 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: MetadataManager presto-main-base/src/main/java/com/facebook/presto/metadata/MetadataManager.java:153 — TooManyMethods — 145 methods. Most of these members implement metadata.Metadata (116 of 131 members), so moving them onto a smaller type would remove them from that contract rather than reduce it. To reduce it, split the contract instead: give each cohesive group of operations its own smaller interface and its own implementing type. Where the contract has to stay whole, move the work behind these members into collaborator types, so what is left here is a forward per member rather than a responsibility per member.
  • TooManyMethods: BytecodeBlock presto-bytecode/src/main/java/com/facebook/presto/bytecode/BytecodeBlock.java:54 — TooManyMethods — 131 methods. 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: MathFunctions presto-main-base/src/main/java/com/facebook/presto/operator/scalar/MathFunctions.java:80 — TooManyMethods — 128 methods. 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: Formatter presto-parser/src/main/java/com/facebook/presto/sql/SqlFormatter.java:179 — TooManyMethods — 121 methods. 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: StatsRecordingMetadataManager presto-main-base/src/main/java/com/facebook/presto/metadata/StatsRecordingMetadataManager.java:67 — TooManyMethods — 120 methods. Most of these members implement metadata.Metadata (116 of 117 members), so moving them onto a smaller type would remove them from that contract rather than reduce it. To reduce it, split the contract instead: give each cohesive group of operations its own smaller interface and its own implementing type. Where the contract has to stay whole, move the work behind these members into collaborator types, so what is left here is a forward per member rather than a responsibility per member.
  • TooManyMethods: DelegatingMetadataManager presto-main-base/src/main/java/com/facebook/presto/metadata/DelegatingMetadataManager.java:67 — TooManyMethods — 115 methods. Most of these members implement metadata.Metadata (111 of 112 members), so moving them onto a smaller type would remove them from that contract rather than reduce it. To reduce it, split the contract instead: give each cohesive group of operations its own smaller interface and its own implementing type. Where the contract has to stay whole, move the work behind these members into collaborator types, so what is left here is a forward per member rather than a responsibility per member.
  • TooManyMethods: ClassLoaderSafeConnectorMetadata presto-spi/src/main/java/com/facebook/presto/spi/connector/classloader/ClassLoaderSafeConnectorMetadata.java:74 — TooManyMethods — 113 methods. Most of these members implement connector.ConnectorMetadata (105 of 106 members), so moving them onto a smaller type would remove them from that contract rather than reduce it. To reduce it, split the contract instead: give each cohesive group of operations its own smaller interface and its own implementing type. Where the contract has to stay whole, move the work behind these members into collaborator types, so what is left here is a forward per member rather than a responsibility per member.
  • TooManyMethods: IcebergAbstractMetadata presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergAbstractMetadata.java:312 — TooManyMethods — 111 methods. 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: UnscaledDecimal128Arithmetic presto-common/src/main/java/com/facebook/presto/common/type/UnscaledDecimal128Arithmetic.java:44 — TooManyMethods — 107 methods. 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 presto-main-base/src/main/java/com/facebook/presto/operator/scalar/DateTimeFunctions.java:71 — TooManyMethods — 107 methods. 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: QueryStateMachine presto-main-base/src/main/java/com/facebook/presto/execution/QueryStateMachine.java:110 — TooManyMethods — 98 methods. 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: HiveSessionProperties presto-hive/src/main/java/com/facebook/presto/hive/HiveSessionProperties.java:44 — TooManyMethods — 96 methods. 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: IcebergUtil presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergUtil.java:238 — TooManyMethods — 96 methods. 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: AccessDeniedException presto-spi/src/main/java/com/facebook/presto/spi/security/AccessDeniedException.java:27 — TooManyMethods — 91 methods. 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.
  • + 218 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×133
  • FileTooLong: analyzer/StatementAnalyzer.java presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java:0 — FileTooLong — 3636 significant lines (blank, comment-only and punctuation-only lines excluded), about 89% of them inside a single declaration: StatementAnalyzer (416-5634). 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: presto/SystemSessionProperties.java presto-main-base/src/main/java/com/facebook/presto/SystemSessionProperties.java:0 — FileTooLong — 3169 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: SystemSessionProperties (99-4218). 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: planner/LocalExecutionPlanner.java presto-main-base/src/main/java/com/facebook/presto/sql/planner/LocalExecutionPlanner.java:0 — FileTooLong — 2853 significant lines (blank, comment-only and punctuation-only lines excluded), about 87% of them inside a single declaration: LocalExecutionPlanner (380-3895). 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: hive/HiveMetadata.java presto-hive/src/main/java/com/facebook/presto/hive/HiveMetadata.java:0 — FileTooLong — 2815 significant lines (blank, comment-only and punctuation-only lines excluded), about 86% of them inside a single declaration: HiveMetadata (400-4003). 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: analyzer/FeaturesConfig.java presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/FeaturesConfig.java:0 — FileTooLong — 2179 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: FeaturesConfig (73-3901). Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: parser/AstBuilder.java presto-parser/src/main/java/com/facebook/presto/sql/parser/AstBuilder.java:0 — FileTooLong — 2111 significant lines (blank, comment-only and punctuation-only lines excluded), about 89% of them inside a single declaration: AstBuilder (252-3238). 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: metastore/SemiTransactionalHiveMetastore.java presto-hive-metastore/src/main/java/com/facebook/presto/hive/metastore/SemiTransactionalHiveMetastore.java:0 — FileTooLong — 1960 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: SemiTransactionalHiveMetastore (125-3158). 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: iceberg/IcebergAbstractMetadata.java presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergAbstractMetadata.java:0 — FileTooLong — 1957 significant lines (blank, comment-only and punctuation-only lines excluded), about 85% of them inside a single declaration: IcebergAbstractMetadata (312-2816). 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: analyzer/ExpressionAnalyzer.java presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/ExpressionAnalyzer.java:0 — FileTooLong — 1516 significant lines (blank, comment-only and punctuation-only lines excluded), about 87% of them inside a single declaration: ExpressionAnalyzer (209-2285). 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: sql/SqlFormatter.java presto-parser/src/main/java/com/facebook/presto/sql/SqlFormatter.java:0 — FileTooLong — 1419 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: SqlFormatter (165-2156). 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: metadata/MetadataManagerStats.java presto-main-base/src/main/java/com/facebook/presto/metadata/MetadataManagerStats.java:0 — FileTooLong — 1375 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: MetadataManagerStats (23-2419). 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: thrift/ThriftHiveMetastore.java presto-hive-metastore/src/main/java/com/facebook/presto/hive/metastore/thrift/ThriftHiveMetastore.java:0 — FileTooLong — 1340 significant lines (blank, comment-only and punctuation-only lines excluded), about 88% of them inside a single declaration: ThriftHiveMetastore (173-1926). 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: optimizations/AddExchanges.java presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/AddExchanges.java:0 — FileTooLong — 1323 significant lines (blank, comment-only and punctuation-only lines excluded), about 88% of them inside a single declaration: AddExchanges (183-1996). 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: metadata/MetadataManager.java presto-main-base/src/main/java/com/facebook/presto/metadata/MetadataManager.java:0 — FileTooLong — 1316 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: MetadataManager (153-1971). 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: scalar/MathFunctions.java presto-main-base/src/main/java/com/facebook/presto/operator/scalar/MathFunctions.java:0 — FileTooLong — 1301 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: MathFunctions (80-1933). 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: planner/QueryPlanner.java presto-main-base/src/main/java/com/facebook/presto/sql/planner/QueryPlanner.java:0 — FileTooLong — 1293 significant lines (blank, comment-only and punctuation-only lines excluded), about 87% of them inside a single declaration: QueryPlanner (185-2107). 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: metadata/BuiltInTypeAndFunctionNamespaceManager.java presto-main-base/src/main/java/com/facebook/presto/metadata/BuiltInTypeAndFunctionNamespaceManager.java:0 — FileTooLong — 1268 significant lines (blank, comment-only and punctuation-only lines excluded), about 60% of them inside a single declaration: BuiltInTypeAndFunctionNamespaceManager (525-1552). 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: planPrinter/PlanPrinter.java presto-main-base/src/main/java/com/facebook/presto/sql/planner/planPrinter/PlanPrinter.java:0 — FileTooLong — 1204 significant lines (blank, comment-only and punctuation-only lines excluded), about 87% of them inside a single declaration: PlanPrinter (173-1770). 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: optimizations/PredicatePushDown.java presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/PredicatePushDown.java:0 — FileTooLong — 1200 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: PredicatePushDown (126-1838). 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: iceberg/IcebergUtil.java presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergUtil.java:0 — FileTooLong — 1190 significant lines (blank, comment-only and punctuation-only lines excluded), about 82% of them inside a single declaration: IcebergUtil (238-1919). 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: jdbc/PrestoResultSet.java presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java:0 — FileTooLong — 1121 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: PrestoResultSet (74-1874). 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: planner/PlanOptimizers.java presto-main-base/src/main/java/com/facebook/presto/sql/planner/PlanOptimizers.java:0 — FileTooLong — 1119 significant lines (blank, comment-only and punctuation-only lines excluded), about 79% of them inside a single declaration: PlanOptimizers (250-1295). 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: analyzer/Analysis.java presto-analyzer/src/main/java/com/facebook/presto/sql/analyzer/Analysis.java:0 — FileTooLong — 1071 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: Analysis (117-2164). 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: hive/HiveClientConfig.java presto-hive/src/main/java/com/facebook/presto/hive/HiveClientConfig.java:0 — FileTooLong — 1044 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: HiveClientConfig (60-1848). 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: scalar/DateTimeFunctions.java presto-main-base/src/main/java/com/facebook/presto/operator/scalar/DateTimeFunctions.java:0 — FileTooLong — 1022 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: DateTimeFunctions (71-1552). 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.
  • + 108 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×64
  • Duplicated block (6 lines × 2) presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/ExpressionAnalyzer.java:271 — presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/ExpressionAnalyzer.java:271-276 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/plan/MergeProcessorNode.java:72-77 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (6 lines × 2) presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/ExpressionAnalyzer.java:1000 — presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/ExpressionAnalyzer.java:1000-1005 | presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/ExpressionAnalyzer.java:1029-1034 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/ExpressionAnalyzer.java:1000` 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) presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/MaterializedViewQueryOptimizer.java:151 — presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/MaterializedViewQueryOptimizer.java:151-156 | presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java:446-451 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
  • Duplicated block (6 lines × 2) presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/MetadataExtractor.java:193 — presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/MetadataExtractor.java:193-198 | presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/MetadataExtractor.java:228-233 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/MetadataExtractor.java:193` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java:4003 — presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java:4003-4008 | presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java:4011-4016 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) presto-main-base/src/main/java/com/facebook/presto/sql/gen/CommonSubExpressionRewriter.java:286 — presto-main-base/src/main/java/com/facebook/presto/sql/gen/CommonSubExpressionRewriter.java:286-291 | presto-main-base/src/main/java/com/facebook/presto/sql/gen/CommonSubExpressionRewriter.java:323-328 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/gen/CommonSubExpressionRewriter.java:286` 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) presto-main-base/src/main/java/com/facebook/presto/sql/gen/CursorProcessorCompiler.java:403 — presto-main-base/src/main/java/com/facebook/presto/sql/gen/CursorProcessorCompiler.java:403-408 | presto-main-base/src/main/java/com/facebook/presto/sql/gen/PageFunctionCompiler.java:551-556 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/gen/CursorProcessorCompiler.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.
  • Duplicated block (6 lines × 2) presto-main-base/src/main/java/com/facebook/presto/sql/gen/JoinCompiler.java:435 — presto-main-base/src/main/java/com/facebook/presto/sql/gen/JoinCompiler.java:435-440 | presto-main-base/src/main/java/com/facebook/presto/sql/gen/JoinCompiler.java:469-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 `presto-main-base/src/main/java/com/facebook/presto/sql/gen/JoinCompiler.java:435` it does not close everything it opens, so those 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 (6 lines × 2) presto-main-base/src/main/java/com/facebook/presto/sql/gen/JoinCompiler.java:505 — presto-main-base/src/main/java/com/facebook/presto/sql/gen/JoinCompiler.java:505-510 | presto-main-base/src/main/java/com/facebook/presto/sql/gen/JoinFilterFunctionCompiler.java:216-222 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/gen/JoinCompiler.java:505` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) presto-main-base/src/main/java/com/facebook/presto/sql/gen/JoinCompiler.java:715 — presto-main-base/src/main/java/com/facebook/presto/sql/gen/JoinCompiler.java:715-720 | presto-main-base/src/main/java/com/facebook/presto/sql/gen/JoinCompiler.java:773-778 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/gen/JoinCompiler.java:715` it does not close everything it opens, so those exact lines 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) presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/properties/LogicalPropertiesProviderImpl.java:185 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/properties/LogicalPropertiesProviderImpl.java:185-190 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/properties/LogicalPropertiesProviderImpl.java:314-319 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/properties/LogicalPropertiesProviderImpl.java:185` 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) presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/properties/LogicalPropertiesProviderImpl.java:275 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/properties/LogicalPropertiesProviderImpl.java:275-280 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/properties/LogicalPropertiesProviderImpl.java:292-297 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/properties/LogicalPropertiesProviderImpl.java:275` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, 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) presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/CollapseFanoutJoinWithArrayAggUnnest.java:408 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/CollapseFanoutJoinWithArrayAggUnnest.java:408-413 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/PushAggregationThroughDisjointUnion.java:115-120 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/CollapseFanoutJoinWithArrayAggUnnest.java:408` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (6 lines × 2) presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/CombineApproxDistinctFunctions.java:112 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/CombineApproxDistinctFunctions.java:112-117 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/CombineApproxPercentileFunctions.java:124-130 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/CombineApproxDistinctFunctions.java:112` 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) presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/CombineApproxDistinctFunctions.java:247 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/CombineApproxDistinctFunctions.java:247-252 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/CombineApproxPercentileFunctions.java:277-283 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/CombineApproxDistinctFunctions.java:247` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (6 lines × 2) presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/CrossJoinWithArrayContainsToInnerJoin.java:118 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/CrossJoinWithArrayContainsToInnerJoin.java:118-123 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/CrossJoinWithArrayNotContainsToAntiJoin.java:134-139 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/CrossJoinWithArrayContainsToInnerJoin.java:118` 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) presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/DetermineJoinDistributionType.java:162 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/DetermineJoinDistributionType.java:162-167 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/DetermineSemiJoinDistributionType.java:134-139 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/DetermineJoinDistributionType.java:162` 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) presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/ExtractSpatialJoins.java:360 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/ExtractSpatialJoins.java:360-365 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/ExtractSpatialJoins.java:379-384 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/ExtractSpatialJoins.java:360` it does not close everything it opens, so those exact lines 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) presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/MergeSumsToVectorSum.java:247 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/MergeSumsToVectorSum.java:247-252 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/MergeSumsToVectorSum.java:258-263 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/MergeSumsToVectorSum.java:247` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/PlanRemoteProjections.java:281 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/PlanRemoteProjections.java:281-286 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/PlanRemoteProjections.java:352-357 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/PlanRemoteProjections.java:281` 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) presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/PushAggregationThroughDisjointUnion.java:139 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/PushAggregationThroughDisjointUnion.java:139-144 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/PushSemiJoinThroughUnion.java:115-120 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/PushAggregationThroughDisjointUnion.java:139` it does not close everything it opens, so those exact lines 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) presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/PushFilterThroughSelectingAggregation.java:133 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/PushFilterThroughSelectingAggregation.java:133-138 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/PushProjectionThroughCrossJoin.java:118-124 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/PushFilterThroughSelectingAggregation.java:133` it does not close everything it opens, so those 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 (6 lines × 2) presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/TransformTableFunctionToTableFunctionProcessor.java:209 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/TransformTableFunctionToTableFunctionProcessor.java:209-214 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/TransformTableFunctionToTableFunctionProcessor.java:218-223 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/ActualProperties.java:260 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/ActualProperties.java:260-265 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/StreamPropertyDerivations.java:424-429 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
  • Duplicated block (6 lines × 2) presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/IndexJoinOptimizer.java:537 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/IndexJoinOptimizer.java:537-542 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/WindowFilterPushDown.java:72-77 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
  • + 39 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×51
  • Duplicated block (8 lines × 2) presto-accumulo/src/main/java/com/facebook/presto/accumulo/serializers/LexicoderRowSerializer.java:110 — presto-accumulo/src/main/java/com/facebook/presto/accumulo/serializers/LexicoderRowSerializer.java:110-117 | presto-accumulo/src/main/java/com/facebook/presto/accumulo/serializers/StringRowSerializer.java:82-89 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
  • Duplicated block (8 lines × 2) presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/ExpressionAnalyzer.java:2149 — presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/ExpressionAnalyzer.java:2149-2156 | presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/ExpressionAnalyzer.java:2172-2179 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/ExpressionAnalyzer.java:2149` it does not close everything it opens, so those 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) presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/QueryExplainer.java:137 — presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/QueryExplainer.java:137-144 | presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/QueryExplainer.java:162-170 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/QueryExplainer.java:137` it does not close everything it opens, so those exact lines 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) presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java:719 — presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java:719-726 | presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java:3681-3688 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java:719` it does not close everything it opens, so those exact lines 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) presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java:3603 — presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java:3603-3610 | presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java:3685-3692 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java:3603` 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) presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java:4799 — presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java:4799-4806 | presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java:4952-4959 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java:4799` it does not close everything it opens, so those exact lines 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) presto-main-base/src/main/java/com/facebook/presto/sql/gen/AndCodeGenerator.java:40 — presto-main-base/src/main/java/com/facebook/presto/sql/gen/AndCodeGenerator.java:40-47 | presto-main-base/src/main/java/com/facebook/presto/sql/gen/OrCodeGenerator.java:40-47 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
  • Duplicated block (8 lines × 2) presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/CombineApproxDistinctFunctions.java:140 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/CombineApproxDistinctFunctions.java:140-147 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/CombineApproxPercentileFunctions.java:174-181 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/CombineApproxDistinctFunctions.java:140` 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) presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/CombineApproxDistinctFunctions.java:299 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/CombineApproxDistinctFunctions.java:299-306 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/MergeSumsToVectorSum.java:229-238 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
  • Duplicated block (8 lines × 2) presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/CrossJoinWithArrayContainsToInnerJoin.java:146 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/CrossJoinWithArrayContainsToInnerJoin.java:146-153 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/LeftJoinWithArrayContainsToEquiJoinCondition.java:134-141 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (8 lines × 2) presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/ExtractSpatialJoins.java:265 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/ExtractSpatialJoins.java:265-272 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/ExtractSpatialJoins.java:321-328 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/ExtractSpatialJoins.java:265` 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) presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/GatherAndMergeWindows.java:273 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/GatherAndMergeWindows.java:273-280 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/GatherAndMergeWindows.java:309-316 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/GatherAndMergeWindows.java:273` it does not close everything it opens, so those 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) presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/PlanRemoteProjections.java:295 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/PlanRemoteProjections.java:295-302 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/PlanRemoteProjections.java:364-371 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/PlanRemoteProjections.java:295` 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) presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/PushDownDereferences.java:206 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/PushDownDereferences.java:206-213 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/PushDownDereferences.java:369-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 `presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/PushDownDereferences.java:206` 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) presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/PushPartialAggregationThroughExchange.java:236 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/PushPartialAggregationThroughExchange.java:236-243 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/PruneUnreferencedOutputs.java:172-179 — 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) presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/TransformCorrelatedInPredicateToJoin.java:120 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/TransformCorrelatedInPredicateToJoin.java:120-127 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/TransformUncorrelatedInPredicateSubqueryToDistinctInnerJoin.java:101-109 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
  • Duplicated block (8 lines × 2) presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/TransformTableFunctionToTableFunctionProcessor.java:628 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/TransformTableFunctionToTableFunctionProcessor.java:628-635 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/TransformTableFunctionToTableFunctionProcessor.java:791-798 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/TransformTableFunctionToTableFunctionProcessor.java:791` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (8 lines × 2) presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/TransformTableFunctionToTableFunctionProcessor.java:637 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/TransformTableFunctionToTableFunctionProcessor.java:637-644 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/TransformTableFunctionToTableFunctionProcessor.java:805-812 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (8 lines × 2) presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/AddExchanges.java:427 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/AddExchanges.java:427-434 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/AddExchanges.java:668-675 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/AddExchanges.java:427` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/AddExchanges.java:1140 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/AddExchanges.java:1140-1147 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/AddExchanges.java:1175-1182 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/AddExchanges.java:1140` 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) presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/GroupInnerJoinsByConnectorRuleSet.java:300 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/GroupInnerJoinsByConnectorRuleSet.java:300-307 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/EqualityInference.java:478-485 — 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) presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/PredicatePushDown.java:770 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/PredicatePushDown.java:770-777 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/PredicatePushDown.java:782-789 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/PredicatePushDown.java:770` 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) presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/RpcFunctionOptimizer.java:531 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/RpcFunctionOptimizer.java:531-538 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/RpcFunctionOptimizer.java:586-593 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, 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) presto-main-base/src/main/java/com/facebook/presto/sql/planner/sanity/ValidateDependenciesChecker.java:424 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/sanity/ValidateDependenciesChecker.java:424-432 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/sanity/ValidateDependenciesChecker.java:442-449 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/planner/sanity/ValidateDependenciesChecker.java:424` 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 (8 lines × 2) presto-main-base/src/main/java/com/facebook/presto/sql/planner/sanity/ValidateDependenciesChecker.java:569 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/sanity/ValidateDependenciesChecker.java:569-576 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/sanity/ValidateDependenciesChecker.java:647-654 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/planner/sanity/ValidateDependenciesChecker.java:569` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • + 26 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×48
  • Duplicated block (7 lines × 2) presto-accumulo/src/main/java/com/facebook/presto/accumulo/iterators/MaxByteArrayCombiner.java:35 — presto-accumulo/src/main/java/com/facebook/presto/accumulo/iterators/MaxByteArrayCombiner.java:35-41 | presto-accumulo/src/main/java/com/facebook/presto/accumulo/iterators/MinByteArrayCombiner.java:35-41 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `presto-accumulo/src/main/java/com/facebook/presto/accumulo/iterators/MaxByteArrayCombiner.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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (7 lines × 2) presto-accumulo/src/main/java/com/facebook/presto/accumulo/serializers/AccumuloRowSerializer.java:558 — presto-accumulo/src/main/java/com/facebook/presto/accumulo/serializers/AccumuloRowSerializer.java:558-564 | presto-prometheus/src/main/java/com/facebook/presto/plugin/prometheus/PrometheusRecordCursor.java:101-107 — 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 `presto-accumulo/src/main/java/com/facebook/presto/accumulo/serializers/AccumuloRowSerializer.java:558` 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 (7 lines × 2) presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/ExpressionAnalyzer.java:1007 — presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/ExpressionAnalyzer.java:1007-1013 | presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/ExpressionAnalyzer.java:1039-1045 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/ExpressionAnalyzer.java:1007` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (7 lines × 2) presto-main-base/src/main/java/com/facebook/presto/sql/gen/CursorProcessorCompiler.java:138 — presto-main-base/src/main/java/com/facebook/presto/sql/gen/CursorProcessorCompiler.java:138-144 | presto-main-base/src/main/java/com/facebook/presto/sql/gen/PageFunctionCompiler.java:756-762 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/gen/CursorProcessorCompiler.java:138` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) presto-main-base/src/main/java/com/facebook/presto/sql/gen/PageFunctionCompiler.java:891 — presto-main-base/src/main/java/com/facebook/presto/sql/gen/PageFunctionCompiler.java:891-897 | presto-main-base/src/main/java/com/facebook/presto/sql/gen/RowExpressionPredicateCompiler.java:217-223 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/gen/PageFunctionCompiler.java:891` 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 (7 lines × 2) presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/AddDistinctForSemiJoinBuild.java:106 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/AddDistinctForSemiJoinBuild.java:106-112 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/RewriteBucketedSemiJoinToJoin.java:256-265 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/AddDistinctForSemiJoinBuild.java:106` 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 (7 lines × 2) presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/CoalesceCascadingProjections.java:203 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/CoalesceCascadingProjections.java:203-209 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/InlineProjections.java:162-168 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/CoalesceCascadingProjections.java:203` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/CombineApproxPercentileFunctions.java:307 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/CombineApproxPercentileFunctions.java:307-313 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/MergeSumsToVectorSum.java:223-232 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/CombineApproxPercentileFunctions.java:307` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (7 lines × 2) presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/PlanRemoteProjections.java:389 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/PlanRemoteProjections.java:389-395 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/RpcFunctionOptimizer.java:320-326 — 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 `presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/PlanRemoteProjections.java:389` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/PullConstantProjectionAboveExchange.java:197 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/PullConstantProjectionAboveExchange.java:197-203 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/PushProjectionThroughExchange.java:159-165 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/PullConstantProjectionAboveExchange.java:197` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/RowExpressionRewriteRuleSet.java:479 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/RowExpressionRewriteRuleSet.java:479-486 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/RowExpressionRewriteRuleSet.java:550-556 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/RowExpressionRewriteRuleSet.java:479` 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) presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/MergeJoinForSortedInputOptimizer.java:162 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/MergeJoinForSortedInputOptimizer.java:162-168 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/SortMergeJoinOptimizer.java:171-180 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, 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) presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/PredicatePushDown.java:1039 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/PredicatePushDown.java:1039-1045 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/PredicatePushDown.java:1192-1198 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (7 lines × 2) presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/PropertyDerivations.java:411 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/PropertyDerivations.java:411-417 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/PropertyDerivations.java:426-432 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/PropertyDerivations.java:411` 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 (7 lines × 2) presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/PropertyDerivations.java:539 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/PropertyDerivations.java:539-545 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/PropertyDerivations.java:664-670 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/PropertyDerivations.java:539` 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (7 lines × 2) presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/PropertyDerivations.java:1122 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/PropertyDerivations.java:1122-1128 | presto-common/src/main/java/com/facebook/presto/common/predicate/TupleDomain.java:98-104 — 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 `presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/PropertyDerivations.java:1122` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/PruneUnreferencedOutputs.java:1064 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/PruneUnreferencedOutputs.java:1064-1070 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/PruneUnreferencedOutputs.java:1103-1109 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/PruneUnreferencedOutputs.java:1064` 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) presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/PushdownSubfields.java:583 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/PushdownSubfields.java:583-589 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/PushdownSubfields.java:605-612 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/PushdownSubfields.java:583` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (7 lines × 2) presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/SymbolMapper.java:297 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/SymbolMapper.java:297-303 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/SymbolMapper.java:324-330 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/SymbolMapper.java:297` 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 (7 lines × 2) presto-main-base/src/main/java/com/facebook/presto/sql/planner/ExpressionDomainTranslator.java:529 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/ExpressionDomainTranslator.java:529-535 | presto-main-base/src/main/java/com/facebook/presto/sql/relational/RowExpressionDomainTranslator.java:604-610 — 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 `presto-main-base/src/main/java/com/facebook/presto/sql/planner/ExpressionDomainTranslator.java:529` 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) presto-main-base/src/main/java/com/facebook/presto/sql/planner/ExpressionDomainTranslator.java:541 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/ExpressionDomainTranslator.java:541-547 | presto-main-base/src/main/java/com/facebook/presto/sql/relational/RowExpressionDomainTranslator.java:616-622 — 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 `presto-main-base/src/main/java/com/facebook/presto/sql/planner/ExpressionDomainTranslator.java:541` 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 (7 lines × 2) presto-main-base/src/main/java/com/facebook/presto/sql/planner/ExpressionInterpreter.java:334 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/ExpressionInterpreter.java:334-340 | presto-main-base/src/main/java/com/facebook/presto/sql/relational/SqlToRowExpressionTranslator.java:782-788 — 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 `presto-main-base/src/main/java/com/facebook/presto/sql/planner/ExpressionInterpreter.java:334` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (7 lines × 2) presto-main-base/src/main/java/com/facebook/presto/sql/planner/ExpressionInterpreter.java:998 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/ExpressionInterpreter.java:998-1004 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/RowExpressionInterpreter.java:324-330 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/planner/ExpressionInterpreter.java:998` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (7 lines × 2) presto-main-base/src/main/java/com/facebook/presto/sql/planner/ExpressionInterpreter.java:1220 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/ExpressionInterpreter.java:1220-1226 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/RowExpressionInterpreter.java:489-495 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/planner/ExpressionInterpreter.java:1220` 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) presto-main-base/src/main/java/com/facebook/presto/sql/planner/LocalExecutionPlanner.java:2008 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/LocalExecutionPlanner.java:2008-2014 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/LocalExecutionPlanner.java:2297-2303 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/planner/LocalExecutionPlanner.java:2008` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • + 23 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×43
  • Duplicated block (9 lines × 2) presto-accumulo/src/main/java/com/facebook/presto/accumulo/AccumuloMetadata.java:398 — presto-accumulo/src/main/java/com/facebook/presto/accumulo/AccumuloMetadata.java:398-407 | presto-example-http/src/main/java/com/facebook/presto/example/ExampleMetadata.java:179-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. Read the line range as the matched WINDOW rather than a finished unit: at `presto-accumulo/src/main/java/com/facebook/presto/accumulo/AccumuloMetadata.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. The matched lines also transfer control out of the body holding them, 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) presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/AggregationAnalyzer.java:374 — presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/AggregationAnalyzer.java:374-382 | presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/AggregationAnalyzer.java:388-396 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/AggregationAnalyzer.java:374` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9 lines × 2) presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/MaterializedViewPlanValidator.java:92 — presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/MaterializedViewPlanValidator.java:92-100 | presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/MaterializedViewPlanValidator.java:123-131 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/MaterializedViewPlanValidator.java:92` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java:2479 — presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java:2479-2487 | presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java:2619-2627 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java:2479` it does not close everything it opens, so those exact lines 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) presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java:2739 — presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java:2739-2747 | presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java:2845-2853 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java:2739` 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) presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java:3727 — presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java:3727-3735 | presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java:4674-4683 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java:4750 — presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java:4750-4758 | presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java:4762-4770 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java:4750` 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) presto-main-base/src/main/java/com/facebook/presto/sql/gen/JoinCompiler.java:730 — presto-main-base/src/main/java/com/facebook/presto/sql/gen/JoinCompiler.java:730-738 | presto-main-base/src/main/java/com/facebook/presto/sql/gen/JoinCompiler.java:796-804 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) presto-main-base/src/main/java/com/facebook/presto/sql/gen/JoinFilterFunctionCompiler.java:188 — presto-main-base/src/main/java/com/facebook/presto/sql/gen/JoinFilterFunctionCompiler.java:188-196 | presto-main-base/src/main/java/com/facebook/presto/sql/gen/LambdaBytecodeGenerator.java:404-412 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9 lines × 2) presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/CombineApproxDistinctFunctions.java:215 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/CombineApproxDistinctFunctions.java:215-223 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/CombineApproxPercentileFunctions.java:256-265 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
  • Duplicated block (9 lines × 2) presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/RowExpressionRewriteRuleSet.java:522 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/RowExpressionRewriteRuleSet.java:522-530 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/RowExpressionRewriteRuleSet.java:580-588 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/planner/iterative/rule/RowExpressionRewriteRuleSet.java:522` it does not close everything it opens, so those exact lines 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) presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/MergeJoinForSortedInputOptimizer.java:124 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/MergeJoinForSortedInputOptimizer.java:124-132 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/SortMergeJoinOptimizer.java:128-136 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/MergeJoinForSortedInputOptimizer.java:124` 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) presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/PlanNodeSearcher.java:160 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/PlanNodeSearcher.java:160-168 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/PlanNodeSearcher.java:184-192 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/PlanNodeSearcher.java:160` it does not close everything it opens, so those exact lines 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) presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/PropertyDerivations.java:874 — presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/PropertyDerivations.java:874-882 | presto-main-base/src/main/java/com/facebook/presto/sql/planner/optimizations/PropertyDerivations.java:889-897 — both copies are in the same file, so extract the block into one function there and call it from...

    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.