Public report — kafka, published 5 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 05-08-2026 @ 03:29 UTC Public
Code Health Audit

Apache/kafka

No baseline yet — first run
63% Adequate
CriticalWeakAdequateStrongExemplary
middle

Very large · 631,243 LoC · rebuild ~13.9 person-years · weakest lens: Security (52%)

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

24/25dimensions tool-verifieddeterministic · confidence 1.0 · 1 LLM-assisted, advisory
1278findings with an exact file:lineof 1297 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
25/94dimensions across the health lenses631243 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.

apache/kafka is sound in substance but carries real gaps (63%). It is not in crisis, but the issues below raise the cost of changing it — friction its consumers ultimately inherit.

It is strongest in Architecture (99%) — the structure is clean and changes stay contained. Code Health (75%) is solid too.

The area that most needs attention is Security (52%) — exposure to security and compliance incidents is elevated. Readiness (67%) 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: 50 High finding(s) (Static Analysis (SAST)); 50 High finding(s) (Data Compliance (PII/GDPR)); Document RTO/RPO and a tested restore procedure (a backup… (DR & Backup).

For scale: Very large (~631,243 production lines); rebuilding it from scratch would take roughly ~13.9 person-years (~8–27 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.
Security 52% · 47% weightReadiness 67% · 26% weightMaturity 75% · 14% weightCode Health 75% · 8% weightArchitecture 99% · 4% weight

Raise Security 52 → 70 (the Healthy floor) ⇒ headline 63 → ~71.

Code composition — where the lines go
Tests 100%
Rebuild cost & value ~ Modeled — €670,000–€3,400,000
Cost to rebuild€670,000–€3,400,000 (6.6–21.1 person-years (11,162–35,411 h), ~8–27 engineers)
Domain complexityStandard — harder problems cost more per line
Quality factor0.9× (at 63% 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 ~13.9 person-years of build effort (about ~€2,000,000 to rebuild). Its weakest lens is Security at 52% — 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.9× 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
Resolve the 50 High finding(s) in Static Analysis (SAST) — start with build.yml (16), Partition.scala (5), deflake.yml (4).
+7.6 pts · Medium effort · Static Analysis (SAST)
2
Resolve the 50 High finding(s) in Data Compliance (PII/GDPR) — start with KafkaConfigBackingStore.java (18), MessageDataGenerator.java (15), JsonConverterGenerator.java (8).
+7.6 pts · Medium effort · Data Compliance (PII/GDPR)
3
Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).
+4.0 pts · Medium effort · DR & Backup

Diagnosis — what's actually going on

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.8–156.1 engineer-days every year, paid as drag on the ~468,271 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 2–5% 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: 115,464 line(s) changed over a 90-day window ⇒ ~468,271/year · D1/D2/D4 code quality: averaging 7.2/10 ⇒ a 2–5% 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.
Value concentrated against a weak lens · Medium · Value at risk
This is a Very large asset (~13.9 person-years to rebuild), and its weakest lens is Security at 52%. The operational and business risk on an asset this size concentrates there — that's where remediation buys the most protection.
Evidence: valuation: Very large, ~13.9 person-years rebuild (631,243 LoC) · weakest lens: Security 52%
→ Direct remediation budget at Security first — highest risk-reduction per euro on an asset this size.
Highest-leverage move · Medium · Leverage
Of everything flagged, the best return on effort is: Resolve the 50 High finding(s) in Static Analysis (SAST) — start with build.yml (16), Partition.scala (5), deflake.yml (4). The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ Resolve the 50 High finding(s) in Static Analysis (SAST) — start with build.yml (16), Partition.scala (5), deflake.yml (4).
A velocity tax on every change · Medium · Economics
The code-quality signals (complexity, duplication, cohesion) average 7.2/10, which acts as a tax on every change in the weaker areas: modifications there plausibly cost on the order of 2–5% 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.2/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

443 modules, 1844 dependencies — 7 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)…e.kafka.common.header…e.kafka.common.config…e.kafka.common.errors….common.security.auth…ommon.utils.internals…ommon.record.internal…kafka.common.protocol…kafka.common.requests….kafka.common.network…e.kafka.server.common…he.kafka.common.utilsorg.apache.kafka.image….kafka.common.metrics….common.serialization…apache.kafka.metadata…afka.common.internals…che.kafka.server.util…afka.clients.producerorg.apache.kafka.raft…storage.internals.log…ache.kafka.controller…g.apache.kafka.server…che.kafka.common.test…g.apache.kafka.common…ts.consumer.internals…inator.common.runtime…afka.clients.consumer…fka.coordinator.group…e.kafka.clients.admin…reams.state.internals….apache.kafka.clients…kafka.connect.runtime…s.processor.internalskafka.server…fka.streams.processororg.apache.kafka.toolskafka.server.share….apache.kafka.streams…a.streams.integration(global)1…e.kafka.common.header2…e.kafka.common.config3…e.kafka.common.errors4….common.security.auth5…ommon.utils.internals6…ommon.record.internal7…kafka.common.protocol8…kafka.common.requests9….kafka.common.network10…e.kafka.server.common11…he.kafka.common.utils12org.apache.kafka.image13….kafka.common.metrics14….common.serialization15…apache.kafka.metadata16…afka.common.internals17…che.kafka.server.util18…afka.clients.producer19org.apache.kafka.raft20…storage.internals.log21…ache.kafka.controller22…g.apache.kafka.server23…che.kafka.common.test24…g.apache.kafka.common25…ts.consumer.internals26…inator.common.runtime27…afka.clients.consumer28…fka.coordinator.group29…e.kafka.clients.admin30…reams.state.internals31….apache.kafka.clients32…kafka.connect.runtime33…s.processor.internals34kafka.server35…fka.streams.processor36org.apache.kafka.tools37kafka.server.share38….apache.kafka.streams39…a.streams.integration40311621311111483251013212153443025265311315324344113429111311416102131012143621210418413171411131517712631111531525752113796155101319141731092436252121925772154825831612961375512219245121335118211112113142634671111592186841237663361215611364509436164516262632123811212274203212661551552212128714132358511693115154571288274200206490115011488731074374342227399217331315111111102121121252717167108316571518127602112222231114336261528295311031211545112556322113112151144314244952013281933375213822321491487318153+403 more modules (most-connected shown)

At a glance — Code Health · 75% · Strong

At a glance — Architecture · 99% · Exemplary

At a glance — Maturity · 75% · Strong

At a glance — Readiness · 67% · Adequate

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

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
A04:2021 — Insecure Design50High / Critical
A05:2021 — Security Misconfiguration10High / Critical

Roadmap

Begin by resolving the 50 high-priority static analysis findings, focusing first on build.yml, Partition.scala, and deflake.yml. Next, address the 50 high-priority data compliance issues, prioritizing KafkaConfigBackingStore.java, MessageDataGenerator.java, and JsonConverterGenerator.java. Then, document your recovery time and objectives with a tested restore procedure to ensure true disaster recovery. Finally, integrate your static analyzer into the CI pipeline to fail builds on new issues, and create architecture decision records to document significant design choices.

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

Do thisHelpsEffortDimension
Resolve the 50 High finding(s) in Static Analysis (SAST) — start with build.yml (16), Partition.scala (5), deflake.yml (4).+7.6 ptsMediumStatic Analysis (SAST)
Resolve the 50 High finding(s) in Data Compliance (PII/GDPR) — start with KafkaConfigBackingStore.java (18), MessageDataGenerator.java (15), JsonConverterGenerator.java (8).+7.6 ptsMediumData Compliance (PII/GDPR)
Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).+4.0 ptsMediumDR & Backup
Your ecosystem's static analyzer is declared as a dependency but is not wired into CI — run it as a required step on push/PR (e.g. `composer phpstan` / `mix sobelow` / `bundle exec brakeman` / the spotbugs Gradle task / `sbt scalafixAll --check` / `golangci-lint run` / `rebar3 lint`) so a regression fails the build instead of relying on someone running it locally.+3.8 ptsMediumSecurity & performance tooling
Resolve the 2 High IaC finding(s) in IaC & Container Security — start with Dockerfile (2).+1.6 ptsLowIaC & Container Security
Resolve the 1 No build provenance finding(s) in Supply-chain Provenance & Signing.+1.5 ptsLowSupply-chain Provenance & Signing
Resolve the 1 PR-triggered workflow without a permissions block finding(s) in Supply-chain Provenance & Signing.+1.5 ptsLowSupply-chain Provenance & Signing
Resolve the 1 Unpinned build actions finding(s) in Supply-chain Provenance & Signing.+1.5 ptsLowSupply-chain Provenance & Signing

File quality

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

FileScoreBandWorst signal
generator/src/main/java/org/apache/kafka/message/MessageDataGenerator.java1.4SlopData Compliance (PII/GDPR): High: watchdog-sensitive-personal-data-in-log
connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java1.4SlopData Compliance (PII/GDPR): High: watchdog-sensitive-personal-data-in-log
docker/native/Dockerfile1.4SlopIaC & Container Security: High IaC: DS-0019
generator/src/main/java/org/apache/kafka/message/JsonConverterGenerator.java2.2SlopData Compliance (PII/GDPR): High: watchdog-sensitive-personal-data-in-log
generator/src/main/java/org/apache/kafka/message/CoordinatorRecordJsonConvertersGenerator.java2.5SlopData Compliance (PII/GDPR): High: watchdog-sensitive-personal-data-in-log
.github/workflows/build.yml4.4MixedStatic Analysis (SAST): High: github-actions-mutable-action-tag
core/src/main/scala/kafka/cluster/Partition.scala4.6MixedStatic Analysis (SAST): High: tainted-sql-string
.github/workflows/deflake.yml4.8MixedStatic Analysis (SAST): High: github-actions-mutable-action-tag
.github/workflows/prepare_docker_official_image_source.yml5.1MixedStatic Analysis (SAST): High: github-actions-mutable-action-tag
connect/runtime/src/main/java/org/apache/kafka/connect/storage/OffsetUtils.java5.1MixedData Compliance (PII/GDPR): High: watchdog-sensitive-personal-data-in-log
streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamsPartitionAssignor.java5.6MixedCyclomatic Complexity: StreamsPartitionAssignor.assignTasksToThreads (cyclomatic 20)
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/isolation/PluginUtils.java5.7MixedData Compliance (PII/GDPR): High: watchdog-sensitive-personal-data-in-log
.github/workflows/ci-complete.yml5.8MixedStatic Analysis (SAST): High: github-actions-mutable-action-tag
.github/workflows/docker_rc_release.yml5.8MixedStatic Analysis (SAST): High: github-actions-mutable-action-tag
.github/workflows/pr-labels-cron.yml5.8MixedStatic Analysis (SAST): High: github-actions-mutable-action-tag
.github/workflows/pr-linter.yml5.8MixedStatic Analysis (SAST): High: github-actions-mutable-action-tag
.github/workflows/pr-update.yml5.8MixedStatic Analysis (SAST): High: github-actions-mutable-action-tag
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/assignor/UniformHeterogeneousAssignmentBuilder.java5.9MixedCognitive Complexity: UniformHeterogeneousAssignmentBuilder.maybeRevokePartitions (cognitive 19)
clients/src/main/java/org/apache/kafka/clients/consumer/internals/events/ApplicationEventProcessor.java5.9MixedGod Classes: TooManyMethods: ApplicationEventProcessor
core/src/main/java/kafka/server/builders/KafkaApisBuilder.java6.3MixedCyclomatic Complexity: KafkaApisBuilder.build (cyclomatic 19)

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. 24 of 25 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 1 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 — 25 dimensions across the health lenses
D1D2D3D4D13D15D16D21D28D29D31D32D34D35D36D37AX5M1M2M3M4P1P3P4P5

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, 1278 of 1297 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 019fcff8-322e-7569-99d1-3324c58cc9df.

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.

  • D19 Documentation Quality — LLM provider failed — The model provider returned an unusable result, so this LLM-assisted dimension fell back to a measurement gap (confidence 0) rather than a penalty. Re-run with a reachable provider to score it.
  • 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 (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.

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.
  • 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.
  • D32 Data Compliance (PII/GDPR): PII/GDPR signals are heuristic pattern matches in code — they flag likely handling concerns, not legal compliance, and cannot trace where data actually flows at runtime.
  • 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.
  • 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.

The LLM boundary

LLM-set scores this run (2): 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.8 / 10Adequate✓ Tool-verified

What it measures: How tangled the control flow is — methods with many branches are hard to test and change.

Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.

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

108 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was FieldSpec.fieldDefault at 49. A further 12 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 AbstractRequest.doParseRequest at 91 — they are counted neither in the figure above nor in this dimension's score.

FieldSpec.fieldDefault (cyclomatic 49)generator/src/main/java/org/apache/kafka/message/FieldSpec.java:291
JsonConverter.convertToJson (cyclomatic 40)connect/json/src/main/java/org/apache/kafka/connect/json/JsonConverter.java:586
ConnectHeaders.checkSchemaMatches (cyclomatic 39)connect/api/src/main/java/org/apache/kafka/connect/header/ConnectHeaders.java:399
JsonConverter.asConnectSchema (cyclomatic 39)connect/json/src/main/java/org/apache/kafka/connect/json/JsonConverter.java:455
IQv2StoreIntegrationTest.shouldHandleTimestampedRangeQueries (cyclomatic 39)streams/integration-tests/src/test/java/org/apache/kafka/streams/integration/IQv2StoreIntegrationTest.java:929

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

What to do

  1. Resolve the 1 FieldSpec.fieldDefault (cyclomatic 49) finding(s) in Cyclomatic Complexity — start with FieldSpec.java. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 JsonConverter.convertToJson (cyclomatic 40) finding(s) in Cyclomatic Complexity — start with JsonConverter.java. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 ConnectHeaders.checkSchemaMatches (cyclomatic 39) finding(s) in Cyclomatic Complexity — start with ConnectHeaders.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 / 10Adequate✓ Tool-verified

What it measures: How hard the code is for a person to follow, beyond raw branching.

Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.

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

490 method(s) exceeded the cognitive complexity threshold of 15; the worst was SchemaGenerator.fieldTypeToSchemaType at 261.

ByteUtils.readUnsignedVarint (cognitive 19) · ×2clients/src/main/java/org/apache/kafka/common/utils/internals/ByteUtils.java:266
Builder.build (cognitive 17) · ×2test-common/test-common-runtime/src/main/java/org/apache/kafka/common/test/KafkaClusterTestKit.java:285
SchemaGenerator.fieldTypeToSchemaType (cognitive 261)generator/src/main/java/org/apache/kafka/message/SchemaGenerator.java:222
FieldSpec.fieldDefault (cognitive 201)generator/src/main/java/org/apache/kafka/message/FieldSpec.java:291
ConfigCommand.alterConfig (cognitive 92)tools/src/main/java/org/apache/kafka/tools/ConfigCommand.java:225

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

What to do

  1. Resolve the 2 ByteUtils.readUnsignedVarint (cognitive 19) finding(s) in Cognitive Complexity — start with ByteUtils.java (2). — One of this dimension's main actionable groups (2 warning-level).
  2. Resolve the 2 Builder.build (cognitive 17) finding(s) in Cognitive Complexity — start with KafkaClusterTestKit.java, CoordinatorRuntime.java. — One of this dimension's main actionable groups (2 warning-level).
  3. Resolve the 1 SchemaGenerator.fieldTypeToSchemaType (cognitive 261) finding(s) in Cognitive Complexity — start with SchemaGenerator.java. — One of this dimension's main actionable groups (1 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.6 / 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.6 / 10 · rule-coverage 100% · ceiling Prevented

258 god class(es) detected.

TooManyMethods: RocksDBGenericOptionsToDbOptionsColumnFamilyOptionsAdapter · ×148streams/src/main/java/org/apache/kafka/streams/state/internals/RocksDBGenericOptionsToDbOptionsColumnFamilyOptionsAdapter.java:65
FileTooLong: group/GroupMetadataManager.java · ×110group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:0

What to do

  1. Resolve the 148 TooManyMethods finding(s) in God Classes — start with SubscriptionState.java (2), LogContext.java (2), QuorumController.java (2). — One of this dimension's main actionable groups (148 warning-level).
  2. Resolve the 110 FileTooLong finding(s) in God Classes — start with GroupMetadataManager.java, KafkaAdminClient.java, KafkaRaftClient.java. — One of this dimension's main actionable groups (110 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

254 duplicated block group(s) detected.

Duplicated block (9 lines × 2) · ×37clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java:1852
Duplicated block (7 lines × 2) · ×37clients/src/main/java/org/apache/kafka/clients/admin/internals/DeleteConsumerGroupOffsetsHandler.java:115
Duplicated block (8 lines × 2) · ×25api-checker/gradle-plugins/src/main/java/org/apache/kafka/gradle/KafkaInternalApiCheckerTask.java:126
Duplicated block (5 lines × 2) · ×25clients/src/main/java/org/apache/kafka/clients/admin/internals/DescribeShareGroupsHandler.java:111
Duplicated block (6 lines × 2) · ×24clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java:2008

+ 30 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 Scanning10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.

Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.

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

Secret scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.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: group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java (20×34=680); group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupCoordinatorShard.java (8×24=192); core/src/main/java/kafka/server/share/SharePartition.java (6×32=192)

Hotspot: group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java · ×10group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.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

87 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is server/src/main/java/org/apache/kafka/server/BrokerLifecycleManager.java.

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

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)10.0 / 10Exemplary○ Nothing flagged

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

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

