Public report — pekko, published 27 Sep 2026.
Concrete security findings (which rule fired, in which file, on which line; CVE IDs, secret matches,
dependency versions) are REDACTED in this version; ask the repo owner for the full report.
Public
Codebase surveyMeasured under the Code Assurance Index · rubric rubric-2026.09.15 (frozen) · verify this surveyFiledcd_893f4546597b42caa7cc4221b4c6858b
Filed 27 September 2026, 18:55 UTC
Public
Large · 251,576 LoC · rebuild ~5.9 person-years · weakest lens: Maturity (68%)
Findings by grade
139 critical983 serious17 minor45 could not be resolved — could be critical — see Limitations
This survey was produced by
Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
27 September 2026, 17:24 UTC
A measurement, not a certificate. The Code Assurance Index does not certify,
approve or guarantee this codebase; it records a reproducible number and the evidence it was computed from. The
standard is authored by Canine Development, who also build Watchdog — its only implementation today. That is said
here so the number is checked rather than believed.
Grounded in facts. Every number here is computed, not narrated — reproducible, tool-backed, and traceable to a line of code. How to trust this ▸
1124findings with an exact file:lineof 1139 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
31/115dimensions across the health lenses251576 LoC — wide & deep
The system holds a strong overall standing with a health score of 71%, indicating a robust asset that is largely well-architected but carries specific, manageable risks. With over half a million lines of code, the platform represents significant value, yet its complexity means that small inefficiencies compound into substantial annual costs. The primary opportunity lies not in a costly rebuild, which would require nearly six person-years and close to a million euros, but in addressing immediate friction points that slow down the team’s daily work.
The most critical issue is a hidden velocity tax on every change. Code quality signals suggest that modifications in weaker areas cost two to five percent more effort than in clean code. This inefficiency acts as a recurring annual bill, costing the business thousands of engineer-days each year. Addressing the top-ranked fix pays for itself within months by eliminating this drag, offering a high-return investment that improves delivery speed without requiring new infrastructure.
A secondary risk involves operational maturity and security exposure. The system lacks clear documentation for new team members and has a confirmed security leak. While the architecture is sound, the absence of a testing guide in the main documentation creates a barrier to entry for new engineers, increasing the risk of human error. Furthermore, the leaked secret poses a direct security threat that must be contained immediately to prevent potential data exposure or compliance violations.
What is genuinely good is the underlying architecture, which scores highly for stability and modularity, and the comprehensive test suite, which provides a safety net for changes. The codebase is not boilerplate; it contains real, valuable business logic that is well-structured. This foundation allows the team to move quickly once the immediate friction points are removed.
Focus first on adding a testing section to the root README and resolving the leaked secret. These actions are low-effort but high-leverage, immediately improving onboarding and security posture. By tackling these items, the team can unlock the full potential of the strong architectural foundation and reduce the annual cost of technical debt.
How the score is built — each lens's share of the headlineWidth 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.
No single dominant problem — the weakest areas are close, so progress on any of them moves the score.
Code composition — where the lines go
Tests 100%
New since the last scan (100+)
1112 finding(s) are new versus the previous scan (2026-08-07) — surfaced by this scheduled scan itself, no pull request required. Showing the first 100; the full set is in the report.
A full-fidelity diff against the previous run's complete recorded findings — line-move tolerant: a finding that only shifted line counts as unchanged, only genuinely new titles/files surface here.
Rebuild cost & value ~ Modeled — €290,000–€1,400,000
1.0× (at 71% quality) — the last 20% of quality is most of the work
Size & shape
Large · effort split not classified (source measured from disk; the effort-tier breakdown is a C#-only syntax walk)
This codebase represents roughly ~5.9 person-years of build effort (about ~€860,000 to rebuild). Its weakest lens is Maturity at 68% — 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 1.0× 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 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED.
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 each file named `NNNN-title` in whatever markup those docs already use, is the most discoverable form).
The top-ranked fix costs roughly 1–3 engineer-days once. Not doing it costs about 5.7–38.1 engineer-days every year, paid as drag on the ~114,152 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–6 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: 28,147 line(s) changed over a 90-day window ⇒ ~114,152/year · D1/D2/D4/D6 code quality: averaging 7.3/10 ⇒ a 2–5% drag on each change · top-ranked remediation: Low effort ⇒ about 1–3 engineer-day(s)
→ Do the top-ranked fix now if this code will still be yours in 6 months.
Highest-leverage move · Medium · Leverage
Of everything flagged, the best return on effort is: Add a 'Testing' section to the root README — how to run the test suite. The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ Add a 'Testing' section to the root README — how to run the test suite.
A velocity tax on every change · Medium · Economics
The code-quality signals (complexity, duplication, cohesion) average 7.3/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/D6 code quality: averaging 7.3/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
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.)
796 modules, 2315 dependencies. 7 dependency cycles across 176 modules, marked above the diagonal.
Showing the 40 most-connected modules; 756 more are not drawn.
Module dependency matrix. The row depends on the column; the number is how many type pairs create the dependency. A cell above the diagonal is part of a dependency cycle.
actor.typed.delivery.ConsumerController uses actor.typed.SpawnProtocol. Changing actor.typed.SpawnProtocol can break actor.typed.delivery.ConsumerController, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
6→34 actor.typed.delivery.ConsumerController depends on actor.typedcycle✕
Type pairs
6 distinct (type in actor.typed.delivery.ConsumerController → type in actor.typed) references.
actor.typed.delivery.DurableProducerQueue uses actor.typed.SpawnProtocol. Changing actor.typed.SpawnProtocol can break actor.typed.delivery.DurableProducerQueue, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
7→34 actor.typed.delivery.DurableProducerQueue depends on actor.typedcycle✕
Type pairs
2 distinct (type in actor.typed.delivery.DurableProducerQueue → type in actor.typed) references.
35 distinct (type in stream.javadsl → type in japi.function) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
stream.javadsl uses actor.typed. Changing actor.typed can break stream.javadsl, not the reverse.
Position
Above the diagonal — a cycle. Neither module can be changed, tested or deployed independently until one of these dependencies goes.
11→35 stream.javadsl depends on org.apache.pekkocycle✕
Type pairs
39 distinct (type in stream.javadsl → type in org.apache.pekko) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
78 distinct (type in stream.impl.fusing → type in stream.stage) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
92 distinct (type in stream.impl.fusing → type in stream) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
persistence.typed.internal.Running uses actor.typed.SpawnProtocol. Changing actor.typed.SpawnProtocol can break persistence.typed.internal.Running, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
20→7 persistence.typed.internal.Running depends on actor.typed.delivery.DurableProducerQueue✕
Type pairs
1 distinct (type in persistence.typed.internal.Running → type in actor.typed.delivery.DurableProducerQueue) reference.
persistence.typed.internal.Running uses actor.typed.delivery.DurableProducerQueue. Changing actor.typed.delivery.DurableProducerQueue can break persistence.typed.internal.Running, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
20→13 persistence.typed.internal.Running depends on stream.impl.fusing✕
Type pairs
1 distinct (type in persistence.typed.internal.Running → type in stream.impl.fusing) reference.
persistence.typed.internal.Running uses persistence.typed.internal. Changing persistence.typed.internal can break persistence.typed.internal.Running, not the reverse.
Position
Above the diagonal — a cycle. Neither module can be changed, tested or deployed independently until one of these dependencies goes.
20→23 persistence.typed.internal.Running depends on persistence.typedcycle✕
Type pairs
1 distinct (type in persistence.typed.internal.Running → type in persistence.typed) reference.
persistence.typed.internal.Running uses actor.typed.javadsl. Changing actor.typed.javadsl can break persistence.typed.internal.Running, not the reverse.
Position
Above the diagonal — a cycle. Neither module can be changed, tested or deployed independently until one of these dependencies goes.
20→34 persistence.typed.internal.Running depends on actor.typedcycle✕
Type pairs
7 distinct (type in persistence.typed.internal.Running → type in actor.typed) references.
persistence.typed.internal uses actor.typed.delivery.DurableProducerQueue. Changing actor.typed.delivery.DurableProducerQueue can break persistence.typed.internal, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
22→9 persistence.typed.internal depends on io.Tcp✕
Type pairs
1 distinct (type in persistence.typed.internal → type in io.Tcp) reference.
persistence.typed.internal uses persistence.typed.internal.Running. Changing persistence.typed.internal.Running can break persistence.typed.internal, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
22→23 persistence.typed.internal depends on persistence.typedcycle✕
Type pairs
10 distinct (type in persistence.typed.internal → type in persistence.typed) references.
persistence.typed uses actor.typed.delivery.DurableProducerQueue. Changing actor.typed.delivery.DurableProducerQueue can break persistence.typed, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
23→22 persistence.typed depends on persistence.typed.internal✕
Type pairs
1 distinct (type in persistence.typed → type in persistence.typed.internal) reference.
actor.typed.javadsl uses actor. Changing actor can break actor.typed.javadsl, not the reverse.
Position
Above the diagonal — a cycle. Neither module can be changed, tested or deployed independently until one of these dependencies goes.
30→34 actor.typed.javadsl depends on actor.typedcycle✕
Type pairs
44 distinct (type in actor.typed.javadsl → type in actor.typed) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
actor.typed.internal uses actor. Changing actor can break actor.typed.internal, not the reverse.
Position
Above the diagonal — a cycle. Neither module can be changed, tested or deployed independently until one of these dependencies goes.
31→34 actor.typed.internal depends on actor.typedcycle✕
Type pairs
42 distinct (type in actor.typed.internal → type in actor.typed) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
actor.typed.delivery.ProducerController uses actor.typed.SpawnProtocol. Changing actor.typed.SpawnProtocol can break actor.typed.delivery.ProducerController, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
36→34 actor.typed.delivery.ProducerController depends on actor.typed✕
Type pairs
6 distinct (type in actor.typed.delivery.ProducerController → type in actor.typed) references.
59 distinct (type in stream.scaladsl → type in stream.javadsl) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A03:2021 — Injection
115
High / Critical
A05:2021 — Security Misconfiguration
26
High / Critical
A02:2021 — Cryptographic Failures
5
High / Critical
Roadmap
Begin by updating the root README with clear instructions for running the test suite and establishing a dedicated directory for dated architecture decision records. Next, immediately resolve the identified leaked secret in the REDACTED and integrate static analysis tools into the CI pipeline to automatically fail builds on regressions. Finally, enhance deployment reliability by adding health probes and implementing a rolling-update or blue/green strategy to ensure automatic rollback of bad releases.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED.
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 each file named `NNNN-title` in whatever markup those docs already use, is the most discoverable form).
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.
Resolve the 20 Orphaned knowledge finding(s) in Knowledge Freshness — start with ReplicatedDataSerializer.scala, ActorRef.scala, EntityPassivationStrategy.scala.
God Classes: TooManyMethods: ReplicatedDataSerializer
REDACTED
5.8
Mixed
Static Analysis (SAST): High: REDACTED
REDACTED
5.8
Mixed
Static Analysis (SAST): High: REDACTED
REDACTED
5.8
Mixed
Static Analysis (SAST): High: REDACTED
REDACTED
5.8
Mixed
Static Analysis (SAST): High: REDACTED
REDACTED
5.8
Mixed
Static Analysis (SAST): High: REDACTED
REDACTED
5.8
Mixed
Static Analysis (SAST): High: REDACTED
REDACTED
5.8
Mixed
Static Analysis (SAST): High: REDACTED
How the grades work
Every finding carries one of four grades. Three say how serious it is. The fourth says this
survey could not settle it — and it is a grade, not a gap.
Critical — 139
A definite problem that already costs you something and drags the score down: a
missing authorisation check, a dependency with a known exploit, a build that does not reproduce. Failure here
tends to cause failures elsewhere.
Serious — 983
Likely wrong, but not failing yet. It degrades
the codebase over a longer horizon and can cause failures elsewhere — not urgent this week, not something to
carry for two years either.
Minor — 17
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 45
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
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. 28 of 31 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 3 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.8 — 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 — 31 dimensions across the health lenses
Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.
How to trust any code-health report — three questions
Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 1124 of 1139 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D8 Code Coverage — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: test source is present (.java, .scala) but the built-in coverage collector has no runner for this repository's ecosystem — so this suite was never executed by it. Not scored — this is a gap in the analyzer's language coverage, not a defect in the repo. To have real coverage read, produce a coverage report in a standard format (JaCoCo XML — `mvn jacoco:report` or the Gradle `jacocoTestReport` task, or `addSbtPlugin("org.scoverage" % "sbt-scoverage" % "<version>")` in `project/plugins.sbt`, then `sbt clean coverage test coverageReport`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures. You can widen what we reach: optional: produce a coverage report in a standard format (JaCoCo XML — `mvn jacoco:report` or the Gradle `jacocoTestReport` task, or `addSbtPlugin("org.scoverage" % "sbt-scoverage" % "<version>")` in `project/plugins.sbt`, then `sbt clean coverage test coverageReport`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures — then the real number is read on the next scan.
D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability not included — the Scala suite (repository root, 1392 test files) did not finish re-running within its budget: the sbt build did not finish re-running within its tier budget.
D12 Dependency Hygiene — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This repository's dependency manifest (an sbt build (build.sbt)) was found, but this pass cannot parse it for hygiene, so no package was assessed. Zero packages read is NOT a clean dependency tree, so this is NOT SCORED — a gap in the analyzer, not a verdict about this repository. This row is about dependency HYGIENE — outdated, deprecated or unmaintained direct dependencies; known CVEs in the same dependency graph are a separate question, reported under D30 wherever the manifest is OSV-readable.
D14 License Compliance — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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 (an sbt build (build.sbt)), which this pass does not parse yet — so this dimension asserts nothing about this repository's licensing in either direction.
D22 Internal API Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. A language sidecar this run needed FAILED, so the code model the non-MSBuild public-API collector reads was never built — this is a DEGRADED run, not a settled gap, and the surface may well be collectable on a re-run: The Java sidecar STALLED after 195s — no output for 180s — so its process tree was killed and the Java code model degraded to null.
D32 Data Compliance (PII/GDPR) — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `docs/src/main/java-jdk-21/docs/actors/classical/OptimizedActorWithJava21.java` produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
D44 Platform End-of-Life — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This dimension reads a project's own statement about the platform it runs on: a TargetFramework in a .NET project file, a .nvmrc or .python-version, a capped requires-python, or a framework major pinned by a dependency constraint. This repository carries none of them, so nothing about its platform was established. That is a gap in this analyzer's coverage, NOT a finding that the platform is supported — a language whose runtime is declared elsewhere (go.mod, a Gemfile's ruby directive, a Dockerfile) is simply not read here yet.
AX3 Project dependency cycles — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over which project references which. That is a language-neutral question, but the project-reference graph is collected from MSBuild .csproj, Gradle and Maven builds only, and this repository commits none — so there was no graph to read, and re-running the same commit reads the same nothing. Its modules are declared as: sbt subprojects (build.sbt). A reader for that graph is the collector this check is missing. That is a COLLECTOR gap in this analyzer — no change to the scan image closes it — and not a finding that the repository is free of what this check looks for.
AX6 Interface segregation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
AX8 Test isolation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over which projects are test projects, and what they reference. That is a language-neutral question, but the project-reference graph is collected from MSBuild .csproj, Gradle and Maven builds only, and this repository commits none — so there was no graph to read, and re-running the same commit reads the same nothing. Its modules are declared as: sbt subprojects (build.sbt). A reader for that graph is the collector this check is missing. That is a COLLECTOR gap in this analyzer — no change to the scan image closes it — and not a finding that the repository is free of what this check looks for.
AXB1 Runtime evidence locked — no reproducible boot — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. The Runtime Evidence tier boots an app only via docker-compose, an Aspire AppHost, or a Dockerfile. None was found, so no live runtime a11y/egress/header evidence was collected. You can widen what we reach: add a docker-compose.yml (or an Aspire AppHost) that brings the app up with its dependencies. Watchdog then boots it in an isolated sandbox and gathers real runtime evidence — you change nothing in your pipeline (no CI step, no SDK).
C1 Data Protection — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
C2 Access Controls — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
C3 Audit Trail — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
C4 Data Retention — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These retention controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks retention controls.
C5 Data-Subject Rights — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These data-subject rights controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks data-subject rights controls.
ED5 Idempotency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check finds retry-prone mutations by walking the repository's declared types, and NONE was loaded on this run, so it had nothing to look at. That is a limit of the analyzer's reach — it reads .NET projects — not a finding that this repository has no command handlers or message consumers.
GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
IC1 Incompleteness & stubs — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
S1 Web-Security Posture — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
X1 Async correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X12 Unreachable branch — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X13 Undrained process stream — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X14 Bypassable address classification — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X15 Unvalidated length from an untrusted reader — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X16 Unfloored truncation loop — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X17 Uncapped recursion over a caller-supplied document — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X18 Disposal-pattern correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X19 Unrestored process-global state — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X2 Cancellation propagation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X20 Mistyped argument guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X21 Side-effecting pattern guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X22 Contradicted release guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X23 Unguarded diagnostic materialisation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X24 Document value interpolated into markup unescaped — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X25 Inert configuration knob — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X26 Unsynchronised callback handoff — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X27 Collection changed while being enumerated — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X28 Index access outside its own emptiness guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X29 Per-element action decided by a fixed element — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X3 Exception handling — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X30 Support guard that admits what it rejects — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X32 Type resolved by simple name across every loaded assembly — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X4 Structured logging — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X5 Nullable reference types — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
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 — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D13 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D19 Documentation Quality: Documentation quality is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement. Its critique rows are drawn from a closed category vocabulary and each row means the same thing in every run, so two scans can be compared row by row; the SET that fires is still a sample, and does not repeat exactly. Measured on one frozen input, six scans at one engine SHA: 2-5 critique rows per scan, 8 distinct rows across the six, 3 of those 8 seen in only one scan. So a D19 row is evidence about the documentation, but a COUNT of D19 rows is not a quantity — never read a change in it as an improvement or a regression.
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.
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.
D40 Network Egress Confinement: Egress confinement is read from committed Kubernetes manifests — a policy applied out-of-band (cluster-default deny, a service mesh, or a cloud firewall/security group off-repo) is invisible, and a present NetworkPolicy is declared config, not proof the cluster admission-controller actually enforces it at runtime.
D41 Kernel & Syscall Confinement: Syscall/MAC confinement is read from committed manifests — a profile applied by a cluster-wide PodSecurity default or a mutating webhook off-repo isn't seen, and a declared seccomp/AppArmor profile is config presence, not proof the node's kernel actually loaded and enforced it.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
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".
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
The LLM boundary
LLM-set scores this run (3): D19, D21, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score; each names its own sample and method on its card. They 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.
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.
109 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was TlsGraphStage.createLogic at 235. A further 17 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 ClusterShardingMessageSerializer.manifest at 43 — they are counted neither in the figure above nor in this dimension's score. 8 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/protobuf/ClusterShardingMessageSerializer.scala (ClusterShardingMessageSerializer.manifest at 43), remote/src/main/scala/org/apache/pekko/remote/serialization/MiscMessageSerializer.scala (MiscMessageSerializer.toBinary at 35), distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/protobuf/ReplicatedDataSerializer.scala (ReplicatedDataSerializer.manifest at 33), cluster/src/main/scala/org/apache/pekko/cluster/Member.scala (Member.highestPriorityOf at 20), cluster/src/main/scala/org/apache/pekko/cluster/sbr/SplitBrainResolver.scala (SplitBrainResolverBase.receive at 19), and 3 more not listed here. They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.
+ 102 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 2 VersionVector.compareOnlyTo (cyclomatic 20) finding(s) in Cyclomatic Complexity — start with VersionVector.scala (2). — One of this dimension's main actionable groups (2 warning-level).
Resolve the 2 JacksonSerializer.fromBinary (cyclomatic 20) finding(s) in Cyclomatic Complexity — start with JacksonSerializer.scala (2). — One of this dimension's main actionable groups (2 warning-level).
Resolve the 1 TlsGraphStage.createLogic (cyclomatic 235) finding(s) in Cyclomatic Complexity — start with TlsGraphStage.scala. — One of this dimension's main actionable groups (1 warning-level).
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.
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.
+ 215 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 2 VersionVector.compareOnlyTo (cognitive 47) finding(s) in Cognitive Complexity — start with VersionVector.scala (2). — One of this dimension's main actionable groups (2 warning-level).
Resolve the 2 ByteStrings.lastIndexOf (cognitive 26) finding(s) in Cognitive Complexity — start with ByteString.scala (2). — One of this dimension's main actionable groups (2 warning-level).
Resolve the 2 ORSet.mergeCommonKeys (cognitive 26) finding(s) in Cognitive Complexity — start with ORSet.scala (2). — One of this dimension's main actionable groups (2 warning-level).
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.
Do you agree with this assessment?
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.
Resolve the 47 TooManyMethods finding(s) in God Classes — start with Source.scala (3), Flow.scala (2), Logging.scala (2). — One of this dimension's main actionable groups (47 warning-level).
Resolve the 42 FileTooLong finding(s) in God Classes — start with Flow.scala (2), ClusterShardingSettings.scala (2), ByteString.scala. — One of this dimension's main actionable groups (42 warning-level).
Resolve the 6 MethodTooLong finding(s) in God Classes — start with TlsGraphStage.scala (2), StreamOfStreams.scala (2), ClusterReceptionist.scala. — One of this dimension's main actionable groups (6 warning-level).
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.
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.
199 duplicated block group(s) detected. A further 8 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 7 of the 207 are in trees this repository does not ship — vendored, example/demo, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.
+ 54 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 18 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with JacksonSerializer.scala (2), ByteIterator.scala, Mailbox.scala. — One of this dimension's main actionable groups (18 warning-level).
Resolve the 17 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with ByteString.scala (4), StashManagement.scala (3), Supervision.scala. — One of this dimension's main actionable groups (17 warning-level).
Resolve the 15 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with FSM.scala (2), CommandHandler.scala (2), ByteString.scala. — One of this dimension's main actionable groups (15 warning-level).
Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
Resolve the 14 Low cohesion finding(s) in Cohesion (LCOM4) — start with ClusterShardingMessageSerializer.scala, ReplicatorMessageSerializer.scala, ActorContextAdapter.scala. — One of this dimension's main actionable groups (14 warning-level).
Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Enforce REDACTED Scanning in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d13_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
Top hotspots: stream/src/main/scala/org/apache/pekko/stream/impl/io/TlsGraphStage.scala (3×235=705); stream/src/main/scala/org/apache/pekko/stream/scaladsl/Hub.scala (4×23=92); cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ShardCoordinator.scala (2×44=88) Repeated repair below the complexity floor: stream/src/main/scala/org/apache/pekko/stream/impl/fusing/GraphInterpreter.scala (3 of 4 changes were fixes); cluster-metrics/src/main/scala/org/apache/pekko/cluster/metrics/protobuf/MessageSerializer.scala (3 of 3 changes were fixes)
Resolve the 21 Hotspot finding(s) in Churn × Complexity Hotspots — start with JacksonSerializer.scala (2), TlsGraphStage.scala, Hub.scala. — One of this dimension's main actionable groups (21 warning-level).
Resolve the 2 Repeated repair finding(s) in Churn × Complexity Hotspots — start with GraphInterpreter.scala, MessageSerializer.scala. — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D16 · Bus Factor8.5 / 10Strong✓ 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.
127 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Ops.scala. Counted over 909 of the 1311 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Off-boarding risk: anonymized user #1 · ×3
Further sole-owners (lower concentration)
What to do
Resolve the 3 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (3 recommendation-level).
Resolve the 1 Further sole-owners (lower concentration) finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.
Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.
279 deducted task-comment markers across 251572 LoC (0.1/KLoC) → score 9.8. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
Resolve the 177 TodoComment finding(s) in Explicit Debt — start with Running.scala (5), SbtMultiJvmPlugin.scala (5), JacksonSerializerSpec.scala (5). — One of this dimension's main actionable groups (177 warning-level).
Resolve the 95 FixmeComment finding(s) in Explicit Debt — start with EventsBySliceFirehoseSpec.scala (6), TestKitApiTest.java (6), Player.scala (4). — One of this dimension's main actionable groups (95 warning-level).
Resolve the 7 HackComment finding(s) in Explicit Debt — start with JacksonSerializerSpec.scala (4), Mailboxes.scala, MultiNode.scala. — One of this dimension's main actionable groups (7 warning-level).
Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Judged by language model at low temperature (0.0-0.1) on a deterministic doc sample (READMEs plus first 25 architecture docs), with two-pass stability filtering. Advisory, sampled.
The repository's root README (Apache Pekko) is clear and well-structured: it states the project name, a brief overview of what Pekko does (Actor Model for concurrent/distributed systems), its Akka fork lineage, and links to reference docs, building from source, IntelliJ IDEA setup, prerequisites, and running the build. It also documents subprojects such as bench-jmh/README.md, remote/src/test/resources/ssl/README.md, and a dedicated architecture/Docs directory (441 markdown files). The READMEs for each of these subdirectories are tailored to their own directories rather than the repository root, so they do not fall under the missing-overview or missing-installation categories. All visible documents are complete per their outlines; no section is missing.
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.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: REDACTED scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.
3 finding(s): 0 critical, 3 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.
REDACTED
REDACTED
REDACTED
What to do
Resolve the 2 REDACTED finding(s) in Secrets (history) — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
Resolve the 1 High secret finding(s) in Secrets (history) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d28_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.
Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.
Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).
115 finding(s): 0 critical, 114 high, 1 medium, 0 low. 112 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 5 file(s) — `actor/src/main/scala-3/org/apache/pekko/util/ByteIterator.scala`, `cluster/src/main/scala/org/apache/pekko/cluster/ClusterDaemon.scala`, `distributed-data/src/main/scala-3/org/apache/pekko/cluster/ddata/GSet.scala`, `docs/src/main/java-jdk-21/docs/actors/classical/OptimizedActorWithJava21.java` (line 36, line 37, line 38), `persistence/src/main/scala/org/apache/pekko/persistence/Eventsourced.scala` — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 12 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.
REDACTED
REDACTED
REDACTED
REDACTED
What to do
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
No action in Static Analysis (SAST) — all 112 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (112 issue-level, 0 of them charged here).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 22 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (22). — One of this dimension's main actionable groups (22 warning-level).
Resolve the 1 High IaC finding(s) in IaC & Container Security — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 3 Low IaC finding(s) in IaC & Container Security — start with REDACTED (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.
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.
420 of 909 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/protobuf/ReplicatedDataSerializer.scala. Counted over 909 of the 1311 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Resolve the 20 Orphaned knowledge finding(s) in Knowledge Freshness — start with ReplicatedDataSerializer.scala, ActorRef.scala, EntityPassivationStrategy.scala. — One of this dimension's main actionable groups (20 issue-level).
Resolve the 1 Further orphaned files (smaller) finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
Resolve the 3 Change coupling finding(s) in Change Coupling — start with FlowWithContext.scala, PersistenceTestKitPlugin.scala, SourceWithContext.scala. — One of this dimension's main actionable groups (3 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.
Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.
What it measures: Whether Kubernetes workloads restrict network EGRESS with a NetworkPolicy (or Cilium policy), limiting where a compromised pod can send data or reach a command-and-control server. Presence of committed egress-restricting policy, not runtime enforcement.
Method: Deterministic YAML-manifest inspection (no external tool, no Roslyn — language-agnostic): Kubernetes workloads gate applicability; credits a NetworkPolicy / Cilium policy that restricts egress (policyTypes: [Egress] / egress rules). Reward-leaning (neutral floor climbing to 10, never a deduction — baseline misconfigs stay with D31). Deterministic.
What it measures: Whether Kubernetes workloads confine the kernel boundary — a seccomp profile (RuntimeDefault/Localhost) plus an AppArmor/SELinux mandatory-access-control layer — shrinking the syscall attack surface a container escape would use. Presence of committed confinement config, not runtime enforcement.
Method: Deterministic YAML-manifest inspection (no external tool, no Roslyn): on Kubernetes workloads, credits a seccomp profile (RuntimeDefault/Localhost) and an AppArmor/SELinux MAC layer. Reward-leaning (neutral floor climbing to 10); NotApplicable without workloads. Deterministic.
Resolve the 1 No seccomp profile finding(s) in Kernel & Syscall Confinement. — One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 No AppArmor/SELinux confinement finding(s) in Kernel & Syscall Confinement. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d41_recommendation.md · top locations in Appendix A, every location in findings.md.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
What to do
The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
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.
Do you agree with this assessment?
ED3 · Event naming7.0 / 10Strong✓ Tool-verified
Other · Event-Driven — Whether events are named in the past tense (a clarity nudge — low weight).
Method: Roslyn scan (event-driven gated): domain and integration events checked for past-tense naming (-ed/-en suffix or irregular set). Naming nudge, low-weight advisory.
`RemotingErrorEvent` is a present-participle name inside a persisted event ADT — it reads as an in-progress intent, not a fact that already happened. Its siblings are past-tense facts; name it for the event that occurred (e.g. `ItemAddedToShoppingCart`) so the event log records what happened. — remote/src/main/scala/org/apache/pekko/remote/RemotingLifecycleEvent.scala:94
`RemotingShutdownEvent` is a present-participle name inside a persisted event ADT — it reads as an in-progress intent, not a fact that already happened. Its siblings are past-tense facts; name it for the event that occurred (e.g. `ItemAddedToShoppingCart`) so the event log records what happened. — remote/src/main/scala/org/apache/pekko/remote/RemotingLifecycleEvent.scala:87
What to do
Name events in the past tense — they record facts that already happened.
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.
841 code files changed in the last 6 months but the README was not touched — it may no longer reflect the system.
What to do
Add a 'Testing' section to the root README — how to run the test suite.
Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
Review the README against recent changes; refresh the parts that drifted.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
What to do
Record 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 each file named `NNNN-title` in whatever markup those docs already use, is the most discoverable form).
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.
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.
Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.
Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.
Deployment automation exists but no readiness/liveness probes, rolling-update strategy, lifecycle hooks or migration job were evidenced — a bad release is harder to detect and reverse.
What to do
Add readiness/liveness probes and a rolling-update (or blue/green) strategy so a bad release is caught and rolled back automatically.
Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.
Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.
Do you agree with this assessment?
Reference — by lens
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Not evidenced — 4 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
C3 Audit Trail — Not assessed: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C4 Data Retention — Not assessed: these retention controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks retention controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C5 Data-Subject Rights — Not assessed: these data-subject rights controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks data-subject rights controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 80 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 (21 DOM element(s) < 25) — too little surface to assess accessibility.
AC2 Forms & labels — Frontend below the scale floor (21 DOM element(s) < 25) — too little surface to assess accessibility.
AC3 Page structure — Frontend below the scale floor (21 DOM element(s) < 25) — too little surface to assess accessibility.
AC4 Keyboard semantics — Frontend below the scale floor (21 DOM element(s) < 25) — too little surface to assess accessibility.
AC5 ARIA correctness — Frontend below the scale floor (21 DOM element(s) < 25) — too little surface to assess accessibility.
AC6 Visual & motion safety — Frontend below the scale floor (21 DOM element(s) < 25) — too little surface to assess accessibility.
AC7 A11y enforcement — Frontend below the scale floor (21 DOM element(s) < 25) — too little surface to assess accessibility.
AX1 Captive dependencies — no DI registrations detected
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 commits no project file of a kind this check models. 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 commits no project file of a kind this check models. 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
AXB1 Runtime evidence locked — no reproducible boot — 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.
D10 Test Quality — ~285421 lines of test source are present (.java, .scala) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
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 — Package manifest not parsed for licence data — analyzer language-coverage gap
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D20 ADR Quality — N/A — ADRs are expected on deployable products with a user-facing host, not consumed libraries; no ADR log is required here.
D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
D23 Boundary Type-Coupling — Production source is present (.java, .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 — symbol resolution incomplete — navigability not assessed
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 (an sbt build (build.sbt) — not scanned yet).
D32 Data Compliance (PII/GDPR) — 1 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
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.
D42 Runtime Threat Enforcement — The repository ships application workloads but no cluster-governance resources (CRDs, admission webhooks, or a committed policy engine). Runtime threat-detection (Falco/Tetragon) and admission control (Kyverno/OPA-Gatekeeper/PodSecurity) are cluster-OPERATOR controls owned by the platform, not shipped by an application repo/chart — nothing for this repo to assess.
D43 Malicious Dependencies — 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 (an sbt build (build.sbt) — not scanned yet).
D44 Platform End-of-Life — Platform end-of-life not assessed — this repository declares no platform this pass reads
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.)
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, .scala) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so 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 (3 signals for this style, 2 needed — the count is met but a required primary signal is absent): 3 aggregate root(s) (types guarding their own state behind command methods — this language has no AggregateRoot base to inherit); 2152 value object(s); 47 domain event(s); a domain→infrastructure coupling (akka/pekko-persistence or akka-ddd aggregate state, a codec-on-entity, or a transport-typed domain port); no aggregate is declared and no domain structure surrounds the state-guarding types: not claimed as DDD
ED5 Idempotency — This check finds retry-prone mutations (command handlers and message/event consumers) by walking the repository's declared types, and none was loaded here, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
GD1 Unfinished & placeholder code — no source files were read — this check reads C# syntax, and none was loaded for this repository. That is a limit of the analyzer, not a finding about your code.
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, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
P2 Observability — Observability was not assessed: this check reads a source model that does not carry this repository's product — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of a logging idiom this check recognises is NOT evidence that this repo lacks structured logging (it may log through its own ecosystem's logger). This is a gap in the analyzer, not a finding about this repository.
P7 Outbound HTTP resilience — not measured — the application kind could not be determined for this repo
P8 Schema migrations — not assessed — schema-migration practice is read from a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (`addSbtPlugin("org.scoverage" % "sbt-scoverage" % "<version>")` in `project/plugins.sbt`, then `sbt clean coverage test coverageReport`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, 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
X12 Unreachable branch — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X13 Undrained process stream — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X14 Bypassable address classification — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X15 Unvalidated length from an untrusted reader — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X16 Unfloored truncation loop — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X17 Uncapped recursion over a caller-supplied document — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X18 Disposal-pattern correctness — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X19 Unrestored process-global state — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
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
X20 Mistyped argument guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X21 Side-effecting pattern guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X22 Contradicted release guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X23 Unguarded diagnostic materialisation — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X24 Document value interpolated into markup unescaped — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X25 Inert configuration knob — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X26 Unsynchronised callback handoff — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X27 Collection changed while being enumerated — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X28 Index access outside its own emptiness guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X29 Per-element action decided by a fixed element — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
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
X30 Support guard that admits what it rejects — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X32 Type resolved by simple name across every loaded assembly — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
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
X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
Orphaned knowledge distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/protobuf/ReplicatedDataSerializer.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 actor/src/main/scala/org/apache/pekko/actor/ActorRef.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 cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/internal/EntityPassivationStrategy.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 remote/src/main/scala/org/apache/pekko/remote/artery/Codecs.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 stream/src/main/scala/org/apache/pekko/stream/impl/package.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 actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/internal/WorkPullingProducerControllerImpl.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 cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/receptionist/ClusterReceptionist.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 multi-node-testkit/src/main/scala/org/apache/pekko/remote/testconductor/Conductor.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 cluster/src/main/scala/org/apache/pekko/cluster/ClusterEvent.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 distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/protobuf/ReplicatorMessageSerializer.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 cluster/src/main/scala/org/apache/pekko/cluster/sbr/DowningStrategy.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 cluster/src/main/scala/org/apache/pekko/cluster/sbr/SplitBrainResolver.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 stream/src/main/scala/org/apache/pekko/stream/impl/StreamLayout.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 actor/src/main/scala/org/apache/pekko/pattern/BackoffOptions.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 testkit/src/main/scala/org/apache/pekko/testkit/TestEventListener.scala— No living knowledge remains for this large file — its last meaningful change has decayed away, so if it breaks, no one currently understands it. It does carry its own tests, so the behaviour is pinned even though the understanding is gone: schedule a read-through, using those tests as the specification, before the next change lands here.
Orphaned knowledge cluster-metrics/src/main/scala/org/apache/pekko/cluster/metrics/ClusterMetricsRouting.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 remote/src/main/scala/org/apache/pekko/remote/artery/EnvelopeBufferPool.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 persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/scaladsl/PersistenceTestKit.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 stream/src/main/scala/org/apache/pekko/stream/scaladsl/Framing.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 persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/crdt/ORSet.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.
TodoComment actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/StubbedActorContext.scala:169— // TODO allow overriding of this — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/BehaviorTestKitImpl.scala:157— // TODO why canonicalize here? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/ActorSystemStub.scala:151— // todo: might be better NOT to pass any class loader and let typesafeConfig rely on the contextClassLoader — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestInbox.scala:78— // TODO expectNoMsg etc — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/TestInbox.scala:77— // TODO expectNoMsg etc — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment actor-tests/src/test/scala/org/apache/pekko/actor/Ticket669Spec.scala:31— // TODO: does this really make sense? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment actor-tests/src/test/scala/org/apache/pekko/actor/dispatch/ActorModelSpec.scala:593— // TODO check why throughput=1 here? (came from old test) — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment actor-tests/src/test/scala/org/apache/pekko/dispatch/ForkJoinPoolStarvationSpec.scala:65— // TODO issue #31117: starvation with JDK 17 FJP
TodoComment actor-tests/src/test/scala/org/apache/pekko/io/SimpleDnsCacheSpec.scala:77— // TODO test that the old protocol is converted correctly — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment actor-tests/src/test/scala/org/apache/pekko/pattern/PatternSpec.scala:62— // TODO after is unfortunately shadowed by ScalaTest, fix as part of #3759
TodoComment actor-tests/src/test/scala/org/apache/pekko/pattern/PatternSpec.scala:70— // TODO after is unfortunately shadowed by ScalaTest, fix as part of #3759
TodoComment actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/AdapterTest.java:221— // TODO Restart will not really restart the behavior — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/adapter/AdapterSpec.scala:140— // TODO Restart will not really restart the behavior — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/delivery/WorkPullingSpec.scala:289— // TODO #28723 add a random test for work pulling
TodoComment actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/WorkPullingProducerController.scala:110— // TODO #28719 when removing ApiMayChange consider removing `case class` for some of the messages
TodoComment actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/ProducerController.scala:97— // TODO #28719 when removing ApiMayChange consider removing `case class` for some of the messages
TodoComment actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/DurableProducerQueue.scala:32— // TODO #28719 when removing ApiMayChange consider removing `case class` for some of the messages
TodoComment actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/ConsumerController.scala:59— // TODO #28719 when removing ApiMayChange consider removing `case class` for some of the messages
TodoComment cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/delivery/ShardingProducerController.scala:103— // TODO #28719 when removing ApiMayChange consider removing `case class` for some of the messages
TodoComment actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/internal/WorkPullingProducerControllerImpl.scala:569— // TODO #28722 we could also track unreachable workers and avoid them when selecting worker
TodoComment actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/internal/ProducerControllerImpl.scala:555— // TODO #28721 to reduce number of writes, consider to only StoreMessageConfirmed for the Request messages and not for each Ack
TodoComment actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/LoggerClass.scala:74— // TODO: can potentially guard for ClassNotFoundException, but seems unlikely — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/InterceptorImpl.scala:91— // TODO performance optimization could maybe to avoid isAssignableFrom if interceptMessageClass is Class[Object]? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment actor/src/main/java/org/apache/pekko/dispatch/AbstractBoundedNodeQueue.java:103— // Possible TODO — impl. could be switched to addNode(new Node(value)) if we want to allocate even if full already — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment actor/src/main/scala/org/apache/pekko/actor/FaultHandling.scala:677— // TODO optimization to drop child here already? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestProbe.scala:276— // FIXME awaitAssert(Procedure): Unit would be nice for java people to not have to return null — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/BehaviorTestKit.scala:78— // FIXME it is weird that this is public but it is used in BehaviorSpec, could we avoid that? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/ActorTestKit.scala:330— // FIXME needed for Pekko internal tests but, users shouldn't spawn system actors? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/receptionist/ReceptionistApiSpec.scala:71— // FIXME inference doesn't work with partial function — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment actor-typed-tests/src/test/scala/org/apache/pekko/actor/typed/scaladsl/adapter/AdapterSpec.scala:318— // FIXME there's a warning with null logged from the classic empty child here, where does that come from? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/pubsub/TopicImpl.scala:86— // FIXME exhaustiveness check fails on receptionist listing match — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment actor/src/main/java/org/apache/pekko/japi/pf/ReceiveBuilder.java:69— // FIXME why no new Receive(statements)? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment actor/src/main/scala/org/apache/pekko/actor/FaultHandling.scala:55— // FIXME How about making ChildRestartStats immutable and then move these methods into the actual supervisor strategies? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment actor/src/main/scala/org/apache/pekko/actor/ActorPath.scala:316— // FIXME make this cheaper by comparing address and name in isolation — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment actor/src/main/scala/org/apache/pekko/event/EventBus.scala:194— // FIXME binary incompatible, but I think it is safe to filter out this problem, — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment actor/src/main/scala/org/apache/pekko/io/SelectionHandler.scala:299— // FIXME: Add possibility to signal failure of task to someone — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment actor/src/main/scala/org/apache/pekko/util/LockUtil.scala:22— // FIXME switch to AQS — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment actor/src/main/scala/org/apache/pekko/util/LineNumbers.scala:63— // FIXME: this needs memoization with an LRU cache — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment bench-jmh/src/main/scala/org/apache/pekko/stream/InterpreterBenchmark.scala:60— // FIXME: This should not be here, this is pure setup overhead — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment cluster-sharding-typed/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/typed/ShardedDaemonProcessSpec.scala:118— // FIXME test removing one cluster node and verify all are alive (how do we do that?) — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/scaladsl/ClusterShardingSpec.scala:317— // FIXME #26514: doesn't compile with Scala 2.13.0-M5
FixmeComment cluster-sharding-typed/src/test/scala/org/apache/pekko/cluster/sharding/typed/scaladsl/ClusterShardingPersistenceSpec.scala:175— // FIXME #24466: rewrite this with Typed API when region queries are supported
FixmeComment cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/internal/ClusterShardAllocationMixin.scala:87— // FIXME #29589, we currently only look at same dc but proxies in other dcs may delay complete as well right now
FixmeComment cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/ShardWithLeaseSpec.scala:34— // FIXME this looks like it is the same test as ClusterShardingLeaseSpec is there any difference? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment cluster-sharding/src/test/scala/org/apache/pekko/cluster/sharding/RememberEntitiesFailureSpec.scala:315— // FIXME restart without passivating is not saved and re-started again without storing the stop so this isn't testing anything — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/internal/ReplicatorBehavior.scala:54— // FIXME perhaps add supervisor for restarting, see PR https://github.com/akka/akka/pull/25988
FixmeComment cluster-typed/src/test/java/jdocs/org/apache/pekko/cluster/typed/BasicClusterExampleTest.java:38— // FIXME use awaitAssert to await cluster forming like in BasicClusterExampleSpec — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment cluster-typed/src/test/scala/org/apache/pekko/cluster/typed/internal/receptionist/ClusterReceptionistSpec.scala:791— // Fixme concurrent registration and unregistration — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment cluster/src/main/scala/org/apache/pekko/cluster/Reachability.scala:148— // FIXME: how should we have gotten into this state? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TooManyMethods: Source stream/src/main/scala/org/apache/pekko/stream/javadsl/Source.scala:879— TooManyMethods — 188 methods. The bar is 30 methods; this is 158 over it, 6.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Flow stream/src/main/scala/org/apache/pekko/stream/javadsl/Flow.scala:373— TooManyMethods — 183 methods. The bar is 30 methods; this is 153 over it, 6.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: FlowOps stream/src/main/scala/org/apache/pekko/stream/scaladsl/Flow.scala:853— TooManyMethods — 145 methods. The bar is 30 methods; this is 115 over it, 4.83× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: SubFlow stream/src/main/scala/org/apache/pekko/stream/javadsl/SubFlow.scala:58— TooManyMethods — 137 methods. The bar is 30 methods; this is 107 over it, 4.57× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: SubSource stream/src/main/scala/org/apache/pekko/stream/javadsl/SubSource.scala:53— TooManyMethods — 137 methods. The bar is 30 methods; this is 107 over it, 4.57× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: GraphStageLogic stream/src/main/scala/org/apache/pekko/stream/stage/GraphStage.scala:550— TooManyMethods — 79 methods. The bar is 30 methods; this is 49 over it, 2.63× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Replicator distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/Replicator.scala:1282— TooManyMethods — 65 methods. The bar is 30 methods; this is 35 over it, 2.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: MiscMessageSerializer remote/src/main/scala/org/apache/pekko/remote/serialization/MiscMessageSerializer.scala:43— TooManyMethods — 65 methods. The bar is 30 methods; this is 35 over it, 2.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ReplicatedDataSerializer distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/protobuf/ReplicatedDataSerializer.scala:269— TooManyMethods — 56 methods. The bar is 30 methods; this is 26 over it, 1.87× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ClusterCoreDaemon cluster/src/main/scala/org/apache/pekko/cluster/ClusterDaemon.scala:340— TooManyMethods — 55 methods. The bar is 30 methods; this is 25 over it, 1.83× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: CachingConfig actor/src/main/scala/org/apache/pekko/dispatch/CachingConfig.scala:52— TooManyMethods — 54 methods. The bar is 30 methods; this is 24 over it, 1.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ClusterShardingMessageSerializer cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/protobuf/ClusterShardingMessageSerializer.scala:48— TooManyMethods — 52 methods. The bar is 30 methods; this is 22 over it, 1.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: CircuitBreaker actor/src/main/scala/org/apache/pekko/pattern/CircuitBreaker.scala:133— TooManyMethods — 51 methods. The bar is 30 methods; this is 21 over it, 1.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ClusterMessageSerializer cluster/src/main/scala/org/apache/pekko/cluster/protobuf/ClusterMessageSerializer.scala:65— TooManyMethods — 50 methods. The bar is 30 methods; this is 20 over it, 1.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: SourceWithContext stream/src/main/scala/org/apache/pekko/stream/javadsl/SourceWithContext.scala:89— TooManyMethods — 50 methods. The bar is 30 methods; this is 20 over it, 1.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Source stream/src/main/scala/org/apache/pekko/stream/scaladsl/Source.scala:274— TooManyMethods — 48 methods. The bar is 30 methods; this is 18 over it, 1.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Source stream/src/main/scala/org/apache/pekko/stream/javadsl/Source.scala:48— TooManyMethods — 47 methods. The bar is 30 methods; this is 17 over it, 1.57× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: FlowWithContext stream/src/main/scala/org/apache/pekko/stream/javadsl/FlowWithContext.scala:89— TooManyMethods — 46 methods. The bar is 30 methods; this is 16 over it, 1.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Association remote/src/main/scala/org/apache/pekko/remote/artery/Association.scala:141— TooManyMethods — 44 methods. The bar is 30 methods; this is 14 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: GraphInterpreter stream/src/main/scala/org/apache/pekko/stream/impl/fusing/GraphInterpreter.scala:231— TooManyMethods — 44 methods. The bar is 30 methods; this is 14 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: LoggingAdapter actor/src/main/scala/org/apache/pekko/event/Logging.scala:1205— TooManyMethods — 42 methods. The bar is 30 methods; this is 12 over it, 1.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ByteString actor/src/main/scala/org/apache/pekko/util/ByteString.scala:2151— TooManyMethods — 42 methods. The bar is 30 methods; this is 12 over it, 1.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Sink stream/src/main/scala/org/apache/pekko/stream/scaladsl/Sink.scala:138— TooManyMethods — 41 methods. The bar is 30 methods; this is 11 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: DowningStrategy cluster/src/main/scala/org/apache/pekko/cluster/sbr/DowningStrategy.scala:70— TooManyMethods — 39 methods. The bar is 30 methods; this is 9 over it, 1.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: SplitBrainResolverBase cluster/src/main/scala/org/apache/pekko/cluster/sbr/SplitBrainResolver.scala:148— TooManyMethods — 38 methods. The bar is 30 methods; this is 8 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
FileTooLong: util/ByteString.scala actor/src/main/scala/org/apache/pekko/util/ByteString.scala— FileTooLong — 1972 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1472 over it, 3.94× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: ddata/Replicator.scala distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/Replicator.scala— FileTooLong — 1732 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1232 over it, 3.46× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: fusing/Ops.scala stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Ops.scala— FileTooLong — 1658 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1158 over it, 3.32× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: sharding/ShardCoordinator.scala cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ShardCoordinator.scala— FileTooLong — 1227 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 727 over it, 2.45× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: cluster/ClusterDaemon.scala cluster/src/main/scala/org/apache/pekko/cluster/ClusterDaemon.scala— FileTooLong — 1160 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 660 over it, 2.32× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: scaladsl/Graph.scala stream/src/main/scala/org/apache/pekko/stream/scaladsl/Graph.scala— FileTooLong — 1021 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 521 over it, 2.04× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: remote/Endpoint.scala remote/src/main/scala/org/apache/pekko/remote/Endpoint.scala— FileTooLong — 1011 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 511 over it, 2.02× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: stage/GraphStage.scala stream/src/main/scala/org/apache/pekko/stream/stage/GraphStage.scala— FileTooLong — 942 significant lines (blank, comment-only and punctuation-only lines excluded), about 61% of them inside a single declaration: GraphStageLogic (550-1881). The bar is 500 significant lines; this is 442 over it, 1.88× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: event/Logging.scala actor/src/main/scala/org/apache/pekko/event/Logging.scala— FileTooLong — 903 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 403 over it, 1.81× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: scaladsl/Flow.scala stream/src/main/scala/org/apache/pekko/stream/scaladsl/Flow.scala— FileTooLong — 880 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 380 over it, 1.76× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: javadsl/Source.scala stream/src/main/scala/org/apache/pekko/stream/javadsl/Source.scala— FileTooLong — 869 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 369 over it, 1.74× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: artery/Association.scala remote/src/main/scala/org/apache/pekko/remote/artery/Association.scala— FileTooLong — 855 significant lines (blank, comment-only and punctuation-only lines excluded), about 81% of them inside a single declaration: transport (142-1147). The bar is 500 significant lines; this is 355 over it, 1.71× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: io/TlsGraphStage.scala stream/src/main/scala/org/apache/pekko/stream/impl/io/TlsGraphStage.scala— FileTooLong — 826 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 326 over it, 1.65× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: sharding/Shard.scala cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/Shard.scala— FileTooLong — 811 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 311 over it, 1.62× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: protobuf/ReplicatedDataSerializer.scala distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/protobuf/ReplicatedDataSerializer.scala— FileTooLong — 802 significant lines (blank, comment-only and punctuation-only lines excluded), about 71% of them inside a single declaration: ReplicatedDataSerializer (269-990). The bar is 500 significant lines; this is 302 over it, 1.60× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: internal/Running.scala persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/Running.scala— FileTooLong — 793 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 293 over it, 1.59× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: sharding/ShardRegion.scala cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ShardRegion.scala— FileTooLong — 784 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 284 over it, 1.57× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: remote/Remoting.scala remote/src/main/scala/org/apache/pekko/remote/Remoting.scala— FileTooLong — 773 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 273 over it, 1.55× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: singleton/ClusterSingletonManager.scala cluster-tools/src/main/scala/org/apache/pekko/cluster/singleton/ClusterSingletonManager.scala— FileTooLong — 768 significant lines (blank, comment-only and punctuation-only lines excluded), about 70% of them inside a single declaration: ClusterSingletonManager (498-1248). The bar is 500 significant lines; this is 268 over it, 1.54× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: javadsl/Flow.scala stream/src/main/scala/org/apache/pekko/stream/javadsl/Flow.scala— FileTooLong — 765 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 265 over it, 1.53× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: scaladsl/Hub.scala stream/src/main/scala/org/apache/pekko/stream/scaladsl/Hub.scala— FileTooLong — 754 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 254 over it, 1.51× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: artery/ArteryTransport.scala remote/src/main/scala/org/apache/pekko/remote/artery/ArteryTransport.scala— FileTooLong — 721 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 221 over it, 1.44× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: fusing/ActorGraphInterpreter.scala stream/src/main/scala/org/apache/pekko/stream/impl/fusing/ActorGraphInterpreter.scala— FileTooLong — 712 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 212 over it, 1.42× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: sharding/ClusterShardingSettings.scala cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ClusterShardingSettings.scala— FileTooLong — 681 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 181 over it, 1.36× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: impl/PhasedFusingActorMaterializer.scala stream/src/main/scala/org/apache/pekko/stream/impl/PhasedFusingActorMaterializer.scala— FileTooLong — 681 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 181 over it, 1.36× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
Hotspot: stream/src/main/scala/org/apache/pekko/stream/impl/io/TlsGraphStage.scala stream/src/main/scala/org/apache/pekko/stream/impl/io/TlsGraphStage.scala:64— stream/src/main/scala/org/apache/pekko/stream/impl/io/TlsGraphStage.scala changed 3 times in last 90 days, max cyclomatic complexity 235 in TlsGraphStage.createLogic at line 64. 3 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 18:02:03 +02:00' --until='2026-09-27 18:02:03 +02:00' --full-history --no-merges -- stream/src/main/scala/org/apache/pekko/stream/impl/io/TlsGraphStage.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: stream/src/main/scala/org/apache/pekko/stream/scaladsl/Hub.scala stream/src/main/scala/org/apache/pekko/stream/scaladsl/Hub.scala:879— stream/src/main/scala/org/apache/pekko/stream/scaladsl/Hub.scala changed 4 times in last 90 days, max cyclomatic complexity 23 in BroadcastHub.createLogicAndMaterializedValue at line 879. 2 of those changes were fix/bug commits, and the other 2 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 18:02:03 +02:00' --until='2026-09-27 18:02:03 +02:00' --full-history --no-merges -- stream/src/main/scala/org/apache/pekko/stream/scaladsl/Hub.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ShardCoordinator.scala cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ShardCoordinator.scala:739— cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ShardCoordinator.scala changed 2 times in last 90 days, max cyclomatic complexity 44 in ShardCoordinator.active at line 739. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 18:02:03 +02:00' --until='2026-09-27 18:02:03 +02:00' --full-history --no-merges -- cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ShardCoordinator.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: actor/src/main/scala/org/apache/pekko/actor/ActorCell.scala actor/src/main/scala/org/apache/pekko/actor/ActorCell.scala:489— actor/src/main/scala/org/apache/pekko/actor/ActorCell.scala changed 3 times in last 90 days, max cyclomatic complexity 22 in ActorCell.systemInvoke at line 489. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 18:02:03 +02:00' --until='2026-09-27 18:02:03 +02:00' --full-history --no-merges -- actor/src/main/scala/org/apache/pekko/actor/ActorCell.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: persistence/src/main/scala/org/apache/pekko/persistence/Eventsourced.scala persistence/src/main/scala/org/apache/pekko/persistence/Eventsourced.scala:636— persistence/src/main/scala/org/apache/pekko/persistence/Eventsourced.scala changed 4 times in last 90 days, max cyclomatic complexity 16 in Eventsourced.recoveryStarted at line 636. 2 of those changes were fix/bug commits, and the other 2 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 18:02:03 +02:00' --until='2026-09-27 18:02:03 +02:00' --full-history --no-merges -- persistence/src/main/scala/org/apache/pekko/persistence/Eventsourced.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: cluster/src/main/scala/org/apache/pekko/cluster/protobuf/ClusterMessageSerializer.scala cluster/src/main/scala/org/apache/pekko/cluster/protobuf/ClusterMessageSerializer.scala:75— cluster/src/main/scala/org/apache/pekko/cluster/protobuf/ClusterMessageSerializer.scala changed 4 times in last 90 days, max cyclomatic complexity 15 in ClusterMessageSerializer.manifest at line 75. 3 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 18:02:03 +02:00' --until='2026-09-27 18:02:03 +02:00' --full-history --no-merges -- cluster/src/main/scala/org/apache/pekko/cluster/protobuf/ClusterMessageSerializer.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala:332— serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala changed 3 times in last 90 days, max cyclomatic complexity 20 in JacksonSerializer.fromBinary at line 332. 3 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 18:02:03 +02:00' --until='2026-09-27 18:02:03 +02:00' --full-history --no-merges -- serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonSerializer.scala serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonSerializer.scala:333— serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonSerializer.scala changed 3 times in last 90 days, max cyclomatic complexity 20 in JacksonSerializer.fromBinary at line 333. 3 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 18:02:03 +02:00' --until='2026-09-27 18:02:03 +02:00' --full-history --no-merges -- serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonSerializer.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: actor/src/main/scala/org/apache/pekko/io/TcpConnection.scala actor/src/main/scala/org/apache/pekko/io/TcpConnection.scala:263— actor/src/main/scala/org/apache/pekko/io/TcpConnection.scala changed 3 times in last 90 days, max cyclomatic complexity 19 in TcpConnection.doRead at line 263. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 18:02:03 +02:00' --until='2026-09-27 18:02:03 +02:00' --full-history --no-merges -- actor/src/main/scala/org/apache/pekko/io/TcpConnection.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: actor/src/main/scala/org/apache/pekko/util/LineNumbers.scala actor/src/main/scala/org/apache/pekko/util/LineNumbers.scala:121— actor/src/main/scala/org/apache/pekko/util/LineNumbers.scala changed 3 times in last 90 days, max cyclomatic complexity 18 in Constants.readOne at line 121. 1 of those changes was a fix/bug commit, and the other 2 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 18:02:03 +02:00' --until='2026-09-27 18:02:03 +02:00' --full-history --no-merges -- actor/src/main/scala/org/apache/pekko/util/LineNumbers.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: remote/src/main/scala/org/apache/pekko/remote/Endpoint.scala remote/src/main/scala/org/apache/pekko/remote/Endpoint.scala:418— remote/src/main/scala/org/apache/pekko/remote/Endpoint.scala changed 3 times in last 90 days, max cyclomatic complexity 18 in ReliableDeliverySupervisor.gated at line 418. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 18:02:03 +02:00' --until='2026-09-27 18:02:03 +02:00' --full-history --no-merges -- remote/src/main/scala/org/apache/pekko/remote/Endpoint.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: actor/src/main/scala/org/apache/pekko/actor/ActorSelection.scala actor/src/main/scala/org/apache/pekko/actor/ActorSelection.scala:208— actor/src/main/scala/org/apache/pekko/actor/ActorSelection.scala changed 3 times in last 90 days, max cyclomatic complexity 16 in ActorSelection.deliverSelection at line 208. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 18:02:03 +02:00' --until='2026-09-27 18:02:03 +02:00' --full-history --no-merges -- actor/src/main/scala/org/apache/pekko/actor/ActorSelection.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: cluster-tools/src/main/scala/org/apache/pekko/cluster/client/ClusterClient.scala cluster-tools/src/main/scala/org/apache/pekko/cluster/client/ClusterClient.scala:1032— cluster-tools/src/main/scala/org/apache/pekko/cluster/client/ClusterClient.scala changed 2 times in last 90 days, max cyclomatic complexity 23 in ClusterReceptionist.receive at line 1032. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 18:02:03 +02:00' --until='2026-09-27 18:02:03 +02:00' --full-history --no-merges -- cluster-tools/src/main/scala/org/apache/pekko/cluster/client/ClusterClient.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: stream/src/main/scala/org/apache/pekko/stream/scaladsl/Graph.scala stream/src/main/scala/org/apache/pekko/stream/scaladsl/Graph.scala:880— stream/src/main/scala/org/apache/pekko/stream/scaladsl/Graph.scala changed 2 times in last 90 days, max cyclomatic complexity 23 in Partition.createLogic at line 880. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 18:02:03 +02:00' --until='2026-09-27 18:02:03 +02:00' --full-history --no-merges -- stream/src/main/scala/org/apache/pekko/stream/scaladsl/Graph.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/ReplayingEvents.scala persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/ReplayingEvents.scala:132— persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/ReplayingEvents.scala changed 2 times in last 90 days, max cyclomatic complexity 22 in ReplayingEvents.onJournalResponse at line 132. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 18:02:03 +02:00' --until='2026-09-27 18:02:03 +02:00' --full-history --no-merges -- persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/ReplayingEvents.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/Replicator.scala distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/Replicator.scala:1677— distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/Replicator.scala changed 2 times in last 90 days, max cyclomatic complexity 22 in Replicator.receiveUpdate at line 1677. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 18:02:03 +02:00' --until='2026-09-27 18:02:03 +02:00' --full-history --no-merges -- distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/Replicator.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: stream/src/main/scala/org/apache/pekko/stream/impl/io/TcpStages.scala stream/src/main/scala/org/apache/pekko/stream/impl/io/TcpStages.scala:354— stream/src/main/scala/org/apache/pekko/stream/impl/io/TcpStages.scala changed 2 times in last 90 days, max cyclomatic complexity 21 in TcpStreamLogic.connected at line 354. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 18:02:03 +02:00' --until='2026-09-27 18:02:03 +02:00' --full-history --no-merges -- stream/src/main/scala/org/apache/pekko/stream/impl/io/TcpStages.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: cluster/src/main/scala/org/apache/pekko/cluster/Member.scala cluster/src/main/scala/org/apache/pekko/cluster/Member.scala:205— cluster/src/main/scala/org/apache/pekko/cluster/Member.scala changed 2 times in last 90 days, max cyclomatic complexity 20 in Member.highestPriorityOf at line 205. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 18:02:03 +02:00' --until='2026-09-27 18:02:03 +02:00' --full-history --no-merges -- cluster/src/main/scala/org/apache/pekko/cluster/Member.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: remote/src/main/scala/org/apache/pekko/remote/serialization/ArteryMessageSerializer.scala remote/src/main/scala/org/apache/pekko/remote/serialization/ArteryMessageSerializer.scala:76— remote/src/main/scala/org/apache/pekko/remote/serialization/ArteryMessageSerializer.scala changed 2 times in last 90 days, max cyclomatic complexity 17 in ArteryMessageSerializer.manifest at line 76. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 18:02:03 +02:00' --until='2026-09-27 18:02:03 +02:00' --full-history --no-merges -- remote/src/main/scala/org/apache/pekko/remote/serialization/ArteryMessageSerializer.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: actor/src/main/scala/org/apache/pekko/actor/ActorPath.scala actor/src/main/scala/org/apache/pekko/actor/ActorPath.scala:127— actor/src/main/scala/org/apache/pekko/actor/ActorPath.scala changed 2 times in last 90 days, max cyclomatic complexity 16 in ActorPath.findInvalidPathElementCharPosition at line 127. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 18:02:03 +02:00' --until='2026-09-27 18:02:03 +02:00' --full-history --no-merges -- actor/src/main/scala/org/apache/pekko/actor/ActorPath.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: persistence/src/main/scala/org/apache/pekko/persistence/journal/PersistencePluginProxy.scala persistence/src/main/scala/org/apache/pekko/persistence/journal/PersistencePluginProxy.scala:198— persistence/src/main/scala/org/apache/pekko/persistence/journal/PersistencePluginProxy.scala changed 2 times in last 90 days, max cyclomatic complexity 15 in PersistencePluginProxy.initTimedOut at line 198. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 18:02:03 +02:00' --until='2026-09-27 18:02:03 +02:00' --full-history --no-merges -- persistence/src/main/scala/org/apache/pekko/persistence/journal/PersistencePluginProxy.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Duplicated block (8 lines × 2) actor/src/main/scala-2.13/org/apache/pekko/util/ByteIterator.scala:453— actor/src/main/scala-2.13/org/apache/pekko/util/ByteIterator.scala:453-460 | actor/src/main/scala-3/org/apache/pekko/util/ByteIterator.scala:448-455 — before extracting anything, compare `actor/src/main/scala-2.13/org/apache/pekko/util/ByteIterator.scala` and `actor/src/main/scala-3/org/apache/pekko/util/ByteIterator.scala` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `actor/src/main/scala-2.13/org/apache/pekko/util/ByteIterator.scala:453` it does not close everything it opens, so those exact lines 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) actor/src/main/scala/org/apache/pekko/dispatch/Mailbox.scala:596— actor/src/main/scala/org/apache/pekko/dispatch/Mailbox.scala:596-603 | actor/src/main/scala/org/apache/pekko/dispatch/Mailbox.scala:644-651 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) actor/src/main/scala/org/apache/pekko/pattern/AskSupport.scala:417— actor/src/main/scala/org/apache/pekko/pattern/AskSupport.scala:417-424 | actor/src/main/scala/org/apache/pekko/pattern/AskSupport.scala:496-503 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `actor/src/main/scala/org/apache/pekko/pattern/AskSupport.scala:417` 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) actor/src/main/scala/org/apache/pekko/routing/Resizer.scala:369— actor/src/main/scala/org/apache/pekko/routing/Resizer.scala:369-376 | actor/src/main/scala/org/apache/pekko/routing/RoutedActorCell.scala:209-216 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `actor/src/main/scala/org/apache/pekko/routing/Resizer.scala:369` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) actor/src/main/scala/org/apache/pekko/util/ByteString.scala:315— actor/src/main/scala/org/apache/pekko/util/ByteString.scala:315-322 | actor/src/main/scala/org/apache/pekko/util/ByteString.scala:741-748 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `actor/src/main/scala/org/apache/pekko/util/ByteString.scala:315` it does not close everything it opens, so those exact lines 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) cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/delivery/ReliableDeliverySerializer.scala:98— cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/delivery/ReliableDeliverySerializer.scala:98-105 | cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/delivery/ReliableDeliverySerializer.scala:156-165 — both copies are in the same file, so extract the 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 (8 lines × 2) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/EventSourcedBehaviorImpl.scala:217— persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/EventSourcedBehaviorImpl.scala:217-224 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/DurableStateBehaviorImpl.scala:145-152 — before extracting anything, compare `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/EventSourcedBehaviorImpl.scala` and `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/DurableStateBehaviorImpl.scala` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/EventSourcedBehaviorImpl.scala:217` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/EventSourcedBehaviorImpl.scala:225` calls `JournalResponse`, `SnapshotterResponse` and `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/DurableStateBehaviorImpl.scala:153` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 2) stream/src/main/scala/org/apache/pekko/stream/impl/fusing/GraphStages.scala:418— stream/src/main/scala/org/apache/pekko/stream/impl/fusing/GraphStages.scala:418-425 | stream/src/main/scala/org/apache/pekko/stream/impl/fusing/LazyFutureSource.scala:51-58 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `stream/src/main/scala/org/apache/pekko/stream/impl/fusing/GraphStages.scala:418` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) actor/src/main/scala/org/apache/pekko/actor/FSM.scala:611— actor/src/main/scala/org/apache/pekko/actor/FSM.scala:611-618 | persistence/src/main/scala/org/apache/pekko/persistence/fsm/PersistentFSMBase.scala:308-315 — before extracting anything, compare `actor/src/main/scala/org/apache/pekko/actor/FSM.scala` and `persistence/src/main/scala/org/apache/pekko/persistence/fsm/PersistentFSMBase.scala` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 142 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) bench-jmh/src/main/scala/org/apache/pekko/util/ByteString_asInputStream_Benchmark.scala:62— bench-jmh/src/main/scala/org/apache/pekko/util/ByteString_asInputStream_Benchmark.scala:62-69 | bench-jmh/src/main/scala/org/apache/pekko/util/ByteString_toArray_Benchmark.scala:63-70 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) cluster-tools/src/main/scala/org/apache/pekko/cluster/singleton/ClusterSingletonManager.scala:365— cluster-tools/src/main/scala/org/apache/pekko/cluster/singleton/ClusterSingletonManager.scala:365-372 | cluster-tools/src/main/scala/org/apache/pekko/cluster/singleton/ClusterSingletonProxy.scala:257-264 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/ExternalInteractions.scala:152— persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/ExternalInteractions.scala:152-159 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/DurableStateStoreInteractions.scala:98-105 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/ExternalInteractions.scala: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.
Duplicated block (8 lines × 2) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/Running.scala:288— persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/Running.scala:288-295 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/Running.scala:123-130 — before extracting anything, compare `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/Running.scala` and `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/Running.scala` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/ActorSystemAccess.scala:25— serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/ActorSystemAccess.scala:25-32 | serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/ActorSystemAccess.scala:25-32 — before extracting anything, compare `serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/ActorSystemAccess.scala` and `serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/ActorSystemAccess.scala` as WHOLE FILES: 96% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonObjectMapperProvider.scala:76— serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonObjectMapperProvider.scala:76-83 | serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonObjectMapperProvider.scala:69-76 — before extracting anything, compare `serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonObjectMapperProvider.scala` and `serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonObjectMapperProvider.scala` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala:56— serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala:56-63 | serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonSerializer.scala:57-64 — before extracting anything, compare `serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala` and `serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonSerializer.scala` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 304 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala:441— serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala:441-448 | serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonSerializer.scala:442-449 — before extracting anything, compare `serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala` and `serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonSerializer.scala` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 304 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/internal/DurableStateBehaviorTestKitImpl.scala:196— persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/internal/DurableStateBehaviorTestKitImpl.scala:196-203 | persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/internal/EventSourcedBehaviorTestKitImpl.scala:250-257 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7 lines × 2) actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/Supervision.scala:194— actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/Supervision.scala:194-200 | actor/src/main/scala/org/apache/pekko/pattern/RetrySupport.scala:409-415 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (7 lines × 2) actor/src/main/scala/org/apache/pekko/serialization/Serialization.scala:514— actor/src/main/scala/org/apache/pekko/serialization/Serialization.scala:514-520 | persistence/src/main/scala/org/apache/pekko/persistence/journal/EventAdapters.scala:166-172 — 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 `actor/src/main/scala/org/apache/pekko/serialization/Serialization.scala:514` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (7 lines × 2) actor/src/main/scala/org/apache/pekko/util/ByteString.scala:272— actor/src/main/scala/org/apache/pekko/util/ByteString.scala:272-278 | actor/src/main/scala/org/apache/pekko/util/ByteString.scala:697-703 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `actor/src/main/scala/org/apache/pekko/util/ByteString.scala:272` 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) actor/src/main/scala/org/apache/pekko/util/ByteString.scala:289— actor/src/main/scala/org/apache/pekko/util/ByteString.scala:289-295 | actor/src/main/scala/org/apache/pekko/util/ByteString.scala:714-720 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `actor/src/main/scala/org/apache/pekko/util/ByteString.scala:289` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) actor/src/main/scala/org/apache/pekko/util/ByteString.scala:298— actor/src/main/scala/org/apache/pekko/util/ByteString.scala:298-304 | actor/src/main/scala/org/apache/pekko/util/ByteString.scala:723-729 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `actor/src/main/scala/org/apache/pekko/util/ByteString.scala:298` 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) bench-jmh/src/main/scala/org/apache/pekko/stream/io/TlsBenchmark.scala:157— bench-jmh/src/main/scala/org/apache/pekko/stream/io/TlsBenchmark.scala:157-163 | bench-jmh/src/main/scala/org/apache/pekko/stream/io/TlsBenchmark.scala:181-187 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `bench-jmh/src/main/scala/org/apache/pekko/stream/io/TlsBenchmark.scala:157` 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) distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/ORMultiMap.scala:93— distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/ORMultiMap.scala:93-99 | distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/ORMultiMap.scala:293-299 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/ORMultiMap.scala:93` 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) stream/src/main/scala/org/apache/pekko/stream/impl/Timers.scala:120— stream/src/main/scala/org/apache/pekko/stream/impl/Timers.scala:120-126 | stream/src/main/scala/org/apache/pekko/stream/impl/Timers.scala:186-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.
Duplicated block (7 lines × 2) actor/src/main/scala/org/apache/pekko/io/UdpConnection.scala:170— actor/src/main/scala/org/apache/pekko/io/UdpConnection.scala:170-176 | actor/src/main/scala/org/apache/pekko/io/UdpSender.scala:83-89 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7 lines × 2) distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/ORSet.scala:99— distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/ORSet.scala:99-105 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/crdt/ORSet.scala:73-79 — before extracting anything, compare `distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/ORSet.scala` and `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/crdt/ORSet.scala` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 144 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) persistence-query/src/main/scala/org/apache/pekko/persistence/query/typed/javadsl/EventsBySliceFirehoseQuery.scala:81— persistence-query/src/main/scala/org/apache/pekko/persistence/query/typed/javadsl/EventsBySliceFirehoseQuery.scala:81-87 | persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/query/javadsl/PersistenceTestKitReadJournal.scala:100-106 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/ExternalInteractions.scala:162— persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/ExternalInteractions.scala:162-168 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/DurableStateStoreInteractions.scala:108-114 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/StashManagement.scala:110— persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/StashManagement.scala:110-116 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/StashManagement.scala:110-116 — before extracting anything, compare `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/StashManagement.scala` and `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/StashManagement.scala` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/StashManagement.scala:118— persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/StashManagement.scala:118-124 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/StashManagement.scala:118-124 — before extracting anything, compare `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/StashManagement.scala` and `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/StashManagement.scala` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/StashManagement.scala:126— persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/StashManagement.scala:126-132 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/StashManagement.scala:126-132 — before extracting anything, compare `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/StashManagement.scala` and `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/StashManagement.scala` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) remote/src/main/scala/org/apache/pekko/remote/artery/tcp/ConfigSSLEngineProvider.scala:114— remote/src/main/scala/org/apache/pekko/remote/artery/tcp/ConfigSSLEngineProvider.scala:114-120 | remote/src/main/scala/org/apache/pekko/remote/transport/netty/SSLEngineProvider.scala:115-121 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) actor/src/main/scala/org/apache/pekko/util/ByteString.scala:371— actor/src/main/scala/org/apache/pekko/util/ByteString.scala:371-377 | actor/src/main/scala/org/apache/pekko/util/ByteString.scala:785-791 — both copies are in the same file, so extract the 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) actor/src/main/scala/org/apache/pekko/actor/FSM.scala:1019— actor/src/main/scala/org/apache/pekko/actor/FSM.scala:1019-1024 | persistence/src/main/scala/org/apache/pekko/persistence/fsm/PersistentFSMBase.scala:722-727 — before extracting anything, compare `actor/src/main/scala/org/apache/pekko/actor/FSM.scala` and `persistence/src/main/scala/org/apache/pekko/persistence/fsm/PersistentFSMBase.scala` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 142 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `actor/src/main/scala/org/apache/pekko/actor/FSM.scala:1019` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) actor/src/main/scala/org/apache/pekko/util/ByteString.scala:380— actor/src/main/scala/org/apache/pekko/util/ByteString.scala:380-385 | actor/src/main/scala/org/apache/pekko/util/ByteString.scala:794-799 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `actor/src/main/scala/org/apache/pekko/util/ByteString.scala:380` 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) actor/src/main/scala/org/apache/pekko/util/SWARUtil.scala:385— actor/src/main/scala/org/apache/pekko/util/SWARUtil.scala:385-390 | actor/src/main/scala/org/apache/pekko/util/SWARUtil.scala:403-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.
Duplicated block (6 lines × 2) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/CommandHandler.scala:208— persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/CommandHandler.scala:208-213 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/CommandHandlerWithReply.scala:220-225 — before extracting anything, compare `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/CommandHandler.scala` and `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/CommandHandlerWithReply.scala` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/CommandHandler.scala:208` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: `CommandHandlerCase` names `CommandHandlerBuilderByState.CommandHandlerCase` in one and `CommandHandlerWithReplyBuilderByState.CommandHandlerCase` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (6 lines × 2) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/CommandHandler.scala:209— persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/CommandHandler.scala:209-214 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/CommandHandlerWithReply.scala:219-224 — before extracting anything, compare `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/CommandHandler.scala` and `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/CommandHandlerWithReply.scala` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/CommandHandler.scala:209` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: `CommandHandlerCase` names `CommandHandlerBuilderByState.CommandHandlerCase` in one and `CommandHandlerWithReplyBuilderByState.CommandHandlerCase` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (6 lines × 2) stream/src/main/scala/org/apache/pekko/stream/scaladsl/Hub.scala:885— stream/src/main/scala/org/apache/pekko/stream/scaladsl/Hub.scala:885-890 | stream/src/main/scala/org/apache/pekko/stream/scaladsl/Hub.scala:1498-1503 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `stream/src/main/scala/org/apache/pekko/stream/scaladsl/Hub.scala:885` it does not close everything it opens, so those exact lines 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) stream/src/main/scala/org/apache/pekko/stream/scaladsl/StatefulMapConcatAccumulator.scala:77— stream/src/main/scala/org/apache/pekko/stream/scaladsl/StatefulMapConcatAccumulator.scala:77-82 | stream/src/main/scala/org/apache/pekko/stream/scaladsl/StatefulMapConcatAccumulator.scala:95-100 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `stream/src/main/scala/org/apache/pekko/stream/scaladsl/StatefulMapConcatAccumulator.scala:77` 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) actor/src/main/scala-2.13/org/apache/pekko/util/ByteIterator.scala:122— actor/src/main/scala-2.13/org/apache/pekko/util/ByteIterator.scala:122-127 | actor/src/main/scala-3/org/apache/pekko/util/ByteIterator.scala:118-123 — before extracting anything, compare `actor/src/main/scala-2.13/org/apache/pekko/util/ByteIterator.scala` and `actor/src/main/scala-3/org/apache/pekko/util/ByteIterator.scala` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `actor/src/main/scala-2.13/org/apache/pekko/util/ByteIterator.scala:118` calls `nowarn` and `actor/src/main/scala-3/org/apache/pekko/util/ByteIterator.scala:113` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 2) actor/src/main/scala/org/apache/pekko/actor/FSM.scala:805— actor/src/main/scala/org/apache/pekko/actor/FSM.scala:805-810 | persistence/src/main/scala/org/apache/pekko/persistence/fsm/PersistentFSMBase.scala:506-511 — before extracting anything, compare `actor/src/main/scala/org/apache/pekko/actor/FSM.scala` and `persistence/src/main/scala/org/apache/pekko/persistence/fsm/PersistentFSMBase.scala` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 142 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 2) cluster-tools/src/main/scala/org/apache/pekko/cluster/singleton/ClusterSingletonManager.scala:374— cluster-tools/src/main/scala/org/apache/pekko/cluster/singleton/ClusterSingletonManager.scala:374-379 | cluster-tools/src/main/scala/org/apache/pekko/cluster/singleton/ClusterSingletonProxy.scala:270-276 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) remote/src/main/scala/org/apache/pekko/remote/artery/ArteryTransport.scala:702— remote/src/main/scala/org/apache/pekko/remote/artery/ArteryTransport.scala:702-707 | remote/src/main/scala/org/apache/pekko/remote/artery/Association.scala:1093-1098 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonModule.scala:99— serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonModule.scala:99-104 | serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonModule.scala:103-108 — 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 `serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonModule.scala:99` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (6 lines × 2) serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala:105— serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala:105-110 | serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonSerializer.scala:106-111 — before extracting anything, compare `serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala` and `serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonSerializer.scala` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 304 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 2) actor/src/main/scala/org/apache/pekko/util/Reflect.scala:223— actor/src/main/scala/org/apache/pekko/util/Reflect.scala:223-228 | remote/src/main/scala/org/apache/pekko/remote/serialization/ProtobufSerializer.scala:65-70 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (6 lines × 2) distributed-data/src/main/scala-2/org/apache/pekko/cluster/ddata/GSet.scala:74— distributed-data/src/main/scala-2/org/apache/pekko/cluster/ddata/GSet.scala:74-79 | distributed-data/src/main/scala-3/org/apache/pekko/cluster/ddata/GSet.scala:74-79 — before extracting anything, compare `distributed-data/src/main/scala-2/org/apache/pekko/cluster/ddata/GSet.scala` and `distributed-data/src/main/scala-3/org/apache/pekko/cluster/ddata/GSet.scala` as WHOLE FILES: 93% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Low cohesion: ClusterShardingMessageSerializer (LCOM4 14) cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/protobuf/ClusterShardingMessageSerializer.scala:48— ClusterShardingMessageSerializer's methods fall into 14 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 14 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: ReplicatorMessageSerializer (LCOM4 12) distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/protobuf/ReplicatorMessageSerializer.scala:161— ReplicatorMessageSerializer's methods fall into 12 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 12 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: ActorContextAdapter (LCOM4 10) actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/adapter/ActorContextAdapter.scala:48— ActorContextAdapter's methods fall into 10 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 10 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: ClusterSingletonManagerSpec (LCOM4 9) cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/singleton/ClusterSingletonManagerSpec.scala:180— ClusterSingletonManagerSpec's methods fall into 9 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 9 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: MultiNodeClusterSpec (LCOM4 9) cluster/src/multi-jvm/scala/org/apache/pekko/cluster/MultiNodeClusterSpec.scala:105— MultiNodeClusterSpec's methods fall into 9 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 9 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: MiscMessageSerializer (LCOM4 7) remote/src/main/scala/org/apache/pekko/remote/serialization/MiscMessageSerializer.scala:43— MiscMessageSerializer's methods fall into 7 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 7 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: ActorAdapter (LCOM4 6) actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/adapter/ActorAdapter.scala:65— ActorAdapter's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: StubbedActorContext (LCOM4 5) actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/StubbedActorContext.scala:74— StubbedActorContext's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: AbstractSupervisor (LCOM4 4) actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/Supervision.scala:72— AbstractSupervisor's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: ChildActorPath (LCOM4 4) actor/src/main/scala/org/apache/pekko/actor/ActorPath.scala:334— ChildActorPath's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: DistributedPubSubMediatorSpec (LCOM4 4) cluster-tools/src/multi-jvm/scala/org/apache/pekko/cluster/pubsub/DistributedPubSubMediatorSpec.scala:139— DistributedPubSubMediatorSpec's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: ReplicatedDataSerializer (LCOM4 4) distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/protobuf/ReplicatedDataSerializer.scala:269— ReplicatedDataSerializer's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: BehaviorSetup (LCOM4 4) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/BehaviorSetup.scala:55— BehaviorSetup's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: AssociationState (LCOM4 4) remote/src/main/scala/org/apache/pekko/remote/artery/ArteryTransport.scala:135— AssociationState's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Duplicated block (11 lines × 2) actor/src/main/scala/org/apache/pekko/util/ByteString.scala:425— actor/src/main/scala/org/apache/pekko/util/ByteString.scala:425-435 | actor/src/main/scala/org/apache/pekko/util/ByteString.scala:862-872 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `actor/src/main/scala/org/apache/pekko/util/ByteString.scala:425` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) actor/src/main/scala/org/apache/pekko/util/ByteString.scala:2000— actor/src/main/scala/org/apache/pekko/util/ByteString.scala:2000-2010 | actor/src/main/scala/org/apache/pekko/util/ByteString.scala:2026-2036 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `actor/src/main/scala/org/apache/pekko/util/ByteString.scala:2000` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) actor/src/main/scala/org/apache/pekko/util/ByteString.scala:2442— actor/src/main/scala/org/apache/pekko/util/ByteString.scala:2442-2452 | actor/src/main/scala/org/apache/pekko/util/ByteString.scala:2504-2514 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `actor/src/main/scala/org/apache/pekko/util/ByteString.scala:2440` calls `slice` and `actor/src/main/scala/org/apache/pekko/util/ByteString.scala:2503` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 2) cluster-tools/src/main/scala/org/apache/pekko/cluster/client/ClusterClient.scala:531— cluster-tools/src/main/scala/org/apache/pekko/cluster/client/ClusterClient.scala:531-541 | cluster-tools/src/main/scala/org/apache/pekko/cluster/singleton/ClusterSingletonProxy.scala:331-341 — 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) persistence-query/src/main/scala/org/apache/pekko/persistence/query/typed/internal/EventsBySliceFirehose.scala:236— persistence-query/src/main/scala/org/apache/pekko/persistence/query/typed/internal/EventsBySliceFirehose.scala:236-246 | persistence-query/src/main/scala/org/apache/pekko/persistence/query/typed/internal/EventsBySliceFirehose.scala:348-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.
Duplicated block (11 lines × 2) persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/internal/PersistenceProbeImpl.scala:181— persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/internal/PersistenceProbeImpl.scala:181-191 | persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/internal/PersistenceProbeImpl.scala:275-285 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/internal/PersistenceProbeImpl.scala:181` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (11 lines × 2) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/ReplayingSnapshot.scala:116— persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/ReplayingSnapshot.scala:116-126 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/Recovering.scala:130-140 — 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) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/Running.scala:691— persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/Running.scala:691-701 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/Running.scala:254-264 — before extracting anything, compare `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/Running.scala` and `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/Running.scala` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/Running.scala:691` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonObjectMapperProvider.scala:410— serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonObjectMapperProvider.scala:410-420 | serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonObjectMapperProvider.scala:526-536 — before extracting anything, compare `serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonObjectMapperProvider.scala` and `serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonObjectMapperProvider.scala` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonObjectMapperProvider.scala:410` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) stream/src/main/scala/org/apache/pekko/stream/scaladsl/Hub.scala:713— stream/src/main/scala/org/apache/pekko/stream/scaladsl/Hub.scala:713-723 | stream/src/main/scala/org/apache/pekko/stream/scaladsl/Hub.scala:1434-1444 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (11 lines × 2) stream/src/main/scala/org/apache/pekko/stream/scaladsl/Hub.scala:923— stream/src/main/scala/org/apache/pekko/stream/scaladsl/Hub.scala:923-940 | stream/src/main/scala/org/apache/pekko/stream/scaladsl/Hub.scala:1527-1537 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `stream/src/main/scala/org/apache/pekko/stream/scaladsl/Hub.scala:923` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (11 lines × 2) actor/src/main/scala/org/apache/pekko/actor/FSM.scala:874— actor/src/main/scala/org/apache/pekko/actor/FSM.scala:874-884 | persistence/src/main/scala/org/apache/pekko/persistence/fsm/PersistentFSMBase.scala:575-585 — before extracting anything, compare `actor/src/main/scala/org/apache/pekko/actor/FSM.scala` and `persistence/src/main/scala/org/apache/pekko/persistence/fsm/PersistentFSMBase.scala` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 142 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala:488— serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala:488-498 | serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonSerializer.scala:489-499 — before extracting anything, compare `serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala` and `serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonSerializer.scala` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 304 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) actor/src/main/scala/org/apache/pekko/util/ByteString.scala:364— actor/src/main/scala/org/apache/pekko/util/ByteString.scala:364-368 | actor/src/main/scala/org/apache/pekko/util/ByteString.scala:809-813 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `actor/src/main/scala/org/apache/pekko/util/ByteString.scala:364` 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) actor/src/main/scala/org/apache/pekko/util/ByteString.scala:639— actor/src/main/scala/org/apache/pekko/util/ByteString.scala:639-643 | actor/src/main/scala/org/apache/pekko/util/ByteString.scala:650-654 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `actor/src/main/scala/org/apache/pekko/util/ByteString.scala:639` 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) persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/internal/PersistenceProbeImpl.scala:331— persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/internal/PersistenceProbeImpl.scala:331-335 | persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/internal/PersistenceProbeImpl.scala:409-413 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) remote/src/main/scala/org/apache/pekko/remote/artery/compress/InboundCompressions.scala:163— remote/src/main/scala/org/apache/pekko/remote/artery/compress/InboundCompressions.scala:163-167 | remote/src/main/scala/org/apache/pekko/remote/artery/compress/InboundCompressions.scala:195-199 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `remote/src/main/scala/org/apache/pekko/remote/artery/compress/InboundCompressions.scala:163` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/ActorRefImpl.scala:36— actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/ActorRefImpl.scala:36-40 | actor/src/main/scala/org/apache/pekko/actor/ActorRef.scala:127-131 — 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) actor/src/main/scala/org/apache/pekko/actor/FSM.scala:952— actor/src/main/scala/org/apache/pekko/actor/FSM.scala:952-956 | persistence/src/main/scala/org/apache/pekko/persistence/fsm/PersistentFSMBase.scala:654-658 — before extracting anything, compare `actor/src/main/scala/org/apache/pekko/actor/FSM.scala` and `persistence/src/main/scala/org/apache/pekko/persistence/fsm/PersistentFSMBase.scala` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 142 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) actor/src/main/scala/org/apache/pekko/util/FrequencyList.scala:181— actor/src/main/scala/org/apache/pekko/util/FrequencyList.scala:181-185 | actor/src/main/scala/org/apache/pekko/util/SegmentedRecencyList.scala:121-125 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) remote/src/main/scala/org/apache/pekko/remote/artery/tcp/ConfigSSLEngineProvider.scala:125— remote/src/main/scala/org/apache/pekko/remote/artery/tcp/ConfigSSLEngineProvider.scala:125-129 | remote/src/main/scala/org/apache/pekko/remote/transport/netty/SSLEngineProvider.scala:126-130 — 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) serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala:91— serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala:91-95 | serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonSerializer.scala:92-96 — before extracting anything, compare `serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala` and `serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonSerializer.scala` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 304 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) cluster-metrics/src/main/scala/org/apache/pekko/cluster/metrics/protobuf/MessageSerializer.scala:102— cluster-metrics/src/main/scala/org/apache/pekko/cluster/metrics/protobuf/MessageSerializer.scala:102-106 | cluster/src/main/scala/org/apache/pekko/cluster/protobuf/ClusterMessageSerializer.scala:167-171 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) stream/src/main/scala/org/apache/pekko/stream/javadsl/Flow.scala:3806— stream/src/main/scala/org/apache/pekko/stream/javadsl/Flow.scala:3806-3810 | stream/src/main/scala/org/apache/pekko/stream/javadsl/Flow.scala:3879-3883 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `stream/src/main/scala/org/apache/pekko/stream/javadsl/Flow.scala:3806` it does not close everything it opens, so those exact lines 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) actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/BehaviorTestKit.scala:43— actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/BehaviorTestKit.scala:43-47 | actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/BehaviorTestKit.scala:36-40 — 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 (12 lines × 2) actor/src/main/scala-2.13/org/apache/pekko/util/ByteIterator.scala:206— actor/src/main/scala-2.13/org/apache/pekko/util/ByteIterator.scala:206-217 | actor/src/main/scala-3/org/apache/pekko/util/ByteIterator.scala:202-213 — before extracting anything, compare `actor/src/main/scala-2.13/org/apache/pekko/util/ByteIterator.scala` and `actor/src/main/scala-3/org/apache/pekko/util/ByteIterator.scala` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `actor/src/main/scala-2.13/org/apache/pekko/util/ByteIterator.scala:206` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) actor/src/main/scala/org/apache/pekko/util/ByteString.scala:275— actor/src/main/scala/org/apache/pekko/util/ByteString.scala:275-286 | actor/src/main/scala/org/apache/pekko/util/ByteString.scala:301-312 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `actor/src/main/scala/org/apache/pekko/util/ByteString.scala:275` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) bench-jmh/src/main/scala/org/apache/pekko/util/ByteString_append_Benchmark.scala:122— bench-jmh/src/main/scala/org/apache/pekko/util/ByteString_append_Benchmark.scala:122-133 | bench-jmh/src/main/scala/org/apache/pekko/util/ByteString_append_Benchmark.scala:138-149 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (12 lines × 2) cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/ClusterShardingImpl.scala:299— cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/ClusterShardingImpl.scala:299-310 | cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ClusterSharding.scala:676-687 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: `ShardAllocationStrategy` names `ShardCoordinator.ShardAllocationStrategy` in one and `pekko.cluster.sharding.ShardCoordinator.ShardAllocationStrategy` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (12 lines × 2) cluster-tools/src/main/scala/org/apache/pekko/cluster/singleton/ClusterSingletonManager.scala:72— cluster-tools/src/main/scala/org/apache/pekko/cluster/singleton/ClusterSingletonManager.scala:72-83 | cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/ClusterSingleton.scala:238-249 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (12 lines × 2) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/EventSourcedBehaviorImpl.scala:227— persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/EventSourcedBehaviorImpl.scala:227-238 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/DurableStateBehaviorImpl.scala:153-164 — before extracting anything, compare `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/EventSourcedBehaviorImpl.scala` and `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/DurableStateBehaviorImpl.scala` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/EventSourcedBehaviorImpl.scala:227` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/EventSourcedBehaviorImpl.scala:225` calls `JournalResponse`, `SnapshotterResponse` and `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/DurableStateBehaviorImpl.scala:152` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12 lines × 2) serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonObjectMapperProvider.scala:96— serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonObjectMapperProvider.scala:96-107 | serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonObjectMapperProvider.scala:89-100 — before extracting anything, compare `serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonObjectMapperProvider.scala` and `serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonObjectMapperProvider.scala` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala:533— serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala:533-544 | serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonSerializer.scala:534-545 — before extracting anything, compare `serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala` and `serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonSerializer.scala` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 304 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (12 lines × 2) cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sbr/SbrTestLeaseActor.scala:52— cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sbr/SbrTestLeaseActor.scala:52-63 | cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sbr/SbrTestLeaseActor.scala:66-77 — both copies are in the same file, so extract the 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) persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/internal/DurableStateBehaviorTestKitImpl.scala:173— persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/internal/DurableStateBehaviorTestKitImpl.scala:173-184 | persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/internal/EventSourcedBehaviorTestKitImpl.scala:203-214 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (13 lines × 2) actor/src/main/scala/org/apache/pekko/actor/FSM.scala:791— actor/src/main/scala/org/apache/pekko/actor/FSM.scala:791-803 | persistence/src/main/scala/org/apache/pekko/persistence/fsm/PersistentFSMBase.scala:492-504 — before extracting anything, compare `actor/src/main/scala/org/apache/pekko/actor/FSM.scala` and `persistence/src/main/scala/org/apache/pekko/persistence/fsm/PersistentFSMBase.scala` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 142 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (13 lines × 2) actor/src/main/scala/org/apache/pekko/util/ByteString.scala:2332— actor/src/main/scala/org/apache/pekko/util/ByteString.scala:2332-2344 | actor/src/main/scala/org/apache/pekko/util/ByteString.scala:2382-2394 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/EventSourcedSettings.scala:55— persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/EventSourcedSettings.scala:55-67 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/DurableStateSettings.scala:58-70 — 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 (13 lines × 2) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/CommandHandler.scala:392— persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/CommandHandler.scala:392-404 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/CommandHandlerWithReply.scala:404-416 — before extracting anything, compare `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/CommandHandler.scala` and `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/CommandHandlerWithReply.scala` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/CommandHandler.scala:392` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/CommandHandler.scala:393— persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/CommandHandler.scala:393-405 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/CommandHandlerWithReply.scala:404-416 — before extracting anything, compare `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/CommandHandler.scala` and `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/CommandHandlerWithReply.scala` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/CommandHandler.scala:393` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala:73— serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala:73-85 | serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonSerializer.scala:74-86 — before extracting anything, compare `serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala` and `serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonSerializer.scala` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 304 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (13 lines × 2) stream/src/main/scala/org/apache/pekko/stream/impl/fusing/CollectFirst.scala:43— stream/src/main/scala/org/apache/pekko/stream/impl/fusing/CollectFirst.scala:43-55 | stream/src/main/scala/org/apache/pekko/stream/impl/fusing/CollectWhile.scala:43-55 — before extracting anything, compare `stream/src/main/scala/org/apache/pekko/stream/impl/fusing/CollectFirst.scala` and `stream/src/main/scala/org/apache/pekko/stream/impl/fusing/CollectWhile.scala` as WHOLE FILES: 83% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `stream/src/main/scala/org/apache/pekko/stream/impl/fusing/CollectFirst.scala:43` it does not close everything it opens, so those exact lines 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) actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/ManualTime.scala:45— actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/ManualTime.scala:45-57 | actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/scaladsl/ManualTime.scala:45-57 — 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 (13 lines × 2) distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/ORSet.scala:278— distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/ORSet.scala:278-290 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/crdt/ORSet.scala:245-257 — before extracting anything, compare `distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/ORSet.scala` and `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/crdt/ORSet.scala` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 144 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/ORSet.scala:278` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9 lines × 2) actor/src/main/scala/org/apache/pekko/actor/FSM.scala:597— actor/src/main/scala/org/apache/pekko/actor/FSM.scala:597-605 | persistence/src/main/scala/org/apache/pekko/persistence/fsm/PersistentFSMBase.scala:294-302 — before extracting anything, compare `actor/src/main/scala/org/apache/pekko/actor/FSM.scala` and `persistence/src/main/scala/org/apache/pekko/persistence/fsm/PersistentFSMBase.scala` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 142 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (9 lines × 2) actor/src/main/scala/org/apache/pekko/actor/FSM.scala:887— actor/src/main/scala/org/apache/pekko/actor/FSM.scala:887-895 | persistence/src/main/scala/org/apache/pekko/persistence/fsm/PersistentFSMBase.scala:588-596 — before extracting anything, compare `actor/src/main/scala/org/apache/pekko/actor/FSM.scala` and `persistence/src/main/scala/org/apache/pekko/persistence/fsm/PersistentFSMBase.scala` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 142 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `actor/src/main/scala/org/apache/pekko/actor/FSM.scala:887` it does not close everything it opens, so those exact lines 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) actor/src/main/scala/org/apache/pekko/util/ByteString.scala:1297— actor/src/main/scala/org/apache/pekko/util/ByteString.scala:1297-1305 | actor/src/main/scala/org/apache/pekko/util/ByteString.scala:1308-1316 — both copies are in the same file, so extract the 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) cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/ClusterShardingImpl.scala:267— cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/ClusterShardingImpl.scala:267-275 | cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/internal/ClusterShardingImpl.scala:288-296 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (9 lines × 2) cluster-tools/src/main/scala/org/apache/pekko/cluster/pubsub/protobuf/DistributedPubSubMessageSerializer.scala:227— cluster-tools/src/main/scala/org/apache/pekko/cluster/pubsub/protobuf/DistributedPubSubMessageSerializer.scala:227-235 | distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/protobuf/SerializationSupport.scala:141-149 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cluster-tools/src/main/scala/org/apache/pekko/cluster/pubsub/protobuf/DistributedPubSubMessageSerializer.scala:227` 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) stream/src/main/scala/org/apache/pekko/stream/scaladsl/Hub.scala:913— stream/src/main/scala/org/apache/pekko/stream/scaladsl/Hub.scala:913-921 | stream/src/main/scala/org/apache/pekko/stream/scaladsl/Hub.scala:1517-1525 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `stream/src/main/scala/org/apache/pekko/stream/scaladsl/Hub.scala:913` 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) actor/src/main/scala/org/apache/pekko/actor/FSM.scala:755— actor/src/main/scala/org/apache/pekko/actor/FSM.scala:755-763 | persistence/src/main/scala/org/apache/pekko/persistence/fsm/PersistentFSMBase.scala:456-464 — before extracting anything, compare `actor/src/main/scala/org/apache/pekko/actor/FSM.scala` and `persistence/src/main/scala/org/apache/pekko/persistence/fsm/PersistentFSMBase.scala` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 142 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/Running.scala:883— persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/Running.scala:883-891 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/Running.scala:358-366 — before extracting anything, compare `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/Running.scala` and `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/Running.scala` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) stream/src/main/scala/org/apache/pekko/stream/MapAsyncPartitioned.scala:46— stream/src/main/scala/org/apache/pekko/stream/MapAsyncPartitioned.scala:46-54 | stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Ops.scala:1330-1338 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) actor/src/main/scala-2.13/org/apache/pekko/util/ByteIterator.scala:411— actor/src/main/scala-2.13/org/apache/pekko/util/ByteIterator.scala:411-420 | actor/src/main/scala-3/org/apache/pekko/util/ByteIterator.scala:406-415 — before extracting anything, compare `actor/src/main/scala-2.13/org/apache/pekko/util/ByteIterator.scala` and `actor/src/main/scala-3/org/apache/pekko/util/ByteIterator.scala` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `actor/src/main/scala-2.13/org/apache/pekko/util/ByteIterator.scala:411` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) actor/src/main/scala/org/apache/pekko/actor/FSM.scala:142— actor/src/main/scala/org/apache/pekko/actor/FSM.scala:142-151 | persistence/src/main/scala/org/apache/pekko/persistence/fsm/PersistentFSM.scala:351-360 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (10 lines × 2) actor/src/main/scala/org/apache/pekko/pattern/BackoffOptions.scala:381— actor/src/main/scala/org/apache/pekko/pattern/BackoffOptions.scala:381-390 | actor/src/main/scala/org/apache/pekko/pattern/BackoffOptions.scala:428-437 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `actor/src/main/scala/org/apache/pekko/pattern/BackoffOptions.scala:381` it does not close everything it opens, so those exact lines 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) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/Running.scala:269— persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/Running.scala:269-278 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/Running.scala:107-116 — before extracting anything, compare `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/Running.scala` and `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/Running.scala` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/Running.scala:269` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/Running.scala:265` calls `alreadySeen`, `getOrElse` and `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/Running.scala:105` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 2) actor/src/main/scala/org/apache/pekko/actor/FSM.scala:863— actor/src/main/scala/org/apache/pekko/actor/FSM.scala:863-872 | persistence/src/main/scala/org/apache/pekko/persistence/fsm/PersistentFSMBase.scala:564-573 — before extracting anything, compare `actor/src/main/scala/org/apache/pekko/actor/FSM.scala` and `persistence/src/main/scala/org/apache/pekko/persistence/fsm/PersistentFSMBase.scala` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 142 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala:121— serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala:121-130 | serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonSerializer.scala:122-131 — before extracting anything, compare `serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala` and `serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonSerializer.scala` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 304 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala:302— serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala:302-311 | serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonSerializer.scala:303-312 — before extracting anything, compare `serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala` and `serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonSerializer.scala` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 304 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/state/scaladsl/PersistenceTestKitDurableStateStore.scala:123— persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/state/scaladsl/PersistenceTestKitDurableStateStore.scala:123-132 | persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/state/scaladsl/PersistenceTestKitDurableStateStore.scala:185-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 `persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/state/scaladsl/PersistenceTestKitDurableStateStore.scala:123` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
HackComment actor/src/main/scala/org/apache/pekko/dispatch/Mailboxes.scala:222— // hack to allow programmatic set of capacity through props in pekko-typed but still share — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment project/MultiNode.scala:78— // Hack because 'provided' dependencies by default are not picked up by the multi-jvm plugin: — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment serialization-jackson/src/test/scala/org/apache/pekko/serialization/jackson/JacksonSerializerSpec.scala:981— // Hack the manifest to enforce the use a particular migration when deserializing the blob of Event1 — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment serialization-jackson/src/test/scala/org/apache/pekko/serialization/jackson/JacksonSerializerSpec.scala:1207— // Hack the manifest to enforce the use a particular migration when deserializing the blob of Event1 — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment serialization-jackson3/src/test/scala/org/apache/pekko/serialization/jackson3/JacksonSerializerSpec.scala:926— // Hack the manifest to enforce the use a particular migration when deserializing the blob of Event1 — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment serialization-jackson3/src/test/scala/org/apache/pekko/serialization/jackson3/JacksonSerializerSpec.scala:1152— // Hack the manifest to enforce the use a particular migration when deserializing the blob of Event1 — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment stream/src/main/scala/org/apache/pekko/stream/impl/JsonObjectParser.scala:143— // HACK: use arithmetic exception to cover error case — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
Duplicated block (14 lines × 2) actor/src/main/scala/org/apache/pekko/util/ByteString.scala:2426— actor/src/main/scala/org/apache/pekko/util/ByteString.scala:2426-2439 | actor/src/main/scala/org/apache/pekko/util/ByteString.scala:2490-2503 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) actor/src/main/scala/org/apache/pekko/util/LineNumbers.scala:126— actor/src/main/scala/org/apache/pekko/util/LineNumbers.scala:126-139 | actor/src/main/scala/org/apache/pekko/util/LineNumbers.scala:142-155 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/ORSet.scala:444— distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/ORSet.scala:444-457 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/crdt/ORSet.scala:428-441 — before extracting anything, compare `distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/ORSet.scala` and `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/crdt/ORSet.scala` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 144 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) remote/src/main/scala/org/apache/pekko/remote/artery/tcp/ConfigSSLEngineProvider.scala:158— remote/src/main/scala/org/apache/pekko/remote/artery/tcp/ConfigSSLEngineProvider.scala:158-171 | remote/src/main/scala/org/apache/pekko/remote/transport/netty/SSLEngineProvider.scala:168-181 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `remote/src/main/scala/org/apache/pekko/remote/artery/tcp/ConfigSSLEngineProvider.scala:158` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala:451— serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala:451-464 | serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonSerializer.scala:452-465 — before extracting anything, compare `serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala` and `serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonSerializer.scala` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 304 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (14 lines × 2) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/Running.scala:1030— persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/Running.scala:1030-1043 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/Running.scala:395-408 — before extracting anything, compare `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/Running.scala` and `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/Running.scala` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/Running.scala:1030` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/StashManagement.scala:77— persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/StashManagement.scala:77-90 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/StashManagement.scala:77-90 — before extracting anything, compare `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/StashManagement.scala` and `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/StashManagement.scala` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
MethodTooLong: TlsGraphStage.initialAttributes stream/src/main/scala/org/apache/pekko/stream/impl/io/TlsGraphStage.scala:62— MethodTooLong — initialAttributes runs 758 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 658 over it, 7.58× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: TlsGraphStage.createLogic stream/src/main/scala/org/apache/pekko/stream/impl/io/TlsGraphStage.scala:64— MethodTooLong — createLogic runs 757 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 657 over it, 7.57× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ClusterReceptionist.behavior cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/receptionist/ClusterReceptionist.scala:272— MethodTooLong — behavior runs 230 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 130 over it, 2.30× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: EventWriter.apply persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/EventWriter.scala:123— MethodTooLong — apply runs 211 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 111 over it, 2.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Split.initialAttributes stream/src/main/scala/org/apache/pekko/stream/impl/fusing/StreamOfStreams.scala:607— MethodTooLong — initialAttributes runs 106 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 6 over it, 1.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Split.createLogic stream/src/main/scala/org/apache/pekko/stream/impl/fusing/StreamOfStreams.scala:609— MethodTooLong — createLogic runs 105 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 5 over it, 1.05× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
Duplicated block (17 lines × 2) actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/internal/WorkPullingProducerControllerImpl.scala:662— actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/internal/WorkPullingProducerControllerImpl.scala:662-678 | cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/delivery/internal/ShardingProducerControllerImpl.scala:571-587 — before extracting anything, compare `actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/internal/WorkPullingProducerControllerImpl.scala` and `cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/delivery/internal/ShardingProducerControllerImpl.scala` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/internal/WorkPullingProducerControllerImpl.scala:662` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: `Start` names `ShardingProducerController.Start` in one and `WorkPullingProducerController.Start` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (17 lines × 2) serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala:284— serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala:284-300 | serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonSerializer.scala:285-301 — before extracting anything, compare `serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala` and `serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonSerializer.scala` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 304 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (17 lines × 2) serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala:314— serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala:314-330 | serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonSerializer.scala:315-331 — before extracting anything, compare `serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala` and `serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonSerializer.scala` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 304 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (17 lines × 2) serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala:420— serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala:420-436 | serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonSerializer.scala:421-437 — before extracting anything, compare `serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala` and `serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonSerializer.scala` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 304 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (17 lines × 2) serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala:547— serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala:547-563 | serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonSerializer.scala:548-564 — before extracting anything, compare `serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala` and `serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonSerializer.scala` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 304 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (17 lines × 2) stream/src/main/scala/org/apache/pekko/stream/scaladsl/Hub.scala:818— stream/src/main/scala/org/apache/pekko/stream/scaladsl/Hub.scala:818-834 | stream/src/main/scala/org/apache/pekko/stream/scaladsl/Hub.scala:1451-1467 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `stream/src/main/scala/org/apache/pekko/stream/scaladsl/Hub.scala:818` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) actor/src/main/scala/org/apache/pekko/actor/FSM.scala:842— actor/src/main/scala/org/apache/pekko/actor/FSM.scala:842-856 | persistence/src/main/scala/org/apache/pekko/persistence/fsm/PersistentFSMBase.scala:543-557 — before extracting anything, compare `actor/src/main/scala/org/apache/pekko/actor/FSM.scala` and `persistence/src/main/scala/org/apache/pekko/persistence/fsm/PersistentFSMBase.scala` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 142 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `actor/src/main/scala/org/apache/pekko/actor/FSM.scala:842` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) actor/src/main/scala/org/apache/pekko/util/ByteString.scala:1244— actor/src/main/scala/org/apache/pekko/util/ByteString.scala:1244-1258 | actor/src/main/scala/org/apache/pekko/util/ByteString.scala:1261-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 (15 lines × 2) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/ReplayingEvents.scala:297— persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/ReplayingEvents.scala:297-311 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/Recovering.scala:179-193 — 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 `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/ReplayingEvents.scala:297` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: `RecoveryCompleted` names `pekko.persistence.typed.RecoveryCompleted` in one and `pekko.persistence.typed.state.RecoveryCompleted` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (15 lines × 2) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/Running.scala:1011— persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/Running.scala:1011-1025 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/Running.scala:376-390 — before extracting anything, compare `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/Running.scala` and `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/Running.scala` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (15 lines × 2) serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala:593— serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala:593-607 | serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonSerializer.scala:594-608 — before extracting anything, compare `serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala` and `serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonSerializer.scala` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 304 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (15 lines × 2) stream/src/main/scala/org/apache/pekko/stream/impl/fusing/GraphInterpreter.scala:593— stream/src/main/scala/org/apache/pekko/stream/impl/fusing/GraphInterpreter.scala:593-607 | stream/src/main/scala/org/apache/pekko/stream/impl/fusing/GraphInterpreter.scala:626-640 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `stream/src/main/scala/org/apache/pekko/stream/impl/fusing/GraphInterpreter.scala:593` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) actor/src/main/scala/org/apache/pekko/actor/FSM.scala:818— actor/src/main/scala/org/apache/pekko/actor/FSM.scala:818-835 | persistence/src/main/scala/org/apache/pekko/persistence/fsm/PersistentFSMBase.scala:519-536 — before extracting anything, compare `actor/src/main/scala/org/apache/pekko/actor/FSM.scala` and `persistence/src/main/scala/org/apache/pekko/persistence/fsm/PersistentFSMBase.scala` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 142 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `actor/src/main/scala/org/apache/pekko/actor/FSM.scala:818` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/MultiNodeClusterShardingConfig.scala:35— cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/MultiNodeClusterShardingConfig.scala:35-52 | testkit/src/main/scala/org/apache/pekko/testkit/TestKitUtils.scala:37-54 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/MultiNodeClusterShardingConfig.scala:35` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `testkit/src/main/scala/org/apache/pekko/testkit/TestKitUtils.scala:55` calls `matches` and `cluster-sharding/src/multi-jvm/scala/org/apache/pekko/cluster/sharding/MultiNodeClusterShardingConfig.scala:53` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (18 lines × 2) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/StashManagement.scala:55— persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/StashManagement.scala:55-72 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/StashManagement.scala:55-72 — before extracting anything, compare `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/StashManagement.scala` and `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/StashManagement.scala` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (18 lines × 2) stream/src/main/scala/org/apache/pekko/stream/impl/TraversalBuilder.scala:372— stream/src/main/scala/org/apache/pekko/stream/impl/TraversalBuilder.scala:372-389 | stream/src/main/scala/org/apache/pekko/stream/impl/TraversalBuilder.scala:416-433 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `stream/src/main/scala/org/apache/pekko/stream/impl/TraversalBuilder.scala:372` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/protobuf/ReplicatedDataSerializer.scala:550— distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/protobuf/ReplicatedDataSerializer.scala:550-567 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/serialization/ReplicatedEventSourcingSerializer.scala:329-346 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×4
Members sharing a duplicated core (4 members, 50+ identical tokens) actor/src/main/scala/org/apache/pekko/util/ByteString.scala:263— actor/src/main/scala/org/apache/pekko/util/ByteString.scala:263-286 | actor/src/main/scala/org/apache/pekko/util/ByteString.scala:288-312 | actor/src/main/scala/org/apache/pekko/util/ByteString.scala:688-711 | actor/src/main/scala/org/apache/pekko/util/ByteString.scala:713-738 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) actor/src/main/scala/org/apache/pekko/util/ByteString.scala:387— actor/src/main/scala/org/apache/pekko/util/ByteString.scala:387-399 | actor/src/main/scala/org/apache/pekko/util/ByteString.scala:401-413 | actor/src/main/scala/org/apache/pekko/util/ByteString.scala:815-827 | actor/src/main/scala/org/apache/pekko/util/ByteString.scala:829-841 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/CommandHandler.scala:207— persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/CommandHandler.scala:207-215 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/CommandHandlerWithReply.scala:219-227 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/CommandHandler.scala:208-216 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/CommandHandlerWithReply.scala:218-226 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) stream/src/main/scala/org/apache/pekko/stream/javadsl/Flow.scala:4611— stream/src/main/scala/org/apache/pekko/stream/javadsl/Flow.scala:4611-4619 | stream/src/main/scala/org/apache/pekko/stream/javadsl/Source.scala:5095-5103 | stream/src/main/scala/org/apache/pekko/stream/javadsl/SubFlow.scala:3187-3195 | stream/src/main/scala/org/apache/pekko/stream/javadsl/SubSource.scala:3154-3162 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Duplicated block (20 lines × 2) distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/ORSet.scala:202— distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/ORSet.scala:202-221 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/crdt/ORSet.scala:169-188 — before extracting anything, compare `distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/ORSet.scala` and `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/crdt/ORSet.scala` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 144 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/ORSet.scala:202` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20 lines × 2) distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/protobuf/ReplicatedDataSerializer.scala:994— distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/protobuf/ReplicatedDataSerializer.scala:994-1013 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/serialization/ReplicatedEventSourcingSerializer.scala:48-67 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (20 lines × 2) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/RequestingRecoveryPermit.scala:60— persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/RequestingRecoveryPermit.scala:60-79 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/RequestingRecoveryPermit.scala:59-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 `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/RequestingRecoveryPermit.scala:60` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20 lines × 2) serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala:511— serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala:511-530 | serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonSerializer.scala:512-531 — before extracting anything, compare `serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala` and `serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonSerializer.scala` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 304 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (16 lines × 2) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/BehaviorSetup.scala:171— persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/BehaviorSetup.scala:171-186 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/BehaviorSetup.scala:104-119 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (16 lines × 2) remote/src/main/scala/org/apache/pekko/remote/artery/Codecs.scala:737— remote/src/main/scala/org/apache/pekko/remote/artery/Codecs.scala:737-752 | remote/src/main/scala/org/apache/pekko/remote/artery/Codecs.scala:805-820 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `remote/src/main/scala/org/apache/pekko/remote/artery/Codecs.scala:737` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) stream/src/main/scala/org/apache/pekko/stream/impl/fusing/CollectFirst.scala:61— stream/src/main/scala/org/apache/pekko/stream/impl/fusing/CollectFirst.scala:61-76 | stream/src/main/scala/org/apache/pekko/stream/impl/fusing/CollectWhile.scala:59-74 — before extracting anything, compare `stream/src/main/scala/org/apache/pekko/stream/impl/fusing/CollectFirst.scala` and `stream/src/main/scala/org/apache/pekko/stream/impl/fusing/CollectWhile.scala` as WHOLE FILES: 83% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `stream/src/main/scala/org/apache/pekko/stream/impl/fusing/CollectFirst.scala: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 (16 lines × 2) actor/src/main/scala/org/apache/pekko/serialization/Serializer.scala:86— actor/src/main/scala/org/apache/pekko/serialization/Serializer.scala:86-476 | testkit/src/main/scala/org/apache/pekko/testkit/TestJavaSerializer.scala:36-51 — 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 `actor/src/main/scala/org/apache/pekko/serialization/Serializer.scala:86` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Change coupling: FlowWithContext.scala ↔ SourceWithContext.scala stream/src/main/scala/org/apache/pekko/stream/javadsl/FlowWithContext.scala— `stream/src/main/scala/org/apache/pekko/stream/javadsl/FlowWithContext.scala` and `stream/src/main/scala/org/apache/pekko/stream/javadsl/SourceWithContext.scala` change together 86% of the time (18 of the 21 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 18 shared commits counted here, the most recent 3 are `a626d621` feat(stream): add withContext filtering and truncating operators (#3199); `60c480ae` Add optionalVia and unsafeOptionalDataVia; `06cff559` some doc changes (#1177) — run `git show` on any of them.
Change coupling: PersistenceTestKitPlugin.scala ↔ PersistenceTestKitReadJournal.scala persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/PersistenceTestKitPlugin.scala— `persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/PersistenceTestKitPlugin.scala` and `persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/query/scaladsl/PersistenceTestKitReadJournal.scala` change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `0e10d291` Implement events by slice in testkit (#1533); `9230df8b` Implement EventsByTagQuery in PersistenceTestKitReadJournal (#1532); `9fb76bbe` Tagging for replicated event sourcing (#29442) (at that commit the files were still `akka-persistence-testkit/src/main/scala/akka/persistence/testkit/PersistenceTestKitPlugin.scala` and `akka-persistence-testkit/src/main/scala/akka/persistence/testkit/query/scaladsl/PersistenceTestKitReadJournal.scala`) — run `git show` on any of them.
Change coupling: SourceWithContext.scala ↔ FlowWithContext.scala stream/src/main/scala/org/apache/pekko/stream/javadsl/SourceWithContext.scala— `stream/src/main/scala/org/apache/pekko/stream/javadsl/SourceWithContext.scala` and `stream/src/main/scala/org/apache/pekko/stream/scaladsl/FlowWithContext.scala` change together 56% of the time (10 of the 18 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `60c480ae` Add optionalVia and unsafeOptionalDataVia; `1b1f5722` =str Tweak the stream mapAsyncPartitioned operator; `7bee80e0` mapAsyncPartitioned / mapAsyncPartitionedUnordered (#561) — run `git show` on any of them.
Duplicated block (25 lines × 2) distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/ORSet.scala:485— distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/ORSet.scala:485-509 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/crdt/ORSet.scala:466-490 — before extracting anything, compare `distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/ORSet.scala` and `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/crdt/ORSet.scala` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 144 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (25 lines × 2) persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/query/internal/EventsByPersistenceIdStage.scala:38— persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/query/internal/EventsByPersistenceIdStage.scala:38-62 | persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/query/internal/TypedEventsByPersistenceIdStage.scala:46-70 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/query/internal/EventsByPersistenceIdStage.scala:38` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (25 lines × 2) remote/src/main/scala/org/apache/pekko/remote/artery/Codecs.scala:766— remote/src/main/scala/org/apache/pekko/remote/artery/Codecs.scala:766-790 | remote/src/main/scala/org/apache/pekko/remote/artery/Codecs.scala:832-856 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `remote/src/main/scala/org/apache/pekko/remote/artery/Codecs.scala:766` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (23 lines × 2) actor/src/main/scala/org/apache/pekko/actor/FSM.scala:987— actor/src/main/scala/org/apache/pekko/actor/FSM.scala:987-1009 | persistence/src/main/scala/org/apache/pekko/persistence/fsm/PersistentFSMBase.scala:690-712 — before extracting anything, compare `actor/src/main/scala/org/apache/pekko/actor/FSM.scala` and `persistence/src/main/scala/org/apache/pekko/persistence/fsm/PersistentFSMBase.scala` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 142 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (23 lines × 2) serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala:566— serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala:566-588 | serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonSerializer.scala:567-589 — before extracting anything, compare `serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala` and `serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonSerializer.scala` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 304 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (23 lines × 2) actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/TestProbeImpl.scala:378— actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/TestProbeImpl.scala:378-400 | testkit/src/main/scala/org/apache/pekko/testkit/TestKit.scala:334-356 — 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 × 3) actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/internal/ProducerControllerImpl.scala:227— actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/internal/ProducerControllerImpl.scala:227-235 | actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/internal/WorkPullingProducerControllerImpl.scala:260-268 | cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/delivery/internal/ShardingProducerControllerImpl.scala:265-273 — before extracting anything, compare `actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/internal/WorkPullingProducerControllerImpl.scala` and `cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/delivery/internal/ShardingProducerControllerImpl.scala` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/internal/ProducerControllerImpl.scala:227` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonObjectMapperProvider.scala:409— serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonObjectMapperProvider.scala:409-417 | serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonObjectMapperProvider.scala:525-533 | serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonObjectMapperProvider.scala:548-556 — before extracting anything, compare `serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonObjectMapperProvider.scala` and `serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonObjectMapperProvider.scala` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 3) actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/internal/ProducerControllerImpl.scala:211— actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/internal/ProducerControllerImpl.scala:211-219 | actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/internal/WorkPullingProducerControllerImpl.scala:244-252 | cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/delivery/internal/ShardingProducerControllerImpl.scala:249-257 — before extracting anything, compare `actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/internal/WorkPullingProducerControllerImpl.scala` and `cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/delivery/internal/ShardingProducerControllerImpl.scala` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/internal/ProducerControllerImpl.scala:211` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: `Command` names `ProducerController.Command` in one and `ShardingProducerController.Command` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (6 lines × 3) actor/src/main/scala/org/apache/pekko/actor/FaultHandling.scala:294— actor/src/main/scala/org/apache/pekko/actor/FaultHandling.scala:294-299 | actor/src/main/scala/org/apache/pekko/serialization/Serialization.scala:514-519 | persistence/src/main/scala/org/apache/pekko/persistence/journal/EventAdapters.scala:166-171 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `actor/src/main/scala/org/apache/pekko/actor/FaultHandling.scala:294` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonObjectMapperProvider.scala:96— serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonObjectMapperProvider.scala:96-101 | serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonObjectMapperProvider.scala:89-94 | serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonObjectMapperProvider.scala:162-167 — before extracting anything, compare `serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonObjectMapperProvider.scala` and `serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonObjectMapperProvider.scala` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonObjectMapperProvider.scala:102` calls `maxTokenCount`, `getLongOrUnlimited` and `serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonObjectMapperProvider.scala:168` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 3) bench-jmh/src/main/scala/org/apache/pekko/stream/AskBenchmark.scala:99— bench-jmh/src/main/scala/org/apache/pekko/stream/AskBenchmark.scala:99-104 | bench-jmh/src/main/scala/org/apache/pekko/stream/BroadcastHubBenchmark.scala:135-140 | bench-jmh/src/main/scala/org/apache/pekko/stream/MapAsyncBenchmark.scala:101-106 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (5 lines × 4) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/CommandHandler.scala:209— persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/CommandHandler.scala:209-213 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/CommandHandlerWithReply.scala:221-225 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/CommandHandler.scala:210-214 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/CommandHandlerWithReply.scala:220-224 — before extracting anything, compare `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/CommandHandler.scala` and `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/CommandHandlerWithReply.scala` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 4) stream/src/main/scala/org/apache/pekko/stream/javadsl/Flow.scala:4615— stream/src/main/scala/org/apache/pekko/stream/javadsl/Flow.scala:4615-4619 | stream/src/main/scala/org/apache/pekko/stream/javadsl/Source.scala:5099-5103 | stream/src/main/scala/org/apache/pekko/stream/javadsl/SubFlow.scala:3191-3195 | stream/src/main/scala/org/apache/pekko/stream/javadsl/SubSource.scala:3158-3162 — before extracting anything, compare `stream/src/main/scala/org/apache/pekko/stream/javadsl/Flow.scala` and `stream/src/main/scala/org/apache/pekko/stream/javadsl/SubFlow.scala` as WHOLE FILES: 85% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `stream/src/main/scala/org/apache/pekko/stream/javadsl/Flow.scala:4615` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 4) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/CommandHandler.scala:243— persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/CommandHandler.scala:243-247 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/CommandHandlerWithReply.scala:253-258 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/CommandHandler.scala:244-248 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/CommandHandlerWithReply.scala:254-258 — before extracting anything, compare `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/CommandHandler.scala` and `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/CommandHandlerWithReply.scala` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/CommandHandler.scala:243` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
VersionVector.compareOnlyTo (cyclomatic 20) distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/VersionVector.scala:192— VersionVector.compareOnlyTo has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
VersionVector.compareOnlyTo (cyclomatic 20) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/VersionVector.scala:150— VersionVector.compareOnlyTo has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
JacksonSerializer.fromBinary (cyclomatic 20) serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala:332— JacksonSerializer.fromBinary has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
JacksonSerializer.fromBinary (cyclomatic 20) serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonSerializer.scala:333— JacksonSerializer.fromBinary has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
Repeated repair: stream/src/main/scala/org/apache/pekko/stream/impl/fusing/GraphInterpreter.scala stream/src/main/scala/org/apache/pekko/stream/impl/fusing/GraphInterpreter.scala:491— stream/src/main/scala/org/apache/pekko/stream/impl/fusing/GraphInterpreter.scala changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is GraphInterpreter.execute at line 491), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: preserve StageActor demand across fused streams (#3461)”; “fix(stream): replace O(n) finalization scan with O(1) counter in afterStageHasRun (#3373)”; “fix: release completed graph interpreter references (#3030)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 18:02:03 +02:00' --until='2026-09-27 18:02:03 +02:00' --full-history --no-merges -- stream/src/main/scala/org/apache/pekko/stream/impl/fusing/GraphInterpreter.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: cluster-metrics/src/main/scala/org/apache/pekko/cluster/metrics/protobuf/MessageSerializer.scala cluster-metrics/src/main/scala/org/apache/pekko/cluster/metrics/protobuf/MessageSerializer.scala:177— cluster-metrics/src/main/scala/org/apache/pekko/cluster/metrics/protobuf/MessageSerializer.scala changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is MessageSerializer.metricsGossipEnvelopeToProto at line 177), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: bound the size a compressed payload may expand to (#3502)”; “fix: support java.math.BigInteger/BigDecimal in MetricNumericConverter (#3382)”; “fix: fix scaladoc warnings (#3285)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 18:02:03 +02:00' --until='2026-09-27 18:02:03 +02:00' --full-history --no-merges -- cluster-metrics/src/main/scala/org/apache/pekko/cluster/metrics/protobuf/MessageSerializer.scala`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
VersionVector.compareOnlyTo (cognitive 47) distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/VersionVector.scala:192— VersionVector.compareOnlyTo has cognitive complexity 47 (threshold 15). Drivers by points: if/else 29 (45 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VersionVector.compareOnlyTo (cognitive 47) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/VersionVector.scala:150— VersionVector.compareOnlyTo has cognitive complexity 47 (threshold 15). Drivers by points: if/else 29 (45 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ByteStrings.lastIndexOf (cognitive 26) actor/src/main/scala/org/apache/pekko/util/ByteString.scala:1930— ByteStrings.lastIndexOf has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (25 pts), boolean chains 1 (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: one other method here (ByteStrings.lastIndexOf) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
ByteStrings.lastIndexOf (cognitive 26) actor/src/main/scala/org/apache/pekko/util/ByteString.scala:1959— ByteStrings.lastIndexOf has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (25 pts), boolean chains 1 (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: one other method here (ByteStrings.lastIndexOf) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
ORSet.mergeCommonKeys (cognitive 26) distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/ORSet.scala:201— ORSet.mergeCommonKeys has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 3, match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ORSet.mergeCommonKeys (cognitive 26) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/crdt/ORSet.scala:168— ORSet.mergeCommonKeys has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 3, match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
JacksonSerializer.fromBinary (cognitive 20) serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala:332— JacksonSerializer.fromBinary has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (10 pts), match/switch 5 (9 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
JacksonSerializer.fromBinary (cognitive 20) serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonSerializer.scala:333— JacksonSerializer.fromBinary has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (10 pts), match/switch 5 (9 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ByteString2.indexOf (cognitive 18) actor/src/main/scala/org/apache/pekko/util/ByteString.scala:1243— ByteString2.indexOf has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (18 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (ByteString2.indexOf) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
ByteString2.indexOf (cognitive 18) actor/src/main/scala/org/apache/pekko/util/ByteString.scala:1260— ByteString2.indexOf has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (18 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (ByteString2.indexOf) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
ManyVersionVector.merge (cognitive 16) distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/VersionVector.scala:370— ManyVersionVector.merge has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 1 (3 pts), match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ManyVersionVector.merge (cognitive 16) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/VersionVector.scala:310— ManyVersionVector.merge has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 1 (3 pts), match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Duplicated block (27 lines × 2) actor/src/main/scala/org/apache/pekko/util/ByteString.scala:1931— actor/src/main/scala/org/apache/pekko/util/ByteString.scala:1931-1957 | actor/src/main/scala/org/apache/pekko/util/ByteString.scala:1960-1986 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (27 lines × 2) distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/ORSet.scala:163— distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/ORSet.scala:163-189 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/crdt/ORSet.scala:130-156 — before extracting anything, compare `distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/ORSet.scala` and `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/crdt/ORSet.scala` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 144 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/ORSet.scala:163` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (24 lines × 2) actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/internal/WorkPullingProducerControllerImpl.scala:211— actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/internal/WorkPullingProducerControllerImpl.scala:211-234 | cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/delivery/internal/ShardingProducerControllerImpl.scala:216-239 — before extracting anything, compare `actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/internal/WorkPullingProducerControllerImpl.scala` and `cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/delivery/internal/ShardingProducerControllerImpl.scala` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/internal/WorkPullingProducerControllerImpl.scala:211` 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 (24 lines × 2) actor/src/main/scala/org/apache/pekko/util/ByteString.scala:1853— actor/src/main/scala/org/apache/pekko/util/ByteString.scala:1853-1876 | actor/src/main/scala/org/apache/pekko/util/ByteString.scala:1879-1902 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (22 lines × 2) distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/protobuf/ReplicatedDataSerializer.scala:500— distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/protobuf/ReplicatedDataSerializer.scala:500-521 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/serialization/ReplicatedEventSourcingSerializer.scala:260-281 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/protobuf/ReplicatedDataSerializer.scala:500` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22 lines × 2) serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonObjectMapperProvider.scala:224— serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonObjectMapperProvider.scala:224-245 | serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonObjectMapperProvider.scala:253-274 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (12–13 lines × 2) actor/src/main/scala/org/apache/pekko/util/ByteString.scala:700— actor/src/main/scala/org/apache/pekko/util/ByteString.scala:700-711 | actor/src/main/scala/org/apache/pekko/util/ByteString.scala:726-738 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `actor/src/main/scala/org/apache/pekko/util/ByteString.scala:700` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12–13 lines × 2) stream/src/main/scala/org/apache/pekko/stream/javadsl/Source.scala:469— stream/src/main/scala/org/apache/pekko/stream/javadsl/Source.scala:469-480 | stream/src/main/scala/org/apache/pekko/stream/javadsl/Source.scala:502-514 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `stream/src/main/scala/org/apache/pekko/stream/javadsl/Source.scala:469` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9 lines × 4) actor/src/main/scala/org/apache/pekko/util/ByteString.scala:391— actor/src/main/scala/org/apache/pekko/util/ByteString.scala:391-399 | actor/src/main/scala/org/apache/pekko/util/ByteString.scala:405-413 | actor/src/main/scala/org/apache/pekko/util/ByteString.scala:819-827 | actor/src/main/scala/org/apache/pekko/util/ByteString.scala:833-841 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `actor/src/main/scala/org/apache/pekko/util/ByteString.scala:391` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 4) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/ReplayingEvents.scala:228— persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/ReplayingEvents.scala:228-237 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/Running.scala:759-767 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/Running.scala:909-917 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/Running.scala:312-320 — before extracting anything, compare `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/Running.scala` and `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/Running.scala` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (6–7 lines × 2) remote/src/main/scala/org/apache/pekko/remote/artery/aeron/ArteryAeronUdpTransport.scala:382— remote/src/main/scala/org/apache/pekko/remote/artery/aeron/ArteryAeronUdpTransport.scala:382-387 | remote/src/main/scala/org/apache/pekko/remote/artery/tcp/ArteryTcpTransport.scala:416-422 — 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 `remote/src/main/scala/org/apache/pekko/remote/artery/aeron/ArteryAeronUdpTransport.scala:382` 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–7 lines × 2) stream/src/main/scala/org/apache/pekko/stream/impl/fusing/StreamOfStreams.scala:215— stream/src/main/scala/org/apache/pekko/stream/impl/fusing/StreamOfStreams.scala:215-220 | stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Switch.scala:98-104 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `stream/src/main/scala/org/apache/pekko/stream/impl/fusing/StreamOfStreams.scala:215` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `stream/src/main/scala/org/apache/pekko/stream/impl/fusing/StreamOfStreams.scala:220` calls `pull`, `enqueue` and `stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Switch.scala:104` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (21 lines × 2) serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/FiniteDurationModule.scala:53— serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/FiniteDurationModule.scala:53-73 | serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/FiniteDurationModule.scala:53-73 — 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 `serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/FiniteDurationModule.scala:53` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: `DeserializationContext` names `com.fasterxml.jackson.databind.DeserializationContext` in one and `tools.jackson.databind.DeserializationContext` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (21 lines × 2) actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/JUnit5TestKitBuilder.scala:36— actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/JUnit5TestKitBuilder.scala:36-56 | actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/JUnitJupiterTestKitBuilder.scala:35-55 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
TlsGraphStage.createLogic (cyclomatic 235) stream/src/main/scala/org/apache/pekko/stream/impl/io/TlsGraphStage.scala:64— TlsGraphStage.createLogic has cyclomatic complexity 235 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WorkPullingProducerControllerImpl.active (cyclomatic 76) actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/internal/WorkPullingProducerControllerImpl.scala:302— WorkPullingProducerControllerImpl.active has cyclomatic complexity 76 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
FlattenConcat.createLogic (cyclomatic 75) stream/src/main/scala/org/apache/pekko/stream/impl/fusing/FlattenConcat.scala:47— FlattenConcat.createLogic has cyclomatic complexity 75 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ProducerControllerImpl.active (cyclomatic 74) actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/internal/ProducerControllerImpl.scala:406— ProducerControllerImpl.active has cyclomatic complexity 74 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DistributedPubSubMediator.receive (cyclomatic 60) cluster-tools/src/main/scala/org/apache/pekko/cluster/pubsub/DistributedPubSubMediator.scala:613— DistributedPubSubMediator.receive has cyclomatic complexity 60 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
SourceRefStageImpl.createLogicAndMaterializedValue (cyclomatic 57) stream/src/main/scala/org/apache/pekko/stream/impl/streamref/SourceRefImpl.scala:136— SourceRefStageImpl.createLogicAndMaterializedValue has cyclomatic complexity 57 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
FlattenMerge.createLogic (cyclomatic 49) stream/src/main/scala/org/apache/pekko/stream/impl/fusing/StreamOfStreams.scala:58— FlattenMerge.createLogic has cyclomatic complexity 49 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ClusterReceptionist.behavior (cyclomatic 48) cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/receptionist/ClusterReceptionist.scala:272— ClusterReceptionist.behavior has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SystemMessageDelivery.createLogic (cyclomatic 47) remote/src/main/scala/org/apache/pekko/remote/artery/SystemMessageDelivery.scala:96— SystemMessageDelivery.createLogic has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ShardCoordinator.active (cyclomatic 44) cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ShardCoordinator.scala:739— ShardCoordinator.active has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GroupBy.createLogic (cyclomatic 44) stream/src/main/scala/org/apache/pekko/stream/impl/fusing/StreamOfStreams.scala:395— GroupBy.createLogic has cyclomatic complexity 44 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MapAsyncPartitioned.createLogic (cyclomatic 42) stream/src/main/scala/org/apache/pekko/stream/MapAsyncPartitioned.scala:87— MapAsyncPartitioned.createLogic has cyclomatic complexity 42 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
Decoder.createLogicAndMaterializedValue (cyclomatic 41) remote/src/main/scala/org/apache/pekko/remote/artery/Codecs.scala:380— Decoder.createLogicAndMaterializedValue has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ShardingProducerControllerImpl.active (cyclomatic 40) cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/delivery/internal/ShardingProducerControllerImpl.scala:302— ShardingProducerControllerImpl.active has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CatchupOrFirehose.createLogic (cyclomatic 40) persistence-query/src/main/scala/org/apache/pekko/persistence/query/typed/internal/EventsBySliceFirehose.scala:619— CatchupOrFirehose.createLogic has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ReplicatorBehavior.apply (cyclomatic 39) cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/internal/ReplicatorBehavior.scala:46— ReplicatorBehavior.apply has cyclomatic complexity 39 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
Batch.createLogic (cyclomatic 37) stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Ops.scala:1070— Batch.createLogic has cyclomatic complexity 37 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
EventWriter.apply (cyclomatic 36) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/EventWriter.scala:123— EventWriter.apply has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
QueueSource.createLogicAndMaterializedValue (cyclomatic 35) stream/src/main/scala/org/apache/pekko/stream/impl/QueueSource.scala:55— QueueSource.createLogicAndMaterializedValue has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ClusterCoreDaemon.receiveGossip (cyclomatic 32) cluster/src/main/scala/org/apache/pekko/cluster/ClusterDaemon.scala:1182— ClusterCoreDaemon.receiveGossip has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Delay.createLogic (cyclomatic 32) stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Ops.scala:2084— Delay.createLogic has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AggregateWithBoundary.createLogic (cyclomatic 31) stream/src/main/scala/org/apache/pekko/stream/impl/fusing/AggregateWithBoundary.scala:45— AggregateWithBoundary.createLogic has cyclomatic complexity 31 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
MapAsyncUnordered.createLogic (cyclomatic 31) stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Ops.scala:1515— MapAsyncUnordered.createLogic has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Split.createLogic (cyclomatic 31) stream/src/main/scala/org/apache/pekko/stream/impl/fusing/StreamOfStreams.scala:609— Split.createLogic has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MapAsync.createLogic (cyclomatic 30) stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Ops.scala:1369— MapAsync.createLogic has cyclomatic complexity 30 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
PhasedFusingActorMaterializer.materialize (cyclomatic 29) stream/src/main/scala/org/apache/pekko/stream/impl/PhasedFusingActorMaterializer.scala:486— PhasedFusingActorMaterializer.materialize has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ReplayFilter.receive (cyclomatic 28) persistence/src/main/scala/org/apache/pekko/persistence/journal/ReplayFilter.scala:80— ReplayFilter.receive has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Association.send (cyclomatic 28) remote/src/main/scala/org/apache/pekko/remote/artery/Association.scala:344— Association.send has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
UnfoldResourceSourceAsync.createLogic (cyclomatic 28) stream/src/main/scala/org/apache/pekko/stream/impl/UnfoldResourceSourceAsync.scala:44— UnfoldResourceSourceAsync.createLogic has cyclomatic complexity 28 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
GroupedWeightedWithin.createLogic (cyclomatic 28) stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Ops.scala:1899— GroupedWeightedWithin.createLogic has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BoundedSourceQueueStage.createLogicAndMaterializedValue (cyclomatic 27) stream/src/main/scala/org/apache/pekko/stream/impl/BoundedSourceQueue.scala:48— BoundedSourceQueueStage.createLogicAndMaterializedValue has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ActorRefSource.createLogicAndMaterializedValue (cyclomatic 26) stream/src/main/scala/org/apache/pekko/stream/impl/ActorRefSource.scala:50— ActorRefSource.createLogicAndMaterializedValue has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GroupedAdjacentByWeighted.createLogic (cyclomatic 26) stream/src/main/scala/org/apache/pekko/stream/impl/fusing/GroupedAdjacentByWeighted.scala:52— GroupedAdjacentByWeighted.createLogic has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DnsClient.ready (cyclomatic 25) actor/src/main/scala/org/apache/pekko/io/dns/internal/DnsClient.scala:99— DnsClient.ready has cyclomatic complexity 25 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
DDataShardCoordinator.waitingForUpdate (cyclomatic 25) cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ShardCoordinator.scala:1701— DDataShardCoordinator.waitingForUpdate has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Controller.receive (cyclomatic 25) multi-node-testkit/src/main/scala/org/apache/pekko/remote/testconductor/Conductor.scala:475— Controller.receive has cyclomatic complexity 25 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
SinkRefStageImpl.createLogicAndMaterializedValue (cyclomatic 25) stream/src/main/scala/org/apache/pekko/stream/impl/streamref/SinkRefImpl.scala:77— SinkRefStageImpl.createLogicAndMaterializedValue has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Association.attachOutboundStreamRestart (cyclomatic 24) remote/src/main/scala/org/apache/pekko/remote/artery/Association.scala:961— Association.attachOutboundStreamRestart has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
OutboundHandshake.createLogic (cyclomatic 24) remote/src/main/scala/org/apache/pekko/remote/artery/Handshake.scala:77— OutboundHandshake.createLogic has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ClusterReceptionist.receive (cyclomatic 23) cluster-tools/src/main/scala/org/apache/pekko/cluster/client/ClusterClient.scala:1032— ClusterReceptionist.receive has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Expand.createLogic (cyclomatic 23) stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Ops.scala:1229— Expand.createLogic has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Partition.createLogic (cyclomatic 23) stream/src/main/scala/org/apache/pekko/stream/scaladsl/Graph.scala:880— Partition.createLogic has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BroadcastHub.createLogicAndMaterializedValue (cyclomatic 23) stream/src/main/scala/org/apache/pekko/stream/scaladsl/Hub.scala:879— BroadcastHub.createLogicAndMaterializedValue has cyclomatic complexity 23 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
ActorCell.systemInvoke (cyclomatic 22) actor/src/main/scala/org/apache/pekko/actor/ActorCell.scala:489— ActorCell.systemInvoke has cyclomatic complexity 22 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
ClusterCoreDaemon.leaderActionsOnConvergence (cyclomatic 22) cluster/src/main/scala/org/apache/pekko/cluster/ClusterDaemon.scala:1461— ClusterCoreDaemon.leaderActionsOnConvergence has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Replicator.receiveUpdate (cyclomatic 22) distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/Replicator.scala:1677— Replicator.receiveUpdate has cyclomatic complexity 22 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
ReplayingEvents.onJournalResponse (cyclomatic 22) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/ReplayingEvents.scala:132— ReplayingEvents.onJournalResponse has cyclomatic complexity 22 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
ConsumerControllerImpl.waitingForConfirmation (cyclomatic 21) actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/internal/ConsumerControllerImpl.scala:553— ConsumerControllerImpl.waitingForConfirmation has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
VectorClock.compareOnlyTo (cyclomatic 21) cluster/src/main/scala/org/apache/pekko/cluster/VectorClock.scala:126— VectorClock.compareOnlyTo has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
QueueSink.createLogicAndMaterializedValue (cyclomatic 21) stream/src/main/scala/org/apache/pekko/stream/impl/Sinks.scala:299— QueueSink.createLogicAndMaterializedValue has cyclomatic complexity 21 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
FlatMapPrefix.createLogicAndMaterializedValue (cyclomatic 21) stream/src/main/scala/org/apache/pekko/stream/impl/fusing/FlatMapPrefix.scala:40— FlatMapPrefix.createLogicAndMaterializedValue has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TcpStreamLogic.connected (cyclomatic 21) stream/src/main/scala/org/apache/pekko/stream/impl/io/TcpStages.scala:354— TcpStreamLogic.connected has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DelimiterFramingStage.createLogic (cyclomatic 21) stream/src/main/scala/org/apache/pekko/stream/scaladsl/Framing.scala:222— DelimiterFramingStage.createLogic has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ConsumerControllerImpl.active (cyclomatic 20) actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/internal/ConsumerControllerImpl.scala:299— ConsumerControllerImpl.active has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LocalReceptionist.behavior (cyclomatic 20) actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/receptionist/LocalReceptionist.scala:162— LocalReceptionist.behavior has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LocalActorRefProvider.actorOf (cyclomatic 20) actor/src/main/scala/org/apache/pekko/actor/ActorRefProvider.scala:659— LocalActorRefProvider.actorOf has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ClusterCoreDaemon.joining (cyclomatic 20) cluster/src/main/scala/org/apache/pekko/cluster/ClusterDaemon.scala:851— ClusterCoreDaemon.joining has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: ClusterCoreDaemon.initialized (cyclomatic 22) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
EventsByPersistenceIdStage.createLogic (cyclomatic 20) persistence-query/src/main/scala/org/apache/pekko/persistence/query/journal/leveldb/EventsByPersistenceIdStage.scala:64— EventsByPersistenceIdStage.createLogic has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PersistingEvents.onJournalResponse (cyclomatic 20) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/Running.scala:790— PersistingEvents.onJournalResponse has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
VirtualProcessor.onNext (cyclomatic 20) stream/src/main/scala/org/apache/pekko/stream/impl/StreamLayout.scala:325— VirtualProcessor.onNext has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ConnectionSourceStage.createLogicAndMaterializedValue (cyclomatic 20) stream/src/main/scala/org/apache/pekko/stream/impl/io/TcpStages.scala:67— ConnectionSourceStage.createLogicAndMaterializedValue has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PekkoVersion.require (cyclomatic 19) actor/src/main/scala/org/apache/pekko/PekkoVersion.scala:40— PekkoVersion.require has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TcpConnection.doRead (cyclomatic 19) actor/src/main/scala/org/apache/pekko/io/TcpConnection.scala:263— TcpConnection.doRead has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
HashCode.hashArray (cyclomatic 19) actor/src/main/scala/org/apache/pekko/util/HashCode.scala:63— HashCode.hashArray has cyclomatic complexity 19 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
ShardCoordinator.receiveTerminated (cyclomatic 19) cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ShardCoordinator.scala:1092— ShardCoordinator.receiveTerminated has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MsgDecoder.decode0 (cyclomatic 19) multi-node-testkit/src/main/scala/org/apache/pekko/remote/testconductor/DataTypes.scala:157— MsgDecoder.decode0 has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RecoverWith.createLogic (cyclomatic 19) stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Ops.scala:2363— RecoverWith.createLogic has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
PartitionHub.createLogicAndMaterializedValue (cyclomatic 19) stream/src/main/scala/org/apache/pekko/stream/scaladsl/Hub.scala:1492— PartitionHub.createLogicAndMaterializedValue has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
TcpConnection.handleWriteMessages (cyclomatic 18) actor/src/main/scala/org/apache/pekko/io/TcpConnection.scala:159— TcpConnection.handleWriteMessages has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WrappedEventSourcedBehavior.onMessage (cyclomatic 18) persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/internal/PersistenceProbeImpl.scala:126— WrappedEventSourcedBehavior.onMessage has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
EventSourcedBehaviorImpl.apply (cyclomatic 18) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/EventSourcedBehaviorImpl.scala:135— EventSourcedBehaviorImpl.apply has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
ReliableDeliverySupervisor.gated (cyclomatic 18) remote/src/main/scala/org/apache/pekko/remote/Endpoint.scala:418— ReliableDeliverySupervisor.gated has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RemoteSystemDaemon.! (cyclomatic 18) remote/src/main/scala/org/apache/pekko/remote/RemoteDaemon.scala:169— RemoteSystemDaemon.! has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
VirtualProcessor.onError (cyclomatic 18) stream/src/main/scala/org/apache/pekko/stream/impl/StreamLayout.scala:256— VirtualProcessor.onError has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FoldAsync.createLogic (cyclomatic 18) stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Ops.scala:674— FoldAsync.createLogic has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MergePrioritized.createLogic (cyclomatic 18) stream/src/main/scala/org/apache/pekko/stream/scaladsl/Graph.scala:354— MergePrioritized.createLogic has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Balance.createLogic (cyclomatic 18) stream/src/main/scala/org/apache/pekko/stream/scaladsl/Graph.scala:1017— Balance.createLogic has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ConsumerControllerImpl.resending (cyclomatic 17) actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/internal/ConsumerControllerImpl.scala:434— ConsumerControllerImpl.resending has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CoordinatedShutdown.run (cyclomatic 17) actor/src/main/scala/org/apache/pekko/actor/CoordinatedShutdown.scala:715— CoordinatedShutdown.run has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Version.parse (cyclomatic 17) actor/src/main/scala/org/apache/pekko/util/Version.scala:56— Version.parse has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PassivationStrategy.describe (cyclomatic 17) cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ClusterShardingSettings.scala:785— PassivationStrategy.describe has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Shard.deliverMessage (cyclomatic 17) cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/Shard.scala:1050— Shard.deliverMessage has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: Shard.waitingForRememberEntitiesStore (cyclomatic 18) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
PersistentShardCoordinator.receiveRecover (cyclomatic 17) cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ShardCoordinator.scala:1405— PersistentShardCoordinator.receiveRecover has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ClusterSingletonProxy.receive (cyclomatic 17) cluster-tools/src/main/scala/org/apache/pekko/cluster/singleton/ClusterSingletonProxy.scala:278— ClusterSingletonProxy.receive has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
Replicator.receiveDeltaPropagation (cyclomatic 17) distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/Replicator.scala:2092— Replicator.receiveDeltaPropagation has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EndpointWriter.sendBufferedMessages (cyclomatic 17) remote/src/main/scala/org/apache/pekko/remote/Endpoint.scala:845— EndpointWriter.sendBufferedMessages has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RemoteActorRefProvider.actorOf (cyclomatic 17) remote/src/main/scala/org/apache/pekko/remote/RemoteActorRefProvider.scala:417— RemoteActorRefProvider.actorOf has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Buffer.createLogic (cyclomatic 17) stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Ops.scala:955— Buffer.createLogic has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
StatefulMapConcat.createLogic (cyclomatic 17) stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Ops.scala:2558— StatefulMapConcat.createLogic has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ActorPath.findInvalidPathElementCharPosition (cyclomatic 16) actor/src/main/scala/org/apache/pekko/actor/ActorPath.scala:127— ActorPath.findInvalidPathElementCharPosition has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ActorSelection.deliverSelection (cyclomatic 16) actor/src/main/scala/org/apache/pekko/actor/ActorSelection.scala:208— ActorSelection.deliverSelection has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ShardRegion.deliverMessage (cyclomatic 16) cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ShardRegion.scala:1288— ShardRegion.deliverMessage has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EventSourcedRememberEntitiesShardStore.receiveCommand (cyclomatic 16) cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/internal/EventSourcedRememberEntitiesShardStore.scala:102— EventSourcedRememberEntitiesShardStore.receiveCommand has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AdapterClusterImpl.subscriptionsBehavior (cyclomatic 16) cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/AdaptedClusterImpl.scala:41— AdapterClusterImpl.subscriptionsBehavior has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
MsgEncoder.encode0 (cyclomatic 16) multi-node-testkit/src/main/scala/org/apache/pekko/remote/testconductor/DataTypes.scala:96— MsgEncoder.encode0 has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
ReplayingSnapshot.createBehavior (cyclomatic 16) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/ReplayingSnapshot.scala:63— ReplayingSnapshot.createBehavior has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
Eventsourced.recoveryStarted (cyclomatic 16) persistence/src/main/scala/org/apache/pekko/persistence/Eventsourced.scala:636— Eventsourced.recoveryStarted has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
DefaultMessageDispatcher.dispatch (cyclomatic 16) remote/src/main/scala/org/apache/pekko/remote/Endpoint.scala:85— DefaultMessageDispatcher.dispatch has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: ReliableDeliverySupervisor.receive (cyclomatic 17) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
Association.setupIdleTimer (cyclomatic 16) remote/src/main/scala/org/apache/pekko/remote/artery/Association.scala:683— Association.setupIdleTimer has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
IterableConcat.createLogic (cyclomatic 16) stream/src/main/scala/org/apache/pekko/stream/impl/IterableConcat.scala:44— IterableConcat.createLogic has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
IslandTracking.wireOut (cyclomatic 16) stream/src/main/scala/org/apache/pekko/stream/impl/PhasedFusingActorMaterializer.scala:324— IslandTracking.wireOut has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
VirtualProcessor.onComplete (cyclomatic 16) stream/src/main/scala/org/apache/pekko/stream/impl/StreamLayout.scala:299— VirtualProcessor.onComplete has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ScanAsync.createLogic (cyclomatic 16) stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Ops.scala:482— ScanAsync.createLogic has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
FileSource.createLogicAndMaterializedValue (cyclomatic 16) stream/src/main/scala/org/apache/pekko/stream/impl/io/IOSources.scala:60— FileSource.createLogicAndMaterializedValue has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TLSActor.doInbound (cyclomatic 16) stream/src/main/scala/org/apache/pekko/stream/impl/io/TLSActor.scala:287— TLSActor.doInbound has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TlsGraphStage.createLogic (cognitive 307) stream/src/main/scala/org/apache/pekko/stream/impl/io/TlsGraphStage.scala:64— TlsGraphStage.createLogic has cognitive complexity 307 (threshold 15). Drivers by points: if/else 123 (176 pts), boolean chains 88, error handling 11 (25 pts), match/switch 10 (14 pts), loops 4 (nesting depth added 71). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProducerControllerImpl.active (cognitive 103) actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/internal/ProducerControllerImpl.scala:406— ProducerControllerImpl.active has cognitive complexity 103 (threshold 15). Drivers by points: if/else 68 (89 pts), boolean chains 13, match/switch 1 (nesting depth added 21). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
FlattenConcat.createLogic (cognitive 96) stream/src/main/scala/org/apache/pekko/stream/impl/fusing/FlattenConcat.scala:47— FlattenConcat.createLogic has cognitive complexity 96 (threshold 15). Drivers by points: if/else 51 (72 pts), boolean chains 12, match/switch 7 (10 pts), loops 1 (2 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WorkPullingProducerControllerImpl.active (cognitive 81) actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/internal/WorkPullingProducerControllerImpl.scala:302— WorkPullingProducerControllerImpl.active has cognitive complexity 81 (threshold 15). Drivers by points: if/else 34 (48 pts), match/switch 16 (24 pts), boolean chains 9 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ShardCoordinator.active (cognitive 80) cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ShardCoordinator.scala:739— ShardCoordinator.active has cognitive complexity 80 (threshold 15). Drivers by points: if/else 29 (58 pts), match/switch 8 (20 pts), boolean chains 2 (nesting depth added 41). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ClusterReceptionist.behavior (cognitive 79) cluster-typed/src/main/scala/org/apache/pekko/cluster/typed/internal/receptionist/ClusterReceptionist.scala:272— ClusterReceptionist.behavior has cognitive complexity 79 (threshold 15). Drivers by points: if/else 35 (68 pts), match/switch 5 (9 pts), boolean chains 2 (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EventWriter.apply (cognitive 77) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/EventWriter.scala:123— EventWriter.apply has cognitive complexity 77 (threshold 15). Drivers by points: if/else 24 (52 pts), match/switch 10 (24 pts), boolean chains 1 (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Decoder.createLogicAndMaterializedValue (cognitive 76) remote/src/main/scala/org/apache/pekko/remote/artery/Codecs.scala:380— Decoder.createLogicAndMaterializedValue has cognitive complexity 76 (threshold 15). Drivers by points: if/else 31 (53 pts), match/switch 7 (13 pts), boolean chains 6, error handling 4 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SystemMessageDelivery.createLogic (cognitive 73) remote/src/main/scala/org/apache/pekko/remote/artery/SystemMessageDelivery.scala:96— SystemMessageDelivery.createLogic has cognitive complexity 73 (threshold 15). Drivers by points: if/else 37 (56 pts), boolean chains 8, match/switch 6 (8 pts), loops 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SourceRefStageImpl.createLogicAndMaterializedValue (cognitive 72) stream/src/main/scala/org/apache/pekko/stream/impl/streamref/SourceRefImpl.scala:136— SourceRefStageImpl.createLogicAndMaterializedValue has cognitive complexity 72 (threshold 15). Drivers by points: if/else 32 (37 pts), match/switch 18 (32 pts), boolean chains 3 (nesting depth added 19). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
DistributedPubSubMediator.receive (cognitive 70) cluster-tools/src/main/scala/org/apache/pekko/cluster/pubsub/DistributedPubSubMediator.scala:613— DistributedPubSubMediator.receive has cognitive complexity 70 (threshold 15). Drivers by points: if/else 21 (40 pts), match/switch 8 (15 pts), loops 3 (12 pts), boolean chains 3 (nesting depth added 35). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
PekkoVersion.require (cognitive 62) actor/src/main/scala/org/apache/pekko/PekkoVersion.scala:40— PekkoVersion.require has cognitive complexity 62 (threshold 15). Drivers by points: if/else 14 (48 pts), match/switch 3 (13 pts), boolean chains 1 (nesting depth added 44). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
CatchupOrFirehose.createLogic (cognitive 60) persistence-query/src/main/scala/org/apache/pekko/persistence/query/typed/internal/EventsBySliceFirehose.scala:619— CatchupOrFirehose.createLogic has cognitive complexity 60 (threshold 15). Drivers by points: if/else 29 (47 pts), boolean chains 7, match/switch 5 (6 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GroupBy.createLogic (cognitive 60) stream/src/main/scala/org/apache/pekko/stream/impl/fusing/StreamOfStreams.scala:395— GroupBy.createLogic has cognitive complexity 60 (threshold 15). Drivers by points: if/else 35 (45 pts), boolean chains 8, loops 2 (3 pts), match/switch 2 (3 pts), error handling 1 (nesting depth added 12). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
MapAsyncPartitioned.createLogic (cognitive 55) stream/src/main/scala/org/apache/pekko/stream/MapAsyncPartitioned.scala:87— MapAsyncPartitioned.createLogic has cognitive complexity 55 (threshold 15). Drivers by points: if/else 23 (29 pts), match/switch 10 (18 pts), boolean chains 6, error handling 1, loops 1 (nesting depth added 14). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
FlattenMerge.createLogic (cognitive 55) stream/src/main/scala/org/apache/pekko/stream/impl/fusing/StreamOfStreams.scala:58— FlattenMerge.createLogic has cognitive complexity 55 (threshold 15). Drivers by points: if/else 32 (37 pts), match/switch 7 (11 pts), boolean chains 6, loops 1 (nesting depth added 9). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
PhasedFusingActorMaterializer.materialize (cognitive 53) stream/src/main/scala/org/apache/pekko/stream/impl/PhasedFusingActorMaterializer.scala:486— PhasedFusingActorMaterializer.materialize has cognitive complexity 53 (threshold 15). Drivers by points: if/else 16 (46 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Shard.deliverMessage (cognitive 52) cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/Shard.scala:1050— Shard.deliverMessage has cognitive complexity 52 (threshold 15). Drivers by points: if/else 15 (46 pts), match/switch 2 (5 pts), boolean chains 1 (nesting depth added 34). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Replicator.receiveDeltaPropagation (cognitive 51) distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/Replicator.scala:2092— Replicator.receiveDeltaPropagation has cognitive complexity 51 (threshold 15). Drivers by points: if/else 15 (43 pts), match/switch 2 (6 pts), error handling 1 (2 pts) (nesting depth added 33). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Association.send (cognitive 50) remote/src/main/scala/org/apache/pekko/remote/artery/Association.scala:344— Association.send has cognitive complexity 50 (threshold 15). Drivers by points: if/else 18 (35 pts), match/switch 4 (8 pts), boolean chains 5, error handling 1 (2 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Batch.createLogic (cognitive 50) stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Ops.scala:1070— Batch.createLogic has cognitive complexity 50 (threshold 15). Drivers by points: if/else 18 (23 pts), match/switch 5 (15 pts), error handling 5 (10 pts), boolean chains 2 (nesting depth added 20). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
GroupedWeightedWithin.createLogic (cognitive 50) stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Ops.scala:1899— GroupedWeightedWithin.createLogic has cognitive complexity 50 (threshold 15). Drivers by points: if/else 29 (43 pts), boolean chains 4, match/switch 1 (2 pts), error handling 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VectorClock.compareOnlyTo (cognitive 48) cluster/src/main/scala/org/apache/pekko/cluster/VectorClock.scala:126— VectorClock.compareOnlyTo has cognitive complexity 48 (threshold 15). Drivers by points: if/else 29 (45 pts), boolean chains 3 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DDataShardCoordinator.waitingForUpdate (cognitive 47) cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ShardCoordinator.scala:1701— DDataShardCoordinator.waitingForUpdate has cognitive complexity 47 (threshold 15). Drivers by points: if/else 26 (46 pts), match/switch 1 (nesting depth added 20). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ClusterCoreDaemon.receiveGossip (cognitive 46) cluster/src/main/scala/org/apache/pekko/cluster/ClusterDaemon.scala:1182— ClusterCoreDaemon.receiveGossip has cognitive complexity 46 (threshold 15). Drivers by points: if/else 20 (33 pts), boolean chains 7, match/switch 2 (5 pts), error handling 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BoundedSourceQueueStage.createLogicAndMaterializedValue (cognitive 46) stream/src/main/scala/org/apache/pekko/stream/impl/BoundedSourceQueue.scala:48— BoundedSourceQueueStage.createLogicAndMaterializedValue has cognitive complexity 46 (threshold 15). Drivers by points: if/else 24 (40 pts), match/switch 5, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VirtualProcessor.onNext (cognitive 46) stream/src/main/scala/org/apache/pekko/stream/impl/StreamLayout.scala:325— VirtualProcessor.onNext has cognitive complexity 46 (threshold 15). Drivers by points: if/else 14 (30 pts), error handling 3 (9 pts), match/switch 3 (7 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Split.createLogic (cognitive 46) stream/src/main/scala/org/apache/pekko/stream/impl/fusing/StreamOfStreams.scala:609— Split.createLogic has cognitive complexity 46 (threshold 15). Drivers by points: if/else 27 (37 pts), match/switch 4 (5 pts), boolean chains 3, error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ActorSelection.deliverSelection (cognitive 44) actor/src/main/scala/org/apache/pekko/actor/ActorSelection.scala:208— ActorSelection.deliverSelection has cognitive complexity 44 (threshold 15). Drivers by points: if/else 15 (36 pts), match/switch 2 (5 pts), boolean chains 3 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReplayFilter.receive (cognitive 44) persistence/src/main/scala/org/apache/pekko/persistence/journal/ReplayFilter.scala:80— ReplayFilter.receive has cognitive complexity 44 (threshold 15). Drivers by points: if/else 12 (26 pts), match/switch 4 (13 pts), loops 1 (3 pts), error handling 1 (2 pts) (nesting depth added 26). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ShardingProducerControllerImpl.active (cognitive 43) cluster-sharding-typed/src/main/scala/org/apache/pekko/cluster/sharding/typed/delivery/internal/ShardingProducerControllerImpl.scala:302— ShardingProducerControllerImpl.active has cognitive complexity 43 (threshold 15). Drivers by points: if/else 22 (32 pts), match/switch 8 (9 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Association.setupIdleTimer (cognitive 42) remote/src/main/scala/org/apache/pekko/remote/artery/Association.scala:683— Association.setupIdleTimer has cognitive complexity 42 (threshold 15). Drivers by points: if/else 10 (22 pts), match/switch 4 (18 pts), boolean chains 2 (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
SubscriberManagement.moreRequested (cognitive 42) stream/src/main/scala/org/apache/pekko/stream/impl/SubscriberManagement.scala:114— SubscriberManagement.moreRequested has cognitive complexity 42 (threshold 15). Drivers by points: if/else 14 (29 pts), match/switch 2 (7 pts), error handling 1 (5 pts), boolean chains 1 (nesting depth added 24). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Shard.entityTerminated (cognitive 41) cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/Shard.scala:913— Shard.entityTerminated has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (38 pts), match/switch 2 (3 pts) (nesting depth added 25). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ActorRefSource.createLogicAndMaterializedValue (cognitive 41) stream/src/main/scala/org/apache/pekko/stream/impl/ActorRefSource.scala:50— ActorRefSource.createLogicAndMaterializedValue has cognitive complexity 41 (threshold 15). Drivers by points: if/else 17 (23 pts), match/switch 5 (13 pts), boolean chains 4, error handling 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QueueSource.createLogicAndMaterializedValue (cognitive 41) stream/src/main/scala/org/apache/pekko/stream/impl/QueueSource.scala:55— QueueSource.createLogicAndMaterializedValue has cognitive complexity 41 (threshold 15). Drivers by points: if/else 17 (27 pts), match/switch 4 (7 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RestartSupervisor.aroundSignal (cognitive 40) actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/Supervision.scala:224— RestartSupervisor.aroundSignal has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (28 pts), match/switch 4 (9 pts), boolean chains 3 (nesting depth added 18). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
LocalActorRefProvider.actorOf (cognitive 40) actor/src/main/scala/org/apache/pekko/actor/ActorRefProvider.scala:659— LocalActorRefProvider.actorOf has cognitive complexity 40 (threshold 15). Drivers by points: if/else 17 (28 pts), match/switch 4 (8 pts), error handling 2 (4 pts) (nesting depth added 17). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ByteString.lastIndexOfSlice (cognitive 40) actor/src/main/scala/org/apache/pekko/util/ByteString.scala:2420— ByteString.lastIndexOfSlice has cognitive complexity 40 (threshold 15). Drivers by points: if/else 19 (36 pts), loops 1 (2 pts), match/switch 1 (2 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Delay.createLogic (cognitive 40) stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Ops.scala:2084— Delay.createLogic has cognitive complexity 40 (threshold 15). Drivers by points: if/else 17 (28 pts), boolean chains 8, match/switch 2 (3 pts), error handling 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IslandTracking.wireOut (cognitive 38) stream/src/main/scala/org/apache/pekko/stream/impl/PhasedFusingActorMaterializer.scala:324— IslandTracking.wireOut has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (34 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AggregateWithBoundary.createLogic (cognitive 38) stream/src/main/scala/org/apache/pekko/stream/impl/fusing/AggregateWithBoundary.scala:45— AggregateWithBoundary.createLogic has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (16 pts), match/switch 5 (13 pts), error handling 5 (8 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TcpConnection.doRead (cognitive 37) actor/src/main/scala/org/apache/pekko/io/TcpConnection.scala:263— TcpConnection.doRead has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (29 pts), match/switch 2 (5 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Version.parse (cognitive 37) actor/src/main/scala/org/apache/pekko/util/Version.scala:56— Version.parse has cognitive complexity 37 (threshold 15). Drivers by points: if/else 20 (27 pts), error handling 2 (7 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClusterCoreDaemon.joining (cognitive 37) cluster/src/main/scala/org/apache/pekko/cluster/ClusterDaemon.scala:851— ClusterCoreDaemon.joining has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (26 pts), match/switch 4 (10 pts), boolean chains 1 (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
RemoteActorRefProvider.actorOf (cognitive 37) remote/src/main/scala/org/apache/pekko/remote/RemoteActorRefProvider.scala:417— RemoteActorRefProvider.actorOf has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (18 pts), error handling 2 (9 pts), match/switch 4 (9 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnfoldResourceSourceAsync.createLogic (cognitive 37) stream/src/main/scala/org/apache/pekko/stream/impl/UnfoldResourceSourceAsync.scala:44— UnfoldResourceSourceAsync.createLogic has cognitive complexity 37 (threshold 15). Drivers by points: match/switch 14 (24 pts), if/else 8 (10 pts), error handling 1 (3 pts) (nesting depth added 14). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
MapAsyncUnordered.createLogic (cognitive 37) stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Ops.scala:1515— MapAsyncUnordered.createLogic has cognitive complexity 37 (threshold 15). Drivers by points: if/else 18 (28 pts), boolean chains 4, match/switch 4, error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SmallestMailboxRoutingLogic.selectNext (cognitive 36) actor/src/main/scala/org/apache/pekko/routing/SmallestMailbox.scala:64— SmallestMailboxRoutingLogic.selectNext has cognitive complexity 36 (threshold 15). Drivers by points: if/else 20 (35 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SinkRefStageImpl.createLogicAndMaterializedValue (cognitive 35) stream/src/main/scala/org/apache/pekko/stream/impl/streamref/SinkRefImpl.scala:77— SinkRefStageImpl.createLogicAndMaterializedValue has cognitive complexity 35 (threshold 15). Drivers by points: if/else 16 (22 pts), match/switch 8 (11 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Association.attachOutboundStreamRestart (cognitive 34) remote/src/main/scala/org/apache/pekko/remote/artery/Association.scala:961— Association.attachOutboundStreamRestart has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 8, match/switch 3 (6 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FlatMapPrefix.createLogicAndMaterializedValue (cognitive 34) stream/src/main/scala/org/apache/pekko/stream/impl/fusing/FlatMapPrefix.scala:40— FlatMapPrefix.createLogicAndMaterializedValue has cognitive complexity 34 (threshold 15). Drivers by points: if/else 20 (25 pts), match/switch 6, error handling 2, boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
GroupedAdjacentByWeighted.createLogic (cognitive 34) stream/src/main/scala/org/apache/pekko/stream/impl/fusing/GroupedAdjacentByWeighted.scala:52— GroupedAdjacentByWeighted.createLogic has cognitive complexity 34 (threshold 15). Drivers by points: if/else 19 (23 pts), match/switch 6, boolean chains 3, error handling 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Expand.createLogic (cognitive 34) stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Ops.scala:1229— Expand.createLogic has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (24 pts), error handling 4, boolean chains 3, match/switch 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MapAsync.createLogic (cognitive 34) stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Ops.scala:1369— MapAsync.createLogic has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (17 pts), match/switch 8 (13 pts), boolean chains 3, error handling 1 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
DelimiterFramingStage.createLogic (cognitive 34) stream/src/main/scala/org/apache/pekko/stream/scaladsl/Framing.scala:222— DelimiterFramingStage.createLogic has cognitive complexity 34 (threshold 15). Drivers by points: if/else 24 (29 pts), boolean chains 3, match/switch 2 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Partition.createLogic (cognitive 34) stream/src/main/scala/org/apache/pekko/stream/scaladsl/Graph.scala:880— Partition.createLogic has cognitive complexity 34 (threshold 15). Drivers by points: if/else 20 (29 pts), boolean chains 2, match/switch 1 (2 pts), error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Serialization.serializerFor (cognitive 33) actor/src/main/scala/org/apache/pekko/serialization/Serialization.scala:306— Serialization.serializerFor has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (22 pts), match/switch 4 (9 pts), boolean chains 2 (nesting depth added 17). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Controller.receive (cognitive 33) multi-node-testkit/src/main/scala/org/apache/pekko/remote/testconductor/Conductor.scala:475— Controller.receive has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 2 (8 pts), match/switch 4 (7 pts) (nesting depth added 18). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Balance.createLogic (cognitive 33) stream/src/main/scala/org/apache/pekko/stream/scaladsl/Graph.scala:1017— Balance.createLogic has cognitive complexity 33 (threshold 15). Drivers by points: if/else 19 (31 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CoordinatedShutdown.run (cognitive 32) actor/src/main/scala/org/apache/pekko/actor/CoordinatedShutdown.scala:715— CoordinatedShutdown.run has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (20 pts), match/switch 3 (7 pts), error handling 1 (4 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TcpConnection.handleWriteMessages (cognitive 32) actor/src/main/scala/org/apache/pekko/io/TcpConnection.scala:159— TcpConnection.handleWriteMessages has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (30 pts), boolean chains 1, match/switch 1 (nesting depth added 16). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
PersistingEvents.onJournalResponse (cognitive 32) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/Running.scala:790— PersistingEvents.onJournalResponse has cognitive complexity 32 (threshold 15). Drivers by points: if/else 17 (28 pts), boolean chains 3, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OutboundHandshake.createLogic (cognitive 32) remote/src/main/scala/org/apache/pekko/remote/artery/Handshake.scala:77— OutboundHandshake.createLogic has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (24 pts), match/switch 5 (7 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DnsClient.ready (cognitive 31) actor/src/main/scala/org/apache/pekko/io/dns/internal/DnsClient.scala:99— DnsClient.ready has cognitive complexity 31 (threshold 15). Drivers by points: match/switch 7 (16 pts), if/else 8 (15 pts) (nesting depth added 16). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ClusterCoreDaemon.leaderActionsOnConvergence (cognitive 31) cluster/src/main/scala/org/apache/pekko/cluster/ClusterDaemon.scala:1461— ClusterCoreDaemon.leaderActionsOnConvergence has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 9, loops 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LinearTraversalBuilder.append (cognitive 31) stream/src/main/scala/org/apache/pekko/stream/impl/TraversalBuilder.scala:958— LinearTraversalBuilder.append has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (21 pts), match/switch 3 (10 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ByteString.indexOfSlice (cognitive 30) actor/src/main/scala/org/apache/pekko/util/ByteString.scala:2330— ByteString.indexOfSlice has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (26 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LeastShardAllocationStrategy.rebalance (cognitive 30) cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/internal/LeastShardAllocationStrategy.scala:57— LeastShardAllocationStrategy.rebalance has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (26 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FoldAsync.createLogic (cognitive 30) stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Ops.scala:674— FoldAsync.createLogic has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (18 pts), match/switch 5 (9 pts), boolean chains 2, error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MergePrioritized.createLogic (cognitive 30) stream/src/main/scala/org/apache/pekko/stream/scaladsl/Graph.scala:354— MergePrioritized.createLogic has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ShardCoordinator.receiveTerminated (cognitive 29) cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ShardCoordinator.scala:1092— ShardCoordinator.receiveTerminated has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (20 pts), match/switch 3 (7 pts), boolean chains 2 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
SplitBrainResolverBase.tick (cognitive 29) cluster/src/main/scala/org/apache/pekko/cluster/sbr/SplitBrainResolver.scala:308— SplitBrainResolverBase.tick has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (20 pts), match/switch 3 (6 pts), boolean chains 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Replicator.receiveUpdate (cognitive 29) distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/Replicator.scala:1677— Replicator.receiveUpdate has cognitive complexity 29 (threshold 15). Drivers by points: match/switch 8 (15 pts), if/else 8 (13 pts), boolean chains 1 (nesting depth added 12). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
EndpointManager.handleInboundAssociation (cognitive 29) remote/src/main/scala/org/apache/pekko/remote/Remoting.scala:857— EndpointManager.handleInboundAssociation has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (19 pts), match/switch 4 (10 pts) (nesting depth added 16). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ArteryTransport.attachControlMessageObserver (cognitive 29) remote/src/main/scala/org/apache/pekko/remote/artery/ArteryTransport.scala:508— ArteryTransport.attachControlMessageObserver has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (19 pts), match/switch 4 (9 pts), error handling 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DaemonMsgCreateSerializer.fromBinary (cognitive 29) remote/src/main/scala/org/apache/pekko/remote/serialization/DaemonMsgCreateSerializer.scala:117— DaemonMsgCreateSerializer.fromBinary has cognitive complexity 29 (threshold 15). Drivers by points: if/else 22 (27 pts), loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
TLSActor.doInbound (cognitive 29) stream/src/main/scala/org/apache/pekko/stream/impl/io/TLSActor.scala:287— TLSActor.doInbound has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (18 pts), error handling 3 (7 pts), boolean chains 4 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LocalReceptionist.behavior (cognitive 28) actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/receptionist/LocalReceptionist.scala:162— LocalReceptionist.behavior has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (20 pts), match/switch 5 (8 pts) (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ClusterCoreDaemon.initJoin (cognitive 28) cluster/src/main/scala/org/apache/pekko/cluster/ClusterDaemon.scala:661— ClusterCoreDaemon.initJoin has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16 (26 pts), match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NettyTransport.associate (cognitive 28) remote/src/main/scala/org/apache/pekko/remote/transport/netty/NettyTransport.scala:579— NettyTransport.associate has cognitive complexity 28 (threshold 15). Drivers by points: loops 4 (14 pts), if/else 7 (12 pts), match/switch 1 (2 pts) (nesting depth added 16). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
StatefulMapConcat.createLogic (cognitive 28) stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Ops.scala:2558— StatefulMapConcat.createLogic has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16 (25 pts), match/switch 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Merge.createLogic (cognitive 28) stream/src/main/scala/org/apache/pekko/stream/scaladsl/Graph.scala:111— Merge.createLogic has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (21 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConsumerControllerImpl.active (cognitive 27) actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/internal/ConsumerControllerImpl.scala:299— ConsumerControllerImpl.active has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (24 pts), match/switch 2, boolean chains 1 (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ConsumerControllerImpl.waitingForConfirmation (cognitive 27) actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/internal/ConsumerControllerImpl.scala:553— ConsumerControllerImpl.waitingForConfirmation has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 2, match/switch 2 (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ShardRegion.deliverMessage (cognitive 27) cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ShardRegion.scala:1288— ShardRegion.deliverMessage has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (18 pts), match/switch 4 (8 pts), boolean chains 1 (nesting depth added 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
VirtualProcessor.onSubscribe (cognitive 27) stream/src/main/scala/org/apache/pekko/stream/impl/StreamLayout.scala:168— VirtualProcessor.onSubscribe has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (21 pts), match/switch 3 (6 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ParsingLogic.doParseInner (cognitive 27) stream/src/main/scala/org/apache/pekko/stream/impl/io/ByteStringParser.scala:61— ParsingLogic.doParseInner has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (23 pts), error handling 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Version.compareTo (cognitive 26) actor/src/main/scala/org/apache/pekko/util/Version.scala:156— Version.compareTo has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (24 pts), boolean chains 2 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ShardRegion.receiveCoordinatorMessage (cognitive 26) cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ShardRegion.scala:825— ShardRegion.receiveCoordinatorMessage has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (25 pts), match/switch 1 (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
DeltaPropagationSelector.collectPropagations (cognitive 26) distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/DeltaPropagationSelector.scala:79— DeltaPropagationSelector.collectPropagations has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (15 pts), match/switch 3 (11 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VirtualProcessor.onError (cognitive 26) stream/src/main/scala/org/apache/pekko/stream/impl/StreamLayout.scala:256— VirtualProcessor.onError has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (23 pts), match/switch 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TraversalBuilder.getValuePresentedSource (cognitive 26) stream/src/main/scala/org/apache/pekko/stream/impl/TraversalBuilder.scala:396— TraversalBuilder.getValuePresentedSource has cognitive complexity 26 (threshold 15). Drivers by points: match/switch 7 (14 pts), if/else 9 (12 pts) (nesting depth added 10). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
GraphInterpreter.execute (cognitive 26) stream/src/main/scala/org/apache/pekko/stream/impl/fusing/GraphInterpreter.scala:491— GraphInterpreter.execute has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (12 pts), error handling 3 (8 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CallingThreadDispatcher.runQueue (cognitive 26) testkit/src/main/scala/org/apache/pekko/testkit/CallingThreadDispatcher.scala:257— CallingThreadDispatcher.runQueue has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (19 pts), error handling 3 (6 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ShardRegion.register (cognitive 25) cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ShardRegion.scala:1132— ShardRegion.register has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ORMap.dryMergeDelta (cognitive 25) distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/ORMap.scala:406— ORMap.dryMergeDelta has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (14 pts), match/switch 6 (11 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Encoder.createLogicAndMaterializedValue (cognitive 25) remote/src/main/scala/org/apache/pekko/remote/artery/Codecs.scala:81— Encoder.createLogicAndMaterializedValue has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (14 pts), match/switch 6 (9 pts), boolean chains 1, error handling 1 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
FileSource.createLogicAndMaterializedValue (cognitive 25) stream/src/main/scala/org/apache/pekko/stream/impl/io/IOSources.scala:60— FileSource.createLogicAndMaterializedValue has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 3, error handling 2 (3 pts), match/switch 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ConnectionSourceStage.createLogicAndMaterializedValue (cognitive 25) stream/src/main/scala/org/apache/pekko/stream/impl/io/TcpStages.scala:67— ConnectionSourceStage.createLogicAndMaterializedValue has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (18 pts), match/switch 4 (5 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
PassivationStrategy.describe (cognitive 24) cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ClusterShardingSettings.scala:785— PassivationStrategy.describe has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (16 pts), match/switch 4 (8 pts) (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
EntityPassivationStrategy.apply (cognitive 24) cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/internal/EntityPassivationStrategy.scala:40— EntityPassivationStrategy.apply has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (23 pts), match/switch 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ClusterReceptionist.receive (cognitive 24) cluster-tools/src/main/scala/org/apache/pekko/cluster/client/ClusterClient.scala:1032— ClusterReceptionist.receive has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (20 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Replicator.initRemovedNodePruning (cognitive 24) distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/Replicator.scala:2535— Replicator.initRemovedNodePruning has cognitive complexity 24 (threshold 15). Drivers by points: match/switch 3 (12 pts), if/else 4 (7 pts), loops 2 (5 pts) (nesting depth added 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
MsgDecoder.decode0 (cognitive 24) multi-node-testkit/src/main/scala/org/apache/pekko/remote/testconductor/DataTypes.scala:157— MsgDecoder.decode0 has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (17 pts), match/switch 3 (7 pts) (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
EventSourcedProducerQueue.onCommand (cognitive 24) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/delivery/EventSourcedProducerQueue.scala:237— EventSourcedProducerQueue.onCommand has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (19 pts), match/switch 2 (5 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReplayingEvents.onJournalResponse (cognitive 24) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/ReplayingEvents.scala:132— ReplayingEvents.onJournalResponse has cognitive complexity 24 (threshold 15). Drivers by points: match/switch 6 (12 pts), if/else 6 (8 pts), error handling 3 (4 pts) (nesting depth added 9). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
TopHeavyHitters.fixHeap (cognitive 24) remote/src/main/scala/org/apache/pekko/remote/artery/compress/TopHeavyHitters.scala:275— TopHeavyHitters.fixHeap has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (24 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IslandTracking.wireIn (cognitive 24) stream/src/main/scala/org/apache/pekko/stream/impl/PhasedFusingActorMaterializer.scala:275— IslandTracking.wireIn has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TraversalBuilder.getSingleSource (cognitive 24) stream/src/main/scala/org/apache/pekko/stream/impl/TraversalBuilder.scala:359— TraversalBuilder.getSingleSource has cognitive complexity 24 (threshold 15). Drivers by points: match/switch 6 (13 pts), if/else 8 (11 pts) (nesting depth added 10). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
BroadcastHub.createLogicAndMaterializedValue (cognitive 24) stream/src/main/scala/org/apache/pekko/stream/scaladsl/Hub.scala:879— BroadcastHub.createLogicAndMaterializedValue has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 4 (5 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StashBufferImpl.interpretUnstashedMessages (cognitive 23) actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/StashBufferImpl.scala:189— StashBufferImpl.interpretUnstashedMessages has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (16 pts), match/switch 2 (4 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Mailboxes.lookupConfigurator (cognitive 23) actor/src/main/scala/org/apache/pekko/dispatch/Mailboxes.scala:214— Mailboxes.lookupConfigurator has cognitive complexity 23 (threshold 15). Drivers by points: match/switch 5 (12 pts), if/else 7 (11 pts) (nesting depth added 11). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
LineNumbers.readMethod (cognitive 23) actor/src/main/scala/org/apache/pekko/util/LineNumbers.scala:340— LineNumbers.readMethod has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (9 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EventsByPersistenceIdStage.createLogic (cognitive 23) persistence-query/src/main/scala/org/apache/pekko/persistence/query/journal/leveldb/EventsByPersistenceIdStage.scala:64— EventsByPersistenceIdStage.createLogic has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 8, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Firehose.detectSlowConsumers (cognitive 23) persistence-query/src/main/scala/org/apache/pekko/persistence/query/typed/internal/EventsBySliceFirehose.scala:260— Firehose.detectSlowConsumers has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EndpointWriter.sendBufferedMessages (cognitive 23) remote/src/main/scala/org/apache/pekko/remote/Endpoint.scala:845— EndpointWriter.sendBufferedMessages has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 4, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Slf4jLogger.receive (cognitive 23) slf4j/src/main/scala/org/apache/pekko/event/slf4j/Slf4jLogger.scala:80— Slf4jLogger.receive has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (18 pts), match/switch 3 (5 pts) (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
TLSActor.doOutbound (cognitive 23) stream/src/main/scala/org/apache/pekko/stream/impl/io/TLSActor.scala:322— TLSActor.doOutbound has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TopicImpl.onMessage (cognitive 22) actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/pubsub/TopicImpl.scala:90— TopicImpl.onMessage has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (21 pts), match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ActorPath.findInvalidPathElementCharPosition (cognitive 22) actor/src/main/scala/org/apache/pekko/actor/ActorPath.scala:127— ActorPath.findInvalidPathElementCharPosition has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 10, if/else 7 (9 pts), match/switch 1 (3 pts) (nesting depth added 4). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ReplicatorBehavior.apply (cognitive 22) cluster-typed/src/main/scala/org/apache/pekko/cluster/ddata/typed/internal/ReplicatorBehavior.scala:46— ReplicatorBehavior.apply has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 11 (18 pts), if/else 4 (nesting depth added 7). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ClusterCoreDaemon.leaderActions (cognitive 22) cluster/src/main/scala/org/apache/pekko/cluster/ClusterDaemon.scala:1369— ClusterCoreDaemon.leaderActions has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 1 (4 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GossipTargetSelector.randomNodesForFullGossip (cognitive 22) cluster/src/main/scala/org/apache/pekko/cluster/MembershipState.scala:260— GossipTargetSelector.randomNodesForFullGossip has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 6 (14 pts), if/else 4 (5 pts), boolean chains 3 (nesting depth added 9). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
StoringSnapshot.onSaveSnapshotResponse (cognitive 22) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/Running.scala:919— StoringSnapshot.onSaveSnapshotResponse has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (17 pts), match/switch 3 (5 pts) (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
DefaultMessageDispatcher.dispatch (cognitive 22) remote/src/main/scala/org/apache/pekko/remote/Endpoint.scala:85— DefaultMessageDispatcher.dispatch has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 4, match/switch 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Association.quarantine (cognitive 22) remote/src/main/scala/org/apache/pekko/remote/artery/Association.scala:551— Association.quarantine has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (19 pts), match/switch 2 (3 pts) (nesting depth added 14). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
QueueSink.createLogicAndMaterializedValue (cognitive 22) stream/src/main/scala/org/apache/pekko/stream/impl/Sinks.scala:299— QueueSink.createLogicAndMaterializedValue has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 5, match/switch 3, boolean chains 2 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MergeSequence.createLogic (cognitive 22) stream/src/main/scala/org/apache/pekko/stream/scaladsl/Graph.scala:1602— MergeSequence.createLogic has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 6 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BroadcastSinkLogic.onEvent (cognitive 22) stream/src/main/scala/org/apache/pekko/stream/scaladsl/Hub.scala:634— BroadcastSinkLogic.onEvent has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (19 pts), match/switch 2 (3 pts) (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
VirtualPathContainer.! (cognitive 21) actor/src/main/scala/org/apache/pekko/actor/ActorRef.scala:748— VirtualPathContainer.! has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 3 (6 pts) (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ActorSystemImpl.printTree (cognitive 21) actor/src/main/scala/org/apache/pekko/actor/ActorSystem.scala:1285— ActorSystemImpl.printTree has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (14 pts), match/switch 4 (7 pts) (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
MessageDispatcher.printActors (cognitive 21) actor/src/main/scala/org/apache/pekko/dispatch/AbstractDispatcher.scala:87— MessageDispatcher.printActors has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (8 pts), match/switch 2 (8 pts), loops 2 (5 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConsistentHashingRoutingLogic.select (cognitive 21) actor/src/main/scala/org/apache/pekko/routing/ConsistentHashing.scala:205— ConsistentHashingRoutingLogic.select has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (14 pts), match/switch 2 (5 pts), error handling 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ByteString.lastIndexOfSlice (cognitive 21) actor/src/main/scala/org/apache/pekko/util/ByteString.scala:2483— ByteString.lastIndexOfSlice has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClusterShardingHealthCheck.apply (cognitive 21) cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ClusterShardingHealthCheck.scala:90— ClusterShardingHealthCheck.apply has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 2 (5 pts), boolean chains 4 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GossipTargetSelector.multiDcGossipTargets (cognitive 21) cluster/src/main/scala/org/apache/pekko/cluster/MembershipState.scala:330— GossipTargetSelector.multiDcGossipTargets has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 2 (7 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Replicator.receiveFlushChanges (cognitive 21) distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/Replicator.scala:2029— Replicator.receiveFlushChanges has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 3 (4 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RemoteSystemDaemon.! (cognitive 21) remote/src/main/scala/org/apache/pekko/remote/RemoteDaemon.scala:169— RemoteSystemDaemon.! has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (10 pts), match/switch 5 (10 pts), error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InboundQuarantineCheck.createLogic (cognitive 21) remote/src/main/scala/org/apache/pekko/remote/artery/InboundQuarantineCheck.scala:37— InboundQuarantineCheck.createLogic has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 2, match/switch 2 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
SystemMessageAcker.createLogic (cognitive 21) remote/src/main/scala/org/apache/pekko/remote/artery/SystemMessageDelivery.scala:351— SystemMessageAcker.createLogic has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (17 pts), match/switch 3 (4 pts) (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
VirtualProcessor.onComplete (cognitive 21) stream/src/main/scala/org/apache/pekko/stream/impl/StreamLayout.scala:299— VirtualProcessor.onComplete has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 1, match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Buffer.createLogic (cognitive 21) stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Ops.scala:955— Buffer.createLogic has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (20 pts), match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RecoverWith.createLogic (cognitive 21) stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Ops.scala:2363— RecoverWith.createLogic has cognitive complexity 21 (threshold 15). Drivers by points: match/switch 4 (14 pts), if/else 6, boolean chains 1 (nesting depth added 10). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Interleave.createLogic (cognitive 21) stream/src/main/scala/org/apache/pekko/stream/scaladsl/Graph.scala:482— Interleave.createLogic has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (20 pts), match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AsyncDnsResolver.receive (cognitive 20) actor/src/main/scala/org/apache/pekko/io/dns/internal/AsyncDnsResolver.scala:99— AsyncDnsResolver.receive has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 4 (9 pts) (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
HashCode.hashArray (cognitive 20) actor/src/main/scala/org/apache/pekko/util/HashCode.scala:63— HashCode.hashArray has cognitive complexity 20 (threshold 15). Drivers by points: loops 9 (18 pts), if/else 1, match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Reachability.change (cognitive 20) cluster/src/main/scala/org/apache/pekko/cluster/Reachability.scala:132— Reachability.change has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 4, match/switch 2 (3 pts) (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
TypedEventsByPersistenceIdStage.createLogic (cognitive 20) persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/query/internal/TypedEventsByPersistenceIdStage.scala:45— TypedEventsByPersistenceIdStage.createLogic has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (11 pts), match/switch 4 (9 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HandlingCommands.onPublishedEvent (cognitive 20) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/Running.scala:396— HandlingCommands.onPublishedEvent has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LeveldbRecovery.replayMessages (cognitive 20) persistence/src/main/scala/org/apache/pekko/persistence/journal/leveldb/LeveldbRecovery.scala:47— LeveldbRecovery.replayMessages has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VirtualProcessor.subscribe (cognitive 20) stream/src/main/scala/org/apache/pekko/stream/impl/StreamLayout.scala:138— VirtualProcessor.subscribe has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (19 pts), match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TcpStreamLogic.connected (cognitive 20) stream/src/main/scala/org/apache/pekko/stream/impl/io/TcpStages.scala:354— TcpStreamLogic.connected has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 4, match/switch 1 (nesting depth added 5). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
EmptyLocalActorRef.specialHandle (cognitive 19) actor/src/main/scala/org/apache/pekko/actor/ActorRef.scala:665— EmptyLocalActorRef.specialHandle has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 3 (6 pts), boolean chains 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
State.callThrough (cognitive 19) actor/src/main/scala/org/apache/pekko/pattern/CircuitBreaker.scala:804— State.callThrough has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 2 (4 pts), error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ByteString2.indexOf (cognitive 19) actor/src/main/scala/org/apache/pekko/util/ByteString.scala:1277— ByteString2.indexOf has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (19 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrequencySketchUtil.debugString (cognitive 19) actor/src/main/scala/org/apache/pekko/util/FrequencySketch.scala:395— FrequencySketchUtil.debugString has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 4 (7 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ShardRegion.receiveCommand (cognitive 19) cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ShardRegion.scala:905— ShardRegion.receiveCommand has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
EventSourcedRememberEntitiesShardStore.receiveCommand (cognitive 19) cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/internal/EventSourcedRememberEntitiesShardStore.scala:102— EventSourcedRememberEntitiesShardStore.receiveCommand has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 1, match/switch 1 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
SharedMediaDriverSupport.startMediaDriver (cognitive 19) cluster/src/multi-jvm/scala/org/apache/pekko/cluster/SharedMediaDriverSupport.scala:45— SharedMediaDriverSupport.startMediaDriver has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), error handling 2 (5 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EventsByTagStage.createLogic (cognitive 19) persistence-query/src/main/scala/org/apache/pekko/persistence/query/journal/leveldb/EventsByTagStage.scala:65— EventsByTagStage.createLogic has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 4, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Firehose.logUpdateConsumerTracking (cognitive 19) persistence-query/src/main/scala/org/apache/pekko/persistence/query/typed/internal/EventsBySliceFirehose.scala:224— Firehose.logUpdateConsumerTracking has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SharedLeveldbStore.receive (cognitive 19) persistence/src/main/scala/org/apache/pekko/persistence/journal/leveldb/SharedLeveldbStore.scala:46— SharedLeveldbStore.receive has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (8 pts), match/switch 3 (6 pts), error handling 1 (3 pts), boolean chains 2 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
EndpointWriter.writeSend (cognitive 19) remote/src/main/scala/org/apache/pekko/remote/Endpoint.scala:965— EndpointWriter.writeSend has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), error handling 5, match/switch 2 (4 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IterableConcat.createLogic (cognitive 19) stream/src/main/scala/org/apache/pekko/stream/impl/IterableConcat.scala:44— IterableConcat.createLogic has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (14 pts), error handling 2 (3 pts), match/switch 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BroadcastSinkLogic.postStop (cognitive 19) stream/src/main/scala/org/apache/pekko/stream/scaladsl/Hub.scala:813— BroadcastSinkLogic.postStop has cognitive complexity 19 (threshold 15). Drivers by points: error handling 2 (7 pts), if/else 4 (6 pts), loops 2 (4 pts), match/switch 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CoordinatedShutdownTerminationWatcher.receive (cognitive 18) actor/src/main/scala/org/apache/pekko/actor/CoordinatedShutdown.scala:920— CoordinatedShutdownTerminationWatcher.receive has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 2 (5 pts), match/switch 2 (4 pts) (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Children.makeChild (cognitive 18) actor/src/main/scala/org/apache/pekko/actor/dungeon/Children.scala:279— Children.makeChild has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (7 pts), error handling 3 (6 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ShardRegion.receiveTerminated (cognitive 18) cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ShardRegion.scala:995— ShardRegion.receiveTerminated has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClusterCoreDaemon.reapUnreachableMembers (cognitive 18) cluster/src/main/scala/org/apache/pekko/cluster/ClusterDaemon.scala:1634— ClusterCoreDaemon.reapUnreachableMembers has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 8). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
LmdbDurableStore.init (cognitive 18) distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/DurableStore.scala:218— LmdbDurableStore.init has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), error handling 1 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ReliableDeliverySupervisor.gated (cognitive 18) remote/src/main/scala/org/apache/pekko/remote/Endpoint.scala:418— ReliableDeliverySupervisor.gated has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 1, match/switch 1 (nesting depth added 6). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
LruBoundedCache.getOrCompute (cognitive 18) remote/src/main/scala/org/apache/pekko/remote/artery/LruBoundedCache.scala:88— LruBoundedCache.getOrCompute has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EagerFutureSink.createLogicAndMaterializedValue (cognitive 18) stream/src/main/scala/org/apache/pekko/stream/impl/Sinks.scala:663— EagerFutureSink.createLogicAndMaterializedValue has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), match/switch 3, error handling 2, boolean chains 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Switch.createLogic (cognitive 18) stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Switch.scala:49— Switch.createLogic has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (14 pts), match/switch 3, boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
LengthFieldFramingStage.createLogic (cognitive 18) stream/src/main/scala/org/apache/pekko/stream/scaladsl/Framing.scala:399— LengthFieldFramingStage.createLogic has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PartitionHub.createLogicAndMaterializedValue (cognitive 18) stream/src/main/scala/org/apache/pekko/stream/scaladsl/Hub.scala:1492— PartitionHub.createLogicAndMaterializedValue has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), match/switch 4 (5 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AddressFromURIString.unapply (cognitive 17) actor/src/main/scala/org/apache/pekko/actor/Address.scala:191— AddressFromURIString.unapply has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Mailbox.processAllSystemMessages (cognitive 17) actor/src/main/scala/org/apache/pekko/dispatch/Mailbox.scala:314— Mailbox.processAllSystemMessages has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), error handling 2 (4 pts), boolean chains 2, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WithUdpSend.sendHandlers (cognitive 17) actor/src/main/scala/org/apache/pekko/io/WithUdpSend.scala:46— WithUdpSend.sendHandlers has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), error handling 1 (4 pts), match/switch 2 (4 pts) (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
DefaultOptimalSizeExploringResizer.updatedStats (cognitive 17) actor/src/main/scala/org/apache/pekko/routing/OptimalSizeExploringResizer.scala:212— DefaultOptimalSizeExploringResizer.updatedStats has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ClusterDeployer.parseConfig (cognitive 17) cluster/src/main/scala/org/apache/pekko/cluster/ClusterActorRefProvider.scala:98— ClusterDeployer.parseConfig has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Reachability.merge (cognitive 17) cluster/src/main/scala/org/apache/pekko/cluster/Reachability.scala:171— Reachability.merge has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 4 (9 pts), if/else 5 (8 pts) (nesting depth added 8). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Eventsourced.recoveryStarted (cognitive 17) persistence/src/main/scala/org/apache/pekko/persistence/Eventsourced.scala:636— Eventsourced.recoveryStarted has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (7 pts), error handling 4 (6 pts), match/switch 3, boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RemoteInstruments.deserializeRaw (cognitive 17) remote/src/main/scala/org/apache/pekko/remote/artery/RemoteInstrument.scala:291— RemoteInstruments.deserializeRaw has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), error handling 2 (5 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InboundCompression.runNextTableAdvertisement (cognitive 17) remote/src/main/scala/org/apache/pekko/remote/artery/compress/InboundCompressions.scala:523— InboundCompression.runNextTableAdvertisement has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), match/switch 3 (6 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ActorRefBackpressureSinkStage.createLogic (cognitive 17) stream/src/main/scala/org/apache/pekko/stream/impl/ActorRefBackpressureSinkStage.scala:41— ActorRefBackpressureSinkStage.createLogic has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 1, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LazySink.createLogicAndMaterializedValue (cognitive 17) stream/src/main/scala/org/apache/pekko/stream/impl/Sinks.scala:518— LazySink.createLogicAndMaterializedValue has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (11 pts), error handling 2 (4 pts), boolean chains 1, match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Flow.viaMat (cognitive 17) stream/src/main/scala/org/apache/pekko/stream/scaladsl/Flow.scala:86— Flow.viaMat has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (17 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LazyDispatch.drain (cognitive 17) stream/src/main/scala/org/apache/pekko/stream/stage/GraphStage.scala:425— LazyDispatch.drain has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, error handling 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ByteArrayIterator.++ (cognitive 16) actor/src/main/scala-2.13/org/apache/pekko/util/ByteIterator.scala:61— ByteArrayIterator.++ has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 6). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
AbstractProps.checkCreatorClosingOver (cognitive 16) actor/src/main/scala/org/apache/pekko/actor/AbstractProps.scala:58— AbstractProps.checkCreatorClosingOver has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
TaskDefinition.apply (cognitive 16) actor/src/main/scala/org/apache/pekko/actor/CoordinatedShutdown.scala:410— TaskDefinition.apply has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (6 pts), match/switch 5 (6 pts), error handling 2 (4 pts) (nesting depth added 5). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
FaultHandling.faultRecreate (cognitive 16) actor/src/main/scala/org/apache/pekko/actor/dungeon/FaultHandling.scala:92— FaultHandling.faultRecreate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (16 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CachingConfig.getPathEntry (cognitive 16) actor/src/main/scala/org/apache/pekko/dispatch/CachingConfig.scala:61— CachingConfig.getPathEntry has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), match/switch 4 (8 pts) (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
DomainName.parse (cognitive 16) actor/src/main/scala/org/apache/pekko/io/dns/internal/DomainName.scala:49— DomainName.parse has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ByteString.indexOfSlice (cognitive 16) actor/src/main/scala/org/apache/pekko/util/ByteString.scala:2380— ByteString.indexOfSlice has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LineNumbers.readAttributes (cognitive 16) actor/src/main/scala/org/apache/pekko/util/LineNumbers.scala:381— LineNumbers.readAttributes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Reflect.findMarker (cognitive 16) actor/src/main/scala/org/apache/pekko/util/Reflect.scala:190— Reflect.findMarker has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PersistentShardCoordinator.receiveRecover (cognitive 16) cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/ShardCoordinator.scala:1405— PersistentShardCoordinator.receiveRecover has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 2 (3 pts) (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
PayloadSizeAggregator.updatePayloadSize (cognitive 16) distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/PayloadSizeAggregator.scala:33— PayloadSizeAggregator.updatePayloadSize has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Replicator.receiveDelete (cognitive 16) distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/Replicator.scala:1854— Replicator.receiveDelete has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 2 (4 pts) (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Replicator.receiveGossip (cognitive 16) distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/Replicator.scala:2313— Replicator.receiveGossip has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EventsByPersistenceIdStage.createLogic (cognitive 16) persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/query/internal/EventsByPersistenceIdStage.scala:37— EventsByPersistenceIdStage.createLogic has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), match/switch 3 (6 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Running.startReplicationStream (cognitive 16) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/Running.scala:138— Running.startReplicationStream has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), match/switch 3 (6 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArteryAeronUdpTransport.startAeron (cognitive 16) remote/src/main/scala/org/apache/pekko/remote/artery/aeron/ArteryAeronUdpTransport.scala:184— ArteryAeronUdpTransport.startAeron has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 pts), match/switch 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WrappedSubscription.request (cognitive 16) stream/src/main/scala/org/apache/pekko/stream/impl/StreamLayout.scala:412— WrappedSubscription.request has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FutureFlow.createLogicAndMaterializedValue (cognitive 16) stream/src/main/scala/org/apache/pekko/stream/impl/fusing/FutureFlow.scala:48— FutureFlow.createLogicAndMaterializedValue has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), match/switch 4, error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
GraphInterpreter.processEvent (cognitive 16) stream/src/main/scala/org/apache/pekko/stream/impl/fusing/GraphInterpreter.scala:645— GraphInterpreter.processEvent has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (16 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IteratorSource.createLogic (cognitive 16) stream/src/main/scala/org/apache/pekko/stream/impl/fusing/IteratorSource.scala:41— IteratorSource.createLogic has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), error handling 2 (3 pts), match/switch 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MapConcat.createLogic (cognitive 16) stream/src/main/scala/org/apache/pekko/stream/impl/fusing/MapConcat.scala:45— MapConcat.createLogic has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InputStreamAdapter.read (cognitive 16) stream/src/main/scala/org/apache/pekko/stream/impl/io/InputStreamSinkStage.scala:157— InputStreamAdapter.read has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 2 (7 pts), if/else 4 (5 pts), error handling 1 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MergeHub.createLogicAndMaterializedValue (cognitive 16) stream/src/main/scala/org/apache/pekko/stream/scaladsl/Hub.scala:367— MergeHub.createLogicAndMaterializedValue has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (13 pts), match/switch 2, boolean chains 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
RestartWithBackoffLogic.logIt (cognitive 16) stream/src/main/scala/org/apache/pekko/stream/scaladsl/RestartFlow.scala:227— RestartWithBackoffLogic.logIt has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 3 (9 pts), if/else 5 (7 pts) (nesting depth added 8). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ClassTooLong: MiscMessageSerializer remote/src/main/scala/org/apache/pekko/remote/serialization/MiscMessageSerializer.scala:43— ClassTooLong — 493 significant lines (blank, comment-only and punctuation-only lines excluded), 65 methods. The bar is 400 significant lines; this is 93 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Near-duplicate member pair (26 shared lines) stream/src/main/scala/org/apache/pekko/stream/scaladsl/Hub.scala:880— stream/src/main/scala/org/apache/pekko/stream/scaladsl/Hub.scala:880-992 | stream/src/main/scala/org/apache/pekko/stream/scaladsl/Hub.scala:1493-1574 — These two members are variants of one another: 26 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Edited copy of a member (16 corresponding lines) · ×1
Edited copy of a member (16 corresponding lines) actor/src/main/scala/org/apache/pekko/util/ByteString.scala:370— actor/src/main/scala/org/apache/pekko/util/ByteString.scala:370-385 | actor/src/main/scala/org/apache/pekko/util/ByteString.scala:784-799 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (10 corresponding lines) · ×1
Edited copy of a member (10 corresponding lines) actor/src/main/scala/org/apache/pekko/util/ByteString.scala:359— actor/src/main/scala/org/apache/pekko/util/ByteString.scala:359-368 | actor/src/main/scala/org/apache/pekko/util/ByteString.scala:804-813 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (5 members, 50+ identical tokens) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/CommandHandler.scala:150— persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/CommandHandler.scala:150-163 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/CommandHandlerWithReply.scala:160-173 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/EventHandler.scala:151-164 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/CommandHandler.scala:153-166 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/CommandHandlerWithReply.scala:161-174 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Duplicated block (81 lines × 2) serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala:333— serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala:333-413 | serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonSerializer.scala:334-414 — before extracting anything, compare `serialization-jackson/src/main/scala/org/apache/pekko/serialization/jackson/JacksonSerializer.scala` and `serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonSerializer.scala` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 304 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (51 lines × 2) stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Ops.scala:1672— stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Ops.scala:1672-1722 | stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Ops.scala:1793-1843 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Ops.scala:1672` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (48 lines × 2) bench-jmh/src/main/scala/org/apache/pekko/actor/AffinityPoolComparativeBenchmark.scala:52— bench-jmh/src/main/scala/org/apache/pekko/actor/AffinityPoolComparativeBenchmark.scala:52-99 | bench-jmh/src/main/scala/org/apache/pekko/actor/AffinityPoolRequestResponseBenchmark.scala:56-103 — before extracting anything, compare `bench-jmh/src/main/scala/org/apache/pekko/actor/AffinityPoolComparativeBenchmark.scala` and `bench-jmh/src/main/scala/org/apache/pekko/actor/AffinityPoolRequestResponseBenchmark.scala` as WHOLE FILES: 87% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (44 lines × 2) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/Running.scala:304— persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/Running.scala:304-347 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/Running.scala:139-182 — before extracting anything, compare `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/Running.scala` and `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/Running.scala` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/Running.scala:304` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (38 lines × 3) cluster/src/main/scala/org/apache/pekko/cluster/VectorClock.scala:132— cluster/src/main/scala/org/apache/pekko/cluster/VectorClock.scala:132-169 | distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/VersionVector.scala:201-238 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/VersionVector.scala:156-193 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `cluster/src/main/scala/org/apache/pekko/cluster/VectorClock.scala:132` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `nt1` to `(Node, Long)` in one and `(UniqueAddress, Long)` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (38 lines × 2) distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/ORSet.scala:224— distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/ORSet.scala:224-261 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/crdt/ORSet.scala:191-228 — before extracting anything, compare `distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/ORSet.scala` and `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/crdt/ORSet.scala` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 144 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/ORSet.scala:224` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (31 lines × 2) persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/internal/PersistenceProbeImpl.scala:345— persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/internal/PersistenceProbeImpl.scala:345-375 | persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/internal/PersistenceProbeImpl.scala:424-454 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/internal/PersistenceProbeImpl.scala:345` 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 (26 lines × 2) remote/src/main/scala/org/apache/pekko/remote/artery/aeron/ArteryAeronUdpTransport.scala:396— remote/src/main/scala/org/apache/pekko/remote/artery/aeron/ArteryAeronUdpTransport.scala:396-421 | remote/src/main/scala/org/apache/pekko/remote/artery/tcp/ArteryTcpTransport.scala:434-459 — 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 (23 lines × 3) stream/src/main/scala/org/apache/pekko/stream/MapAsyncPartitioned.scala:115— stream/src/main/scala/org/apache/pekko/stream/MapAsyncPartitioned.scala:115-137 | stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Ops.scala:1377-1399 | stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Ops.scala:1529-1551 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (19–20 lines × 2) stream/src/main/scala/org/apache/pekko/stream/impl/fusing/GraphStages.scala:456— stream/src/main/scala/org/apache/pekko/stream/impl/fusing/GraphStages.scala:456-475 | stream/src/main/scala/org/apache/pekko/stream/impl/fusing/GraphStages.scala:507-525 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `stream/src/main/scala/org/apache/pekko/stream/impl/fusing/GraphStages.scala:456` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16–20 lines × 2) stream/src/main/scala/org/apache/pekko/stream/impl/io/TLSActor.scala:441— stream/src/main/scala/org/apache/pekko/stream/impl/io/TLSActor.scala:441-456 | stream/src/main/scala/org/apache/pekko/stream/impl/io/TlsGraphStage.scala:459-478 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `stream/src/main/scala/org/apache/pekko/stream/impl/io/TLSActor.scala:441` 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 (19 lines × 2) serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonObjectMapperProvider.scala:109— serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonObjectMapperProvider.scala:109-127 | serialization-jackson3/src/main/scala/org/apache/pekko/serialization/jackson3/JacksonObjectMapperProvider.scala:181-199 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17–18 lines × 2) persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/internal/PersistenceProbeImpl.scala:200— persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/internal/PersistenceProbeImpl.scala:200-217 | persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/internal/PersistenceProbeImpl.scala:289-305 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `persistence-testkit/src/main/scala/org/apache/pekko/persistence/testkit/internal/PersistenceProbeImpl.scala:200` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16–17 lines × 2) cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/internal/EventSourcedRememberEntitiesCoordinatorStore.scala:111— cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/internal/EventSourcedRememberEntitiesCoordinatorStore.scala:111-126 | cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/internal/EventSourcedRememberEntitiesShardStore.scala:146-162 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/internal/EventSourcedRememberEntitiesCoordinatorStore.scala:111` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–17 lines × 2) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/EventSourcedBehaviorImpl.scala:146— persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/EventSourcedBehaviorImpl.scala:146-159 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/DurableStateBehaviorImpl.scala:103-119 — before extracting anything, compare `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/EventSourcedBehaviorImpl.scala` and `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/internal/DurableStateBehaviorImpl.scala` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/internal/EventSourcedBehaviorImpl.scala:146` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12–14 lines × 2) stream/src/main/scala/org/apache/pekko/stream/impl/IterableConcat.scala:78— stream/src/main/scala/org/apache/pekko/stream/impl/IterableConcat.scala:78-89 | stream/src/main/scala/org/apache/pekko/stream/impl/fusing/IteratorSource.scala:52-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 `stream/src/main/scala/org/apache/pekko/stream/impl/IterableConcat.scala:78` 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–14 lines × 2) stream/src/main/scala/org/apache/pekko/stream/impl/Sinks.scala:208— stream/src/main/scala/org/apache/pekko/stream/impl/Sinks.scala:208-220 | stream/src/main/scala/org/apache/pekko/stream/impl/Sinks.scala:257-270 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `stream/src/main/scala/org/apache/pekko/stream/impl/Sinks.scala:208` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12 lines × 5) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/CommandHandler.scala:152— persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/CommandHandler.scala:152-163 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/CommandHandlerWithReply.scala:162-173 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/EventHandler.scala:153-164 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/CommandHandler.scala:155-166 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/CommandHandlerWithReply.scala:163-174 — before extracting anything, compare `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/CommandHandler.scala` and `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/CommandHandlerWithReply.scala` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (12 lines × 3) actor/src/main/scala/org/apache/pekko/util/ByteString.scala:1854— actor/src/main/scala/org/apache/pekko/util/ByteString.scala:1854-1865 | actor/src/main/scala/org/apache/pekko/util/ByteString.scala:1880-1891 | actor/src/main/scala/org/apache/pekko/util/ByteString.scala:1906-1917 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `actor/src/main/scala/org/apache/pekko/util/ByteString.scala:1854` 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–10 lines × 2) actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/internal/ProducerControllerImpl.scala:149— actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/internal/ProducerControllerImpl.scala:149-157 | actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/internal/ProducerControllerImpl.scala:183-192 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `actor-typed/src/main/scala/org/apache/pekko/actor/typed/delivery/internal/ProducerControllerImpl.scala:149` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (4–5 lines × 4) actor/src/main/scala-2.13/org/apache/pekko/util/ByteIterator.scala:624— actor/src/main/scala-2.13/org/apache/pekko/util/ByteIterator.scala:624-627 | actor/src/main/scala-2.13/org/apache/pekko/util/ByteIterator.scala:634-638 | actor/src/main/scala-3/org/apache/pekko/util/ByteIterator.scala:620-623 | actor/src/main/scala-3/org/apache/pekko/util/ByteIterator.scala:630-634 — before extracting anything, compare `actor/src/main/scala-2.13/org/apache/pekko/util/ByteIterator.scala` and `actor/src/main/scala-3/org/apache/pekko/util/ByteIterator.scala` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `actor/src/main/scala-2.13/org/apache/pekko/util/ByteIterator.scala:624` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (171 lines × 2) actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/SystemMessage.scala:31— actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/SystemMessage.scala:31-201 | actor/src/main/scala/org/apache/pekko/dispatch/sysmsg/SystemMessage.scala:35-209 — before extracting anything, compare `actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/SystemMessage.scala` and `actor/src/main/scala/org/apache/pekko/dispatch/sysmsg/SystemMessage.scala` as WHOLE FILES: 84% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/SystemMessage.scala:31` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (157 lines × 2) actor-typed/src/main/scala/org/apache/pekko/actor/typed/javadsl/TimerScheduler.scala:89— actor-typed/src/main/scala/org/apache/pekko/actor/typed/javadsl/TimerScheduler.scala:89-245 | actor-typed/src/main/scala/org/apache/pekko/actor/typed/scaladsl/TimerScheduler.scala:89-245 — `actor-typed/src/main/scala/org/apache/pekko/actor/typed/javadsl/TimerScheduler.scala` and `actor-typed/src/main/scala/org/apache/pekko/actor/typed/scaladsl/TimerScheduler.scala` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 1 separate duplicated blocks between them, totalling at least 157 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (56 lines × 2) persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/SignalHandler.scala:26— persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/SignalHandler.scala:26-81 | persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/SignalHandler.scala:26-81 — before extracting anything, compare `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/SignalHandler.scala` and `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/SignalHandler.scala` as WHOLE FILES: 93% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/javadsl/SignalHandler.scala:26` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (7 lines × 4) actor/src/main/scala/org/apache/pekko/dispatch/Mailbox.scala:433— actor/src/main/scala/org/apache/pekko/dispatch/Mailbox.scala:433-439 | actor/src/main/scala/org/apache/pekko/dispatch/Mailbox.scala:467-473 | bench-jmh/src/main/scala/org/apache/pekko/actor/JCToolsMailbox.scala:61-67 | bench-jmh/src/main/scala/org/apache/pekko/actor/ManyToOneArrayMailbox.scala:75-81 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (7 lines × 5) cluster-metrics/src/main/scala/org/apache/pekko/cluster/metrics/protobuf/MessageSerializer.scala:78— cluster-metrics/src/main/scala/org/apache/pekko/cluster/metrics/protobuf/MessageSerializer.scala:78-84 | cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/protobuf/ClusterShardingMessageSerializer.scala:635-641 | cluster-tools/src/main/scala/org/apache/pekko/cluster/pubsub/protobuf/DistributedPubSubMessageSerializer.scala:90-96 | cluster/src/main/scala/org/apache/pekko/cluster/protobuf/ClusterMessageSerializer.scala:129-135 | distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/protobuf/SerializationSupport.scala:67-73 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times.
Duplicated block (6 lines × 6) cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/protobuf/ClusterShardingMessageSerializer.scala:332— cluster-sharding/src/main/scala/org/apache/pekko/cluster/sharding/protobuf/ClusterShardingMessageSerializer.scala:332-337 | cluster-tools/src/main/scala/org/apache/pekko/cluster/client/protobuf/ClusterClientMessageSerializer.scala:81-86 | cluster-tools/src/main/scala/org/apache/pekko/cluster/pubsub/protobuf/DistributedPubSubMessageSerializer.scala:83-88 | cluster-tools/src/main/scala/org/apache/pekko/cluster/singleton/protobuf/ClusterSingletonMessageSerializer.scala:76-81 | distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/protobuf/ReplicatedDataSerializer.scala:411-416 | distributed-data/src/main/scala/org/apache/pekko/cluster/ddata/protobuf/ReplicatorMessageSerializer.scala:266-271 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 6 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 6 times.
M1 · Documentation (README)· README may be stale · ×1
README may be stale — 841 code files changed in the last 6 months but the README was not touched — it may no longer reflect the system.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 105 significant file(s) lose their only recent owner: stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Ops.scala, stream/src/main/scala/org/apache/pekko/stream/stage/GraphStage.scala, stream/src/main/scala/org/apache/pekko/stream/scaladsl/Graph.scala, stream/src/main/scala/org/apache/pekko/stream/scaladsl/Hub.scala, cluster-tools/src/main/scala/org/apache/pekko/cluster/singleton/ClusterSingletonManager.scala, stream/src/main/scala/org/apache/pekko/stream/impl/io/TlsGraphStage.scala, stream/src/main/scala/org/apache/pekko/stream/impl/fusing/GraphInterpreter.scala, stream/src/main/scala/org/apache/pekko/stream/impl/PhasedFusingActorMaterializer.scala (+97 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 18 significant file(s) lose their only recent owner: remote/src/main/scala/org/apache/pekko/remote/RemoteActorRefProvider.scala, remote/src/main/scala/org/apache/pekko/remote/artery/tcp/ArteryTcpTransport.scala, remote/src/main/scala/org/apache/pekko/remote/serialization/ArteryMessageSerializer.scala, remote/src/main/scala/org/apache/pekko/remote/serialization/DaemonMsgCreateSerializer.scala, stream/src/main/scala/org/apache/pekko/stream/impl/io/ByteStringParser.scala, persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/javadsl/Effect.scala, remote/src/main/scala/org/apache/pekko/remote/artery/tcp/ssl/RotatingKeysSSLEngineProvider.scala, actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/adapter/ActorContextAdapter.scala (+10 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 3 significant file(s) lose their only recent owner: cluster/src/main/scala/org/apache/pekko/cluster/ClusterHeartbeat.scala, actor/src/main/scala/org/apache/pekko/util/Version.scala, coordination/src/main/scala/org/apache/pekko/coordination/lease/LeaseHealthCheck.scala. Pair on, review, or document these before any departure.
ED3 · Event naming· Event not named in past tense · ×2
Event not named in past tense: RemotingErrorEvent remote/src/main/scala/org/apache/pekko/remote/RemotingLifecycleEvent.scala:94— `RemotingErrorEvent` is a present-participle name inside a persisted event ADT — it reads as an in-progress intent, not a fact that already happened. Its siblings are past-tense facts; name it for the event that occurred (e.g. `ItemAddedToShoppingCart`) so the event log records what happened.
Event not named in past tense: RemotingShutdownEvent remote/src/main/scala/org/apache/pekko/remote/RemotingLifecycleEvent.scala:87— `RemotingShutdownEvent` is a present-participle name inside a persisted event ADT — it reads as an in-progress intent, not a fact that already happened. Its siblings are past-tense facts; name it for the event that occurred (e.g. `ItemAddedToShoppingCart`) so the event log records what happened.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 1 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (127 single-owned of 909 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 909 of the 1311 production source files in this repository met that bar). They are anonymized user #4 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above.
D28 · Secrets (history)· Rotate the exposed credentials · ×1
REDACTED
D34 · Knowledge Freshness· Further orphaned files (smaller) · ×1
Further orphaned files (smaller) — 400 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: remote/src/main/scala/org/apache/pekko/remote/transport/TestTransport.scala, actor/src/main/scala/org/apache/pekko/routing/ConsistentHashing.scala, cluster/src/main/scala/org/apache/pekko/cluster/MembershipState.scala, actor-typed/src/main/scala/org/apache/pekko/actor/typed/receptionist/Receptionist.scala, actor-typed/src/main/scala/org/apache/pekko/actor/typed/scaladsl/package.scala, actor-typed/src/main/scala/org/apache/pekko/actor/typed/scaladsl/Behaviors.scala, actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/TestProbeImpl.scala, actor/src/main/scala/org/apache/pekko/io/SelectionHandler.scala (and 392 more) (420 orphaned of 909 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 909 of the 1311 production source files in this repository met that bar). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
D40 · Network Egress Confinement· No network policy · ×1
No network policy — No Kubernetes NetworkPolicy (or Cilium policy) found. Without one, every pod can talk to every other pod and reach out to the internet by default. Add a default-deny policy and open only the flows you need.
No seccomp profile — Workloads do not set a seccomp profile (RuntimeDefault or a Localhost profile). Seccomp blocks the syscalls a container never needs, shrinking the kernel attack surface a container escape would use.
No AppArmor/SELinux confinement — Workloads declare no AppArmor or SELinux profile. A mandatory-access-control profile confines what a compromised container can touch on the host, complementing seccomp's syscall filter.
No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
P4 · Deployment & Rollback· No rollback/health safety · ×1
No rollback/health safety — Deployment automation exists but no readiness/liveness probes, rolling-update strategy, lifecycle hooks or migration job were evidenced — a bad release is harder to detect and reverse.
Appendix B — Reproduction & audit trail
Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.
none (dependency manifest found, not scanned for vulnerabilities here)
—
none (dependency manifest found, not scanned for vulnerabilities here): not applicable — 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 (an sbt build (build.sbt) — not scanned yet).
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 1 file(s) — `docs/src/main/java-jdk-21/docs/actors/classical/OptimizedActorWithJava21.java` — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
runtime-hardening: not applicable — The repository ships application workloads but no cluster-governance resources (CRDs, admission webhooks, or a committed policy engine). Runtime threat-detection (Falco/Tetragon) and admission control (Kyverno/OPA-Gatekeeper/PodSecurity) are cluster-OPERATOR controls owned by the platform, not shipped by an application repo/chart — nothing for this repo to assess.
none (dependency manifest found, not scanned for vulnerabilities here)
—
none (dependency manifest found, not scanned for vulnerabilities here): not applicable — 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 (an sbt build (build.sbt) — not scanned yet).
0
—
Run 01a0e3e5-cba4-7329-994c-70dbec672c22 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 139 · Warnings: 983 · Recommendations: 17 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 27-09-2026 @ 17:24 UTC.
Downloadable artifacts
Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.