✓ On the Gold path — maintain.

Detailed fixes: d28_recommendation.md.

D29 · Static Analysis (SAST)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

60 finding(s): 0 critical, 58 high, 1 medium, 1 low.

High: github-actions-mutable-action-tag · ×50.github/actions/run-gradle/action.yml:110detected by semgrep finding

What to do

  1. Resolve the 50 High finding(s) in Static Analysis (SAST) — start with build.yml (16), Partition.scala (5), deflake.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.8 / 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.8 / 10 · rule-coverage 100% · ceiling Documented

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

High IaC: DS-0019 · ×2docker/native/Dockerfiledetected by trivy finding
Medium IaC: DS-0001 · ×5docker/native/Dockerfiledetected by trivy finding
Low IaC: DS-0026 · ×3docker/docker_official_images/3.7.0/jvm/Dockerfiledetected by trivy finding

What to do

  1. Resolve the 2 High IaC finding(s) in IaC & Container Security — start with Dockerfile (2). — One of this dimension's main actionable groups (2 issue-level).
  2. Resolve the 5 Medium IaC finding(s) in IaC & Container Security — start with Dockerfile (5). — 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.

D32 · Data Compliance (PII/GDPR)0.0 / 10Critical✓ Tool-verified

What it measures: Likely personal-data (PII / GDPR) handling concerns — logging or storing data without safeguards.

Method: Heuristic PII/GDPR pattern scan via semgrep across the repo, using Watchdog's own ruleset (personal data reaching log/console sinks, URLs and query strings, or unprotected browser storage); matches map to severity and a 0-10 wide normalizer. NotApplicable when the scan runs and detects no PII/GDPR surface (no unearned 10); reported LOUDLY as a measurement gap, never as not-applicable, if the ruleset is missing from the analyzer image. Exhaustive, advisory-leaning; degrades on parse failure.

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

63 finding(s): 0 critical, 63 high, 0 medium, 0 low.

High: watchdog-sensitive-personal-data-in-log · ×50connect/runtime/src/main/java/org/apache/kafka/connect/runtime/isolation/DelegatingClassLoader.java:199detected by semgrep finding

What to do

  1. Resolve the 50 High finding(s) in Data Compliance (PII/GDPR) — start with KafkaConfigBackingStore.java (18), MessageDataGenerator.java (15), JsonConverterGenerator.java (8). — One of this dimension's main actionable groups (50 issue-level).

Detailed fixes: d32_recommendation.md · top locations in Appendix A, every location in findings.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

1011 of 2519 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractStickyAssignor.java.

Orphaned knowledge · ×38clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractStickyAssignor.java
Further orphaned files (smaller)

What to do

  1. Resolve the 38 Orphaned knowledge finding(s) in Knowledge Freshness — start with AbstractStickyAssignor.java, Values.java, TaskAssignmentUtils.java. — One of this dimension's main actionable groups (38 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.9 / 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.9 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: ServerSideAssignorBenchmark.java↔TargetAssignmentBuilderBenchmark.java 84%; ActiveTaskCreator.java↔StandbyTaskCreator.java 83%; ApplicationEventProcessor.java↔CommitEvent.java 82%

Boundary-crossing change coupling: ApiKeys.java ↔ RequestConvertToJson.java · ×2clients/src/main/java/org/apache/kafka/common/protocol/ApiKeys.java
Change coupling: ServerSideAssignorBenchmark.java ↔ TargetAssignmentBuilderBenchmark.java · ×8jmh-benchmarks/src/main/java/org/apache/kafka/jmh/assignor/ServerSideAssignorBenchmark.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
PR-triggered workflow without a permissions block
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 PR-triggered workflow without a permissions block 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.

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d37_recommendation.md.

Frontend & cross-cutting dimensions

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

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 an 'Architecture' / 'How it works' section to the root README — the high-level shape.
  • Add a README to the 6 of 7 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 accuracy10.0 / 10Exemplary◐ 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.

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

  • Your ecosystem's static analyzer is declared as a dependency but is not wired into CI — run it as a required step on push/PR (e.g. `composer phpstan` / `mix sobelow` / `bundle exec brakeman` / the spotbugs Gradle task / `sbt scalafixAll --check` / `golangci-lint run` / `rebar3 lint`) so a regression fails the build instead of relying on someone running it locally.
  • 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.

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).
  • Enable purge protection / soft-delete (and prevent_destroy on critical resources) so data stores can't be lost to an accidental or malicious delete.

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 Health75%StrongSolid.
Architecture99%ExemplaryStrongest area.
Maturity75%StrongSolid.
Readiness67%AdequateAcceptable, with room to improve.
Security52%Adequate — gated by D29, D32, D36Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Not included — 69 check(s) not relevant to this codebase

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

  • AC1 Text alternatives — Frontend below the scale floor (2 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC2 Forms & labels — Frontend below the scale floor (2 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC3 Page structure — Frontend below the scale floor (2 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC4 Keyboard semantics — Frontend below the scale floor (2 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC5 ARIA correctness — Frontend below the scale floor (2 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC6 Visual & motion safety — Frontend below the scale floor (2 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC7 A11y enforcement — Frontend below the scale floor (2 DOM element(s) < 25) — too little surface to assess accessibility.
  • 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 — ~845175 lines of test source are present (.java, .py, .scala) 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 Gradle version catalogue 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.
  • D19 Documentation Quality — LLM evaluation failed
  • 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, .scala) 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 Gradle version catalogue 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.
  • D33 JS/npm Dependency Vulnerabilities — No JS/npm manifest or lockfile found outside build output (package.json, package-lock.json, yarn.lock, pnpm-lock.yaml, bun.lockb); no JS dependencies to scan.
  • D38 OSV Dependency Vulnerabilities — Scanner failed to run — not a clean result
  • 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, .scala, 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, .py, .scala) 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 2 signals for this style — below the bar we score at): 1842 value object(s); 46 domain event(s)
  • ED1 Event-Driven — not scored — this repository shows only 1 of the 3 signals this check looks for (23 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.
  • P6 Release Hygiene — not evidenced — no changelog, version stamp or semver release tag in the repo
  • 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 — the Gradle `jacocoTestReport` task) 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.
  • S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • X1 Async correctness — not 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 — 142 finding(s)
D29 · Static Analysis (SAST) · High · ×50
  • High: github-actions-mutable-action-tag .github/actions/run-gradle/action.yml:110 — 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/actions/setup-gradle/action.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/actions/setup-python/action.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-python@<40-character SHA>`. This step references `actions/setup-python@v6`; resolve the SHA it points at today with `gh api repos/actions/setup-python/commits/v6 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/build.yml:69 — 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@v5`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v5 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/build.yml:74 — 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@v5`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v5 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/build.yml:105 — 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/build.yml:121 — 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@v5`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v5 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/build.yml:149 — 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/build.yml:198 — 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@v5`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v5 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/build.yml:216 — 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/download-artifact@<40-character SHA>`. This step references `actions/download-artifact@v5`; resolve the SHA it points at today with `gh api repos/actions/download-artifact/commits/v5 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/build.yml:237 — 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/build.yml:247 — 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/build.yml:258 — 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/build.yml:288 — 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@v5`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v5 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/build.yml:292 — 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/download-artifact@<40-character SHA>`. This step references `actions/download-artifact@v5`; resolve the SHA it points at today with `gh api repos/actions/download-artifact/commits/v5 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/build.yml:306 — 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/download-artifact@<40-character SHA>`. This step references `actions/download-artifact@v5`; resolve the SHA it points at today with `gh api repos/actions/download-artifact/commits/v5 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/build.yml:322 — 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/build.yml:340 — 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@v5`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v5 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/build.yml:348 — 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/download-artifact@<40-character SHA>`. This step references `actions/download-artifact@v5`; resolve the SHA it points at today with `gh api repos/actions/download-artifact/commits/v5 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/ci-complete.yml:88 — 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@v5`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v5 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/ci-complete.yml:99 — 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/download-artifact@<40-character SHA>`. This step references `actions/download-artifact@v5`; resolve the SHA it points at today with `gh api repos/actions/download-artifact/commits/v5 --jq .sha`.
  • High: secrets-inherit .github/workflows/ci.yml:43 — This workflow uses `secrets: inherit` to pass all of the calling workflow's secrets to a reusable workflow. This violates the principle of least privilege because the called workflow receives access to every secret in the repository, not just the ones it needs. If the called workflow is compromised or sourced from a third party, an attacker gains access to all repository secrets. Instead, explicitly pass only the secrets that the called workflow requires using the `secrets:` map, e.g. `secrets: { MY_SECRET: ${{ secrets.MY_SECRET }} }`.
  • High: github-actions-mutable-action-tag .github/workflows/deflake.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/checkout@<40-character SHA>`. This step references `actions/checkout@v5`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v5 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/deflake.yml:79 — 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/deflake.yml:89 — 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`.
  • + 25 more in this group — see findings.md.
D32 · Data Compliance (PII/GDPR) · High · ×50
  • High: watchdog-sensitive-personal-data-in-log connect/runtime/src/main/java/org/apache/kafka/connect/runtime/isolation/DelegatingClassLoader.java:199 — Special-category or directly-identifying personal data appears to be written to a log or console sink. Logs are copied, shipped to third parties and retained far longer than the data itself is lawfully needed. Log a stable pseudonymous reference instead of the value.
  • High: watchdog-sensitive-personal-data-in-log connect/runtime/src/main/java/org/apache/kafka/connect/runtime/isolation/PluginUtils.java:439 — Special-category or directly-identifying personal data appears to be written to a log or console sink. Logs are copied, shipped to third parties and retained far longer than the data itself is lawfully needed. Log a stable pseudonymous reference instead of the value.
  • High: watchdog-sensitive-personal-data-in-log connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java:948 — Special-category or directly-identifying personal data appears to be written to a log or console sink. Logs are copied, shipped to third parties and retained far longer than the data itself is lawfully needed. Log a stable pseudonymous reference instead of the value.
  • High: watchdog-sensitive-personal-data-in-log connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java:955 — Special-category or directly-identifying personal data appears to be written to a log or console sink. Logs are copied, shipped to third parties and retained far longer than the data itself is lawfully needed. Log a stable pseudonymous reference instead of the value.
  • High: watchdog-sensitive-personal-data-in-log connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java:964 — Special-category or directly-identifying personal data appears to be written to a log or console sink. Logs are copied, shipped to third parties and retained far longer than the data itself is lawfully needed. Log a stable pseudonymous reference instead of the value.
  • High: watchdog-sensitive-personal-data-in-log connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java:1001 — Special-category or directly-identifying personal data appears to be written to a log or console sink. Logs are copied, shipped to third parties and retained far longer than the data itself is lawfully needed. Log a stable pseudonymous reference instead of the value.
  • High: watchdog-sensitive-personal-data-in-log connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java:1007 — Special-category or directly-identifying personal data appears to be written to a log or console sink. Logs are copied, shipped to third parties and retained far longer than the data itself is lawfully needed. Log a stable pseudonymous reference instead of the value.
  • High: watchdog-sensitive-personal-data-in-log connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java:1037 — Special-category or directly-identifying personal data appears to be written to a log or console sink. Logs are copied, shipped to third parties and retained far longer than the data itself is lawfully needed. Log a stable pseudonymous reference instead of the value.
  • High: watchdog-sensitive-personal-data-in-log connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java:1044 — Special-category or directly-identifying personal data appears to be written to a log or console sink. Logs are copied, shipped to third parties and retained far longer than the data itself is lawfully needed. Log a stable pseudonymous reference instead of the value.
  • High: watchdog-sensitive-personal-data-in-log connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java:1097 — Special-category or directly-identifying personal data appears to be written to a log or console sink. Logs are copied, shipped to third parties and retained far longer than the data itself is lawfully needed. Log a stable pseudonymous reference instead of the value.
  • High: watchdog-sensitive-personal-data-in-log connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java:1148 — Special-category or directly-identifying personal data appears to be written to a log or console sink. Logs are copied, shipped to third parties and retained far longer than the data itself is lawfully needed. Log a stable pseudonymous reference instead of the value.
  • High: watchdog-sensitive-personal-data-in-log connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java:1157 — Special-category or directly-identifying personal data appears to be written to a log or console sink. Logs are copied, shipped to third parties and retained far longer than the data itself is lawfully needed. Log a stable pseudonymous reference instead of the value.
  • High: watchdog-sensitive-personal-data-in-log connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java:1166 — Special-category or directly-identifying personal data appears to be written to a log or console sink. Logs are copied, shipped to third parties and retained far longer than the data itself is lawfully needed. Log a stable pseudonymous reference instead of the value.
  • High: watchdog-sensitive-personal-data-in-log connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java:1176 — Special-category or directly-identifying personal data appears to be written to a log or console sink. Logs are copied, shipped to third parties and retained far longer than the data itself is lawfully needed. Log a stable pseudonymous reference instead of the value.
  • High: watchdog-sensitive-personal-data-in-log connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java:1195 — Special-category or directly-identifying personal data appears to be written to a log or console sink. Logs are copied, shipped to third parties and retained far longer than the data itself is lawfully needed. Log a stable pseudonymous reference instead of the value.
  • High: watchdog-sensitive-personal-data-in-log connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java:1204 — Special-category or directly-identifying personal data appears to be written to a log or console sink. Logs are copied, shipped to third parties and retained far longer than the data itself is lawfully needed. Log a stable pseudonymous reference instead of the value.
  • High: watchdog-sensitive-personal-data-in-log connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java:1211 — Special-category or directly-identifying personal data appears to be written to a log or console sink. Logs are copied, shipped to third parties and retained far longer than the data itself is lawfully needed. Log a stable pseudonymous reference instead of the value.
  • High: watchdog-sensitive-personal-data-in-log connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java:1217 — Special-category or directly-identifying personal data appears to be written to a log or console sink. Logs are copied, shipped to third parties and retained far longer than the data itself is lawfully needed. Log a stable pseudonymous reference instead of the value.
  • High: watchdog-sensitive-personal-data-in-log connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java:1235 — Special-category or directly-identifying personal data appears to be written to a log or console sink. Logs are copied, shipped to third parties and retained far longer than the data itself is lawfully needed. Log a stable pseudonymous reference instead of the value.
  • High: watchdog-sensitive-personal-data-in-log connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java:1244 — Special-category or directly-identifying personal data appears to be written to a log or console sink. Logs are copied, shipped to third parties and retained far longer than the data itself is lawfully needed. Log a stable pseudonymous reference instead of the value.
  • High: watchdog-sensitive-personal-data-in-log connect/runtime/src/main/java/org/apache/kafka/connect/storage/OffsetUtils.java:101 — Special-category or directly-identifying personal data appears to be written to a log or console sink. Logs are copied, shipped to third parties and retained far longer than the data itself is lawfully needed. Log a stable pseudonymous reference instead of the value.
  • High: watchdog-sensitive-personal-data-in-log connect/runtime/src/main/java/org/apache/kafka/connect/storage/OffsetUtils.java:113 — Special-category or directly-identifying personal data appears to be written to a log or console sink. Logs are copied, shipped to third parties and retained far longer than the data itself is lawfully needed. Log a stable pseudonymous reference instead of the value.
  • High: watchdog-sensitive-personal-data-in-log connect/runtime/src/main/java/org/apache/kafka/connect/storage/OffsetUtils.java:120 — Special-category or directly-identifying personal data appears to be written to a log or console sink. Logs are copied, shipped to third parties and retained far longer than the data itself is lawfully needed. Log a stable pseudonymous reference instead of the value.
  • High: watchdog-sensitive-personal-data-in-log generator/src/main/java/org/apache/kafka/message/CoordinatorRecordJsonConvertersGenerator.java:114 — Special-category or directly-identifying personal data appears to be written to a log or console sink. Logs are copied, shipped to third parties and retained far longer than the data itself is lawfully needed. Log a stable pseudonymous reference instead of the value.
  • High: watchdog-sensitive-personal-data-in-log generator/src/main/java/org/apache/kafka/message/CoordinatorRecordJsonConvertersGenerator.java:141 — Special-category or directly-identifying personal data appears to be written to a log or console sink. Logs are copied, shipped to third parties and retained far longer than the data itself is lawfully needed. Log a stable pseudonymous reference instead of the value.
  • + 25 more in this group — see findings.md.
D34 · Knowledge Freshness · Orphaned knowledge · ×38
  • Orphaned knowledge clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractStickyAssignor.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 connect/api/src/main/java/org/apache/kafka/connect/data/Values.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 streams/src/main/java/org/apache/kafka/streams/processor/assignment/TaskAssignmentUtils.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 streams/streams-scala/src/main/scala/org/apache/kafka/streams/scala/kstream/KTable.scala — 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 connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerSinkTask.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 connect/runtime/src/main/java/org/apache/kafka/connect/util/TopicAdmin.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 streams/src/main/java/org/apache/kafka/streams/state/internals/metrics/RocksDBMetrics.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 clients/src/main/java/org/apache/kafka/common/security/authenticator/SaslClientAuthenticator.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 streams/src/main/java/org/apache/kafka/streams/state/internals/RocksDBVersionedStoreSegmentValueFormatter.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 connect/runtime/src/main/java/org/apache/kafka/connect/runtime/ConnectMetricsRegistry.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 connect/runtime/src/main/java/org/apache/kafka/connect/runtime/AbstractWorkerSourceTask.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 connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaStatusBackingStore.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 streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamsMetadataState.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 clients/src/main/java/org/apache/kafka/common/network/KafkaChannel.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 clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerNetworkClient.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 streams/src/main/java/org/apache/kafka/streams/state/internals/metrics/RocksDBMetricsRecorder.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 tools/src/main/java/org/apache/kafka/tools/ManifestWorkspace.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 connect/runtime/src/main/java/org/apache/kafka/connect/runtime/ExactlyOnceWorkerSourceTask.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 streams/src/main/java/org/apache/kafka/streams/processor/internals/assignment/RackAwareTaskAssignor.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 generator/src/main/java/org/apache/kafka/message/JsonConverterGenerator.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 connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerTask.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 streams/src/main/java/org/apache/kafka/streams/processor/internals/assignment/ClientState.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 connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerConnector.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 clients/src/main/java/org/apache/kafka/common/security/oauthbearer/internals/expiring/ExpiringCredentialRefreshingLogin.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 trogdor/src/main/java/org/apache/kafka/trogdor/workload/ConsumeBenchWorker.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.
  • + 13 more in this group — see findings.md.
D31 · IaC & Container Security · High IaC · ×2
  • High IaC: DS-0019 docker/native/Dockerfile — 'dnf clean all' missing The install step leaves the package manager's index and downloaded packages behind in that layer, so every pull carries them and every CVE in them is attributed to your image. The step: this file installs with `microdnf`, so end the SAME `RUN` that installs with `&& microdnf clean all` — a later `RUN` cannot help, because the cache is already committed to the earlier layer. (The rule's title names the command for a different package manager; the defect it measures is the same one.) Where the builder supports it, `RUN --mount=type=cache` is the alternative: the cache is mounted for the step and never enters a layer at all.
  • High IaC: DS-0027 docker/native/Dockerfile — 'microdnf clean all' missing
D35 · Change Coupling · Boundary-crossing change coupling · ×2
  • Boundary-crossing change coupling: ApiKeys.java ↔ RequestConvertToJson.java clients/src/main/java/org/apache/kafka/common/protocol/ApiKeys.java — `clients/src/main/java/org/apache/kafka/common/protocol/ApiKeys.java` (context clients) and `server/src/main/java/org/apache/kafka/network/RequestConvertToJson.java` (context main) sit in DIFFERENT parts of the tree yet change together 64% of the time (9 of the 14 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: GroupSpecImpl.java ↔ TargetAssignmentBuilderBenchmark.java group-coordinator/src/main/java/org/apache/kafka/coordinator/group/modern/GroupSpecImpl.java — `group-coordinator/src/main/java/org/apache/kafka/coordinator/group/modern/GroupSpecImpl.java` (context group-coordinator) and `jmh-benchmarks/src/main/java/org/apache/kafka/jmh/assignor/TargetAssignmentBuilderBenchmark.java` (context jmh-benchmarks) sit in DIFFERENT parts of the tree yet change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) — 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.
Warning — 1136 finding(s)
D3 · God Classes · TooManyMethods · ×148
  • TooManyMethods: RocksDBGenericOptionsToDbOptionsColumnFamilyOptionsAdapter streams/src/main/java/org/apache/kafka/streams/state/internals/RocksDBGenericOptionsToDbOptionsColumnFamilyOptionsAdapter.java:65 — TooManyMethods — 308 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: GroupMetadataManager group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:275 — TooManyMethods — 263 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: UnifiedLog storage/src/main/java/org/apache/kafka/storage/internals/log/UnifiedLog.java:105 — TooManyMethods — 152 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: KafkaRaftClient raft/src/main/java/org/apache/kafka/raft/KafkaRaftClient.java:170 — TooManyMethods — 138 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: TaskManager streams/src/main/java/org/apache/kafka/streams/processor/internals/TaskManager.java:77 — TooManyMethods — 120 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: KafkaAdminClient clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java:324 — TooManyMethods — 114 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: AsyncKafkaConsumer clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java:177 — TooManyMethods — 105 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: Utils clients/src/main/java/org/apache/kafka/common/utils/Utils.java:101 — TooManyMethods — 103 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: DistributedHerder connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/DistributedHerder.java:154 — TooManyMethods — 97 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: SubscriptionState clients/src/main/java/org/apache/kafka/clients/consumer/internals/SubscriptionState.java:74 — 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: TransactionManager clients/src/main/java/org/apache/kafka/clients/producer/internals/TransactionManager.java:99 — 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: InternalTopologyBuilder streams/src/main/java/org/apache/kafka/streams/processor/internals/InternalTopologyBuilder.java:72 — 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: SharePartition core/src/main/java/kafka/server/share/SharePartition.java:103 — TooManyMethods — 94 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: StreamsGroup group-coordinator/src/main/java/org/apache/kafka/coordinator/group/streams/StreamsGroup.java:72 — TooManyMethods — 94 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: LogManager storage/src/main/java/org/apache/kafka/storage/internals/log/LogManager.java:81 — TooManyMethods — 89 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: ClassicGroup group-coordinator/src/main/java/org/apache/kafka/coordinator/group/classic/ClassicGroup.java:77 — TooManyMethods — 85 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: AbstractKafkaConfig server/src/main/java/org/apache/kafka/server/config/AbstractKafkaConfig.java:66 — TooManyMethods — 82 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: KStreamImpl streams/src/main/java/org/apache/kafka/streams/kstream/internals/KStreamImpl.java:78 — TooManyMethods — 82 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: MockConsumer clients/src/main/java/org/apache/kafka/clients/consumer/MockConsumer.java:62 — TooManyMethods — 80 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: Worker connect/runtime/src/main/java/org/apache/kafka/connect/runtime/Worker.java:140 — TooManyMethods — 80 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: GroupCoordinatorService group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupCoordinatorService.java:171 — TooManyMethods — 78 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: StreamThread streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamThread.java:114 — TooManyMethods — 76 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: StreamsMetricsImpl streams/src/main/java/org/apache/kafka/streams/processor/internals/metrics/StreamsMetricsImpl.java:53 — TooManyMethods — 76 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: GroupCoordinatorConfig group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupCoordinatorConfig.java:68 — TooManyMethods — 75 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: ClientState streams/src/main/java/org/apache/kafka/streams/processor/internals/assignment/ClientState.java:52 — TooManyMethods — 73 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.
  • + 123 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×110
  • FileTooLong: group/GroupMetadataManager.java group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:0 — FileTooLong — 5161 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: GroupMetadataManager (275-9860). 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: admin/KafkaAdminClient.java clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java:0 — FileTooLong — 3521 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: KafkaAdminClient (324-5234). 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: raft/KafkaRaftClient.java raft/src/main/java/org/apache/kafka/raft/KafkaRaftClient.java:0 — FileTooLong — 2552 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: KafkaRaftClient (170-4162). 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: share/SharePartition.java core/src/main/java/kafka/server/share/SharePartition.java:0 — FileTooLong — 1857 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: SharePartition (103-3645). 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: group/GroupCoordinatorService.java group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupCoordinatorService.java:0 — FileTooLong — 1854 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: GroupCoordinatorService (171-3086). 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: distributed/DistributedHerder.java connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/DistributedHerder.java:0 — FileTooLong — 1850 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: DistributedHerder (154-3032). 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: controller/ReplicationControlManager.java metadata/src/main/java/org/apache/kafka/controller/ReplicationControlManager.java:0 — FileTooLong — 1691 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: ReplicationControlManager (150-2548). 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: internals/AsyncKafkaConsumer.java clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java:0 — FileTooLong — 1535 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: AsyncKafkaConsumer (177-2538). 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: storage/RemoteLogManager.java storage/src/main/java/org/apache/kafka/server/log/remote/storage/RemoteLogManager.java:0 — FileTooLong — 1528 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: RemoteLogManager (152-2453). 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: internals/InternalTopologyBuilder.java streams/src/main/java/org/apache/kafka/streams/processor/internals/InternalTopologyBuilder.java:0 — FileTooLong — 1475 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: InternalTopologyBuilder (72-2367). 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: log/UnifiedLog.java storage/src/main/java/org/apache/kafka/storage/internals/log/UnifiedLog.java:0 — FileTooLong — 1472 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: UnifiedLog (105-2787). 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: runtime/Worker.java connect/runtime/src/main/java/org/apache/kafka/connect/runtime/Worker.java:0 — FileTooLong — 1469 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: Worker (140-2415). 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: controller/QuorumController.java metadata/src/main/java/org/apache/kafka/controller/QuorumController.java:0 — FileTooLong — 1419 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: QuorumController (176-2229). 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: message/MessageDataGenerator.java generator/src/main/java/org/apache/kafka/message/MessageDataGenerator.java:0 — FileTooLong — 1405 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: MessageDataGenerator (32-1688). 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: internals/StreamThread.java streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamThread.java:0 — FileTooLong — 1393 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: StreamThread (114-2239). 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: streams/StreamsConfig.java streams/src/main/java/org/apache/kafka/streams/StreamsConfig.java:0 — FileTooLong — 1392 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: internals/TaskManager.java streams/src/main/java/org/apache/kafka/streams/processor/internals/TaskManager.java:0 — FileTooLong — 1334 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: TaskManager (77-2205). 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: internals/TransactionManager.java clients/src/main/java/org/apache/kafka/clients/producer/internals/TransactionManager.java:0 — FileTooLong — 1235 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: runtime/CoordinatorRuntime.java coordinator-common/src/main/java/org/apache/kafka/coordinator/common/runtime/CoordinatorRuntime.java:0 — FileTooLong — 1204 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: CoordinatorRuntime (100-2540). 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: internals/RocksDBGenericOptionsToDbOptionsColumnFamilyOptionsAdapter.java streams/src/main/java/org/apache/kafka/streams/state/internals/RocksDBGenericOptionsToDbOptionsColumnFamilyOptionsAdapter.java:0 — FileTooLong — 1140 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: RocksDBGenericOptionsToDbOptionsColumnFamilyOptionsAdapter (65-1799). 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: streams/KafkaStreams.java streams/src/main/java/org/apache/kafka/streams/KafkaStreams.java:0 — FileTooLong — 1127 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: KafkaStreams (162-2225). 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: persister/PersisterStateManager.java server-common/src/main/java/org/apache/kafka/server/share/persister/PersisterStateManager.java:0 — FileTooLong — 1123 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: PersisterStateManager (90-1740). 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: streams/TopologyTestDriver.java streams/test-utils/src/main/java/org/apache/kafka/streams/TopologyTestDriver.java:0 — FileTooLong — 1117 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: log/LogManager.java storage/src/main/java/org/apache/kafka/storage/internals/log/LogManager.java:0 — FileTooLong — 1072 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: LogManager (81-1897). 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: internals/StreamsPartitionAssignor.java streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamsPartitionAssignor.java:0 — FileTooLong — 1068 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: StreamsPartitionAssignor (106-1704). 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.
  • + 85 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×37
  • Duplicated block (9 lines × 2) clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java:1852 — clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java:1852-1860 | clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java:3245-3253 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java:1852` 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) clients/src/main/java/org/apache/kafka/clients/consumer/internals/events/ApplicationEventProcessor.java:254 — clients/src/main/java/org/apache/kafka/clients/consumer/internals/events/ApplicationEventProcessor.java:254-262 | clients/src/main/java/org/apache/kafka/clients/consumer/internals/events/ApplicationEventProcessor.java:272-280 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `clients/src/main/java/org/apache/kafka/clients/consumer/internals/events/ApplicationEventProcessor.java:254` it does not close everything it opens, so those exact lines 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) clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinator.java:757 — clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinator.java:757-765 | clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinator.java:790-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 `clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinator.java:757` it does not close everything it opens, so those exact lines 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) clients/src/main/java/org/apache/kafka/clients/consumer/internals/Acknowledgements.java:197 — clients/src/main/java/org/apache/kafka/clients/consumer/internals/Acknowledgements.java:197-205 | clients/src/main/java/org/apache/kafka/clients/consumer/internals/Acknowledgements.java:216-224 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `clients/src/main/java/org/apache/kafka/clients/consumer/internals/Acknowledgements.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 (9 lines × 2) clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java:1661 — clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java:1661-1669 | clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareConsumerImpl.java:1038-1046 — 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) clients/src/main/java/org/apache/kafka/clients/consumer/internals/FetchMetricsRegistry.java:91 — clients/src/main/java/org/apache/kafka/clients/consumer/internals/FetchMetricsRegistry.java:91-99 | clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareFetchMetricsRegistry.java:84-92 — 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 `clients/src/main/java/org/apache/kafka/clients/consumer/internals/FetchMetricsRegistry.java:91` 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) clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareConsumeRequestManager.java:591 — clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareConsumeRequestManager.java:591-600 | clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareConsumeRequestManager.java:670-678 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareConsumeRequestManager.java:591` it does not close everything it opens, so those 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) clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareConsumeRequestManager.java:1070 — clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareConsumeRequestManager.java:1070-1078 | clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareConsumeRequestManager.java:1102-1110 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareConsumeRequestManager.java:1070` 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) clients/src/main/java/org/apache/kafka/common/network/SaslChannelBuilder.java:377 — clients/src/main/java/org/apache/kafka/common/network/SaslChannelBuilder.java:377-385 | clients/src/main/java/org/apache/kafka/common/security/authenticator/SaslServerAuthenticator.java:221-229 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (9 lines × 2) clients/src/main/java/org/apache/kafka/common/utils/internals/ByteUtils.java:224 — clients/src/main/java/org/apache/kafka/common/utils/internals/ByteUtils.java:224-232 | jmh-benchmarks/src/main/java/org/apache/kafka/jmh/util/ByteUtilsBenchmark.java:383-391 — 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 `clients/src/main/java/org/apache/kafka/common/utils/internals/ByteUtils.java:224` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, 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) server-common/src/main/java/org/apache/kafka/server/share/persister/DefaultStatePersister.java:284 — server-common/src/main/java/org/apache/kafka/server/share/persister/DefaultStatePersister.java:284-292 | server-common/src/main/java/org/apache/kafka/server/share/persister/DefaultStatePersister.java:437-446 — both copies are in the same file, so extract the 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) storage/api/src/main/java/org/apache/kafka/server/log/remote/storage/RemoteStorageMetrics.java:116 — storage/api/src/main/java/org/apache/kafka/server/log/remote/storage/RemoteStorageMetrics.java:116-124 | storage/api/src/main/java/org/apache/kafka/server/log/remote/storage/RemoteStorageMetrics.java:145-153 — both copies are in the same file, so extract the 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) server/src/main/java/org/apache/kafka/server/BrokerLifecycleManager.java:531 — server/src/main/java/org/apache/kafka/server/BrokerLifecycleManager.java:531-539 | server/src/main/java/org/apache/kafka/server/BrokerLifecycleManager.java:622-631 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `server/src/main/java/org/apache/kafka/server/BrokerLifecycleManager.java:531` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java:1002 — connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java:1002-1010 | connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java:1038-1046 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java:1002` 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) connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java:1196 — connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java:1196-1204 | connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java:1236-1244 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java:1196` 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) connect/transforms/src/main/java/org/apache/kafka/connect/transforms/InsertField.java:177 — connect/transforms/src/main/java/org/apache/kafka/connect/transforms/InsertField.java:177-185 | connect/transforms/src/main/java/org/apache/kafka/connect/transforms/ReplaceField.java:173-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 `connect/transforms/src/main/java/org/apache/kafka/connect/transforms/InsertField.java:177` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) connect/runtime/src/main/java/org/apache/kafka/connect/runtime/AbstractWorkerSourceTask.java:243 — connect/runtime/src/main/java/org/apache/kafka/connect/runtime/AbstractWorkerSourceTask.java:243-252 | connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerSinkTask.java:130-138 — 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) connect/runtime/src/main/java/org/apache/kafka/connect/runtime/Worker.java:1530 — connect/runtime/src/main/java/org/apache/kafka/connect/runtime/Worker.java:1530-1538 | connect/runtime/src/main/java/org/apache/kafka/connect/runtime/Worker.java:1573-1581 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `connect/runtime/src/main/java/org/apache/kafka/connect/runtime/Worker.java:1530` 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) connect/test-plugins/src/main/java/org/apache/kafka/connect/tools/MockSinkTask.java:50 — connect/test-plugins/src/main/java/org/apache/kafka/connect/tools/MockSinkTask.java:50-58 | connect/test-plugins/src/main/java/org/apache/kafka/connect/tools/MockSourceTask.java:50-58 — 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 `connect/test-plugins/src/main/java/org/apache/kafka/connect/tools/MockSinkTask.java:50` it does not close everything it opens, so those exact lines 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) coordinator-common/src/main/java/org/apache/kafka/coordinator/common/runtime/CoordinatorRuntime.java:1290 — coordinator-common/src/main/java/org/apache/kafka/coordinator/common/runtime/CoordinatorRuntime.java:1290-1298 | coordinator-common/src/main/java/org/apache/kafka/coordinator/common/runtime/CoordinatorRuntime.java:1603-1611 — both copies are in the same file, so extract the 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) group-coordinator/src/main/java/org/apache/kafka/coordinator/group/assignor/SimpleHeterogeneousAssignmentBuilder.java:425 — group-coordinator/src/main/java/org/apache/kafka/coordinator/group/assignor/SimpleHeterogeneousAssignmentBuilder.java:425-433 | group-coordinator/src/main/java/org/apache/kafka/coordinator/group/assignor/SimpleHomogeneousAssignmentBuilder.java:351-359 — 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 `group-coordinator/src/main/java/org/apache/kafka/coordinator/group/assignor/SimpleHeterogeneousAssignmentBuilder.java:425` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) group-coordinator/src/main/java/org/apache/kafka/coordinator/group/streams/assignor/StickyTaskAssignor.java:190 — group-coordinator/src/main/java/org/apache/kafka/coordinator/group/streams/assignor/StickyTaskAssignor.java:190-198 | group-coordinator/src/main/java/org/apache/kafka/coordinator/group/streams/assignor/StickyTaskAssignor.java:206-214 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `group-coordinator/src/main/java/org/apache/kafka/coordinator/group/streams/assignor/StickyTaskAssignor.java:190` 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) group-coordinator/src/main/java/org/apache/kafka/coordinator/group/streams/CurrentAssignmentBuilder.java:440 — group-coordinator/src/main/java/org/apache/kafka/coordinator/group/streams/CurrentAssignmentBuilder.java:440-448 | group-coordinator/src/main/java/org/apache/kafka/coordinator/group/streams/CurrentAssignmentBuilder.java:455-463 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupConfig.java:921 — group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupConfig.java:921-929 | group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupConfig.java:980-988 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupConfig.java:921` it does not close everything it opens, so those 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) group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:4207 — group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:4207-4215 | group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:4402-4410 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 12 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×37
  • Duplicated block (7 lines × 2) clients/src/main/java/org/apache/kafka/clients/admin/internals/DeleteConsumerGroupOffsetsHandler.java:115 — clients/src/main/java/org/apache/kafka/clients/admin/internals/DeleteConsumerGroupOffsetsHandler.java:115-121 | clients/src/main/java/org/apache/kafka/clients/admin/internals/RemoveMembersFromConsumerGroupHandler.java:98-104 — 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 `clients/src/main/java/org/apache/kafka/clients/admin/internals/DeleteConsumerGroupOffsetsHandler.java:115` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, 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) clients/src/main/java/org/apache/kafka/clients/admin/internals/DescribeClassicGroupsHandler.java:91 — clients/src/main/java/org/apache/kafka/clients/admin/internals/DescribeClassicGroupsHandler.java:91-97 | clients/src/main/java/org/apache/kafka/clients/admin/internals/DescribeShareGroupsHandler.java:86-92 — 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) clients/src/main/java/org/apache/kafka/clients/admin/internals/ListConsumerGroupOffsetsHandler.java:100 — clients/src/main/java/org/apache/kafka/clients/admin/internals/ListConsumerGroupOffsetsHandler.java:100-106 | clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinator.java:1490-1496 — 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 `clients/src/main/java/org/apache/kafka/clients/admin/internals/ListConsumerGroupOffsetsHandler.java:100` 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) clients/src/main/java/org/apache/kafka/clients/admin/AlterConsumerGroupOffsetsResult.java:45 — clients/src/main/java/org/apache/kafka/clients/admin/AlterConsumerGroupOffsetsResult.java:45-51 | clients/src/main/java/org/apache/kafka/clients/admin/AlterShareGroupOffsetsResult.java:47-53 — 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 `clients/src/main/java/org/apache/kafka/clients/admin/AlterConsumerGroupOffsetsResult.java:45` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinator.java:648 — clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinator.java:648-654 | clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinator.java:829-835 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinator.java:648` it does not close everything it opens, so those exact lines 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) clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java:2353 — clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java:2353-2359 | clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareConsumerImpl.java:1280-1286 — 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 `clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java:2353` it does not close everything it opens, so those exact lines 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) clients/src/main/java/org/apache/kafka/clients/consumer/internals/FetchCollector.java:325 — clients/src/main/java/org/apache/kafka/clients/consumer/internals/FetchCollector.java:325-331 | clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareFetchCollector.java:156-162 — 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 `clients/src/main/java/org/apache/kafka/clients/consumer/internals/FetchCollector.java:325` it does not close everything it opens, so those 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) clients/src/main/java/org/apache/kafka/clients/consumer/internals/StreamsMembershipManager.java:1196 — clients/src/main/java/org/apache/kafka/clients/consumer/internals/StreamsMembershipManager.java:1196-1202 | clients/src/main/java/org/apache/kafka/clients/consumer/internals/StreamsMembershipManager.java:1269-1275 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) clients/src/main/java/org/apache/kafka/clients/producer/internals/TransactionManager.java:1832 — clients/src/main/java/org/apache/kafka/clients/producer/internals/TransactionManager.java:1832-1838 | clients/src/main/java/org/apache/kafka/clients/producer/internals/TransactionManager.java:1897-1903 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `clients/src/main/java/org/apache/kafka/clients/producer/internals/TransactionManager.java:1832` 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) clients/src/main/java/org/apache/kafka/clients/NetworkClient.java:1045 — clients/src/main/java/org/apache/kafka/clients/NetworkClient.java:1045-1051 | clients/src/main/java/org/apache/kafka/clients/NetworkClient.java:1157-1163 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `clients/src/main/java/org/apache/kafka/clients/NetworkClient.java:1045` 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) clients/src/main/java/org/apache/kafka/common/network/Selector.java:1338 — clients/src/main/java/org/apache/kafka/common/network/Selector.java:1338-1344 | clients/src/main/java/org/apache/kafka/common/network/Selector.java:1358-1364 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `clients/src/main/java/org/apache/kafka/common/network/Selector.java:1338` 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) clients/src/main/java/org/apache/kafka/common/requests/InitializeShareGroupStateResponse.java:47 — clients/src/main/java/org/apache/kafka/common/requests/InitializeShareGroupStateResponse.java:47-53 | clients/src/main/java/org/apache/kafka/common/requests/ReadShareGroupStateResponse.java:47-53 — 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) clients/src/main/java/org/apache/kafka/common/requests/ShareFetchRequest.java:75 — clients/src/main/java/org/apache/kafka/common/requests/ShareFetchRequest.java:75-81 | clients/src/main/java/org/apache/kafka/common/requests/ShareFetchRequest.java:95-101 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) clients/src/main/java/org/apache/kafka/common/security/authenticator/SaslClientCallbackHandler.java:75 — clients/src/main/java/org/apache/kafka/common/security/authenticator/SaslClientCallbackHandler.java:75-81 | clients/src/main/java/org/apache/kafka/common/security/kerberos/KerberosClientCallbackHandler.java:58-64 — 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 `clients/src/main/java/org/apache/kafka/common/security/authenticator/SaslClientCallbackHandler.java:75` 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) clients/src/main/java/org/apache/kafka/common/security/ssl/SslFactory.java:328 — clients/src/main/java/org/apache/kafka/common/security/ssl/SslFactory.java:328-334 | clients/src/main/java/org/apache/kafka/common/security/ssl/SslFactory.java:352-358 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `clients/src/main/java/org/apache/kafka/common/security/ssl/SslFactory.java:328` 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) clients/src/main/java/org/apache/kafka/common/serialization/ListDeserializer.java:108 — clients/src/main/java/org/apache/kafka/common/serialization/ListDeserializer.java:108-115 | clients/src/main/java/org/apache/kafka/common/serialization/ListSerializer.java:79-85 — 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 `clients/src/main/java/org/apache/kafka/common/serialization/ListDeserializer.java:108` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) storage/src/main/java/org/apache/kafka/server/log/remote/metadata/storage/serialization/RemoteLogSegmentMetadataSnapshotTransform.java:35 — storage/src/main/java/org/apache/kafka/server/log/remote/metadata/storage/serialization/RemoteLogSegmentMetadataSnapshotTransform.java:35-41 | storage/src/main/java/org/apache/kafka/server/log/remote/metadata/storage/serialization/RemoteLogSegmentMetadataTransform.java:39-45 — 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 `storage/src/main/java/org/apache/kafka/server/log/remote/metadata/storage/serialization/RemoteLogSegmentMetadataSnapshotTransform.java:35` 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) connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java:525 — connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java:525-531 | connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java:550-558 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java:525` 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) connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java:948 — connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java:948-954 | connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java:1235-1243 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java:948` 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) connect/transforms/src/main/java/org/apache/kafka/connect/transforms/Cast.java:393 — connect/transforms/src/main/java/org/apache/kafka/connect/transforms/Cast.java:393-399 | connect/transforms/src/main/java/org/apache/kafka/connect/transforms/Cast.java:402-408 — both copies are in the same file, so extract the 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) connect/transforms/src/main/java/org/apache/kafka/connect/transforms/InsertField.java:155 — connect/transforms/src/main/java/org/apache/kafka/connect/transforms/InsertField.java:155-161 | connect/transforms/src/main/java/org/apache/kafka/connect/transforms/InsertField.java:189-195 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `connect/transforms/src/main/java/org/apache/kafka/connect/transforms/InsertField.java:155` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) coordinator-common/src/main/java/org/apache/kafka/coordinator/common/runtime/KRaftCoordinatorMetadataImage.java:57 — coordinator-common/src/main/java/org/apache/kafka/coordinator/common/runtime/KRaftCoordinatorMetadataImage.java:57-63 | coordinator-common/src/main/java/org/apache/kafka/coordinator/common/runtime/KRaftCoordinatorMetadataImage.java:68-74 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, 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) group-coordinator/src/main/java/org/apache/kafka/coordinator/group/assignor/SimpleHeterogeneousAssignmentBuilder.java:108 — group-coordinator/src/main/java/org/apache/kafka/coordinator/group/assignor/SimpleHeterogeneousAssignmentBuilder.java:108-114 | group-coordinator/src/main/java/org/apache/kafka/coordinator/group/assignor/SimpleHomogeneousAssignmentBuilder.java:139-145 — 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 (7 lines × 2) group-coordinator/src/main/java/org/apache/kafka/coordinator/group/assignor/SimpleHeterogeneousAssignmentBuilder.java:376 — group-coordinator/src/main/java/org/apache/kafka/coordinator/group/assignor/SimpleHeterogeneousAssignmentBuilder.java:376-382 | group-coordinator/src/main/java/org/apache/kafka/coordinator/group/assignor/SimpleHomogeneousAssignmentBuilder.java:307-313 — 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 (7 lines × 2) group-coordinator/src/main/java/org/apache/kafka/coordinator/group/assignor/SimpleHeterogeneousAssignmentBuilder.java:435 — group-coordinator/src/main/java/org/apache/kafka/coordinator/group/assignor/SimpleHeterogeneousAssignmentBuilder.java:435-441 | group-coordinator/src/main/java/org/apache/kafka/coordinator/group/assignor/SimpleHomogeneousAssignmentBuilder.java:361-367 — 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 `group-coordinator/src/main/java/org/apache/kafka/coordinator/group/assignor/SimpleHeterogeneousAssignmentBuilder.java:435` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • + 12 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×25
  • Duplicated block (8 lines × 2) api-checker/gradle-plugins/src/main/java/org/apache/kafka/gradle/KafkaInternalApiCheckerTask.java:126 — api-checker/gradle-plugins/src/main/java/org/apache/kafka/gradle/KafkaInternalApiCheckerTask.java:126-133 | api-checker/gradle-plugins/src/main/java/org/apache/kafka/gradle/KafkaPublicApiCheckerTask.java:98-108 — 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) clients/src/main/java/org/apache/kafka/clients/admin/DescribeUserScramCredentialsResult.java:58 — clients/src/main/java/org/apache/kafka/clients/admin/DescribeUserScramCredentialsResult.java:58-68 | clients/src/main/java/org/apache/kafka/clients/admin/DescribeUserScramCredentialsResult.java:118-125 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `clients/src/main/java/org/apache/kafka/clients/admin/DescribeUserScramCredentialsResult.java:58` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note 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) clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java:808 — clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java:808-815 | clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinator.java:1297-1304 — 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 `clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java:808` 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) clients/src/main/java/org/apache/kafka/common/requests/FetchMetadata.java:154 — clients/src/main/java/org/apache/kafka/common/requests/FetchMetadata.java:154-161 | clients/src/main/java/org/apache/kafka/common/requests/ShareRequestMetadata.java:107-114 — 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 (8 lines × 2) clients/src/main/java/org/apache/kafka/common/requests/ShareAcknowledgeResponse.java:66 — clients/src/main/java/org/apache/kafka/common/requests/ShareAcknowledgeResponse.java:66-73 | clients/src/main/java/org/apache/kafka/common/requests/ShareFetchResponse.java:73-80 — 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 `clients/src/main/java/org/apache/kafka/common/requests/ShareAcknowledgeResponse.java:66` 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) clients/src/main/java/org/apache/kafka/common/requests/ShareAcknowledgeResponse.java:138 — clients/src/main/java/org/apache/kafka/common/requests/ShareAcknowledgeResponse.java:138-145 | clients/src/main/java/org/apache/kafka/common/requests/ShareFetchResponse.java:196-203 — 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 `clients/src/main/java/org/apache/kafka/common/requests/ShareAcknowledgeResponse.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. The matched lines also transfer control out of the body holding them, 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) clients/src/main/java/org/apache/kafka/common/utils/internals/ByteUtils.java:423 — clients/src/main/java/org/apache/kafka/common/utils/internals/ByteUtils.java:423-430 | jmh-benchmarks/src/main/java/org/apache/kafka/jmh/util/ByteUtilsBenchmark.java:575-582 — 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 `clients/src/main/java/org/apache/kafka/common/utils/internals/ByteUtils.java:423` 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) storage/src/main/java/org/apache/kafka/server/log/remote/storage/RemoteLogManager.java:1116 — storage/src/main/java/org/apache/kafka/server/log/remote/storage/RemoteLogManager.java:1116-1123 | storage/src/main/java/org/apache/kafka/server/log/remote/storage/RemoteLogManager.java:1139-1146 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `storage/src/main/java/org/apache/kafka/server/log/remote/storage/RemoteLogManager.java:1116` 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) server/src/main/java/org/apache/kafka/server/FetchContext.java:348 — server/src/main/java/org/apache/kafka/server/FetchContext.java:348-355 | server/src/main/java/org/apache/kafka/server/FetchContext.java:371-378 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `server/src/main/java/org/apache/kafka/server/FetchContext.java:348` it does not close everything it opens, so those 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 (8 lines × 2) connect/api/src/main/java/org/apache/kafka/connect/data/Values.java:503 — connect/api/src/main/java/org/apache/kafka/connect/data/Values.java:503-510 | connect/api/src/main/java/org/apache/kafka/connect/data/Values.java:531-538 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `connect/api/src/main/java/org/apache/kafka/connect/data/Values.java:503` it does not close everything it opens, so those exact lines 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) connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaStatusBackingStore.java:419 — connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaStatusBackingStore.java:419-427 | connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaStatusBackingStore.java:441-448 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaStatusBackingStore.java:419` it does not close everything it opens, so those exact lines 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) connect/mirror-client/src/main/java/org/apache/kafka/connect/mirror/MirrorClientConfig.java:88 — connect/mirror-client/src/main/java/org/apache/kafka/connect/mirror/MirrorClientConfig.java:88-95 | connect/mirror/src/main/java/org/apache/kafka/connect/mirror/MirrorConnectorConfig.java:248-255 — 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 `connect/mirror-client/src/main/java/org/apache/kafka/connect/mirror/MirrorClientConfig.java:88` 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) connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/DistributedHerder.java:1440 — connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/DistributedHerder.java:1440-1447 | connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/DistributedHerder.java:1477-1484 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/DistributedHerder.java:1440` 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) connect/runtime/src/main/java/org/apache/kafka/connect/runtime/rest/resources/ConnectorPluginsResource.java:129 — connect/runtime/src/main/java/org/apache/kafka/connect/runtime/rest/resources/ConnectorPluginsResource.java:129-136 | connect/runtime/src/main/java/org/apache/kafka/connect/runtime/rest/HerderRequestHandler.java:71-78 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `connect/runtime/src/main/java/org/apache/kafka/connect/runtime/rest/resources/ConnectorPluginsResource.java:129` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) connect/runtime/src/main/java/org/apache/kafka/connect/runtime/Worker.java:1973 — connect/runtime/src/main/java/org/apache/kafka/connect/runtime/Worker.java:1973-1980 | connect/runtime/src/main/java/org/apache/kafka/connect/runtime/Worker.java:2038-2045 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `connect/runtime/src/main/java/org/apache/kafka/connect/runtime/Worker.java:1973` 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 (8 lines × 2) group-coordinator/src/main/java/org/apache/kafka/coordinator/group/assignor/SimpleHeterogeneousAssignmentBuilder.java:152 — group-coordinator/src/main/java/org/apache/kafka/coordinator/group/assignor/SimpleHeterogeneousAssignmentBuilder.java:152-159 | group-coordinator/src/main/java/org/apache/kafka/coordinator/group/assignor/SimpleHomogeneousAssignmentBuilder.java:209-216 — 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 `group-coordinator/src/main/java/org/apache/kafka/coordinator/group/assignor/SimpleHeterogeneousAssignmentBuilder.java:152` 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) group-coordinator/src/main/java/org/apache/kafka/coordinator/group/streams/TasksTupleWithEpochs.java:147 — group-coordinator/src/main/java/org/apache/kafka/coordinator/group/streams/TasksTupleWithEpochs.java:147-154 | group-coordinator/src/main/java/org/apache/kafka/coordinator/group/Utils.java:261-268 — 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 `group-coordinator/src/main/java/org/apache/kafka/coordinator/group/streams/TasksTupleWithEpochs.java:147` 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) group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupCoordinatorService.java:2310 — group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupCoordinatorService.java:2310-2317 | group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupCoordinatorService.java:2373-2380 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupCoordinatorService.java:2310` it does not close everything it opens, so those 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) group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:7230 — group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:7230-7237 | group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:7275-7282 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:7230` 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) generator/src/main/java/org/apache/kafka/message/MetadataJsonConvertersGenerator.java:45 — generator/src/main/java/org/apache/kafka/message/MetadataJsonConvertersGenerator.java:45-52 | generator/src/main/java/org/apache/kafka/message/MetadataRecordTypeGenerator.java:46-53 — 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 `generator/src/main/java/org/apache/kafka/message/MetadataJsonConvertersGenerator.java:45` 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) generator/src/main/java/org/apache/kafka/message/MetadataJsonConvertersGenerator.java:71 — generator/src/main/java/org/apache/kafka/message/MetadataJsonConvertersGenerator.java:71-78 | generator/src/main/java/org/apache/kafka/message/MetadataJsonConvertersGenerator.java:98-105 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `generator/src/main/java/org/apache/kafka/message/MetadataJsonConvertersGenerator.java:71` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) jmh-benchmarks/src/main/java/org/apache/kafka/jmh/util/ByteUtilsBenchmark.java:305 — jmh-benchmarks/src/main/java/org/apache/kafka/jmh/util/ByteUtilsBenchmark.java:305-312 | jmh-benchmarks/src/main/java/org/apache/kafka/jmh/util/ByteUtilsBenchmark.java:322-329 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, 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) metadata/src/main/java/org/apache/kafka/controller/BrokersToElrs.java:110 — metadata/src/main/java/org/apache/kafka/controller/BrokersToElrs.java:110-117 | metadata/src/main/java/org/apache/kafka/controller/BrokersToIsrs.java:198-205 — 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) metadata/src/main/java/org/apache/kafka/controller/ScramControlManager.java:191 — metadata/src/main/java/org/apache/kafka/controller/ScramControlManager.java:191-198 | metadata/src/main/java/org/apache/kafka/controller/ScramControlManager.java:212-219 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `metadata/src/main/java/org/apache/kafka/controller/ScramControlManager.java:191` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) metadata/src/main/java/org/apache/kafka/metadata/authorizer/ClusterMetadataAuthorizer.java:111 — metadata/src/main/java/org/apache/kafka/metadata/authorizer/ClusterMetadataAuthorizer.java:111-118 | metadata/src/main/java/org/apache/kafka/metadata/authorizer/ClusterMetadataAuthorizer.java:151-158 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `metadata/src/main/java/org/apache/kafka/metadata/authorizer/ClusterMetadataAuthorizer.java:111` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×25
  • Duplicated block (5 lines × 2) clients/src/main/java/org/apache/kafka/clients/admin/internals/DescribeShareGroupsHandler.java:111 — clients/src/main/java/org/apache/kafka/clients/admin/internals/DescribeShareGroupsHandler.java:111-115 | clients/src/main/java/org/apache/kafka/clients/admin/internals/DescribeStreamsGroupsHandler.java:121-125 — 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 (5 lines × 2) clients/src/main/java/org/apache/kafka/clients/admin/ConsumerGroupDescription.java:93 — clients/src/main/java/org/apache/kafka/clients/admin/ConsumerGroupDescription.java:93-97 | clients/src/main/java/org/apache/kafka/clients/admin/ConsumerGroupDescription.java:115-119 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java:3463 — clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java:3463-3467 | clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java:3625-3629 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java:3463` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) clients/src/main/java/org/apache/kafka/clients/admin/StreamsGroupMemberDescription.java:204 — clients/src/main/java/org/apache/kafka/clients/admin/StreamsGroupMemberDescription.java:204-208 | group-coordinator/src/main/java/org/apache/kafka/coordinator/group/modern/consumer/ConsumerGroupMember.java:574-578 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) clients/src/main/java/org/apache/kafka/clients/admin/StreamsGroupSubtopologyDescription.java:47 — clients/src/main/java/org/apache/kafka/clients/admin/StreamsGroupSubtopologyDescription.java:47-51 | storage/api/src/main/java/org/apache/kafka/server/log/remote/storage/LogSegmentData.java:58-62 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) clients/src/main/java/org/apache/kafka/clients/consumer/internals/CompletedFetch.java:328 — clients/src/main/java/org/apache/kafka/clients/consumer/internals/CompletedFetch.java:328-332 | clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareCompletedFetch.java:332-336 — 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 `clients/src/main/java/org/apache/kafka/clients/consumer/internals/CompletedFetch.java:328` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (5 lines × 2) clients/src/main/java/org/apache/kafka/clients/consumer/internals/FetchConfig.java:82 — clients/src/main/java/org/apache/kafka/clients/consumer/internals/FetchConfig.java:82-86 | clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareFetchConfig.java:86-90 — 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 (5 lines × 2) clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareConsumeRequestManager.java:947 — clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareConsumeRequestManager.java:947-951 | clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareConsumeRequestManager.java:1064-1069 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareConsumeRequestManager.java:947` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) clients/src/main/java/org/apache/kafka/clients/FetchSessionHandler.java:451 — clients/src/main/java/org/apache/kafka/clients/FetchSessionHandler.java:451-455 | clients/src/main/java/org/apache/kafka/clients/FetchSessionHandler.java:478-482 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `clients/src/main/java/org/apache/kafka/clients/FetchSessionHandler.java:451` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) clients/src/main/java/org/apache/kafka/common/protocol/types/ArrayOf.java:77 — clients/src/main/java/org/apache/kafka/common/protocol/types/ArrayOf.java:77-81 | clients/src/main/java/org/apache/kafka/common/protocol/types/CompactArrayOf.java:82-86 — 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 (5 lines × 2) clients/src/main/java/org/apache/kafka/common/protocol/MessageUtil.java:229 — clients/src/main/java/org/apache/kafka/common/protocol/MessageUtil.java:229-233 | clients/src/main/java/org/apache/kafka/common/protocol/MessageUtil.java:256-260 — both copies are in the same file, so extract the 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 (5 lines × 2) server-common/src/main/java/org/apache/kafka/server/metrics/KafkaMetricsGroup.java:142 — server-common/src/main/java/org/apache/kafka/server/metrics/KafkaMetricsGroup.java:142-146 | server-common/src/main/java/org/apache/kafka/server/metrics/KafkaMetricsGroup.java:156-161 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `server-common/src/main/java/org/apache/kafka/server/metrics/KafkaMetricsGroup.java:142` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) server-common/src/main/java/org/apache/kafka/server/share/persister/PersisterStateManager.java:389 — server-common/src/main/java/org/apache/kafka/server/share/persister/PersisterStateManager.java:389-393 | server/src/main/java/org/apache/kafka/server/share/dlq/ShareGroupDLQStateManager.java:580-584 — 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 `server-common/src/main/java/org/apache/kafka/server/share/persister/PersisterStateManager.java:389` 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 (5 lines × 2) server/src/main/java/org/apache/kafka/server/share/fetch/InFlightBatch.java:210 — server/src/main/java/org/apache/kafka/server/share/fetch/InFlightBatch.java:210-214 | server/src/main/java/org/apache/kafka/server/share/fetch/InFlightBatch.java:236-240 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `server/src/main/java/org/apache/kafka/server/share/fetch/InFlightBatch.java:210` 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 (5 lines × 2) server/src/main/java/org/apache/kafka/server/AuthHelper.java:108 — server/src/main/java/org/apache/kafka/server/AuthHelper.java:108-112 | server/src/main/java/org/apache/kafka/server/AuthHelper.java:172-176 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) group-coordinator/src/main/java/org/apache/kafka/coordinator/group/assignor/UniformHeterogeneousAssignmentBuilder.java:855 — group-coordinator/src/main/java/org/apache/kafka/coordinator/group/assignor/UniformHeterogeneousAssignmentBuilder.java:855-859 | group-coordinator/src/main/java/org/apache/kafka/coordinator/group/assignor/UniformHeterogeneousAssignmentBuilder.java:887-891 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `group-coordinator/src/main/java/org/apache/kafka/coordinator/group/assignor/UniformHeterogeneousAssignmentBuilder.java:855` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) group-coordinator/src/main/java/org/apache/kafka/coordinator/group/streams/StreamsGroupMember.java:411 — group-coordinator/src/main/java/org/apache/kafka/coordinator/group/streams/StreamsGroupMember.java:411-415 | group-coordinator/src/main/java/org/apache/kafka/coordinator/group/streams/StreamsGroupMember.java:421-425 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `group-coordinator/src/main/java/org/apache/kafka/coordinator/group/streams/StreamsGroupMember.java:411` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (5 lines × 2) group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:6505 — group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:6505-6509 | group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:6511-6515 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:6505` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) share-coordinator/src/main/java/org/apache/kafka/coordinator/share/ShareCoordinatorShard.java:842 — share-coordinator/src/main/java/org/apache/kafka/coordinator/share/ShareCoordinatorShard.java:842-846 | share-coordinator/src/main/java/org/apache/kafka/coordinator/share/ShareCoordinatorShard.java:877-881 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `share-coordinator/src/main/java/org/apache/kafka/coordinator/share/ShareCoordinatorShard.java:842` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) generator/src/main/java/org/apache/kafka/message/SchemaGenerator.java:148 — generator/src/main/java/org/apache/kafka/message/SchemaGenerator.java:148-152 | generator/src/main/java/org/apache/kafka/message/SchemaGenerator.java:190-194 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `generator/src/main/java/org/apache/kafka/message/SchemaGenerator.java:148` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) generator/src/main/java/org/apache/kafka/message/StructRegistry.java:90 — generator/src/main/java/org/apache/kafka/message/StructRegistry.java:90-94 | generator/src/main/java/org/apache/kafka/message/StructRegistry.java:128-132 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `generator/src/main/java/org/apache/kafka/message/StructRegistry.java:90` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) jmh-benchmarks/src/main/java/org/apache/kafka/jmh/util/ByteUtilsBenchmark.java:508 — jmh-benchmarks/src/main/java/org/apache/kafka/jmh/util/ByteUtilsBenchmark.java:508-512 | jmh-benchmarks/src/main/java/org/apache/kafka/jmh/util/ByteUtilsBenchmark.java:528-532 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `jmh-benchmarks/src/main/java/org/apache/kafka/jmh/util/ByteUtilsBenchmark.java:508` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) metadata/src/main/java/org/apache/kafka/image/TopicDelta.java:180 — metadata/src/main/java/org/apache/kafka/image/TopicDelta.java:180-184 | metadata/src/main/java/org/apache/kafka/image/TopicsDelta.java:239-243 — 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 `metadata/src/main/java/org/apache/kafka/image/TopicDelta.java:180` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (5 lines × 2) metadata/src/main/java/org/apache/kafka/metadata/authorizer/ClusterMetadataAuthorizer.java:103 — metadata/src/main/java/org/apache/kafka/metadata/authorizer/ClusterMetadataAuthorizer.java:103-107 | metadata/src/main/java/org/apache/kafka/metadata/authorizer/ClusterMetadataAuthorizer.java:143-147 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `metadata/src/main/java/org/apache/kafka/metadata/authorizer/ClusterMetadataAuthorizer.java:103` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) metadata/src/main/java/org/apache/kafka/metadata/KafkaConfigSchema.java:197 — metadata/src/main/java/org/apache/kafka/metadata/KafkaConfigSchema.java:197-201 | metadata/src/main/java/org/apache/kafka/metadata/KafkaConfigSchema.java:227-231 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `metadata/src/main/java/org/apache/kafka/metadata/KafkaConfigSchema.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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×24
  • Duplicated block (6 lines × 2) clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java:2008 — clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java:2008-2013 | clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java:2081-2086 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.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.
  • Duplicated block (6 lines × 2) clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java:3512 — clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java:3512-3517 | clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java:3676-3681 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java:3512` it does not close everything it opens, so those exact lines 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) clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java:485 — clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java:485-490 | clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareConsumerImpl.java:260-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 (6 lines × 2) clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java:496 — clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java:496-501 | clients/src/main/java/org/apache/kafka/clients/consumer/internals/ClassicKafkaConsumer.java:185-191 — 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 (6 lines × 2) clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerMembershipManager.java:224 — clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerMembershipManager.java:224-229 | clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareMembershipManager.java:138-143 — 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) clients/src/main/java/org/apache/kafka/clients/consumer/internals/OffsetFetcher.java:391 — clients/src/main/java/org/apache/kafka/clients/consumer/internals/OffsetFetcher.java:391-396 | clients/src/main/java/org/apache/kafka/clients/consumer/internals/OffsetsRequestManager.java:897-902 — 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 `clients/src/main/java/org/apache/kafka/clients/consumer/internals/OffsetFetcher.java:391` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareConsumeRequestManager.java:581 — clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareConsumeRequestManager.java:581-586 | clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareConsumeRequestManager.java:662-667 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareConsumeRequestManager.java:581` 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) clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareSessionHandler.java:169 — clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareSessionHandler.java:169-174 | clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareSessionHandler.java:233-238 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareSessionHandler.java:169` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) clients/src/main/java/org/apache/kafka/common/network/SslTransportLayer.java:681 — clients/src/main/java/org/apache/kafka/common/network/SslTransportLayer.java:681-687 | clients/src/main/java/org/apache/kafka/common/network/SslTransportLayer.java:755-760 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `clients/src/main/java/org/apache/kafka/common/network/SslTransportLayer.java:681` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) clients/src/main/java/org/apache/kafka/common/security/kerberos/KerberosShortNamer.java:51 — clients/src/main/java/org/apache/kafka/common/security/kerberos/KerberosShortNamer.java:51-56 | clients/src/main/java/org/apache/kafka/common/security/ssl/SslPrincipalMapper.java:60-65 — 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 `clients/src/main/java/org/apache/kafka/common/security/kerberos/KerberosShortNamer.java:51` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) clients/src/main/java/org/apache/kafka/common/security/oauthbearer/internals/unsecured/OAuthBearerUnsecuredLoginCallbackHandler.java:144 — clients/src/main/java/org/apache/kafka/common/security/oauthbearer/internals/unsecured/OAuthBearerUnsecuredLoginCallbackHandler.java:144-149 | clients/src/main/java/org/apache/kafka/common/security/oauthbearer/internals/unsecured/OAuthBearerUnsecuredValidatorCallbackHandler.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.
  • Duplicated block (6 lines × 2) clients/src/main/java/org/apache/kafka/common/security/plain/PlainLoginModule.java:40 — clients/src/main/java/org/apache/kafka/common/security/plain/PlainLoginModule.java:40-45 | clients/src/main/java/org/apache/kafka/common/security/scram/ScramLoginModule.java:43-48 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) clients/src/main/java/org/apache/kafka/common/serialization/DoubleSerializer.java:30 — clients/src/main/java/org/apache/kafka/common/serialization/DoubleSerializer.java:30-35 | clients/src/main/java/org/apache/kafka/common/serialization/LongSerializer.java:28-33 — 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 `clients/src/main/java/org/apache/kafka/common/serialization/DoubleSerializer.java:30` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) clients/src/main/java/org/apache/kafka/common/utils/internals/ByteUtils.java:411 — clients/src/main/java/org/apache/kafka/common/utils/internals/ByteUtils.java:411-416 | jmh-benchmarks/src/main/java/org/apache/kafka/jmh/util/ByteUtilsBenchmark.java:563-568 — 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 `clients/src/main/java/org/apache/kafka/common/utils/internals/ByteUtils.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.
  • Duplicated block (6 lines × 2) storage/src/main/java/org/apache/kafka/server/log/remote/metadata/storage/serialization/RemoteLogSegmentMetadataSnapshotTransform.java:42 — storage/src/main/java/org/apache/kafka/server/log/remote/metadata/storage/serialization/RemoteLogSegmentMetadataSnapshotTransform.java:42-47 | storage/src/main/java/org/apache/kafka/server/log/remote/metadata/storage/serialization/RemoteLogSegmentMetadataTransform.java:46-51 — 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 `storage/src/main/java/org/apache/kafka/server/log/remote/metadata/storage/serialization/RemoteLogSegmentMetadataSnapshotTransform.java:42` 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) connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java:1269 — connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java:1269-1274 | connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaStatusBackingStore.java:519-524 — 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 `connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java:1269` it does not close everything it opens, so those 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) connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/ExtendedAssignment.java:249 — connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/ExtendedAssignment.java:249-254 | connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/ExtendedAssignment.java:270-275 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/ExtendedAssignment.java:249` it does not close everything it opens, so those 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) connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/IncrementalCooperativeAssignor.java:346 — connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/IncrementalCooperativeAssignor.java:346-352 | connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/IncrementalCooperativeAssignor.java:355-360 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/IncrementalCooperativeAssignor.java:346` it does not close everything it opens, so those 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) group-coordinator/src/main/java/org/apache/kafka/coordinator/group/modern/consumer/ConsumerGroup.java:1190 — group-coordinator/src/main/java/org/apache/kafka/coordinator/group/modern/consumer/ConsumerGroup.java:1190-1195 | group-coordinator/src/main/java/org/apache/kafka/coordinator/group/modern/share/ShareGroup.java:315-320 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `group-coordinator/src/main/java/org/apache/kafka/coordinator/group/modern/consumer/ConsumerGroup.java:1190` 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) group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupCoordinatorRecordHelpers.java:781 — group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupCoordinatorRecordHelpers.java:781-786 | group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupCoordinatorRecordHelpers.java:788-793 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupCoordinatorRecordHelpers.java:781` 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) group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:1752 — group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:1752-1757 | group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:1771-1776 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:1752` 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) generator/src/main/java/org/apache/kafka/message/checker/Unifier.java:101 — generator/src/main/java/org/apache/kafka/message/checker/Unifier.java:101-106 | generator/src/main/java/org/apache/kafka/message/checker/Unifier.java:121-126 — both copies are in the same file, so extract the 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) generator/src/main/java/org/apache/kafka/message/CoordinatorRecordJsonConvertersGenerator.java:133 — generator/src/main/java/org/apache/kafka/message/CoordinatorRecordJsonConvertersGenerator.java:133-138 | generator/src/main/java/org/apache/kafka/message/CoordinatorRecordJsonConvertersGenerator.java:187-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 `generator/src/main/java/org/apache/kafka/message/CoordinatorRecordJsonConvertersGenerator.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.
  • Duplicated block (6 lines × 2) metadata/src/main/java/org/apache/kafka/controller/PeriodicTaskControlManager.java:226 — metadata/src/main/java/org/apache/kafka/controller/PeriodicTaskControlManager.java:226-231 | metadata/src/main/java/org/apache/kafka/controller/PeriodicTaskControlManager.java:242-247 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×22
  • Duplicated block (10 lines × 2) clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractMembershipManager.java:634 — clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractMembershipManager.java:634-645 | clients/src/main/java/org/apache/kafka/clients/consumer/internals/StreamsMembershipManager.java:992-1001 — 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 `clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractMembershipManager.java:634` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java:1028 — clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java:1028-1038 | clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java:1063-1072 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java:1028` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java:2378 — clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java:2378-2387 | clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareConsumerImpl.java:1293-1302 — 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 `clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java:2378` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerRebalanceListenerInvoker.java:85 — clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerRebalanceListenerInvoker.java:85-94 | clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerRebalanceListenerInvoker.java:115-124 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerRebalanceListenerInvoker.java:85` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) clients/src/main/java/org/apache/kafka/clients/consumer/internals/FetchBuffer.java:250 — clients/src/main/java/org/apache/kafka/clients/consumer/internals/FetchBuffer.java:250-259 | clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareFetchBuffer.java:181-190 — 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 `clients/src/main/java/org/apache/kafka/clients/consumer/internals/FetchBuffer.java:250` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) clients/src/main/java/org/apache/kafka/common/config/provider/FileConfigProvider.java:85 — clients/src/main/java/org/apache/kafka/common/config/provider/FileConfigProvider.java:85-94 | clients/src/main/java/org/apache/kafka/common/config/provider/FileConfigProvider.java:124-133 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `clients/src/main/java/org/apache/kafka/common/config/provider/FileConfigProvider.java:85` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) clients/src/main/java/org/apache/kafka/common/protocol/Protocol.java:193 — clients/src/main/java/org/apache/kafka/common/protocol/Protocol.java:193-202 | clients/src/main/java/org/apache/kafka/common/protocol/Protocol.java:223-232 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) clients/src/main/java/org/apache/kafka/common/serialization/StringDeserializer.java:44 — clients/src/main/java/org/apache/kafka/common/serialization/StringDeserializer.java:44-53 | clients/src/main/java/org/apache/kafka/common/serialization/StringSerializer.java:41-50 — 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 `clients/src/main/java/org/apache/kafka/common/serialization/StringDeserializer.java:44` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) server-common/src/main/java/org/apache/kafka/server/share/persister/PersisterStateManager.java:452 — server-common/src/main/java/org/apache/kafka/server/share/persister/PersisterStateManager.java:452-461 | server-common/src/main/java/org/apache/kafka/server/share/persister/PersisterStateManager.java:470-479 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `server-common/src/main/java/org/apache/kafka/server/share/persister/PersisterStateManager.java:452` 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 (10 lines × 2) server-common/src/main/java/org/apache/kafka/server/share/persister/PersisterStateManager.java:821 — server-common/src/main/java/org/apache/kafka/server/share/persister/PersisterStateManager.java:821-830 | server-common/src/main/java/org/apache/kafka/server/share/persister/PersisterStateManager.java:849-858 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `server-common/src/main/java/org/apache/kafka/server/share/persister/PersisterStateManager.java:821` 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 (10 lines × 2) server-common/src/main/java/org/apache/kafka/server/share/persister/PersisterStateManager.java:1002 — server-common/src/main/java/org/apache/kafka/server/share/persister/PersisterStateManager.java:1002-1011 | server-common/src/main/java/org/apache/kafka/server/share/persister/PersisterStateManager.java:1030-1039 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `server-common/src/main/java/org/apache/kafka/server/share/persister/PersisterStateManager.java:1002` 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 (10 lines × 2) server-common/src/main/java/org/apache/kafka/server/share/persister/PersisterStateManager.java:1183 — server-common/src/main/java/org/apache/kafka/server/share/persister/PersisterStateManager.java:1183-1192 | server-common/src/main/java/org/apache/kafka/server/share/persister/PersisterStateManager.java:1211-1220 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `server-common/src/main/java/org/apache/kafka/server/share/persister/PersisterStateManager.java:1183` 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 (10 lines × 2) server-common/src/main/java/org/apache/kafka/server/share/persister/PersisterStateManager.java:1361 — server-common/src/main/java/org/apache/kafka/server/share/persister/PersisterStateManager.java:1361-1370 | server-common/src/main/java/org/apache/kafka/server/share/persister/PersisterStateManager.java:1389-1398 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `server-common/src/main/java/org/apache/kafka/server/share/persister/PersisterStateManager.java:1361` 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 (10 lines × 2) connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java:1032 — connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java:1032-1041 | connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java:1230-1239 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) group-coordinator/src/main/java/org/apache/kafka/coordinator/group/streams/TasksTuple.java:167 — group-coordinator/src/main/java/org/apache/kafka/coordinator/group/streams/TasksTuple.java:167-176 | group-coordinator/src/main/java/org/apache/kafka/coordinator/group/streams/TasksTupleWithEpochs.java:201-210 — 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 `group-coordinator/src/main/java/org/apache/kafka/coordinator/group/streams/TasksTuple.java:167` it does not close everything it opens, so those 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 (10 lines × 2) group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:6131 — group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:6131-6140 | group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:6445-6455 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:6131` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) generator/src/main/java/org/apache/kafka/message/CoordinatorRecordTypeGenerator.java:103 — generator/src/main/java/org/apache/kafka/message/CoordinatorRecordTypeGenerator.java:103-112 | generator/src/main/java/org/apache/kafka/message/MetadataRecordTypeGenerator.java:73-82 — 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 (10 lines × 2) generator/src/main/java/org/apache/kafka/message/VersionConditional.java:90 — generator/src/main/java/org/apache/kafka/message/VersionConditional.java:90-99 | generator/src/main/java/org/apache/kafka/message/VersionConditional.java:139-148 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) jmh-benchmarks/src/main/java/org/apache/kafka/jmh/assignor/ServerSideAssignorBenchmark.java:193 — jmh-benchmarks/src/main/java/org/apache/kafka/jmh/assignor/ServerSideAssignorBenchmark.java:193-202 | jmh-benchmarks/src/main/java/org/apache/kafka/jmh/assignor/ShareGroupAssignorBenchmark.java:176-185 — 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 `jmh-benchmarks/src/main/java/org/apache/kafka/jmh/assignor/ServerSideAssignorBenchmark.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 (10 lines × 2) jmh-benchmarks/src/main/java/org/apache/kafka/jmh/server/CheckpointBench.java:139 — jmh-benchmarks/src/main/java/org/apache/kafka/jmh/server/CheckpointBench.java:139-148 | jmh-benchmarks/src/main/java/org/apache/kafka/jmh/server/PartitionCreationBench.java:143-153 — 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 (10 lines × 2) metadata/src/main/java/org/apache/kafka/controller/BrokersToElrs.java:63 — metadata/src/main/java/org/apache/kafka/controller/BrokersToElrs.java:63-73 | metadata/src/main/java/org/apache/kafka/controller/BrokersToIsrs.java:144-153 — 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 `metadata/src/main/java/org/apache/kafka/controller/BrokersToElrs.java:63` 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 (10 lines × 2) metadata/src/main/java/org/apache/kafka/controller/BrokersToElrs.java:141 — metadata/src/main/java/org/apache/kafka/controller/BrokersToElrs.java:141-150 | metadata/src/main/java/org/apache/kafka/controller/BrokersToIsrs.java:257-266 — 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 `metadata/src/main/java/org/apache/kafka/controller/BrokersToElrs.java:141` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×19
  • Duplicated block (11 lines × 2) clients/src/main/java/org/apache/kafka/clients/admin/internals/AlterShareGroupOffsetsHandler.java:159 — clients/src/main/java/org/apache/kafka/clients/admin/internals/AlterShareGroupOffsetsHandler.java:159-171 | clients/src/main/java/org/apache/kafka/clients/admin/internals/DeleteShareGroupOffsetsHandler.java:161-171 — 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 `clients/src/main/java/org/apache/kafka/clients/admin/internals/AlterShareGroupOffsetsHandler.java:159` 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 (11 lines × 2) clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java:3495 — clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java:3495-3505 | clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java:3659-3669 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java:3495` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java:3552 — clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java:3552-3562 | clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java:3710-3720 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java:3552` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractFetch.java:158 — clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractFetch.java:158-168 | clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareConsumeRequestManager.java:841-851 — 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 `clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractFetch.java:158` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractMembershipManager.java:237 — clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractMembershipManager.java:237-247 | clients/src/main/java/org/apache/kafka/clients/consumer/internals/StreamsMembershipManager.java:608-618 — 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 `clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractMembershipManager.java:237` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java:1174 — clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java:1174-1184 | clients/src/main/java/org/apache/kafka/clients/consumer/internals/ClassicKafkaConsumer.java:818-828 — 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 `clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java:1174` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) clients/src/main/java/org/apache/kafka/clients/consumer/internals/TopicMetadataFetcher.java:117 — clients/src/main/java/org/apache/kafka/clients/consumer/internals/TopicMetadataFetcher.java:117-127 | clients/src/main/java/org/apache/kafka/clients/consumer/internals/TopicMetadataRequestManager.java:249-259 — 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 `clients/src/main/java/org/apache/kafka/clients/consumer/internals/TopicMetadataFetcher.java:117` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) clients/src/main/java/org/apache/kafka/common/config/provider/FileConfigProvider.java:68 — clients/src/main/java/org/apache/kafka/common/config/provider/FileConfigProvider.java:68-78 | clients/src/main/java/org/apache/kafka/common/config/provider/FileConfigProvider.java:109-119 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `clients/src/main/java/org/apache/kafka/common/config/provider/FileConfigProvider.java:68` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) server-common/src/main/java/org/apache/kafka/server/metrics/KafkaMetricsGroup.java:62 — server-common/src/main/java/org/apache/kafka/server/metrics/KafkaMetricsGroup.java:62-72 | server-common/src/main/java/org/apache/kafka/server/metrics/KafkaYammerMetrics.java:106-116 — 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 (11 lines × 2) connect/runtime/src/main/java/org/apache/kafka/connect/util/TopicAdmin.java:443 — connect/runtime/src/main/java/org/apache/kafka/connect/util/TopicAdmin.java:443-453 | connect/mirror/src/main/java/org/apache/kafka/connect/mirror/MirrorUtils.java:306-316 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (11 lines × 2) connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/DistributedHerder.java:1018 — connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/DistributedHerder.java:1018-1028 | connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/DistributedHerder.java:1056-1066 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/DistributedHerder.java:1018` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/DistributedHerder.java:1698 — connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/DistributedHerder.java:1698-1712 | connect/runtime/src/main/java/org/apache/kafka/connect/runtime/standalone/StandaloneHerder.java:445-455 — 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 `connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/DistributedHerder.java:1698` 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 (11 lines × 2) group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:5265 — group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:5265-5275 | group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:5308-5318 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:5265` 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 (11 lines × 2) group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:5726 — group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:5726-5736 | group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:6037-6047 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:5726` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:5873 — group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:5873-5884 | group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:6199-6209 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:5873` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:5963 — group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:5963-5973 | group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:6281-6291 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:5963` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) jmh-benchmarks/src/main/java/org/apache/kafka/jmh/fetcher/ReplicaFetcherThreadBenchmark.java:136 — jmh-benchmarks/src/main/java/org/apache/kafka/jmh/fetcher/ReplicaFetcherThreadBenchmark.java:136-146 | jmh-benchmarks/src/main/java/org/apache/kafka/jmh/partition/PartitionMakeFollowerBenchmark.java:107-117 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (11 lines × 2) metadata/src/main/java/org/apache/kafka/controller/BrokersToIsrs.java:124 — metadata/src/main/java/org/apache/kafka/controller/BrokersToIsrs.java:124-134 | metadata/src/main/java/org/apache/kafka/controller/BrokersToIsrs.java:135-145 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) metadata/src/main/java/org/apache/kafka/controller/DelegationTokenControlManager.java:242 — metadata/src/main/java/org/apache/kafka/controller/DelegationTokenControlManager.java:242-252 | metadata/src/main/java/org/apache/kafka/controller/DelegationTokenControlManager.java:293-303 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D15 · Churn × Complexity Hotspots · Hotspot · ×10
  • Hotspot: group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java — group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java changed 20 times in last 90 days, max complexity 34. 1 of those changes was a fix/bug commit, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time.
  • Hotspot: group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupCoordinatorShard.java group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupCoordinatorShard.java — group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupCoordinatorShard.java changed 8 times in last 90 days, max complexity 24. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, behind tests written first.
  • Hotspot: core/src/main/java/kafka/server/share/SharePartition.java core/src/main/java/kafka/server/share/SharePartition.java — core/src/main/java/kafka/server/share/SharePartition.java changed 6 times in last 90 days, max complexity 32. 1 of those changes was a fix/bug commit, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time.
  • Hotspot: server/src/main/java/org/apache/kafka/network/RequestConvertToJson.java server/src/main/java/org/apache/kafka/network/RequestConvertToJson.java — server/src/main/java/org/apache/kafka/network/RequestConvertToJson.java changed 2 times in last 90 days, max complexity 91. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, behind tests written first.
  • Hotspot: streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamThread.java streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamThread.java — streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamThread.java changed 8 times in last 90 days, max complexity 21. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, behind tests written first.
  • Hotspot: clients/src/main/java/org/apache/kafka/clients/consumer/internals/StreamsGroupHeartbeatRequestManager.java clients/src/main/java/org/apache/kafka/clients/consumer/internals/StreamsGroupHeartbeatRequestManager.java — clients/src/main/java/org/apache/kafka/clients/consumer/internals/StreamsGroupHeartbeatRequestManager.java changed 9 times in last 90 days, max complexity 16. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, behind tests written first.
  • Hotspot: streams/src/main/java/org/apache/kafka/streams/processor/internals/TaskManager.java streams/src/main/java/org/apache/kafka/streams/processor/internals/TaskManager.java — streams/src/main/java/org/apache/kafka/streams/processor/internals/TaskManager.java changed 5 times in last 90 days, max complexity 25. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, behind tests written first.
  • Hotspot: clients/src/main/java/org/apache/kafka/clients/producer/internals/TransactionManager.java clients/src/main/java/org/apache/kafka/clients/producer/internals/TransactionManager.java — clients/src/main/java/org/apache/kafka/clients/producer/internals/TransactionManager.java changed 5 times in last 90 days, max complexity 23. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, behind tests written first.
  • Hotspot: storage/src/main/java/org/apache/kafka/server/log/remote/storage/RemoteLogManager.java storage/src/main/java/org/apache/kafka/server/log/remote/storage/RemoteLogManager.java — storage/src/main/java/org/apache/kafka/server/log/remote/storage/RemoteLogManager.java changed 4 times in last 90 days, max complexity 28. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, behind tests written first.
  • Hotspot: streams/src/main/java/org/apache/kafka/streams/KafkaStreams.java streams/src/main/java/org/apache/kafka/streams/KafkaStreams.java — streams/src/main/java/org/apache/kafka/streams/KafkaStreams.java changed 5 times in last 90 days, max complexity 21. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, behind tests written first.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×9
  • Duplicated block (13 lines × 2) clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java:3367 — clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java:3367-3379 | clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java:3401-3413 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java:3367` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractMembershipManager.java:459 — clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractMembershipManager.java:459-471 | clients/src/main/java/org/apache/kafka/clients/consumer/internals/StreamsMembershipManager.java:856-868 — 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 `clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractMembershipManager.java:459` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java:1314 — clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java:1314-1327 | clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinator.java:1573-1585 — 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 `clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java:1314` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareSessionHandler.java:276 — clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareSessionHandler.java:276-288 | clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareSessionHandler.java:313-325 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareSessionHandler.java:276` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) clients/src/main/java/org/apache/kafka/clients/consumer/internals/WakeupTrigger.java:101 — clients/src/main/java/org/apache/kafka/clients/consumer/internals/WakeupTrigger.java:101-113 | clients/src/main/java/org/apache/kafka/clients/consumer/internals/WakeupTrigger.java:120-132 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `clients/src/main/java/org/apache/kafka/clients/consumer/internals/WakeupTrigger.java:101` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) coordinator-common/src/main/java/org/apache/kafka/coordinator/common/runtime/CoordinatorRuntime.java:1332 — coordinator-common/src/main/java/org/apache/kafka/coordinator/common/runtime/CoordinatorRuntime.java:1332-1345 | coordinator-common/src/main/java/org/apache/kafka/coordinator/common/runtime/CoordinatorRuntime.java:1638-1650 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `coordinator-common/src/main/java/org/apache/kafka/coordinator/common/runtime/CoordinatorRuntime.java:1332` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) group-coordinator/src/main/java/org/apache/kafka/coordinator/group/streams/CurrentAssignmentBuilder.java:293 — group-coordinator/src/main/java/org/apache/kafka/coordinator/group/streams/CurrentAssignmentBuilder.java:293-305 | group-coordinator/src/main/java/org/apache/kafka/coordinator/group/streams/CurrentAssignmentBuilder.java:388-400 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `group-coordinator/src/main/java/org/apache/kafka/coordinator/group/streams/CurrentAssignmentBuilder.java:293` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:5745 — group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:5745-5757 | group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:6243-6255 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:5745` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) generator/src/main/java/org/apache/kafka/message/CoordinatorRecordJsonConvertersGenerator.java:68 — generator/src/main/java/org/apache/kafka/message/CoordinatorRecordJsonConvertersGenerator.java:68-80 | generator/src/main/java/org/apache/kafka/message/CoordinatorRecordTypeGenerator.java:69-81 — 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 `generator/src/main/java/org/apache/kafka/message/CoordinatorRecordJsonConvertersGenerator.java:68` 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.
D35 · Change Coupling · Change coupling · ×8
  • Change coupling: ServerSideAssignorBenchmark.java ↔ TargetAssignmentBuilderBenchmark.java jmh-benchmarks/src/main/java/org/apache/kafka/jmh/assignor/ServerSideAssignorBenchmark.java — `jmh-benchmarks/src/main/java/org/apache/kafka/jmh/assignor/ServerSideAssignorBenchmark.java` and `jmh-benchmarks/src/main/java/org/apache/kafka/jmh/assignor/TargetAssignmentBuilderBenchmark.java` change together 84% of the time (16 of the 19 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking.
  • Change coupling: ActiveTaskCreator.java ↔ StandbyTaskCreator.java streams/src/main/java/org/apache/kafka/streams/processor/internals/ActiveTaskCreator.java — `streams/src/main/java/org/apache/kafka/streams/processor/internals/ActiveTaskCreator.java` and `streams/src/main/java/org/apache/kafka/streams/processor/internals/StandbyTaskCreator.java` change together 83% of the time (20 of the 24 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking.
  • Change coupling: ApplicationEventProcessor.java ↔ CommitEvent.java clients/src/main/java/org/apache/kafka/clients/consumer/internals/events/ApplicationEventProcessor.java — `clients/src/main/java/org/apache/kafka/clients/consumer/internals/events/ApplicationEventProcessor.java` and `clients/src/main/java/org/apache/kafka/clients/consumer/internals/events/CommitEvent.java` change together 82% of the time (9 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking.
  • Change coupling: UniformHeterogeneousAssignmentBuilder.java ↔ UniformHomogeneousAssignmentBuilder.java group-coordinator/src/main/java/org/apache/kafka/coordinator/group/assignor/UniformHeterogeneousAssignmentBuilder.java — `group-coordinator/src/main/java/org/apache/kafka/coordinator/group/assignor/UniformHeterogeneousAssignmentBuilder.java` and `group-coordinator/src/main/java/org/apache/kafka/coordinator/group/assignor/UniformHomogeneousAssignmentBuilder.java` change together 75% of the time (9 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking.
  • Change coupling: KafkaApisBuilder.java ↔ BrokerServer.scala core/src/main/java/kafka/server/builders/KafkaApisBuilder.java — `core/src/main/java/kafka/server/builders/KafkaApisBuilder.java` and `core/src/main/scala/kafka/server/BrokerServer.scala` change together 74% of the time (23 of the 31 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking.
  • Change coupling: MirrorMaker.java ↔ ConnectDistributed.java connect/mirror/src/main/java/org/apache/kafka/connect/mirror/MirrorMaker.java — `connect/mirror/src/main/java/org/apache/kafka/connect/mirror/MirrorMaker.java` and `connect/runtime/src/main/java/org/apache/kafka/connect/cli/ConnectDistributed.java` change together 70% of the time (7 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking.
  • Change coupling: StreamsPartitionAssignor.java ↔ HighAvailabilityTaskAssignor.java streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamsPartitionAssignor.java — `streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamsPartitionAssignor.java` and `streams/src/main/java/org/apache/kafka/streams/processor/internals/assignment/HighAvailabilityTaskAssignor.java` change together 69% of the time (9 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking.
  • Change coupling: PartitionMakeFollowerBenchmark.java ↔ UpdateFollowerFetchStateBenchmark.java jmh-benchmarks/src/main/java/org/apache/kafka/jmh/partition/PartitionMakeFollowerBenchmark.java — `jmh-benchmarks/src/main/java/org/apache/kafka/jmh/partition/PartitionMakeFollowerBenchmark.java` and `jmh-benchmarks/src/main/java/org/apache/kafka/jmh/partition/UpdateFollowerFetchStateBenchmark.java` change together 62% of the time (30 of the 48 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×8
  • Duplicated block (12 lines × 2) clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java:5042 — clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java:5042-5053 | clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java:5084-5095 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java:5042` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) clients/src/main/java/org/apache/kafka/clients/consumer/internals/metrics/KafkaConsumerMetrics.java:61 — clients/src/main/java/org/apache/kafka/clients/consumer/internals/metrics/KafkaConsumerMetrics.java:61-72 | clients/src/main/java/org/apache/kafka/clients/consumer/internals/metrics/KafkaShareConsumerMetrics.java:58-69 — 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 `clients/src/main/java/org/apache/kafka/clients/consumer/internals/metrics/KafkaConsumerMetrics.java:61` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractMembershipManager.java:510 — clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractMembershipManager.java:510-521 | clients/src/main/java/org/apache/kafka/clients/consumer/internals/StreamsMembershipManager.java:556-567 — 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 `clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractMembershipManager.java:510` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java:1638 — clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java:1638-1650 | clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareConsumerImpl.java:1018-1029 — 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 `clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java:1638` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) clients/src/main/java/org/apache/kafka/common/record/internal/DefaultRecord.java:320 — clients/src/main/java/org/apache/kafka/common/record/internal/DefaultRecord.java:320-331 | clients/src/main/java/org/apache/kafka/common/record/internal/DefaultRecord.java:383-394 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) server/src/main/java/org/apache/kafka/server/KRaftTopicCreator.java:72 — server/src/main/java/org/apache/kafka/server/KRaftTopicCreator.java:72-85 | server/src/main/java/org/apache/kafka/server/KRaftTopicCreator.java:130-141 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `server/src/main/java/org/apache/kafka/server/KRaftTopicCreator.java:72` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/EagerAssignor.java:74 — connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/EagerAssignor.java:74-85 | connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/IncrementalCooperativeAssignor.java:133-144 — 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 `connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/EagerAssignor.java:74` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) metadata/src/main/java/org/apache/kafka/controller/ActivationRecordsGenerator.java:48 — metadata/src/main/java/org/apache/kafka/controller/ActivationRecordsGenerator.java:48-59 | metadata/src/main/java/org/apache/kafka/controller/ActivationRecordsGenerator.java:123-134 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `metadata/src/main/java/org/apache/kafka/controller/ActivationRecordsGenerator.java:48` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D31 · IaC & Container Security · Medium IaC · ×5
  • Medium IaC: DS-0001 docker/native/Dockerfile — ':latest' tag used A `:latest` base pins nothing: the stage rebuilds against whatever that tag points at on the day, so the same commit produces different images and a change you did not make arrives without a diff. The step: pin the base to a concrete release and, where the registry offers one, its digest — `FROM alpine:3.21@sha256:…` — then bump it deliberately, which is a review a bot can raise. A build stage that only compiles is worth pinning for the same reason: it decides what ends up in the layers you ship.
  • Medium IaC: CKV_DOCKER_2 docker/docker_official_images/3.7.0/jvm/Dockerfile:1 — Ensure that HEALTHCHECK instructions have been added to container images
  • Medium IaC: CKV_DOCKER_7 docker/native/Dockerfile:47 — Ensure the base image uses a non latest version tag
  • Medium IaC: CKV_DOCKER_2 docker/native/Dockerfile:1 — Ensure that HEALTHCHECK instructions have been added to container images
  • Medium IaC: CKV_DOCKER_2 docker/jvm/Dockerfile:1 — Ensure that HEALTHCHECK instructions have been added to container images
D4 · Code Duplication · Duplicated block (7 lines ×...

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.