Public report — pulsar, published 29 Jul 2026. Concrete security findings (CVE IDs, secret matches, dependency versions) are hidden in this version; ask the repo owner for the full report.
Watchdog 29-07-2026 @ 16:31 UTC Public
Code Health Audit

Apache/pulsar

59% At Risk

Large · 450,492 LoC · rebuild ~6.3 person-years · weakest lens: Security (41%)

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

22/23dimensions tool-verifieddeterministic · confidence 1.0 · 1 LLM-assisted, advisory
1307findings with an exact file:lineof 1324 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
23/95dimensions across the health lenses450492 LoC — wide & deep

Executive summary

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

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

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

Most urgent: a critical security exposure was detected (see the Security & Compliance lens). Treat it as a priority regardless of the overall grade.

The area that most needs attention is Security (41%) — exposure to security and compliance incidents is elevated.

Leadership focus, highest impact first: 50 High finding(s) (Static Analysis (SAST)); 5 Secret finding(s) (Secrets (history)); 8 High IaC finding(s) (IaC & Container Security).

For scale: Large (~450,492 production lines); rebuilding it from scratch would take roughly ~6.3 person-years (~3–13 engineers). Approximate, ±~30%.

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

How the score is built — each lens's share of the headline Width is the lens's weight in the worst-heaviest fold (the weakest area pulls hardest); colour is that lens's own band. A lens fixes the score in proportion to its width.
Security 41% · 47% weightMaturity 72% · 26% weightReadiness 73% · 14% weightCode Health 74% · 8% weightArchitecture 97% · 4% weight

Raise Security 41 → 70 (the Healthy floor) ⇒ headline 59 → ~73.

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

599 finding(s) are new versus the previous scan (2026-07-20) — surfaced by this scheduled scan itself, no pull request required. Showing the first 100; the full set is in the report.

  • D1 · ServerCnx.handleProducer (cyclomatic 37) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
  • D1 · ServerCnx.handleSubscribe (cyclomatic 36) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
  • D1 · ServerCnx.channelInactive (cyclomatic 21) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
  • D1 · ServerCnx.handleConnect (cyclomatic 19) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
  • D1 · ServerCnx.handlePartitionMetadataRequest (cyclomatic 18) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
  • D2 · ServerCnx.handleProducer (cognitive 49) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
  • D2 · ServerCnx.handleSubscribe (cognitive 48) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
  • D2 · ServerCnx.handlePartitionMetadataRequest (cognitive 32) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
  • D2 · ServerCnx.authChallengeSuccessCallback (cognitive 27) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
  • D2 · ServerCnx.channelInactive (cognitive 24) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
  • D2 · ServerCnx.handleConnect (cognitive 22) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
  • D2 · ServerCnx.buildProducerAndAddTopic (cognitive 20) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
  • D2 · ServerCnx.getLargestBatchIndexWhenPossible (cognitive 19) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
  • D2 · ServerCnx.handleLookup (cognitive 19) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
  • D2 · BucketDelayedDeliveryTracker.selectMergedBuckets (cognitive 16) pulsar-broker/src/main/java/org/apache/pulsar/broker/delayed/bucket/BucketDelayedDeliveryTracker.java
  • D3 · FileTooLong: v2/PersistentTopics.java pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java
  • D3 · FileTooLong: impl/PersistentTopicsBase.java pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
  • D3 · FileTooLong: service/ServerCnx.java pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
  • D3 · FileTooLong: broker/ServiceConfiguration.java pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java
  • D3 · FileTooLong: impl/ManagedLedgerImpl.java managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java
  • D3 · FileTooLong: persistent/PersistentTopic.java pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
  • D3 · FileTooLong: v2/Namespaces.java pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java
  • D3 · FileTooLong: service/BrokerService.java pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java
  • D3 · FileTooLong: impl/ManagedCursorImpl.java managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java
  • D3 · FileTooLong: impl/NamespacesBase.java pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java
  • D3 · FileTooLong: impl/ConsumerImpl.java pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java
  • D3 · TooManyMethods: ServerCnx pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
  • D3 · FileTooLong: cli/CmdTopics.java pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdTopics.java
  • D3 · FileTooLong: internal/TopicsImpl.java pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/TopicsImpl.java
  • D3 · FileTooLong: cli/CmdNamespaces.java pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdNamespaces.java
  • D3 · FileTooLong: impl/ProducerImpl.java pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java
  • D3 · FileTooLong: protocol/Commands.java pulsar-common/src/main/java/org/apache/pulsar/common/protocol/Commands.java
  • D3 · FileTooLong: broker/PulsarService.java pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java
  • D3 · FileTooLong: cli/CmdTopicPolicies.java pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdTopicPolicies.java
  • D3 · FileTooLong: channel/ServiceUnitStateChannelImpl.java pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/channel/ServiceUnitStateChannelImpl.java
  • D3 · FileTooLong: internal/NamespacesImpl.java pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/NamespacesImpl.java
  • D3 · FileTooLong: api/ComponentImpl.java pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/ComponentImpl.java
  • D3 · FileTooLong: impl/ClientCnx.java pulsar-client/src/main/java/org/apache/pulsar/client/impl/ClientCnx.java
  • D3 · FileTooLong: namespace/NamespaceService.java pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java
  • D3 · FileTooLong: impl/ManagedLedgerFactoryImpl.java managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerFactoryImpl.java
  • D3 · FileTooLong: persistent/PersistentSubscription.java pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentSubscription.java
  • D3 · FileTooLong: impl/MultiTopicsConsumerImpl.java pulsar-client/src/main/java/org/apache/pulsar/client/impl/MultiTopicsConsumerImpl.java
  • D3 · FileTooLong: impl/ClustersBase.java pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/ClustersBase.java
  • D3 · FileTooLong: service/AbstractTopic.java pulsar-broker/src/main/java/org/apache/pulsar/broker/service/AbstractTopic.java
  • D3 · FileTooLong: impl/PulsarClientImpl.java pulsar-client/src/main/java/org/apache/pulsar/client/impl/PulsarClientImpl.java
  • D3 · FileTooLong: impl/PulsarZooKeeperClient.java pulsar-metadata/src/main/java/org/apache/pulsar/metadata/impl/PulsarZooKeeperClient.java
  • D3 · FileTooLong: impl/SimpleLoadManagerImpl.java pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/SimpleLoadManagerImpl.java
  • D3 · FileTooLong: cli/CmdFunctions.java pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java
  • D3 · FileTooLong: impl/ConsumerBase.java pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerBase.java
  • D3 · FileTooLong: persistent/PersistentDispatcherMultipleConsumers.java pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java
  • D3 · FileTooLong: internal/TopicPoliciesImpl.java pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/TopicPoliciesImpl.java
  • D3 · FileTooLong: web/PulsarWebResource.java pulsar-broker/src/main/java/org/apache/pulsar/broker/web/PulsarWebResource.java
  • D3 · FileTooLong: service/Consumer.java pulsar-broker/src/main/java/org/apache/pulsar/broker/service/Consumer.java
  • D3 · FileTooLong: nonpersistent/NonPersistentTopic.java pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentTopic.java
  • D3 · FileTooLong: instance/JavaInstanceRunnable.java pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/JavaInstanceRunnable.java
  • D3 · FileTooLong: persistent/PersistentDispatcherMultipleConsumersClassic.java pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumersClassic.java
  • D3 · FileTooLong: kubernetes/KubernetesRuntime.java pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/kubernetes/KubernetesRuntime.java
  • D3 · FileTooLong: zookeeper/MockZooKeeper.java testmocks/src/main/java/org/apache/zookeeper/MockZooKeeper.java
  • D3 · FileTooLong: v2/ScalableTopics.java pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/ScalableTopics.java
  • D3 · FileTooLong: impl/PendingAckHandleImpl.java pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/pendingack/impl/PendingAckHandleImpl.java
  • D3 · FileTooLong: scalable/ScalableTopicController.java pulsar-broker/src/main/java/org/apache/pulsar/broker/service/scalable/ScalableTopicController.java
  • D3 · FileTooLong: extensions/ExtensibleLoadManagerImpl.java pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/ExtensibleLoadManagerImpl.java
  • D3 · FileTooLong: impl/ModularLoadManagerImpl.java pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/ModularLoadManagerImpl.java
  • D3 · FileTooLong: server/ProxyConfiguration.java pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/ProxyConfiguration.java
  • D3 · FileTooLong: service/SystemTopicBasedTopicPoliciesService.java pulsar-broker/src/main/java/org/apache/pulsar/broker/service/SystemTopicBasedTopicPoliciesService.java
  • D3 · FileTooLong: utils/FunctionConfigUtils.java pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/FunctionConfigUtils.java
  • D3 · FileTooLong: bookkeeper/PulsarLedgerUnderreplicationManager.java pulsar-metadata/src/main/java/org/apache/pulsar/metadata/bookkeeper/PulsarLedgerUnderreplicationManager.java
  • D3 · FileTooLong: admin/AdminResource.java pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/AdminResource.java
  • D3 · FileTooLong: worker/WorkerConfig.java pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/worker/WorkerConfig.java
  • D3 · FileTooLong: server/ProxyConnection.java pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/ProxyConnection.java
  • D3 · FileTooLong: persistent/PersistentReplicator.java pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentReplicator.java
  • D3 · FileTooLong: impl/FunctionsBase.java pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/FunctionsBase.java
  • D3 · FileTooLong: admin/Topics.java pulsar-client-admin-api/src/main/java/org/apache/pulsar/client/admin/Topics.java
  • D3 · FileTooLong: impl/AbstractMetadataStore.java pulsar-metadata/src/main/java/org/apache/pulsar/metadata/impl/AbstractMetadataStore.java
  • D3 · FileTooLong: bucket/BucketDelayedDeliveryTracker.java pulsar-broker/src/main/java/org/apache/pulsar/broker/delayed/bucket/BucketDelayedDeliveryTracker.java
  • D3 · FileTooLong: worker/FunctionRuntimeManager.java pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/FunctionRuntimeManager.java
  • D3 · FileTooLong: impl/TopicTransactionBuffer.java pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/buffer/impl/TopicTransactionBuffer.java
  • D3 · FileTooLong: impl/TransactionMetaStoreHandler.java pulsar-client/src/main/java/org/apache/pulsar/client/impl/TransactionMetaStoreHandler.java
  • D3 · FileTooLong: authorization/PulsarAuthorizationProvider.java pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/PulsarAuthorizationProvider.java
  • D3 · FileTooLong: testclient/PerformanceProducer.java pulsar-testclient/src/main/java/org/apache/pulsar/testclient/PerformanceProducer.java
  • D3 · FileTooLong: functions/LocalRunner.java pulsar-functions/localrun/src/main/java/org/apache/pulsar/functions/LocalRunner.java
  • D3 · FileTooLong: worker/SchedulerManager.java pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/SchedulerManager.java
  • D3 · FileTooLong: admin/Commands.java jetty-upgrade/zookeeper-with-patched-admin/src/main/java/org/apache/zookeeper/server/admin/Commands.java
  • D3 · FileTooLong: protocol/PulsarDecoder.java pulsar-common/src/main/java/org/apache/pulsar/common/protocol/PulsarDecoder.java
  • D3 · FileTooLong: service/Producer.java pulsar-broker/src/main/java/org/apache/pulsar/broker/service/Producer.java
  • D3 · FileTooLong: v2/NonPersistentTopics.java pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/NonPersistentTopics.java
  • D3 · FileTooLong: cli/CmdSinks.java pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdSinks.java
  • D3 · FileTooLong: impl/BlobStoreManagedLedgerOffloader.java tiered-storage/jcloud/src/main/java/org/apache/bookkeeper/mledger/offload/jcloud/impl/BlobStoreManagedLedgerOffloader.java
  • D3 · FileTooLong: schema/BookkeeperSchemaStorage.java pulsar-broker/src/main/java/org/apache/pulsar/broker/service/schema/BookkeeperSchemaStorage.java
  • D3 · FileTooLong: impl/MessageImpl.java pulsar-client/src/main/java/org/apache/pulsar/client/impl/MessageImpl.java
  • D3 · FileTooLong: api/FunctionsImpl.java pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/FunctionsImpl.java
  • D3 · FileTooLong: scheduler/TransferShedder.java pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/scheduler/TransferShedder.java
  • D3 · FileTooLong: api/SinksImpl.java pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/SinksImpl.java
  • D3 · FileTooLong: prometheus/TopicStats.java pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/prometheus/TopicStats.java
  • D3 · FileTooLong: authorization/AuthorizationService.java pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/AuthorizationService.java
  • D3 · FileTooLong: resourcegroup/ResourceGroupService.java pulsar-broker/src/main/java/org/apache/pulsar/broker/resourcegroup/ResourceGroupService.java
  • D3 · FileTooLong: rest/TopicsBase.java pulsar-broker/src/main/java/org/apache/pulsar/broker/rest/TopicsBase.java
  • D3 · FileTooLong: worker/FunctionActioner.java pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/FunctionActioner.java
  • D3 · FileTooLong: service/TopicListService.java pulsar-broker/src/main/java/org/apache/pulsar/broker/service/TopicListService.java
  • D3 · FileTooLong: impl/SnapshotSegmentAbortedTxnProcessorImpl.java pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/buffer/impl/SnapshotSegmentAbortedTxnProcessorImpl.java

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 — €310,000–€1,500,000
Cost to rebuild€310,000–€1,500,000 (3.0–9.7 person-years (5,111–16,215 h), ~3–13 engineers)
Domain complexityStandard — harder problems cost more per line
Quality factor0.8× (at 59% quality) — the last 20% of quality is most of the work
Size & shapeLarge · effort split not classified (source measured from disk; the effort-tier breakdown is a C#-only syntax walk)

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

How we model this: boilerplate at a scaffolding rate + logic × domain Standard (×1.0) — standard service × a 0.8× 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 5 Secret finding(s) in Secrets (history) — start with broker.key-pk8.pem, broker.key.pem, ca.key.pem.
+6.6 pts · Low effort · Secrets (history)
2
Resolve the 50 High finding(s) in Static Analysis (SAST) — start with pulsar-ci.yaml (21), pulsar-ci-flaky.yaml (10), ci-go-functions.yaml (5).
+7.9 pts · Medium effort · Static Analysis (SAST)
3
Resolve the 8 High IaC finding(s) in IaC & Container Security — start with instances.tf (2), network.tf (2), Dockerfile.wolfi (2).
+2.7 pts · Low effort · IaC & Container Security

Diagnosis — what's actually going on

Value concentrated against a weak lens · High · Value at risk
This is a Large asset (~6.3 person-years to rebuild), and its weakest lens is Security at 41%. The operational and business risk on an asset this size concentrates there — that's where remediation buys the most protection.
Evidence: valuation: Large, ~6.3 person-years rebuild (450,492 LoC) · weakest lens: Security 41%
→ Direct remediation budget at Security first — highest risk-reduction per euro on an asset this size.
Highest-leverage move · Medium · Leverage
Of everything flagged, the best return on effort is: Resolve the 50 High finding(s) in Static Analysis (SAST) — start with pulsar-ci.yaml (21), pulsar-ci-flaky.yaml (10), ci-go-functions.yaml (5). The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ Resolve the 50 High finding(s) in Static Analysis (SAST) — start with pulsar-ci.yaml (21), pulsar-ci-flaky.yaml (10), ci-go-functions.yaml (5).
A velocity tax on every change · Medium · Economics
The code-quality signals (complexity, duplication, cohesion) average 7.1/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 complexity, D4 duplication, D6 cohesion: averaging 7.1/10 across the code-quality signals
→ Pay it down where churn is highest — the hotspots — not everywhere; that's where the tax is actually paid.

At a glance — Code Health · 74% · Strong

At a glance — Architecture · 97% · Exemplary

At a glance — Maturity · 72% · Strong

At a glance — Readiness · 73% · Strong

At a glance — Security · 41% · Weak · gated by D28, D29, D31, D36

Security & Compliance — OWASP Top-10 mapping

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

OWASP categoryFindingsSeverity
A03:2021 — Injection50High / Critical
A05:2021 — Security Misconfiguration17High / Critical
A02:2021 — Cryptographic Failures6High / Critical
A06:2021 — Vulnerable & Outdated Components5Medium

Roadmap

Begin by resolving the 50 high-priority static analysis findings, focusing first on the CI configuration files. Next, address the five secret history issues by removing exposed keys. Then, remediate the eight high-severity IaC and container security findings, prioritizing the main infrastructure and Docker files. Finally, improve documentation by adding a testing section to the root README and establishing an architecture decision record log.

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

Do thisHelpsEffortDimension
Resolve the 5 Secret finding(s) in Secrets (history) — start with broker.key-pk8.pem, broker.key.pem, ca.key.pem.+6.6 ptsLowSecrets (history)
Resolve the 50 High finding(s) in Static Analysis (SAST) — start with pulsar-ci.yaml (21), pulsar-ci-flaky.yaml (10), ci-go-functions.yaml (5).+7.9 ptsMediumStatic Analysis (SAST)
Resolve the 8 High IaC finding(s) in IaC & Container Security — start with instances.tf (2), network.tf (2), Dockerfile.wolfi (2).+2.7 ptsLowIaC & Container Security
Resolve the 1 Critical IaC finding(s) in IaC & Container Security — start with security.tf.+1.6 ptsLowIaC & Container Security
Resolve the 1 Build action pinned to a mutable branch finding(s) in Supply-chain Provenance & Signing.+1.6 ptsLowSupply-chain Provenance & Signing
Resolve the 4 Medium IaC finding(s) in IaC & Container Security — start with Dockerfile (2), network.tf, Dockerfile.wolfi.+1.3 ptsLowIaC & Container Security
Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history).+1.3 ptsLowSecrets (history)
Resolve the 1 PR-triggered workflow without a permissions block finding(s) in Supply-chain Provenance & Signing.+1.2 ptsLowSupply-chain Provenance & Signing

File quality

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

FileScoreBandWorst signal
docker/pulsar/Dockerfile.wolfi3.0SlopIaC & Container Security: High IaC: DS-0015
docker/pulsar/Dockerfile3.4SlopIaC & Container Security: High IaC: DS-0025
deployment/terraform-ansible/aws/network.tf3.7SlopIaC & Container Security: High IaC: AWS-0053
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java4.0MixedChange Coupling: Boundary-crossing change coupling: PersistentTopic.java ↔ HierarchyTopicPolicies.java
.github/workflows/pulsar-ci.yaml4.4MixedStatic Analysis (SAST): High: github-actions-mutable-action-tag
.github/workflows/pulsar-ci-flaky.yaml4.4MixedStatic Analysis (SAST): High: github-actions-mutable-action-tag
.github/workflows/ci-go-functions.yaml4.6MixedStatic Analysis (SAST): High: github-actions-mutable-action-tag
pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/NamespacesImpl.java4.8MixedChange Coupling: Boundary-crossing change coupling: NamespacesImpl.java ↔ CmdNamespaces.java
.github/workflows/codeql.yaml4.8MixedStatic Analysis (SAST): High: github-actions-mutable-action-tag
deployment/terraform-ansible/aws/security.tf4.8MixedIaC & Container Security: Critical IaC: AWS-0104
.github/actions/upload-coverage/action.yml5.1MixedStatic Analysis (SAST): High: github-actions-mutable-action-tag
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/TransactionsBase.java5.4MixedChange Coupling: Boundary-crossing change coupling: TransactionsBase.java ↔ CmdTransactions.java
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentSubscription.java5.5MixedCyclomatic Complexity: PersistentSubscription.getStatsAsync (cyclomatic 19)
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v3/Transactions.java5.8MixedChange Coupling: Boundary-crossing change coupling: Transactions.java ↔ CmdTransactions.java
.github/workflows/ci-gradle-cache-update.yaml5.8MixedStatic Analysis (SAST): High: github-actions-mutable-action-tag
.github/workflows/ci-gradle-dependency-submission.yaml5.8MixedStatic Analysis (SAST): High: github-actions-mutable-action-tag
deployment/terraform-ansible/aws/instances.tf5.8MixedIaC & Container Security: High IaC: AWS-0028
pulsar-function-go/go.mod5.9MixedOSV Dependency Vulnerabilities: Medium CVE: GO-2026-5046
pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/TransactionsImpl.java6.5MixedChange Coupling: Boundary-crossing change coupling: TransactionsImpl.java ↔ CmdTransactions.java
pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/FunctionConfigUtils.java7.0MixedCyclomatic Complexity: FunctionConfigUtils.convert (cyclomatic 70)

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. 22 of 23 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 1 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.6 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.

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

What we checked — 23 dimensions across the health lenses
D1D2D3D4D13D15D16D21D28D29D31D34D35D36D37D38M1M2M3M4P1P3P4

Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.

How to trust any code-health report — three questions
  1. Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 1307 of 1324 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
  2. Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
  3. Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.

This report answers yes to all three. That's the bar to hold any assessment to.

Tools & methods

The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.

MethodBacksVersionEvaluator
Roslyn static analysisComplexity, cohesion, coupling, dead code, API surface, layering5.3.0✓ deterministic
Native secret scannerHardcoded secrets / credentials1.0.0✓ deterministic
jscpdCode duplication✓ deterministic
Coverage (coverlet / dotnet-coverage)Line & branch coverage10.0.302✓ deterministic
NuGet / dotnetOutdated, vulnerable & deprecated dependencies10.0.302✓ deterministic
git / LibGit2SharpChurn hotspots, knowledge concentration, history2.43.0 · 0.31.0✓ deterministic
gitleaks · semgrep · trivy · checkovSecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3✓ deterministic
LLM (sampled · advisory)Documentation quality, ADR conformance, naming — sampled over a bounded sample; advisory, never a deterministic measurementLocal LLM◐ LLM · sampled · advisory

Every finding is locatable in findings.md. Run 019faeb7-2eb5-7a35-9e7c-e5b429711bcd.

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

Run transparency — what happened this run

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

  • D19 Documentation Quality — LLM provider failed — The model provider returned an unusable result, so this LLM-assisted dimension fell back to a measurement gap (confidence 0) rather than a penalty. Re-run with a reachable provider to score it.
  • D30 Dependency Vulnerabilities — scanner not present in this environment — The backing tool was not installed where this scan ran, so this dimension was not scored. Install the tool (or run in the hosted environment, where it is always present) for a graded result.

Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.

Limitations & what we did not check

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

Per-dimension blind spots

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

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity (jscpd) — it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
  • D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".

The LLM boundary

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

Dimensions

D1 · Cyclomatic Complexity6.2 / 10Adequate✓ Tool-verified

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

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

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

166 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was PulsarDecoder.channelRead at 80. A further 9 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 PulsarAuthorizationProvider.allowTopicOperationAsync at 28 — they are counted neither in the figure above nor in this dimension's score.

PulsarDecoder.channelRead (cyclomatic 80)pulsar-common/src/main/java/org/apache/pulsar/common/protocol/PulsarDecoder.java:118
FunctionConfigUtils.convert (cyclomatic 70)pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/FunctionConfigUtils.java:102
TransferShedder.findBundlesForUnloading (cyclomatic 66)pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/scheduler/TransferShedder.java:317
FunctionDetailsCommand.processArguments (cyclomatic 66)pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java:441
PulsarService.closeAsync (cyclomatic 55)pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java:517

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

What to do

  1. Resolve the 1 PulsarDecoder.channelRead (cyclomatic 80) finding(s) in Cyclomatic Complexity — start with PulsarDecoder.java. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 FunctionConfigUtils.convert (cyclomatic 70) finding(s) in Cyclomatic Complexity — start with FunctionConfigUtils.java. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 TransferShedder.findBundlesForUnloading (cyclomatic 66) finding(s) in Cyclomatic Complexity — start with TransferShedder.java. — One of this dimension's main actionable groups (1 warning-level).
  4. Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

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

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

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

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

410 method(s) exceeded the cognitive complexity threshold of 15; the worst was TransferShedder.findBundlesForUnloading at 182.

TransferShedder.findBundlesForUnloading (cognitive 182)pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/scheduler/TransferShedder.java:317
PerformanceTransaction.run (cognitive 130)pulsar-testclient/src/main/java/org/apache/pulsar/testclient/PerformanceTransaction.java:191
PerformanceProducer.runProducer (cognitive 111)pulsar-testclient/src/main/java/org/apache/pulsar/testclient/PerformanceProducer.java:526
FunctionConfigUtils.convert (cognitive 87)pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/FunctionConfigUtils.java:102
AbstractBaseDispatcher.filterEntriesForConsumer (cognitive 84)pulsar-broker/src/main/java/org/apache/pulsar/broker/service/AbstractBaseDispatcher.java:126

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

What to do

  1. Resolve the 1 TransferShedder.findBundlesForUnloading (cognitive 182) finding(s) in Cognitive Complexity — start with TransferShedder.java. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 PerformanceTransaction.run (cognitive 130) finding(s) in Cognitive Complexity — start with PerformanceTransaction.java. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 PerformanceProducer.runProducer (cognitive 111) finding(s) in Cognitive Complexity — start with PerformanceProducer.java. — One of this dimension's main actionable groups (1 warning-level).
  4. Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

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

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

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

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

196 god class(es) detected.

TooManyMethods: TopicsImpl · ×101pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/TopicsImpl.java:106
FileTooLong: v2/PersistentTopics.java · ×95pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:0

What to do

  1. Resolve the 101 TooManyMethods finding(s) in God Classes — start with TopicsImpl.java, NamespacesImpl.java, ManagedLedgerImpl.java. — One of this dimension's main actionable groups (101 warning-level).
  2. Resolve the 95 FileTooLong finding(s) in God Classes — start with Commands.java (2), FunctionsImpl.java (2), PersistentTopics.java. — One of this dimension's main actionable groups (95 warning-level).
  3. Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

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

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

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

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

416 duplicated block group(s) detected.

Duplicated block (10 lines × 2) · ×47pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentTopic.java:564
Duplicated block (9 lines × 2) · ×47pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:367
Duplicated block (11 lines × 2) · ×43pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentReplicator.java:100
Duplicated block (8 lines × 2) · ×41pulsar-broker/src/main/java/org/apache/pulsar/broker/delayed/bucket/BookkeeperBucketSnapshotStorage.java:179
Duplicated block (7 lines × 2) · ×36pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentTopic.java:1277

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

✓ On the Gold path — maintain.

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

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

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

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

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

Secret scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

D15 · Churn × Complexity Hotspots9.8 / 10Exemplary✓ Tool-verified

What it measures: Files that change often and are also complex — the riskiest hotspots.

Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.

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

Top hotspots: pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java (19×38=722); pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java (15×37=555); pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java (12×31=372)

Hotspot: pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java · ×10pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java

✓ On the Gold path — maintain.

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

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

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

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

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

116 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is pulsar-broker/src/main/java/org/apache/pulsar/broker/service/scalable/ScalableTopicController.java.

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

✓ On the Gold path — maintain.

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

D21 · Naming Consistency / 10Exemplary◐ Sampled · advisory

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

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

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

0 naming inconsistencies across 0 sampled symbols.

✓ On the Gold path — maintain.

Detailed fixes: d21_recommendation.md.

D28 · Secrets (history)0.0 / 10Critical✓ Tool-verified

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

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

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

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

Secret: private-key · ×5.ci/tls/servers/broker/broker.key-pk8.pem:1detected by gitleaks finding
Rotate the exposed credentials — git history can't be un-committed

What to do

  1. Resolve the 5 Secret finding(s) in Secrets (history) — start with broker.key-pk8.pem, broker.key.pem, ca.key.pem. — One of this dimension's main actionable groups (5 issue-level).
  2. Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).

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

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

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

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

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

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

88 finding(s): 0 critical, 73 high, 13 medium, 2 low.

High: run-shell-injection · ×50.github/actions/ssh-access/action.yml:50detected by semgrep finding

What to do

  1. Resolve the 50 High finding(s) in Static Analysis (SAST) — start with pulsar-ci.yaml (21), pulsar-ci-flaky.yaml (10), ci-go-functions.yaml (5). — One of this dimension's main actionable groups (50 issue-level).

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

D31 · IaC & Container Security2.7 / 10Weak✓ Tool-verified

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

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

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

35 finding(s): 2 critical, 15 high, 6 medium, 12 low.

High IaC: AWS-0028 · ×8deployment/terraform-ansible/aws/instances.tfdetected by trivy finding
Critical IaC: AWS-0104deployment/terraform-ansible/aws/security.tfdetected by trivy finding
Medium IaC: AWS-0178 · ×4deployment/terraform-ansible/aws/network.tfdetected by trivy finding
Low IaC: AWS-0099 · ×4deployment/terraform-ansible/aws/security.tfdetected by trivy finding

What to do

  1. Resolve the 8 High IaC finding(s) in IaC & Container Security — start with instances.tf (2), network.tf (2), Dockerfile.wolfi (2). — One of this dimension's main actionable groups (8 issue-level).
  2. Resolve the 1 Critical IaC finding(s) in IaC & Container Security — start with security.tf. — One of this dimension's main actionable groups (1 issue-level).
  3. Resolve the 4 Medium IaC finding(s) in IaC & Container Security — start with Dockerfile (2), network.tf, Dockerfile.wolfi. — One of this dimension's main actionable groups (4 warning-level).

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

D34 · Knowledge Freshness6.0 / 10Adequate✓ Tool-verified

What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.

Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.

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

605 of 1505 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/FunctionsBase.java.

Orphaned knowledge · ×22pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/FunctionsBase.java
Further orphaned files (smaller)

What to do

  1. Resolve the 22 Orphaned knowledge finding(s) in Knowledge Freshness — start with FunctionsImpl.java (2), SinksImpl.java (2), FunctionsBase.java. — One of this dimension's main actionable groups (22 issue-level).
  2. Resolve the 1 Further orphaned files (smaller) finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).

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

D35 · Change Coupling9.7 / 10Exemplary✓ Tool-verified

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

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

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

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

Strongest change-coupling: ScalableQueueConsumer.java↔ScalableStreamConsumer.java 91%; PendingAckHandleDisabled.java↔PendingAckHandleImpl.java 83%; Transactions.java↔CmdTransactions.java 76%

Boundary-crossing change coupling: Transactions.java ↔ CmdTransactions.java · ×9pulsar-client-admin-api/src/main/java/org/apache/pulsar/client/admin/Transactions.java
Change coupling clique: PersistentSubscription.java, AggregatedSubscriptionStats.java, SubscriptionStats.javapulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentSubscription.java

✓ On the Gold path — maintain.

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

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

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

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

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

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

Build action pinned to a mutable branch
Unpinned build actions
PR-triggered workflow without a permissions block
No build provenance
No SBOM

What to do

  1. Resolve the 1 Build action pinned to a mutable branch finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 issue-level).
  2. Resolve the 1 Unpinned build actions finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 PR-triggered workflow without a permissions block finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).

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

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d37_recommendation.md.

D38 · OSV Dependency Vulnerabilities9.1 / 10Exemplary✓ Tool-verified

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

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

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

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

Medium CVE: GO-2026-5046 · ×4pulsar-function-go/go.moddetected by osv-scanner finding
Medium vulnerability: GO-2026-5841pulsar-function-go/go.moddetected by osv-scanner finding

✓ On the Gold path — maintain.

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

Frontend & cross-cutting dimensions

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

M1 · Documentation (README)6.7 / 10Adequate✓ Tool-verified

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

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

What to do

  • Add a 'Testing' section to the root README — how to run the test suite.
  • Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
  • Add a README to the 71 of 72 project(s) that lack one — worth up to 2 pts.
M2 · Architecture documentation5.0 / 10Adequate✓ Tool-verified

Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.

Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.

  • No Architecture Decision Records found — decisions aren't captured for future maintainers.

What to do

  • Start an ADR log (docs/adr/) recording significant decisions and their rationale.
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

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

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

M4 · Documentation accuracy10.0 / 10Exemplary◐ Sampled · advisory

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

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

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

Readiness · Readiness — Whether an automated pipeline builds and tests every change.

Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.

P3 · Security & performance tooling7.0 / 10Strong✓ Tool-verified

Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).

Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.

What to do

  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback5.0 / 10Adequate✓ Tool-verified

Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.

Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.

  • 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.
  • Add an approval/environment gate (required reviewers / protection rules) before production promotion.

Reference — by lens

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

LensScoreRatingImpact
Code Health74%StrongSolid.
Architecture97%ExemplaryStrongest area.
Maturity72%StrongSolid.
Readiness73%StrongSolid.
Security41%Weak — gated by D28, D29, D31, D36Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Not included — 72 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 (4 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC2 Forms & labels — Frontend below the scale floor (4 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC3 Page structure — Frontend below the scale floor (4 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC4 Keyboard semantics — Frontend below the scale floor (4 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC5 ARIA correctness — Frontend below the scale floor (4 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC6 Visual & motion safety — Frontend below the scale floor (4 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC7 A11y enforcement — Frontend below the scale floor (4 DOM element(s) < 25) — too little surface to assess accessibility.
  • AX1 Captive dependencies — no DI registrations detected
  • AX10 Code composition — not assessed — code composition is computed by ROLE over the .NET document set and none was loaded for this repository, because it is written in another language or the solution failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX2 Stateful singletons — no singleton implementations detected
  • AX3 Project dependency cycles — not assessed — project cycles and dependency direction are computed over the .NET project-reference graph and none was loaded for this repository, because it is written in another language or the solution failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX4 Dependency direction — not assessed — project cycles and dependency direction are computed over the .NET project-reference graph and none was loaded for this repository, because it is written in another language or the solution failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from the .NET project graph (projects, types, namespaces) and no such graph was loaded for this repository, because it is written in another language or the solution failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX6 Interface segregation — not assessed — interface segregation is computed over the .NET type surface and none was loaded for this repository, because it is written in another language or the solution 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 the .NET project graph (which projects are test projects, and what they reference) and no such graph was loaded for this repository, because it is written in another language or the solution failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
  • AXB2 Runtime readiness — no data
  • C1 Data Protection — Not assessed: these personal data controls are read from C# source (attributes, middleware, entity/column names, guard methods) and no C# source was loaded for this repository — because it is written in another language, or the solution failed to load. Absence of a .NET idiom 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 C# source (attributes, middleware, entity/column names, guard methods) and no C# source was loaded for this repository — because it is written in another language, or the solution failed to load. Absence of a .NET idiom is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C3 Audit Trail — Not assessed: these audit controls are read from C# source (attributes, middleware, entity/column names, guard methods) and no C# source was loaded for this repository — because it is written in another language, or the solution failed to load. Absence of a .NET idiom 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 C# source (attributes, middleware, entity/column names, guard methods) and no C# source was loaded for this repository — because it is written in another language, or the solution failed to load. Absence of a .NET idiom 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 C# source (attributes, middleware, entity/column names, guard methods) and no C# source was loaded for this repository — because it is written in another language, or the solution failed to load. Absence of a .NET idiom is NOT evidence that this repository lacks data-subject rights controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • D10 Test Quality — ~426053 lines of test source are present (.java) but the test-quality collector reads C# only, so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • D11 Test Reliability — Test reliability not included
  • D12 Dependency Hygiene — Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
  • D14 License Compliance — Not scored — this repository's package manifest is not parsed for licence data yet. A gap in the analyzer's language coverage, NOT a finding that the repository's licenses are compliant (a Gradle version catalogue, a Go module (go.mod/go.sum)), which this pass does not parse yet — so this dimension asserts nothing about this repository's licensing in either direction.
  • D17 Explicit Debt — explicit-debt markers are read through a C# workspace today, so they were not read for this repository's language — this asserts nothing about how many markers the code carries. Not scored — this is a gap in the analyzer, not a finding about this repository
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D19 Documentation Quality — LLM evaluation failed
  • D20 ADR Quality — N/A — ADRs are expected on deployable products with a user-facing host, not consumed libraries; no ADR log is required here.
  • D22 Internal API Consistency — No exposed public API
  • D23 Boundary Type-Coupling — Production source is present (.go, .java, .kt, .py) 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 namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["Acme.Billing"]`, `Catalog: ["Acme.Catalog"]`.
  • D24 Comment Value — No inline comments to assess — comment value is not applicable here.
  • D25 ADR Conformance — no ADRs to check
  • D26 Project Cohesion — Project cohesion is assessed over the .NET project set; this target exposed no projects, so project size and spread could not be assessed. Not scored — this is a gap in the analyzer's reach, not a verdict about this repository.
  • D27 Navigability — No calls could be sampled, so navigability was not assessed — tracing effort is measured over resolved call sites and this target exposed none. Not scored — this is a gap in the analyzer's reach, not a verdict about this repository.
  • D30 Dependency Vulnerabilities — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Gradle version catalogue, a Go module (go.mod/go.sum) — not scanned yet) — where an OSV-supported manifest exists, dependency vulnerabilities for this repository are reported under D38 instead.
  • D32 Data Compliance (PII/GDPR) — No PII/GDPR ruleset is bundled (the public p/gdpr semgrep pack was retired) — data compliance is not assessed in this scan.
  • D33 JS/npm Dependency Vulnerabilities — No JS/npm manifest or lockfile found outside build output (package.json, package-lock.json, yarn.lock, pnpm-lock.yaml, bun.lockb); no JS dependencies to scan.
  • D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D5 Coupling — Inter-project coupling could not be assessed — no analyzable project graph was found for this repository. Not scored: a gap in the analyzer's reach, not a verdict about this repository. (Coupling here is Martin afferent/efferent/instability plus reference cycles across a project-reference graph, read today from .NET project files; other ecosystems' module graphs are not read yet.)
  • D6 Cohesion (LCOM4) — Cohesion (LCOM4) is measured over a C#/VB class graph, and this repository's production source is .go, .java, .kt, .py, which this pass does not read — so no class could be assessed. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • D7 Architectural Integrity — no checkable ADRs and no dependency cycles — architectural integrity not assessed
  • D8 Code Coverage — Coverage not included — suite not readable by the collector
  • D9 Test Distribution — Test source is present (.java) but the test-pyramid classifier reads C# only, so its unit/integration/BDD/E2E split couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • DM1 Domain Modelling — applicable but skipped (1/2 markers — below the conservative bar): 448 value object(s)
  • ED1 Event-Driven — not run — 0/3 markers found
  • ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
  • ES1 Event Sourcing — not run — 0/3 markers found
  • GD1 Unfinished & placeholder code — no source files
  • IC1 Incompleteness & stubs — not analysed — these correctness checks are read from C# source and none was loaded for this repository, because it is written in another language or the solution failed to load. This is a gap in the analyzer, not a finding about this repository
  • P12 CI test-gate honesty — no data
  • P2 Observability — Observability was not assessed: this check reads .NET source (ILogger/Serilog, OpenTelemetry, health checks) and no such source carries this repository's product — because it is written in another language, or because the solution failed to load. Absence of a .NET logging idiom 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.
  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
  • P6 Release Hygiene — not evidenced — no changelog, version stamp or semver release tag in the repo
  • P7 Outbound HTTP resilience — not applicable — this isn't a service/API/worker
  • P8 Schema migrations — not assessed — schema-migration practice is read from EF Core usage in .NET source and none was loaded for this repository, because it is written in another language or the solution failed to load. This is a gap in the analyzer, not a finding about this repository
  • P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (JaCoCo XML — the Gradle `jacocoTestReport` task) into the repo working tree before the scan — a CI step is the usual place, since the artefact is commonly gitignored, or wire coverage collection into CI, to enable this cross-layer check
  • PF1 Benchmark discipline — Performance was not assessed: this lens reads .NET source (allocation-aware APIs — Span/Memory, ArrayPool/ObjectPool, stackalloc — and a BenchmarkDotNet suite) and no such source was loaded for this repository, because it is written in another language or the solution 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 .NET source (allocation-aware APIs — Span/Memory, ArrayPool/ObjectPool, stackalloc — and a BenchmarkDotNet suite) and no such source was loaded for this repository, because it is written in another language or the solution 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 .NET source (allocation-aware APIs — Span/Memory, ArrayPool/ObjectPool, stackalloc — and a BenchmarkDotNet suite) and no such source was loaded for this repository, because it is written in another language or the solution 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 C# source (attributes, middleware, entity/column names, guard methods) and no C# source was loaded for this repository — because it is written in another language, or the solution failed to load. Absence of a .NET idiom is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • SC1 Supply-chain hygiene — no data
  • X1 Async correctness — not analysed — these correctness checks are read from C# source and none was loaded for this repository, because it is written in another language or the solution failed to load. This is a gap in the analyzer, not a finding about this repository
  • X2 Cancellation propagation — not analysed — these correctness checks are read from C# source and none was loaded for this repository, because it is written in another language or the solution failed to load. This is a gap in the analyzer, not a finding about this repository
  • X3 Exception handling — not analysed — these correctness checks are read from C# source and none was loaded for this repository, because it is written in another language or the solution failed to load. This is a gap in the analyzer, not a finding about this repository
  • X4 Structured logging — not analysed — these correctness checks are read from C# source and none was loaded for this repository, because it is written in another language or the solution 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 are read from C# source and none was loaded for this repository, because it is written in another language or the solution failed to load. This is a gap in the analyzer, not a finding about this repository

Appendix A — Findings (grouped)

The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.

Issue — 96 finding(s)
D29 · Static Analysis (SAST) · High · ×50
  • High: run-shell-injection .github/actions/ssh-access/action.yml:50 — Using variable interpolation `${{...}}` with a workflow input in a `run:` step could allow an attacker to inject their own code into the runner. This would allow them to steal secrets and code. A workflow input is not bounded by this step and should be treated as untrusted. Instead, use an intermediate environment variable with `env:` to store the data and use the environment variable in the `run:` script. Reference it as a shell VARIABLE rather than a `${{ }}` interpolation, using your shell's own syntax (`"$ENVVAR"` in bash, `$env:ENVVAR` in PowerShell), so the value is passed as data and never re-expanded as code.
  • High: github-actions-mutable-action-tag .github/actions/upload-coverage/action.yml:58 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: codecov/codecov-action@<40-character SHA>`. This step references `codecov/codecov-action@v5`; resolve the SHA it points at today with `gh api repos/codecov/codecov-action/commits/v5 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/actions/upload-coverage/action.yml:72 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: codecov/codecov-action@<40-character SHA>`. This step references `codecov/codecov-action@v5`; resolve the SHA it points at today with `gh api repos/codecov/codecov-action/commits/v5 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/actions/upload-coverage/action.yml:86 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: codecov/codecov-action@<40-character SHA>`. This step references `codecov/codecov-action@v5`; resolve the SHA it points at today with `gh api repos/codecov/codecov-action/commits/v5 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/ci-go-functions.yaml:42 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v6`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v6 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/ci-go-functions.yaml:46 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: apache/pulsar-test-infra/paths-filter@<40-character SHA>`. This step references `apache/pulsar-test-infra/paths-filter@master`; resolve the SHA it points at today with `gh api repos/apache/pulsar-test-infra/commits/master --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/ci-go-functions.yaml:71 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v6`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v6 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/ci-go-functions.yaml:77 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/setup-go@<40-character SHA>`. This step references `actions/setup-go@v6`; resolve the SHA it points at today with `gh api repos/actions/setup-go/commits/v6 --jq .sha`.
  • High: gha-curl-pipe-shell .github/workflows/ci-go-functions.yaml:83 — A `run:` step pipes the output of `curl` or `wget` directly into a shell interpreter. This is the "curl | bash" install pattern — if the remote server is compromised or the URL is hijacked, an attacker can execute arbitrary code in your CI runner. Consider downloading the file first, verifying its checksum or signature, and then executing it.
  • High: github-actions-mutable-action-tag .github/workflows/ci-gradle-cache-update.yaml:56 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v6`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v6 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/ci-gradle-cache-update.yaml:62 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/setup-java@<40-character SHA>`. This step references `actions/setup-java@v5`; resolve the SHA it points at today with `gh api repos/actions/setup-java/commits/v5 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/ci-gradle-dependency-submission.yaml:52 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v6`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v6 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/ci-gradle-dependency-submission.yaml:58 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/setup-java@<40-character SHA>`. This step references `actions/setup-java@v5`; resolve the SHA it points at today with `gh api repos/actions/setup-java/commits/v5 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/ci-pulsarbot.yaml:38 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/github-script@<40-character SHA>`. This step references `actions/github-script@v8`; resolve the SHA it points at today with `gh api repos/actions/github-script/commits/v8 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/codeql.yaml:56 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/setup-java@<40-character SHA>`. This step references `actions/setup-java@v5`; resolve the SHA it points at today with `gh api repos/actions/setup-java/commits/v5 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/codeql.yaml:62 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v6`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v6 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/codeql.yaml:83 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: github/codeql-action/init@<40-character SHA>`. This step references `github/codeql-action/init@v4`; resolve the SHA it points at today with `gh api repos/github/codeql-action/commits/v4 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/codeql.yaml:89 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: github/codeql-action/analyze@<40-character SHA>`. This step references `github/codeql-action/analyze@v4`; resolve the SHA it points at today with `gh api repos/github/codeql-action/commits/v4 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/labeler.yml:36 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/labeler@<40-character SHA>`. This step references `actions/labeler@v6`; resolve the SHA it points at today with `gh api repos/actions/labeler/commits/v6 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/pulsar-ci-flaky.yaml:98 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/github-script@<40-character SHA>`. This step references `actions/github-script@v8`; resolve the SHA it points at today with `gh api repos/actions/github-script/commits/v8 --jq .sha`.
  • High: run-shell-injection .github/workflows/pulsar-ci-flaky.yaml:106 — Using variable interpolation `${{...}}` with `github` context data in a `run:` step could allow an attacker to inject their own code into the runner. This would allow them to steal secrets and code. `github` context data can have arbitrary user input and should be treated as untrusted. Instead, use an intermediate environment variable with `env:` to store the data and use the environment variable in the `run:` script. Reference it as a shell VARIABLE rather than a `${{ }}` interpolation, using your shell's own syntax (`"$ENVVAR"` in bash, `$env:ENVVAR` in PowerShell), so the value is passed as data and never re-expanded as code.
  • High: github-actions-mutable-action-tag .github/workflows/pulsar-ci-flaky.yaml:117 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v6`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v6 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/pulsar-ci-flaky.yaml:122 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: apache/pulsar-test-infra/paths-filter@<40-character SHA>`. This step references `apache/pulsar-test-infra/paths-filter@master`; resolve the SHA it points at today with `gh api repos/apache/pulsar-test-infra/commits/master --jq .sha`.
  • High: run-shell-injection .github/workflows/pulsar-ci-flaky.yaml:139 — Using variable interpolation `${{...}}` with `github` context data in a `run:` step could allow an attacker to inject their own code into the runner. This would allow them to steal secrets and code. `github` context data can have arbitrary user input and should be treated as untrusted. Instead, use an intermediate environment variable with `env:` to store the data and use the environment variable in the `run:` script. Reference it as a shell VARIABLE rather than a `${{ }}` interpolation, using your shell's own syntax (`"$ENVVAR"` in bash, `$env:ENVVAR` in PowerShell), so the value is passed as data and never re-expanded as code.
  • High: run-shell-injection .github/workflows/pulsar-ci-flaky.yaml:148 — Using variable interpolation `${{...}}` with `github` context data in a `run:` step could allow an attacker to inject their own code into the runner. This would allow them to steal secrets and code. `github` context data can have arbitrary user input and should be treated as untrusted. Instead, use an intermediate environment variable with `env:` to store the data and use the environment variable in the `run:` script. Reference it as a shell VARIABLE rather than a `${{ }}` interpolation, using your shell's own syntax (`"$ENVVAR"` in bash, `$env:ENVVAR` in PowerShell), so the value is passed as data and never re-expanded as code.
  • + 25 more in this group — see findings.md.
D34 · Knowledge Freshness · Orphaned knowledge · ×22
  • Orphaned knowledge pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/FunctionsBase.java — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/FunctionsImpl.java — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/SinksImpl.java — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/SchedulerManager.java — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/SinksBase.java — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/SourcesImpl.java — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/LoadManagerShared.java — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdSinks.java — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/FunctionsImpl.java — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdSources.java — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge pulsar-broker/src/main/java/org/apache/pulsar/broker/resourcegroup/ResourceGroup.java — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/SourcesBase.java — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge pulsar-client-admin-api/src/main/java/org/apache/pulsar/client/admin/Functions.java — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge pulsar-broker/src/main/java/org/apache/pulsar/broker/TransactionMetadataStoreService.java — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentLongLongPairHashMap.java — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge pulsar-testclient/src/main/java/org/apache/pulsar/testclient/BrokerMonitor.java — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge pulsar-client-api/src/main/java/org/apache/pulsar/client/api/Consumer.java — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge pulsar-websocket/src/main/java/org/apache/pulsar/websocket/ConsumerHandler.java — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge pulsar-client-admin-api/src/main/java/org/apache/pulsar/client/admin/Clusters.java — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdClusters.java — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/SinksImpl.java — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/AuthorizationProvider.java — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
D35 · Change Coupling · Boundary-crossing change coupling · ×9
  • Boundary-crossing change coupling: Transactions.java ↔ CmdTransactions.java pulsar-client-admin-api/src/main/java/org/apache/pulsar/client/admin/Transactions.java — `pulsar-client-admin-api/src/main/java/org/apache/pulsar/client/admin/Transactions.java` (context pulsar-client-admin-api) and `pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdTransactions.java` (context pulsar-client-tools) sit in DIFFERENT parts of the tree yet change together 76% of the time (13 of the 17 commits that touched the less-changed of the two, renames followed) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see.
  • Boundary-crossing change coupling: PersistentTopic.java ↔ HierarchyTopicPolicies.java pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java — `pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java` (context pulsar-broker) and `pulsar-common/src/main/java/org/apache/pulsar/common/policies/data/HierarchyTopicPolicies.java` (context pulsar-common) sit in DIFFERENT parts of the tree yet change together 76% of the time (22 of the 29 commits that touched the less-changed of the two, renames followed) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see.
  • Boundary-crossing change coupling: TransactionsImpl.java ↔ CmdTransactions.java pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/TransactionsImpl.java — `pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/TransactionsImpl.java` (context pulsar-client-admin) and `pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdTransactions.java` (context pulsar-client-tools) sit in DIFFERENT parts of the tree yet change together 72% of the time (13 of the 18 commits that touched the less-changed of the two, renames followed) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see.
  • Boundary-crossing change coupling: TransactionsBase.java ↔ CmdTransactions.java pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/TransactionsBase.java — `pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/TransactionsBase.java` (context pulsar-broker) and `pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdTransactions.java` (context pulsar-client-tools) sit in DIFFERENT parts of the tree yet change together 72% of the time (13 of the 18 commits that touched the less-changed of the two, renames followed) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see.
  • Boundary-crossing change coupling: Transactions.java ↔ CmdTransactions.java pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v3/Transactions.java — `pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v3/Transactions.java` (context pulsar-broker) and `pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdTransactions.java` (context pulsar-client-tools) sit in DIFFERENT parts of the tree yet change together 72% of the time (13 of the 18 commits that touched the less-changed of the two, renames followed) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see.
  • Boundary-crossing change coupling: NamespacesImpl.java ↔ CmdNamespaces.java pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/NamespacesImpl.java — `pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/NamespacesImpl.java` (context pulsar-client-admin) and `pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdNamespaces.java` (context pulsar-client-tools) sit in DIFFERENT parts of the tree yet change together 70% of the time (43 of the 61 commits that touched the less-changed of the two, renames followed) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see.
  • Boundary-crossing change coupling: PersistentTopic.java ↔ TopicStats.java pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java — `pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java` (context pulsar-broker) and `pulsar-client-admin-api/src/main/java/org/apache/pulsar/common/policies/data/TopicStats.java` (context pulsar-client-admin-api) sit in DIFFERENT parts of the tree yet change together 69% of the time (11 of the 16 commits that touched the less-changed of the two, renames followed) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see.
  • Boundary-crossing change coupling: NamespacesImpl.java ↔ PolicyName.java pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/NamespacesImpl.java — `pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/NamespacesImpl.java` (context pulsar-client-admin) and `pulsar-common/src/main/java/org/apache/pulsar/common/policies/data/PolicyName.java` (context pulsar-common) sit in DIFFERENT parts of the tree yet change together 62% of the time (10 of the 16 commits that touched the less-changed of the two, renames followed) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see.
  • Boundary-crossing change coupling: Namespaces.java ↔ PolicyName.java pulsar-client-admin-api/src/main/java/org/apache/pulsar/client/admin/Namespaces.java — `pulsar-client-admin-api/src/main/java/org/apache/pulsar/client/admin/Namespaces.java` (context pulsar-client-admin-api) and `pulsar-common/src/main/java/org/apache/pulsar/common/policies/data/PolicyName.java` (context pulsar-common) sit in DIFFERENT parts of the tree yet change together 62% of the time (10 of the 16 commits that touched the less-changed of the two, renames followed) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see.
D31 · IaC & Container Security · High IaC · ×8
  • High IaC: AWS-0028 deployment/terraform-ansible/aws/instances.tf — aws_instance should activate session tokens for Instance Metadata Service.
  • High IaC: AWS-0131 deployment/terraform-ansible/aws/instances.tf — Instance with unencrypted block device.
  • High IaC: AWS-0053 deployment/terraform-ansible/aws/network.tf — Load balancer is exposed to the internet.
  • High IaC: AWS-0164 deployment/terraform-ansible/aws/network.tf — Instances in a subnet should not receive a public IP address by default.
  • High IaC: AWS-0107 deployment/terraform-ansible/aws/security.tf — Security groups should not allow unrestricted ingress to SSH or RDP from any IP address.
  • High IaC: DS-0025 docker/pulsar/Dockerfile — 'apk add' is missing '--no-cache'
  • High IaC: DS-0015 docker/pulsar/Dockerfile.wolfi — 'yum clean all' missing
  • High IaC: DS-0025 docker/pulsar/Dockerfile.wolfi — 'apk add' is missing '--no-cache'
D28 · Secrets (history) · Secret · ×5
  • Secret: private-key .ci/tls/servers/broker/broker.key-pk8.pem:1 — matched rule 'private-key'
  • Secret: private-key .ci/tls/servers/broker/broker.key.pem:1 — matched rule 'private-key'
  • Secret: private-key .ci/tls/private/ca.key.pem:1 — matched rule 'private-key'
  • Secret: private-key .ci/tls/servers/proxy/proxy.key-pk8.pem:1 — matched rule 'private-key'
  • Secret: private-key .ci/tls/servers/proxy/proxy.key.pem:1 — matched rule 'private-key'
D31 · IaC & Container Security · Critical IaC · ×1
  • Critical IaC: AWS-0104 deployment/terraform-ansible/aws/security.tf — A security group rule should not allow unrestricted egress to any IP address.
D36 · Supply-chain Provenance & Signing · Build action pinned to a mutable branch · ×1
  • Build action pinned to a mutable branch — 3 CI action reference(s) point at a mutable BRANCH rather than a version tag or a commit SHA, 3 of them on a THIRD-PARTY action: `apache/pulsar-test-infra/paths-filter@master` (.github/workflows/pulsar-ci.yaml:115), `apache/pulsar-test-infra/paths-filter@master` (.github/workflows/pulsar-ci-flaky.yaml:122), `apache/pulsar-test-infra/paths-filter@master` (.github/workflows/ci-go-functions.yaml:46). A branch re-points on every upstream push, so whatever its tip holds when the job runs executes inside your pipeline with that job's secrets — a version tag at least moves only when the publisher cuts a release. Pin these to a full commit SHA first; the remaining tag refs are the same control at a lower blast radius.
Warning — 1211 finding(s)
D3 · God Classes · TooManyMethods · ×101
  • TooManyMethods: TopicsImpl pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/TopicsImpl.java:106 — TooManyMethods — 337 methods.
  • TooManyMethods: NamespacesImpl pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/NamespacesImpl.java:65 — TooManyMethods — 333 methods.
  • TooManyMethods: ManagedLedgerImpl managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java:156 — TooManyMethods — 226 methods.
  • TooManyMethods: TopicPoliciesImpl pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/TopicPoliciesImpl.java:50 — TooManyMethods — 213 methods.
  • TooManyMethods: PersistentTopic pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:212 — TooManyMethods — 192 methods.
  • TooManyMethods: Commands pulsar-common/src/main/java/org/apache/pulsar/common/protocol/Commands.java:126 — TooManyMethods — 185 methods.
  • TooManyMethods: PersistentTopicsBase pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:160 — TooManyMethods — 184 methods.
  • TooManyMethods: BrokerService pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java:216 — TooManyMethods — 179 methods.
  • TooManyMethods: ManagedCursorImpl managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java:119 — TooManyMethods — 176 methods.
  • TooManyMethods: Namespaces pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:101 — TooManyMethods — 156 methods.
  • TooManyMethods: PersistentTopics pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:109 — TooManyMethods — 153 methods.
  • TooManyMethods: NamespacesBase pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:129 — TooManyMethods — 140 methods.
  • TooManyMethods: ServerCnx pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:214 — TooManyMethods — 140 methods.
  • TooManyMethods: ConsumerImpl pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java:143 — TooManyMethods — 130 methods.
  • TooManyMethods: ConsumerBase pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerBase.java:76 — TooManyMethods — 126 methods.
  • TooManyMethods: AbstractTopic pulsar-broker/src/main/java/org/apache/pulsar/broker/service/AbstractTopic.java:102 — TooManyMethods — 123 methods.
  • TooManyMethods: PulsarService pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java:218 — TooManyMethods — 103 methods.
  • TooManyMethods: ClientCnx pulsar-client/src/main/java/org/apache/pulsar/client/impl/ClientCnx.java:119 — TooManyMethods — 98 methods.
  • TooManyMethods: NamespaceService pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java:126 — TooManyMethods — 96 methods.
  • TooManyMethods: ManagedLedgerConfig managed-ledger/src/main/java/org/apache/bookkeeper/mledger/ManagedLedgerConfig.java:45 — TooManyMethods — 93 methods.
  • TooManyMethods: PulsarClientImpl pulsar-client/src/main/java/org/apache/pulsar/client/impl/PulsarClientImpl.java:105 — TooManyMethods — 92 methods.
  • TooManyMethods: PersistentDispatcherMultipleConsumers pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:84 — TooManyMethods — 90 methods.
  • TooManyMethods: ProducerImpl pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java:113 — TooManyMethods — 87 methods.
  • TooManyMethods: ServiceUnitStateChannelImpl pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/channel/ServiceUnitStateChannelImpl.java:105 — TooManyMethods — 85 methods.
  • TooManyMethods: MessageImpl pulsar-client/src/main/java/org/apache/pulsar/client/impl/MessageImpl.java:64 — TooManyMethods — 82 methods.
  • + 76 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×95
  • FileTooLong: v2/PersistentTopics.java pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:0 — FileTooLong — 5047 significant lines (blank, comment-only and punctuation-only lines excluded).
  • FileTooLong: impl/PersistentTopicsBase.java pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:0 — FileTooLong — 4350 significant lines (blank, comment-only and punctuation-only lines excluded).
  • FileTooLong: service/ServerCnx.java pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:0 — FileTooLong — 3601 significant lines (blank, comment-only and punctuation-only lines excluded).
  • FileTooLong: broker/ServiceConfiguration.java pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java:0 — FileTooLong — 3560 significant lines (blank, comment-only and punctuation-only lines excluded).
  • FileTooLong: impl/ManagedLedgerImpl.java managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java:0 — FileTooLong — 3474 significant lines (blank, comment-only and punctuation-only lines excluded).
  • FileTooLong: persistent/PersistentTopic.java pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:0 — FileTooLong — 3446 significant lines (blank, comment-only and punctuation-only lines excluded).
  • FileTooLong: v2/Namespaces.java pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:0 — FileTooLong — 3376 significant lines (blank, comment-only and punctuation-only lines excluded).
  • FileTooLong: service/BrokerService.java pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java:0 — FileTooLong — 2983 significant lines (blank, comment-only and punctuation-only lines excluded).
  • FileTooLong: impl/ManagedCursorImpl.java managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java:0 — FileTooLong — 2765 significant lines (blank, comment-only and punctuation-only lines excluded).
  • FileTooLong: impl/NamespacesBase.java pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:0 — FileTooLong — 2566 significant lines (blank, comment-only and punctuation-only lines excluded).
  • FileTooLong: impl/ConsumerImpl.java pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java:0 — FileTooLong — 2371 significant lines (blank, comment-only and punctuation-only lines excluded).
  • FileTooLong: cli/CmdTopics.java pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdTopics.java:0 — FileTooLong — 2216 significant lines (blank, comment-only and punctuation-only lines excluded).
  • FileTooLong: internal/TopicsImpl.java pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/TopicsImpl.java:0 — FileTooLong — 2059 significant lines (blank, comment-only and punctuation-only lines excluded).
  • FileTooLong: cli/CmdNamespaces.java pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdNamespaces.java:0 — FileTooLong — 2043 significant lines (blank, comment-only and punctuation-only lines excluded).
  • FileTooLong: impl/ProducerImpl.java pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java:0 — FileTooLong — 1885 significant lines (blank, comment-only and punctuation-only lines excluded).
  • FileTooLong: protocol/Commands.java pulsar-common/src/main/java/org/apache/pulsar/common/protocol/Commands.java:0 — FileTooLong — 1662 significant lines (blank, comment-only and punctuation-only lines excluded).
  • FileTooLong: broker/PulsarService.java pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java:0 — FileTooLong — 1660 significant lines (blank, comment-only and punctuation-only lines excluded).
  • FileTooLong: cli/CmdTopicPolicies.java pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdTopicPolicies.java:0 — FileTooLong — 1518 significant lines (blank, comment-only and punctuation-only lines excluded).
  • FileTooLong: channel/ServiceUnitStateChannelImpl.java pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/channel/ServiceUnitStateChannelImpl.java:0 — FileTooLong — 1452 significant lines (blank, comment-only and punctuation-only lines excluded).
  • FileTooLong: internal/NamespacesImpl.java pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/NamespacesImpl.java:0 — FileTooLong — 1448 significant lines (blank, comment-only and punctuation-only lines excluded).
  • FileTooLong: api/ComponentImpl.java pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/ComponentImpl.java:0 — FileTooLong — 1402 significant lines (blank, comment-only and punctuation-only lines excluded).
  • FileTooLong: impl/ClientCnx.java pulsar-client/src/main/java/org/apache/pulsar/client/impl/ClientCnx.java:0 — FileTooLong — 1323 significant lines (blank, comment-only and punctuation-only lines excluded).
  • FileTooLong: namespace/NamespaceService.java pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java:0 — FileTooLong — 1226 significant lines (blank, comment-only and punctuation-only lines excluded).
  • FileTooLong: impl/ManagedLedgerFactoryImpl.java managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerFactoryImpl.java:0 — FileTooLong — 1185 significant lines (blank, comment-only and punctuation-only lines excluded).
  • FileTooLong: persistent/PersistentSubscription.java pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentSubscription.java:0 — FileTooLong — 1185 significant lines (blank, comment-only and punctuation-only lines excluded).
  • + 70 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×47
  • Duplicated block (10 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentTopic.java:564 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentTopic.java:564-573 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:1820-1829
  • Duplicated block (10 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:244 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:244-253 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumersClassic.java:234-243
  • Duplicated block (10 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumersClassic.java:839 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumersClassic.java:839-848 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentStickyKeyDispatcherMultipleConsumersClassic.java:392-401
  • Duplicated block (10 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/scalable/ScalableTopicController.java:240 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/scalable/ScalableTopicController.java:240-249 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/scalable/ScalableTopicController.java:1185-1194
  • Duplicated block (10 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:2885 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:2885-2894 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:2906-2915
  • Duplicated block (10 lines × 2) pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/PulsarAuthorizationProvider.java:841 — pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/PulsarAuthorizationProvider.java:841-851 | pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/PulsarAuthorizationProvider.java:870-879
  • Duplicated block (10 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/OpenTelemetryConsumerStats.java:101 — pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/OpenTelemetryConsumerStats.java:101-110 | pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/OpenTelemetryTopicStats.java:350-359
  • Duplicated block (10 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:2017 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:2017-2026 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:2072-2081
  • Duplicated block (10 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:2907 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:2907-2916 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:2944-2953
  • Duplicated block (10 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:712 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:712-721 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:776-785
  • Duplicated block (10 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:1464 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:1464-1473 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:4062-4071
  • Duplicated block (10 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:2044 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:2044-2053 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:2060-2069
  • Duplicated block (10 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:2947 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:2947-2956 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:5711-5720
  • Duplicated block (10 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:4951 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:4951-4960 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:5221-5230
  • Duplicated block (10 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/TransactionsBase.java:107 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/TransactionsBase.java:107-116 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/TransactionsBase.java:304-313
  • Duplicated block (10 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:387 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:387-396 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:411-420
  • Duplicated block (10 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:1163 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:1163-1172 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:1201-1210
  • Duplicated block (10 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:3072 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:3072-3081 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:3280-3289
  • Duplicated block (10 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/ScalableTopics.java:206 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/ScalableTopics.java:206-215 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/ScalableTopics.java:288-297
  • Duplicated block (10 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/ScalableTopics.java:476 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/ScalableTopics.java:476-485 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/ScalableTopics.java:519-528
  • Duplicated block (10 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/ExtensibleLoadManagerImpl.java:717 — pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/ExtensibleLoadManagerImpl.java:717-726 | pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/ExtensibleLoadManagerImpl.java:766-777
  • Duplicated block (10 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/LoadManagerShared.java:367 — pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/LoadManagerShared.java:367-376 | pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/LoadManagerShared.java:432-442
  • Duplicated block (10 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/LoadManagerShared.java:511 — pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/LoadManagerShared.java:511-520 | pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/LoadManagerShared.java:559-568
  • Duplicated block (10 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java:1406 — pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java:1406-1415 | pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java:1425-1434
  • Duplicated block (10 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/buffer/impl/TopicTransactionBuffer.java:570 — pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/buffer/impl/TopicTransactionBuffer.java:570-580 | pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/pendingack/impl/PendingAckHandleImpl.java:677-686
  • + 22 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×47
  • Duplicated block (9 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:367 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:367-375 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumersClassic.java:337-345
  • Duplicated block (9 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:786 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:786-794 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumersClassic.java:682-690
  • Duplicated block (9 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:936 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:936-944 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumersClassic.java:799-807
  • Duplicated block (9 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentStickyKeyDispatcherMultipleConsumers.java:137 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentStickyKeyDispatcherMultipleConsumers.java:137-145 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentStickyKeyDispatcherMultipleConsumersClassic.java:150-158
  • Duplicated block (9 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/scalable/SegmentLayout.java:187 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/scalable/SegmentLayout.java:187-195 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/scalable/SegmentLayout.java:232-240
  • Duplicated block (9 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/schema/SchemaRegistryServiceImpl.java:420 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/schema/SchemaRegistryServiceImpl.java:420-428 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/schema/SchemaRegistryServiceImpl.java:431-439
  • Duplicated block (9 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:2158 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:2158-2166 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:2193-2201
  • Duplicated block (9 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:3923 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:3923-3931 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:3936-3944
  • Duplicated block (9 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:4015 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:4015-4023 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:4027-4035
  • Duplicated block (9 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:4038 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:4038-4046 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:4051-4059
  • Duplicated block (9 lines × 2) pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/AuthorizationService.java:887 — pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/AuthorizationService.java:887-895 | pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/AuthorizationService.java:907-915
  • Duplicated block (9 lines × 2) pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/MultiRolesTokenAuthorizationProvider.java:145 — pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/MultiRolesTokenAuthorizationProvider.java:145-153 | pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/PulsarAuthorizationProvider.java:749-757
  • Duplicated block (9 lines × 2) pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/PulsarAuthorizationProvider.java:209 — pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/PulsarAuthorizationProvider.java:209-217 | pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/PulsarAuthorizationProvider.java:499-507
  • Duplicated block (9 lines × 2) pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/PulsarAuthorizationProvider.java:266 — pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/PulsarAuthorizationProvider.java:266-274 | pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/PulsarAuthorizationProvider.java:295-303
  • Duplicated block (9 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/OpenTelemetryReplicatorStats.java:122 — pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/OpenTelemetryReplicatorStats.java:122-130 | pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/OpenTelemetryTransactionPendingAckStoreStats.java:43-51
  • Duplicated block (9 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:1245 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:1245-1253 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:1260-1268
  • Duplicated block (9 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:2201 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:2201-2209 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:2257-2265
  • Duplicated block (9 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:2310 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:2310-2318 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:2349-2357
  • Duplicated block (9 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:806 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:806-814 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/AdminResource.java:1048-1056
  • Duplicated block (9 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:1764 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:1764-1772 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:1827-1835
  • Duplicated block (9 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:2512 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:2512-2520 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:2804-2812
  • Duplicated block (9 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:4212 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:4212-4220 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:4328-4336
  • Duplicated block (9 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:925 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:925-933 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:994-1002
  • Duplicated block (9 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/NonPersistentTopics.java:681 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/NonPersistentTopics.java:681-689 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:5405-5413
  • Duplicated block (9 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:3591 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:3591-3599 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:3693-3701
  • + 22 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×43
  • Duplicated block (11 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentReplicator.java:100 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentReplicator.java:100-110 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/GeoPersistentReplicator.java:167-177
  • Duplicated block (11 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentSubscription.java:474 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentSubscription.java:474-484 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentSubscription.java:1345-1355
  • Duplicated block (11 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:391 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:391-401 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumersClassic.java:363-373
  • Duplicated block (11 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:873 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:873-883 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumersClassic.java:763-773
  • Duplicated block (11 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentReplicator.java:642 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentReplicator.java:642-652 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentSubscription.java:811-821
  • Duplicated block (11 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentReplicator.java:669 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentReplicator.java:669-679 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentSubscription.java:856-866
  • Duplicated block (11 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/PersistentTopicAttributes.java:64 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/PersistentTopicAttributes.java:64-74 | pulsar-client-api-v5/src/main/java/org/apache/pulsar/client/api/v5/config/ConnectionPolicy.java:72-82
  • Duplicated block (11 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/PulsarMetadataEventSynchronizer.java:175 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/PulsarMetadataEventSynchronizer.java:175-185 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/PulsarMetadataEventSynchronizer.java:254-264
  • Duplicated block (11 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:689 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:689-699 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:1191-1201
  • Duplicated block (11 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:3895 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:3895-3905 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:4007-4017
  • Duplicated block (11 lines × 2) pulsar-broker-auth-oidc/src/main/java/org/apache/pulsar/broker/authentication/oidc/JwksCache.java:87 — pulsar-broker-auth-oidc/src/main/java/org/apache/pulsar/broker/authentication/oidc/JwksCache.java:87-97 | pulsar-broker-auth-oidc/src/main/java/org/apache/pulsar/broker/authentication/oidc/OpenIDProviderMetadataCache.java:77-87
  • Duplicated block (11 lines × 2) pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/PulsarAuthorizationProvider.java:607 — pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/PulsarAuthorizationProvider.java:607-617 | pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/PulsarAuthorizationProvider.java:666-676
  • Duplicated block (11 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/web/PulsarWebResource.java:423 — pulsar-broker/src/main/java/org/apache/pulsar/broker/web/PulsarWebResource.java:423-433 | pulsar-broker/src/main/java/org/apache/pulsar/broker/web/PulsarWebResource.java:453-464
  • Duplicated block (11 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/web/PulsarWebResource.java:1055 — pulsar-broker/src/main/java/org/apache/pulsar/broker/web/PulsarWebResource.java:1055-1065 | pulsar-broker/src/main/java/org/apache/pulsar/broker/web/PulsarWebResource.java:1241-1251
  • Duplicated block (11 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:520 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:520-531 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:605-615
  • Duplicated block (11 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:2995 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:2995-3005 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:3076-3086
  • Duplicated block (11 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:283 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:283-293 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:308-319
  • Duplicated block (11 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:2205 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:2205-2215 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:4173-4183
  • Duplicated block (11 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:2531 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:2531-2541 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:2820-2831
  • Duplicated block (11 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:1902 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:1902-1912 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:1956-1966
  • Duplicated block (11 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:2639 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:2639-2649 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:3726-3736
  • Duplicated block (11 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:3751 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:3751-3761 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:3776-3786
  • Duplicated block (11 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/filter/BrokerVersionFilter.java:128 — pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/filter/BrokerVersionFilter.java:128-138 | pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/BrokerVersionFilter.java:81-91
  • Duplicated block (11 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/rest/Topics.java:66 — pulsar-broker/src/main/java/org/apache/pulsar/broker/rest/Topics.java:66-76 | pulsar-broker/src/main/java/org/apache/pulsar/broker/rest/Topics.java:133-143
  • Duplicated block (11 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/rest/Topics.java:100 — pulsar-broker/src/main/java/org/apache/pulsar/broker/rest/Topics.java:100-110 | pulsar-broker/src/main/java/org/apache/pulsar/broker/rest/Topics.java:169-179
  • + 18 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×41
  • Duplicated block (8 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/delayed/bucket/BookkeeperBucketSnapshotStorage.java:179 — pulsar-broker/src/main/java/org/apache/pulsar/broker/delayed/bucket/BookkeeperBucketSnapshotStorage.java:179-186 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/schema/BookkeeperSchemaStorage.java:648-655
  • Duplicated block (8 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/MessageDeduplication.java:391 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/MessageDeduplication.java:391-398 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/MessageDeduplication.java:533-540
  • Duplicated block (8 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:950 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:950-957 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumersClassic.java:811-818
  • Duplicated block (8 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:412 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:412-419 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:449-456
  • Duplicated block (8 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/Consumer.java:1377 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/Consumer.java:1377-1384 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/Producer.java:920-927
  • Duplicated block (8 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/Producer.java:634 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/Producer.java:634-641 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/Producer.java:657-664
  • Duplicated block (8 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/PulsarChannelInitializer.java:137 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/PulsarChannelInitializer.java:137-144 | pulsar-broker/src/main/java/org/apache/pulsar/broker/web/WebService.java:596-603
  • Duplicated block (8 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:2796 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:2796-2803 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:2818-2825
  • Duplicated block (8 lines × 2) pulsar-broker-common/src/main/java/org/apache/pulsar/broker/resources/BaseResources.java:64 — pulsar-broker-common/src/main/java/org/apache/pulsar/broker/resources/BaseResources.java:64-71 | pulsar-broker-common/src/main/java/org/apache/pulsar/broker/resources/BaseResources.java:75-82
  • Duplicated block (8 lines × 2) pulsar-broker-common/src/main/java/org/apache/pulsar/broker/stats/prometheus/PrometheusMetricsServlet.java:87 — pulsar-broker-common/src/main/java/org/apache/pulsar/broker/stats/prometheus/PrometheusMetricsServlet.java:87-94 | pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/prometheus/PulsarPrometheusMetricsServlet.java:117-125
  • Duplicated block (8 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/BrokersBase.java:213 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/BrokersBase.java:213-220 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/ClustersBase.java:1153-1160
  • Duplicated block (8 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/ClustersBase.java:497 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/ClustersBase.java:497-504 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/ClustersBase.java:1004-1012
  • Duplicated block (8 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:317 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:317-324 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:329-336
  • Duplicated block (8 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:3322 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:3322-3330 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:3353-3360
  • Duplicated block (8 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:1555 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:1555-1562 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:1644-1651
  • Duplicated block (8 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:2258 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:2258-2265 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:2379-2387
  • Duplicated block (8 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Bookies.java:158 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Bookies.java:158-165 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Bookies.java:210-217
  • Duplicated block (8 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/ScalableTopics.java:237 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/ScalableTopics.java:237-244 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/ScalableTopics.java:419-426
  • Duplicated block (8 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Segments.java:254 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Segments.java:254-262 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Segments.java:492-499
  • Duplicated block (8 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/resourcegroup/ResourceGroupService.java:597 — pulsar-broker/src/main/java/org/apache/pulsar/broker/resourcegroup/ResourceGroupService.java:597-604 | pulsar-broker/src/main/java/org/apache/pulsar/broker/resourcegroup/ResourceGroupService.java:699-708
  • Duplicated block (8 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/buffer/impl/MetadataTransactionBuffer.java:431 — pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/buffer/impl/MetadataTransactionBuffer.java:431-438 | pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/pendingack/impl/MetadataPendingAckStore.java:246-253
  • Duplicated block (8 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/buffer/impl/TransactionBufferHandlerImpl.java:85 — pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/buffer/impl/TransactionBufferHandlerImpl.java:85-92 | pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/buffer/impl/TransactionBufferHandlerImpl.java:106-113
  • Duplicated block (8 lines × 2) pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/BitSetRecyclable.java:775 — pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/BitSetRecyclable.java:775-782 | pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/BitSetRecyclable.java:813-820
  • Duplicated block (8 lines × 2) pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentOpenLongPairRangeSet.java:176 — pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentOpenLongPairRangeSet.java:176-183 | pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/OpenLongPairRangeSet.java:173-180
  • Duplicated block (8 lines × 2) pulsar-common/src/main/java/org/apache/pulsar/common/util/FieldParser.java:325 — pulsar-common/src/main/java/org/apache/pulsar/common/util/FieldParser.java:325-332 | pulsar-common/src/main/java/org/apache/pulsar/common/util/FieldParser.java:344-351
  • + 16 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×36
  • Duplicated block (7 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentTopic.java:1277 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentTopic.java:1277-1283 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:4583-4589
  • Duplicated block (7 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:157 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:157-163 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumersClassic.java:152-158
  • Duplicated block (7 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:1337 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:1337-1343 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumersClassic.java:1177-1184
  • Duplicated block (7 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/scalable/ScalableTopicController.java:1037 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/scalable/ScalableTopicController.java:1037-1043 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/scalable/ScalableTopicController.java:1292-1301
  • Duplicated block (7 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java:2241 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java:2241-2247 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java:2263-2269
  • Duplicated block (7 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/PulsarChannelInitializer.java:63 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/PulsarChannelInitializer.java:63-69 | pulsar-broker/src/main/java/org/apache/pulsar/broker/web/WebService.java:165-171
  • Duplicated block (7 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:3864 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:3864-3870 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:3964-3971
  • Duplicated block (7 lines × 2) pulsar-broker-common/src/main/java/org/apache/pulsar/broker/web/JettyRequestLogFactory.java:221 — pulsar-broker-common/src/main/java/org/apache/pulsar/broker/web/JettyRequestLogFactory.java:221-227 | pulsar-broker-common/src/main/java/org/apache/pulsar/broker/web/JettyRequestLogFactory.java:229-235
  • Duplicated block (7 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/web/ProcessHandlerFilter.java:43 — pulsar-broker/src/main/java/org/apache/pulsar/broker/web/ProcessHandlerFilter.java:43-49 | pulsar-broker/src/main/java/org/apache/pulsar/broker/web/ResponseHandlerFilter.java:109-115
  • Duplicated block (7 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/BrokersBase.java:247 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/BrokersBase.java:247-255 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/ClustersBase.java:350-356
  • Duplicated block (7 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:267 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:267-273 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/NonPersistentTopics.java:475-481
  • Duplicated block (7 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:1593 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:1593-1599 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/NonPersistentTopics.java:318-324
  • Duplicated block (7 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:2040 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:2040-2046 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:5057-5063
  • Duplicated block (7 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/ScalableTopics.java:837 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/ScalableTopics.java:837-844 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/ScalableTopics.java:961-967
  • Duplicated block (7 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/ScalableTopics.java:967 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/ScalableTopics.java:967-974 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Segments.java:405-411
  • Duplicated block (7 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/strategy/DefaultNamespaceBundleSplitStrategyImpl.java:77 — pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/strategy/DefaultNamespaceBundleSplitStrategyImpl.java:77-83 | pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/BundleSplitterTask.java:66-72
  • Duplicated block (7 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/LeastResourceUsageWithWeight.java:69 — pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/LeastResourceUsageWithWeight.java:69-75 | pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/LeastResourceUsageWithWeight.java:112-118
  • Duplicated block (7 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/OverloadShedder.java:104 — pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/OverloadShedder.java:104-113 | pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/ThresholdShedder.java:129-135
  • Duplicated block (7 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java:980 — pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java:980-986 | pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java:1110-1116
  • Duplicated block (7 lines × 2) pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentOpenLongPairRangeSet.java:240 — pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentOpenLongPairRangeSet.java:240-246 | pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/OpenLongPairRangeSet.java:237-243
  • Duplicated block (7 lines × 2) pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentOpenLongPairRangeSet.java:251 — pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentOpenLongPairRangeSet.java:251-257 | pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/OpenLongPairRangeSet.java:248-254
  • Duplicated block (7 lines × 2) pulsar-common/src/main/java/org/apache/pulsar/common/policies/data/stats/SubscriptionStatsImpl.java:304 — pulsar-common/src/main/java/org/apache/pulsar/common/policies/data/stats/SubscriptionStatsImpl.java:304-310 | pulsar-common/src/main/java/org/apache/pulsar/common/policies/data/stats/TopicStatsImpl.java:311-318
  • Duplicated block (7 lines × 2) pulsar-client-messagecrypto-bc/src/main/java/org/apache/pulsar/client/impl/crypto/MessageCryptoBc.java:368 — pulsar-client-messagecrypto-bc/src/main/java/org/apache/pulsar/client/impl/crypto/MessageCryptoBc.java:368-374 | pulsar-client-messagecrypto-bc/src/main/java/org/apache/pulsar/client/impl/crypto/MessageCryptoBc.java:530-536
  • Duplicated block (7 lines × 2) pulsar-client-v5/src/main/java/org/apache/pulsar/client/impl/v5/MessageIdV5.java:270 — pulsar-client-v5/src/main/java/org/apache/pulsar/client/impl/v5/MessageIdV5.java:270-276 | pulsar-client-v5/src/main/java/org/apache/pulsar/client/impl/v5/MessageIdV5.java:323-329
  • Duplicated block (7 lines × 2) pulsar-client-v5/src/main/java/org/apache/pulsar/client/impl/v5/ScalableQueueConsumer.java:223 — pulsar-client-v5/src/main/java/org/apache/pulsar/client/impl/v5/ScalableQueueConsumer.java:223-229 | pulsar-client-v5/src/main/java/org/apache/pulsar/client/impl/v5/ScalableQueueConsumer.java:234-240
  • + 11 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×33
  • Duplicated block (12 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentSubscription.java:156 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentSubscription.java:156-167 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentSubscription.java:352-363
  • Duplicated block (12 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentTopic.java:868 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentTopic.java:868-879 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:2832-2843
  • Duplicated block (12 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentTopic.java:974 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentTopic.java:974-985 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:2962-2973
  • Duplicated block (12 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentTopic.java:1290 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentTopic.java:1290-1301 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:4596-4608
  • Duplicated block (12 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:610 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:610-621 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumersClassic.java:522-533
  • Duplicated block (12 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:1198 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:1198-1209 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumersClassic.java:1047-1058
  • Duplicated block (12 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/scalable/ScalableTopicController.java:975 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/scalable/ScalableTopicController.java:975-988 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/scalable/ScalableTopicController.java:1000-1011
  • Duplicated block (12 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java:1820 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java:1820-1831 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java:1837-1848
  • Duplicated block (12 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:3293 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:3293-3304 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:4201-4212
  • Duplicated block (12 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/StreamingStats.java:41 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/StreamingStats.java:41-52 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/StreamingStats.java:75-86
  • Duplicated block (12 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/TopicListService.java:498 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/TopicListService.java:498-509 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/TopicListService.java:605-616
  • Duplicated block (12 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/ClustersBase.java:726 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/ClustersBase.java:726-737 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:2613-2624
  • Duplicated block (12 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/ClustersBase.java:1014 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/ClustersBase.java:1014-1025 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/ClustersBase.java:1167-1178
  • Duplicated block (12 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:1920 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:1920-1931 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:2118-2130
  • Duplicated block (12 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:3231 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:3231-3242 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:3278-3289
  • Duplicated block (12 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:994 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:994-1006 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:4445-4456
  • Duplicated block (12 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:2224 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:2224-2236 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:2457-2468
  • Duplicated block (12 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:5377 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:5377-5389 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:5486-5497
  • Duplicated block (12 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:1929 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:1929-1940 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:1982-1993
  • Duplicated block (12 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/NonPersistentTopics.java:550 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/NonPersistentTopics.java:550-561 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/NonPersistentTopics.java:562-573
  • Duplicated block (12 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/SchemasResource.java:349 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/SchemasResource.java:349-361 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/SchemasResource.java:394-405
  • Duplicated block (12 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/buffer/impl/TopicTransactionBuffer.java:480 — pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/buffer/impl/TopicTransactionBuffer.java:480-491 | pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/buffer/impl/TopicTransactionBuffer.java:530-541
  • Duplicated block (12 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/buffer/impl/TopicTransactionBuffer.java:963 — pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/buffer/impl/TopicTransactionBuffer.java:963-974 | pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/pendingack/impl/MLPendingAckStore.java:494-505
  • Duplicated block (12 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/pendingack/impl/PendingAckHandleImpl.java:480 — pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/pendingack/impl/PendingAckHandleImpl.java:480-491 | pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/pendingack/impl/PendingAckHandleImpl.java:582-594
  • Duplicated block (12 lines × 2) pulsar-client-v5/src/main/java/org/apache/pulsar/client/impl/v5/MultiTopicQueueConsumer.java:372 — pulsar-client-v5/src/main/java/org/apache/pulsar/client/impl/v5/MultiTopicQueueConsumer.java:372-383 | pulsar-client-v5/src/main/java/org/apache/pulsar/client/impl/v5/MultiTopicStreamConsumer.java:365-376
  • + 8 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×30
  • Duplicated block (13 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentSubscription.java:304 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentSubscription.java:304-316 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentSubscription.java:1150-1162
  • Duplicated block (13 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentSubscription.java:537 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentSubscription.java:537-549 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentSubscription.java:1469-1481
  • Duplicated block (13 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:983 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:983-995 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentStickyKeyDispatcherMultipleConsumers.java:313-328
  • Duplicated block (13 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:1389 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:1389-1401 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumersClassic.java:1224-1236
  • Duplicated block (13 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:3449 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:3449-3461 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:3473-3485
  • Duplicated block (13 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java:1746 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java:1746-1758 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java:1770-1782
  • Duplicated block (13 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:3497 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:3497-3509 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:3593-3605
  • Duplicated block (13 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:3679 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:3679-3691 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:4111-4123
  • Duplicated block (13 lines × 2) pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/AuthorizationService.java:262 — pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/AuthorizationService.java:262-274 | pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/AuthorizationService.java:283-295
  • Duplicated block (13 lines × 2) pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/PulsarAuthorizationProvider.java:250 — pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/PulsarAuthorizationProvider.java:250-262 | pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/PulsarAuthorizationProvider.java:388-400
  • Duplicated block (13 lines × 2) pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/PulsarAuthorizationProvider.java:358 — pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/PulsarAuthorizationProvider.java:358-370 | pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/PulsarAuthorizationProvider.java:416-428
  • Duplicated block (13 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:2644 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:2644-2657 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:2709-2721
  • Duplicated block (13 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:1843 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:1843-1855 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:1875-1887
  • Duplicated block (13 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:2588 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:2588-2600 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:5304-5316
  • Duplicated block (13 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:2635 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:2635-2647 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:3008-3020
  • Duplicated block (13 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:244 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:244-256 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:1132-1144
  • Duplicated block (13 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Segments.java:372 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Segments.java:372-385 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Segments.java:445-457
  • Duplicated block (13 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v3/Transactions.java:373 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v3/Transactions.java:373-385 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v3/Transactions.java:429-441
  • Duplicated block (13 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/LoadManagerShared.java:119 — pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/LoadManagerShared.java:119-131 | pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/LoadManagerShared.java:206-218
  • Duplicated block (13 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java:1292 — pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java:1292-1304 | pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java:1321-1333
  • Duplicated block (13 lines × 2) pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentLongLongPairHashMap.java:345 — pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentLongLongPairHashMap.java:345-357 | pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentLongPairSet.java:352-365
  • Duplicated block (13 lines × 2) pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentLongLongPairHashMap.java:400 — pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentLongLongPairHashMap.java:400-412 | pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentLongPairSet.java:405-417
  • Duplicated block (13 lines × 2) pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentOpenLongPairRangeSet.java:345 — pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentOpenLongPairRangeSet.java:345-357 | pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/OpenLongPairRangeSet.java:347-359
  • Duplicated block (13 lines × 2) pulsar-client-messagecrypto-bc/src/main/java/org/apache/pulsar/client/impl/crypto/MessageCryptoBc.java:242 — pulsar-client-messagecrypto-bc/src/main/java/org/apache/pulsar/client/impl/crypto/MessageCryptoBc.java:242-254 | pulsar-client-messagecrypto-bc/src/main/java/org/apache/pulsar/client/impl/crypto/MessageCryptoBc.java:285-297
  • Duplicated block (13 lines × 2) pulsar-client/src/main/java/org/apache/pulsar/client/impl/transaction/TransactionImpl.java:132 — pulsar-client/src/main/java/org/apache/pulsar/client/impl/transaction/TransactionImpl.java:132-144 | pulsar-client/src/main/java/org/apache/pulsar/client/impl/transaction/TransactionImpl.java:173-185
  • + 5 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×22
  • Duplicated block (14 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/GeoPersistentReplicator.java:241 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/GeoPersistentReplicator.java:241-254 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/ShadowReplicator.java:110-123
  • Duplicated block (14 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:308 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:308-321 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumersClassic.java:288-301
  • Duplicated block (14 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:682 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:682-695 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumersClassic.java:594-607
  • Duplicated block (14 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentStickyKeyDispatcherMultipleConsumers.java:255 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentStickyKeyDispatcherMultipleConsumers.java:255-268 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentStickyKeyDispatcherMultipleConsumersClassic.java:300-314
  • Duplicated block (14 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:2126 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:2126-2140 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:2165-2178
  • Duplicated block (14 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:2950 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:2950-2963 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:3010-3024
  • Duplicated block (14 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:731 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:731-744 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:790-803
  • Duplicated block (14 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:1627 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:1627-1640 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:1681-1694
  • Duplicated block (14 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:2126 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:2126-2139 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:2208-2221
  • Duplicated block (14 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:2562 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:2562-2575 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:4118-4131
  • Duplicated block (14 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/intercept/BrokerInterceptorUtils.java:99 — pulsar-broker/src/main/java/org/apache/pulsar/broker/intercept/BrokerInterceptorUtils.java:99-112 | pulsar-broker/src/main/java/org/apache/pulsar/broker/protocol/ProtocolHandlerUtils.java:98-111
  • Duplicated block (14 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/coordinator/v5/TransactionCoordinatorV5.java:578 — pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/coordinator/v5/TransactionCoordinatorV5.java:578-591 | pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/metadata/TxnMetadataStore.java:419-433
  • Duplicated block (14 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/pendingack/impl/PendingAckHandleImpl.java:249 — pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/pendingack/impl/PendingAckHandleImpl.java:249-262 | pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/pendingack/impl/PendingAckHandleImpl.java:893-907
  • Duplicated block (14 lines × 2) pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/BitSetRecyclable.java:381 — pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/BitSetRecyclable.java:381-394 | pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/BitSetRecyclable.java:458-472
  • Duplicated block (14 lines × 2) pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentLongLongPairHashMap.java:488 — pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentLongLongPairHashMap.java:488-501 | pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentLongPairSet.java:507-520
  • Duplicated block (14 lines × 2) pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentOpenLongPairRangeSet.java:97 — pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentOpenLongPairRangeSet.java:97-110 | pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/OpenLongPairRangeSet.java:94-107
  • Duplicated block (14 lines × 2) pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/TripleLongPriorityQueue.java:226 — pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/TripleLongPriorityQueue.java:226-239 | pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/TripleLongPriorityQueue.java:277-290
  • Duplicated block (14 lines × 2) pulsar-client/src/main/java/org/apache/pulsar/client/impl/auth/oauth2/ClientCredentialsFlow.java:169 — pulsar-client/src/main/java/org/apache/pulsar/client/impl/auth/oauth2/ClientCredentialsFlow.java:169-182 | pulsar-client/src/main/java/org/apache/pulsar/client/impl/auth/oauth2/TlsClientAuthFlow.java:127-140
  • Duplicated block (14 lines × 2) pulsar-client-v5/src/main/java/org/apache/pulsar/client/impl/v5/ScalableQueueConsumer.java:453 — pulsar-client-v5/src/main/java/org/apache/pulsar/client/impl/v5/ScalableQueueConsumer.java:453-466 | pulsar-client-v5/src/main/java/org/apache/pulsar/client/impl/v5/ScalableStreamConsumer.java:613-627
  • Duplicated block (14 lines × 2) pulsar-client-admin-api/src/main/java/org/apache/pulsar/client/admin/utils/ReflectionUtils.java:40 — pulsar-client-admin-api/src/main/java/org/apache/pulsar/client/admin/utils/ReflectionUtils.java:40-53 | pulsar-client-api/src/main/java/org/apache/pulsar/client/internal/ReflectionUtils.java:32-45
  • Duplicated block (14 lines × 2) pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/SchemasImpl.java:163 — pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/SchemasImpl.java:163-176 | pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/SchemasImpl.java:219-232
  • Duplicated block (14 lines × 2) pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/SchemasImpl.java:190 — pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/SchemasImpl.java:190-203 | pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/SchemasImpl.java:247-260
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×16
  • Duplicated block (6 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentDispatcherMultipleConsumers.java:203 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentDispatcherMultipleConsumers.java:203-208 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentDispatcherSingleActiveConsumer.java:60-65
  • Duplicated block (6 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentSubscription.java:112 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentSubscription.java:112-117 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentSubscription.java:271-276
  • Duplicated block (6 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/AbstractReplicator.java:546 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/AbstractReplicator.java:546-551 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/TopicAttributes.java:33-38
  • Duplicated block (6 lines × 2) pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/AuthorizationService.java:860 — pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/AuthorizationService.java:860-865 | pulsar-broker/src/main/java/org/apache/pulsar/broker/resourcegroup/ResourceGroup.java:487-497
  • Duplicated block (6 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/BrokersBase.java:456 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/BrokersBase.java:456-461 | pulsar-broker-common/src/main/java/org/apache/pulsar/common/configuration/VipStatus.java:104-111
  • Duplicated block (6 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/SchemasResourceBase.java:155 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/SchemasResourceBase.java:155-160 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/SchemasResourceBase.java:175-180
  • Duplicated block (6 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Segments.java:402 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Segments.java:402-407 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Segments.java:457-462
  • Duplicated block (6 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/rest/TopicsBase.java:118 — pulsar-broker/src/main/java/org/apache/pulsar/broker/rest/TopicsBase.java:118-125 | pulsar-broker/src/main/java/org/apache/pulsar/broker/rest/TopicsBase.java:159-164
  • Duplicated block (6 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/rest/TopicsBase.java:195 — pulsar-broker/src/main/java/org/apache/pulsar/broker/rest/TopicsBase.java:195-200 | pulsar-broker/src/main/java/org/apache/pulsar/broker/rest/TopicsBase.java:236-242
  • Duplicated block (6 lines × 2) pulsar-common/src/main/java/org/apache/pulsar/common/policies/data/stats/NonPersistentTopicStatsImpl.java:66 — pulsar-common/src/main/java/org/apache/pulsar/common/policies/data/stats/NonPersistentTopicStatsImpl.java:66-71 | pulsar-common/src/main/java/org/apache/pulsar/common/policies/data/stats/NonPersistentTopicStatsImpl.java:98-103
  • Duplicated block (6 lines × 2) pulsar-common/src/main/java/org/apache/pulsar/common/compression/CompressionCodecLZ4.java:91 — pulsar-common/src/main/java/org/apache/pulsar/common/compression/CompressionCodecLZ4.java:91-96 | pulsar-common/src/main/java/org/apache/pulsar/common/compression/CompressionCodecSnappy.java:94-102
  • Duplicated block (6 lines × 2) pulsar-client-v5/src/main/java/org/apache/pulsar/client/impl/v5/AuthenticationAdapter.java:65 — pulsar-client-v5/src/main/java/org/apache/pulsar/client/impl/v5/AuthenticationAdapter.java:65-70 | pulsar-client-v5/src/main/java/org/apache/pulsar/client/impl/v5/AuthenticationAdapter.java:78-83
  • Duplicated block (6 lines × 2) pulsar-client-v5/src/main/java/org/apache/pulsar/client/impl/v5/DagWatchClient.java:85 — pulsar-client-v5/src/main/java/org/apache/pulsar/client/impl/v5/DagWatchClient.java:85-90 | pulsar-client-v5/src/main/java/org/apache/pulsar/client/impl/v5/ScalableTopicsWatcher.java:101-108
  • Duplicated block (6 lines × 2) pulsar-client-v5/src/main/java/org/apache/pulsar/client/impl/v5/ScalableQueueConsumer.java:128 — pulsar-client-v5/src/main/java/org/apache/pulsar/client/impl/v5/ScalableQueueConsumer.java:128-136 | pulsar-client-v5/src/main/java/org/apache/pulsar/client/impl/v5/ScalableStreamConsumer.java:146-151
  • Duplicated block (6 lines × 2) pulsar-client-v5/src/main/java/org/apache/pulsar/client/impl/v5/SchemaAdapter.java:62 — pulsar-client-v5/src/main/java/org/apache/pulsar/client/impl/v5/SchemaAdapter.java:62-67 | pulsar-client-v5/src/main/java/org/apache/pulsar/client/impl/v5/SchemaAdapter.java:141-146
  • Duplicated block (6 lines × 2) pulsar-client/src/main/java/org/apache/pulsar/client/impl/BinaryProtoLookupService.java:115 — pulsar-client/src/main/java/org/apache/pulsar/client/impl/BinaryProtoLookupService.java:115-120 | pulsar-client/src/main/java/org/apache/pulsar/client/impl/HttpLookupService.java:85-90
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×14
  • Duplicated block (15 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentSubscription.java:433 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentSubscription.java:433-447 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentSubscription.java:1301-1315
  • Duplicated block (15 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentTopic.java:798 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentTopic.java:798-812 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:2692-2706
  • Duplicated block (15 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentTopic.java:891 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentTopic.java:891-905 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:2864-2879
  • Duplicated block (15 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:807 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:807-821 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumersClassic.java:694-708
  • Duplicated block (15 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:1035 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:1035-1049 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumersClassic.java:893-907
  • Duplicated block (15 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:1067 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:1067-1081 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumersClassic.java:925-939
  • Duplicated block (15 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentReplicator.java:700 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentReplicator.java:700-714 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentSubscription.java:1068-1082
  • Duplicated block (15 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:656 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:656-670 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:4754-4768
  • Duplicated block (15 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:3699 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:3699-3713 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:4131-4145
  • Duplicated block (15 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:1981 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:1981-1995 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:2036-2050
  • Duplicated block (15 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:2285 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:2285-2299 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:2401-2415
  • Duplicated block (15 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:5241 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:5241-5256 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:5394-5408
  • Duplicated block (15 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/ExtensibleLoadManagerImpl.java:927 — pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/ExtensibleLoadManagerImpl.java:927-941 | pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/ExtensibleLoadManagerImpl.java:998-1012
  • Duplicated block (15 lines × 2) pulsar-common/src/main/java/org/apache/pulsar/common/intercept/BrokerEntryMetadataUtils.java:49 — pulsar-common/src/main/java/org/apache/pulsar/common/intercept/BrokerEntryMetadataUtils.java:49-63 | pulsar-common/src/main/java/org/apache/pulsar/common/intercept/BrokerEntryMetadataUtils.java:79-93
D15 · Churn × Complexity Hotspots · Hotspot · ×10
  • Hotspot: pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java changed 19 times in last 90 days, max complexity 38. 13 of those changes were fix/bug commits — a defect-dense hotspot worth prioritising.
  • Hotspot: pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java changed 15 times in last 90 days, max complexity 37. 8 of those changes were fix/bug commits — a defect-dense hotspot worth prioritising.
  • Hotspot: pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java changed 12 times in last 90 days, max complexity 31. 5 of those changes were fix/bug commits — a defect-dense hotspot worth prioritising.
  • Hotspot: pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java — pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java changed 6 times in last 90 days, max complexity 55. 1 of those changes were fix/bug commits — a defect-dense hotspot worth prioritising.
  • Hotspot: managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java — managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java changed 7 times in last 90 days, max complexity 25. 4 of those changes were fix/bug commits — a defect-dense hotspot worth prioritising.
  • Hotspot: pulsar-broker/src/main/java/org/apache/pulsar/broker/delayed/bucket/BucketDelayedDeliveryTracker.java pulsar-broker/src/main/java/org/apache/pulsar/broker/delayed/bucket/BucketDelayedDeliveryTracker.java — pulsar-broker/src/main/java/org/apache/pulsar/broker/delayed/bucket/BucketDelayedDeliveryTracker.java changed 9 times in last 90 days, max complexity 18. 7 of those changes were fix/bug commits — a defect-dense hotspot worth prioritising.
  • Hotspot: pulsar-common/src/main/java/org/apache/pulsar/common/protocol/PulsarDecoder.java pulsar-common/src/main/java/org/apache/pulsar/common/protocol/PulsarDecoder.java — pulsar-common/src/main/java/org/apache/pulsar/common/protocol/PulsarDecoder.java changed 2 times in last 90 days, max complexity 80.
  • Hotspot: pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java — pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java changed 5 times in last 90 days, max complexity 27. 3 of those changes were fix/bug commits — a defect-dense hotspot worth prioritising.
  • Hotspot: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java changed 6 times in last 90 days, max complexity 21. 3 of those changes were fix/bug commits — a defect-dense hotspot worth prioritising.
  • Hotspot: managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java — managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java changed 5 times in last 90 days, max complexity 24. 2 of those changes were fix/bug commits — a defect-dense hotspot worth prioritising.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×7
  • Duplicated block (8 lines × 3) pulsar-broker/src/main/java/org/apache/pulsar/broker/web/PulsarWebResource.java:1016 — pulsar-broker/src/main/java/org/apache/pulsar/broker/web/PulsarWebResource.java:1016-1024 | pulsar-broker/src/main/java/org/apache/pulsar/broker/web/PulsarWebResource.java:1045-1053 | pulsar-broker/src/main/java/org/apache/pulsar/broker/web/PulsarWebResource.java:1233-1240
  • Duplicated block (8 lines × 3) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:3353 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:3353-3360 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:4621-4628 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:4728-4735
  • Duplicated block (8 lines × 3) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Segments.java:156 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Segments.java:156-163 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Segments.java:366-377 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Segments.java:439-449
  • Duplicated block (8 lines × 3) pulsar-client-v5/src/main/java/org/apache/pulsar/client/impl/v5/DagWatchClient.java:231 — pulsar-client-v5/src/main/java/org/apache/pulsar/client/impl/v5/DagWatchClient.java:231-238 | pulsar-client-v5/src/main/java/org/apache/pulsar/client/impl/v5/ScalableConsumerClient.java:279-286 | pulsar-client-v5/src/main/java/org/apache/pulsar/client/impl/v5/ScalableTopicsWatcher.java:253-260
  • Duplicated block (8 lines × 3) pulsar-client/src/main/java/org/apache/pulsar/client/impl/HttpClient.java:362 — pulsar-client/src/main/java/org/apache/pulsar/client/impl/HttpClient.java:362-369 | pulsar-client/src/main/java/org/apache/pulsar/client/impl/PulsarChannelInitializer.java:215-222 | pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/http/AsyncHttpConnector.java:637-644
  • Duplicated block (8 lines × 3) pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/FunctionsImpl.java:312 — pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/FunctionsImpl.java:312-319 | pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/SinksImpl.java:297-304 | pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/SourcesImpl.java:263-270
  • Duplicated block (8 lines × 3) pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/TopicPoliciesImpl.java:407 — pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/TopicPoliciesImpl.java:407-414 | pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/TopicPoliciesImpl.java:463-470 | pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/TopicsImpl.java:2103-2110
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×6
  • Duplicated block (16 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/GeoPersistentReplicator.java:152 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/GeoPersistentReplicator.java:152-167 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/ShadowReplicator.java:65-80
  • Duplicated block (16 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentStickyKeyDispatcherMultipleConsumers.java:235 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentStickyKeyDispatcherMultipleConsumers.java:235-250 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentStickyKeyDispatcherMultipleConsumersClassic.java:275-292
  • Duplicated block (16 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:2514 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:2514-2529 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:2606-2621
  • Duplicated block (16 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/TransactionsBase.java:148 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/TransactionsBase.java:148-163 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/TransactionsBase.java:372-387
  • Duplicated block (16 lines × 2) pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentLongLongPairHashMap.java:443 — pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentLongLongPairHashMap.java:443-458 | pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentLongPairSet.java:440-455
  • Duplicated block (16 lines × 2) pulsar-client/src/main/java/org/apache/pulsar/client/impl/tracing/OpenTelemetryConsumerInterceptor.java:277 — pulsar-client/src/main/java/org/apache/pulsar/client/impl/tracing/OpenTelemetryConsumerInterceptor.java:277-292 | pulsar-client/src/main/java/org/apache/pulsar/client/impl/tracing/OpenTelemetryConsumerInterceptor.java:309-324
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×6
  • Duplicated block (11 lines × 3) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java:1672 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java:1672-1682 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java:1821-1831 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java:1838-1848
  • Duplicated block (11 lines × 3) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/ClustersBase.java:252 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/ClustersBase.java:252-262 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/ClustersBase.java:293-303 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/ClustersBase.java:357-367
  • Duplicated block (11 lines × 3) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/TenantsBase.java:155 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/TenantsBase.java:155-165 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/ResourceQuotas.java:139-149 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/ResourceQuotas.java:173-183
  • Duplicated block (11 lines × 3) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:362 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:362-372 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:678-688 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:702-712
  • Duplicated block (11 lines × 3) pulsar-common/src/main/java/org/apache/pulsar/common/util/Reflections.java:90 — pulsar-common/src/main/java/org/apache/pulsar/common/util/Reflections.java:90-100 | pulsar-common/src/main/java/org/apache/pulsar/common/util/Reflections.java:127-137 | pulsar-common/src/main/java/org/apache/pulsar/common/util/Reflections.java:161-171
  • Duplicated block (11 lines × 3) pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/FunctionsImpl.java:252 — pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/FunctionsImpl.java:252-262 | pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/SinksImpl.java:226-236 | pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/SourcesImpl.java:194-205
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×6
  • Duplicated block (7 lines × 3) pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/prometheus/TransactionAggregator.java:167 — pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/prometheus/TransactionAggregator.java:167-173 | pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/prometheus/TransactionAggregator.java:194-200 | pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/prometheus/TransactionAggregator.java:221-227
  • Duplicated block (7 lines × 3) pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/prometheus/TransactionAggregator.java:182 — pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/prometheus/TransactionAggregator.java:182-188 | pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/prometheus/TransactionAggregator.java:209-216 | pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/prometheus/TransactionAggregator.java:234-240
  • Duplicated block (7 lines × 3) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:1959 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:1959-1965 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:2009-2015 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:2065-2071
  • Duplicated block (7 lines × 3) pulsar-client/src/main/java/org/apache/pulsar/client/impl/TransactionMetaStoreHandler.java:353 — pulsar-client/src/main/java/org/apache/pulsar/client/impl/TransactionMetaStoreHandler.java:353-359 | pulsar-client/src/main/java/org/apache/pulsar/client/impl/TransactionMetaStoreHandler.java:435-442 | pulsar-client/src/main/java/org/apache/pulsar/client/impl/TransactionMetaStoreHandler.java:528-534
  • Duplicated block (7 lines × 3) pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/SinksImpl.java:325 — pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/SinksImpl.java:325-331 | pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/SinksImpl.java:357-363 | pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/SinksImpl.java:389-395
  • Duplicated block (7 lines × 3) pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/SinksImpl.java:340 — pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/SinksImpl.java:340-346 | pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/SinksImpl.java:372-378 | pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/SinksImpl.java:404-410
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×5
  • Duplicated block (18 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentTopic.java:817 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentTopic.java:817-834 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:2779-2796
  • Duplicated block (18 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:194 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:194-211 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumersClassic.java:184-201
  • Duplicated block (18 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:342 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:342-359 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumersClassic.java:315-332
  • Duplicated block (18 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:1305 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:1305-1322 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumersClassic.java:1152-1169
  • Duplicated block (18 lines × 2) microbench/src/main/java/org/apache/pulsar/broker/service/PendingAcksMapPackingBenchmark.java:422 — microbench/src/main/java/org/apache/pulsar/broker/service/PendingAcksMapPackingBenchmark.java:422-439 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/PendingAcksMap.java:485-502
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×5
  • Duplicated block (10 lines × 3) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java:893 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java:893-902 | pulsar-broker/src/main/java/org/apache/pulsar/broker/systopic/TopicPoliciesSystemTopicClient.java:122-131 | pulsar-broker/src/main/java/org/apache/pulsar/broker/systopic/TopicPoliciesSystemTopicClient.java:193-202
  • Duplicated block (10 lines × 3) pulsar-broker-common/src/main/java/org/apache/pulsar/broker/web/plugin/servlet/AdditionalServletUtils.java:158 — pulsar-broker-common/src/main/java/org/apache/pulsar/broker/web/plugin/servlet/AdditionalServletUtils.java:158-167 | pulsar-broker/src/main/java/org/apache/pulsar/broker/intercept/BrokerInterceptorUtils.java:153-162 | pulsar-broker/src/main/java/org/apache/pulsar/broker/protocol/ProtocolHandlerUtils.java:153-162
  • Duplicated block (10 lines × 3) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:1909 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:1909-1918 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:2107-2116 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:2684-2693
  • Duplicated block (10 lines × 3) pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/channel/ServiceUnitStateChannelImpl.java:1922 — pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/channel/ServiceUnitStateChannelImpl.java:1922-1931 | pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/channel/ServiceUnitStateChannelImpl.java:1944-1953 | pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/channel/ServiceUnitStateChannelImpl.java:1966-1975
  • Duplicated block (10 lines × 3) pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentLongHashMap.java:151 — pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentLongHashMap.java:151-160 | pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentLongLongPairHashMap.java:157-166 | pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentLongPairSet.java:162-171
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×5
  • Duplicated block (9 lines × 3) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:1292 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:1292-1300 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumersClassic.java:1139-1147 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherSingleActiveConsumer.java:584-592
  • Duplicated block (9 lines × 3) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/ClustersBase.java:188 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/ClustersBase.java:188-196 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/ClustersBase.java:247-255 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/ClustersBase.java:352-360
  • Duplicated block (9 lines × 3) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/ClustersBase.java:396 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/ClustersBase.java:396-404 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/ClustersBase.java:781-789 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/ClustersBase.java:999-1008
  • Duplicated block (9 lines × 3) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/ScalableTopics.java:673 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/ScalableTopics.java:673-681 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Segments.java:175-183 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Segments.java:507-515
  • Duplicated block (9 lines × 3) pulsar-client/src/main/java/org/apache/pulsar/client/impl/ClientCnx.java:1403 — pulsar-client/src/main/java/org/apache/pulsar/client/impl/ClientCnx.java:1403-1411 | pulsar-client/src/main/java/org/apache/pulsar/client/impl/ClientCnx.java:1503-1511 | pulsar-client/src/main/java/org/apache/pulsar/client/impl/ClientCnx.java:1585-1593
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×5
  • Duplicated block (5 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/LeastLongTermMessageRate.java:109 — pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/LeastLongTermMessageRate.java:109-113 | pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/LeastResourceUsageWithWeight.java:64-68
  • Duplicated block (5 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/resourcegroup/ResourceGroupService.java:380 — pulsar-broker/src/main/java/org/apache/pulsar/broker/resourcegroup/ResourceGroupService.java:380-385 | pulsar-broker/src/main/java/org/apache/pulsar/broker/resourcegroup/ResourceGroupService.java:386-390
  • Duplicated block (5 lines × 2) pulsar-common/src/main/java/org/apache/pulsar/common/util/DefaultPulsarSslFactory.java:202 — pulsar-common/src/main/java/org/apache/pulsar/common/util/DefaultPulsarSslFactory.java:202-206 | pulsar-common/src/main/java/org/apache/pulsar/common/util/DefaultPulsarSslFactory.java:209-213
  • Duplicated block (5 lines × 2) pulsar-client-v5/src/main/java/org/apache/pulsar/client/impl/v5/ScalableTopicsWatcher.java:225 — pulsar-client-v5/src/main/java/org/apache/pulsar/client/impl/v5/ScalableTopicsWatcher.java:225-231 | pulsar-client/src/main/java/org/apache/pulsar/client/impl/transaction/WatchTcAssignmentsDiscovery.java:190-194
  • Duplicated block (5 lines × 2) pulsar-client/src/main/java/org/apache/pulsar/client/impl/MessageIdImpl.java:105 — pulsar-client/src/main/java/org/apache/pulsar/client/impl/MessageIdImpl.java:105-109 | pulsar-client/src/main/java/org/apache/pulsar/client/impl/MessageIdImpl.java:140-145
D31 · IaC & Container Security · Medium IaC · ×4
  • Medium IaC: AWS-0178 deployment/terraform-ansible/aws/network.tf — VPC Flow Logs is a feature that enables you to capture information about the IP traffic going to and from network interfaces in your VPC. After you've created a flow log, you can view and retrieve its data in Amazon CloudWatch Logs. It is recommended that VPC Flow Logs be enabled for packet "Rejects" for VPCs.
  • Medium IaC: DS-0001 docker/pulsar/Dockerfile — ':latest' tag used
  • Medium IaC: DS-0013 docker/pulsar/Dockerfile — 'RUN cd ...' to change directory
  • Medium IaC: DS-0001 docker/pulsar/Dockerfile.wolfi — ':latest' tag used
D38 · OSV Dependency Vulnerabilities · Medium CVE · ×4
  • Medium CVE: GO-2026-5046 pulsar-function-go/go.mod — github.com/hamba/avro/v2 2.29.0 (github.com/hamba/avro/v2): GO-2026-5046 — no fixed version has been published yet. Track the advisory, and remove or replace github.com/hamba/avro/v2 if the exposure is not acceptable until one lands. One upgrade of github.com/hamba/avro/v2 2.29.0 clears all 3 advisories it raises: GO-2026-5046, GO-2026-5047, GO-2026-5048.
  • Medium CVE: GO-2026-5942 pulsar-function-go/go.mod — golang.org/x/net 0.55.0 (golang.org/x/net/dns/dnsmessage): GO-2026-5942 — golang.org/x/net is not a DIRECT requirement of this module: go.mod records it as `// indirect`, pulled in transitively, so raise it in place (run `go get golang.org/x/net@v0.56.0`, which updates the require line go.mod already holds for it).
  • Medium CVE: GO-2026-5970 pulsar-function-go/go.mod — golang.org/x/text 0.37.0 (golang.org/x/text/unicode/norm): GO-2026-5970 — golang.org/x/text is not a DIRECT requirement of this module: go.mod records it as `// indirect`, pulled in transitively, so raise it in place (run `go get golang.org/x/text@v0.39.0`, which updates the require line go.mod already holds for it).
  • Medium CVE: GO-2025-3955 pulsar-function-go/go.mod — stdlib 1.25.0 (net/http): GO-2025-3955 — fixed in Go 1.25.1; pin a build toolchain at or above it (go.mod `toolchain` directive, or your CI's Go version) — the `go` directive is a minimum language version, not the compiler that builds your binaries. One upgrade of stdlib 1.25.0 clears all 39 advisories it raises: GO-2025-3955, GO-2025-4006, GO-2025-4007, GO-2025-4008, GO-2025-4009, GO-2025-4010, GO-2025-4011, GO-2025-4012, GO-2025-4013, GO-2025-4014, GO-2025-4015, GO-2025-4155, GO-2025-4175, GO-2026-4337, GO-2026-4340, GO-2026-4341, GO-2026-4342, GO-2026-4601, GO-2026-4602, GO-2026-4603, GO-2026-4864, GO-2026-4865, GO-2026-4869, GO-2026-4870, GO-2026-4918, GO-2026-4946, GO-2026-4947, GO-2026-4970, GO-2026-4971, GO-2026-4976, GO-2026-4977, GO-2026-4980, GO-2026-4981, GO-2026-4982, GO-2026-4986, GO-2026-5037, GO-2026-5038, GO-2026-5039, GO-2026-5856.
D4 · Code Duplication · Duplicated block (13 lines × 4) · ×4
  • Duplicated block (13 lines × 4) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:1945 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:1945-1957 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:2468-2480 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:2612-2624 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:2741-2753
  • Duplicated block (13 lines × 4) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v3/Transactions.java:132 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v3/Transactions.java:132-144 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v3/Transactions.java:175-187 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v3/Transactions.java:218-230 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v3/Transactions.java:260-272
  • Duplicated block (13 lines × 4) pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentBitSet.java:117 — pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentBitSet.java:117-129 | pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentBitSet.java:133-145 | pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentBitSet.java:149-161 | pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentBitSet.java:165-177
  • Duplicated block (13 lines × 4) pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentBitSet.java:197 — pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentBitSet.java:197-209 | pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentBitSet.java:213-225 | pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentBitSet.java:323-335 | pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentBitSet.java:455-467
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×3
  • Duplicated block (12 lines × 3) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:661 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:661-672 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:699-710 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:738-749
  • Duplicated block (12 lines × 3) pulsar-client/src/main/java/org/apache/pulsar/client/impl/tracing/OpenTelemetryConsumerInterceptor.java:167 — pulsar-client/src/main/java/org/apache/pulsar/client/impl/tracing/OpenTelemetryConsumerInterceptor.java:167-178 | pulsar-client/src/main/java/org/apache/pulsar/client/impl/tracing/OpenTelemetryConsumerInterceptor.java:289-300 | pulsar-client/src/main/java/org/apache/pulsar/client/impl/tracing/OpenTelemetryConsumerInterceptor.java:321-332
  • Duplicated block (12 lines × 3) pulsar-client/src/main/java/org/apache/pulsar/client/impl/TransactionMetaStoreHandler.java:296 — pulsar-client/src/main/java/org/apache/pulsar/client/impl/TransactionMetaStoreHandler.java:296-307 | pulsar-client/src/main/java/org/apache/pulsar/client/impl/TransactionMetaStoreHandler.java:377-388 | pulsar-client/src/main/java/org/apache/pulsar/client/impl/TransactionMetaStoreHandler.java:550-561
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×3
  • Duplicated block (5 lines × 3) pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/prometheus/NamespaceStatsAggregator.java:479 — pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/prometheus/NamespaceStatsAggregator.java:479-483 | pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/prometheus/NamespaceStatsAggregator.java:496-503 | pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/prometheus/NamespaceStatsAggregator.java:523-527
  • Duplicated block (5 lines × 3) pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/prometheus/NamespaceStatsAggregator.java:486 — pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/prometheus/NamespaceStatsAggregator.java:486-491 | pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/prometheus/NamespaceStatsAggregator.java:510-518 | pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/prometheus/NamespaceStatsAggregator.java:529-533
  • Duplicated block (5 lines × 3) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/SchemasResourceBase.java:141 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/SchemasResourceBase.java:141-145 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/SchemasResourceBase.java:162-167 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/SchemasResourceBase.java:183-187
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×2
  • Duplicated block (17 lines × 2) pulsar-broker-auth-oidc/src/main/java/org/apache/pulsar/broker/authentication/oidc/JwksCache.java:191 — pulsar-broker-auth-oidc/src/main/java/org/apache/pulsar/broker/authentication/oidc/JwksCache.java:191-207 | pulsar-broker-auth-oidc/src/main/java/org/apache/pulsar/broker/authentication/oidc/OpenIDProviderMetadataCache.java:189-206
  • Duplicated block (17 lines × 2) pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentOpenLongPairRangeSet.java:408 — pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentOpenLongPairRangeSet.java:408-424 | pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/OpenLongPairRangeSet.java:410-426
D4 · Code Duplication · Duplicated block (14 lines × 3) · ×2
  • Duplicated block (14 lines × 3) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/BrokersBase.java:549 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/BrokersBase.java:549-562 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/ClustersBase.java:1231-1244 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/ClustersBase.java:1267-1280
  • Duplicated block (14 lines × 3) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:2466 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:2466-2479 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:2610-2623 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:2739-2752
D4 · Code Duplication · Duplicated block (12 lines × 4) · ×2
  • Duplicated block (12 lines × 4) pulsar-broker/src/main/java/org/apache/pulsar/broker/web/PulsarWebResource.java:997 — pulsar-broker/src/main/java/org/apache/pulsar/broker/web/PulsarWebResource.java:997-1008 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/BrokersBase.java:586-597 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/ClustersBase.java:1303-1314 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/ClustersBase.java:1324-1335
  • Duplicated block (12 lines × 4) pulsar-client/src/main/java/org/apache/pulsar/client/impl/TransactionMetaStoreHandler.java:332 — pulsar-client/src/main/java/org/apache/pulsar/client/impl/TransactionMetaStoreHandler.java:332-343 | pulsar-client/src/main/java/org/apache/pulsar/client/impl/TransactionMetaStoreHandler.java:412-423 | pulsar-client/src/main/java/org/apache/pulsar/client/impl/TransactionMetaStoreHandler.java:507-518 | pulsar-client/src/main/java/org/apache/pulsar/client/impl/TransactionMetaStoreHandler.java:587-598
D4 · Code Duplication · Duplicated block (10 lines × 4) · ×2
  • Duplicated block (10 lines × 4) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:3388 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:3388-3397 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:3491-3500 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:3799-3808 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:4442-4451
  • Duplicated block (10 lines × 4) pulsar-client/src/main/java/org/apache/pulsar/client/impl/TransactionMetaStoreHandler.java:285 — pulsar-client/src/main/java/org/apache/pulsar/client/impl/TransactionMetaStoreHandler.java:285-294 | pulsar-client/src/main/java/org/apache/pulsar/client/impl/TransactionMetaStoreHandler.java:365-375 | pulsar-client/src/main/java/org/apache/pulsar/client/impl/TransactionMetaStoreHandler.java:447-456 | pulsar-client/src/main/java/org/apache/pulsar/client/impl/TransactionMetaStoreHandler.java:539-548
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×2
  • Duplicated block (7 lines × 4) pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/prometheus/TopicStats.java:221 — pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/prometheus/TopicStats.java:221-227 | pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/prometheus/TopicStats.java:249-258 | pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/prometheus/TopicStats.java:286-292 | pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/prometheus/TopicStats.java:519-528
  • Duplicated block (7 lines × 4) pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/prometheus/TopicStats.java:235 — pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/prometheus/TopicStats.java:235-241 | pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/prometheus/TopicStats.java:270-279 | pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/prometheus/TopicStats.java:298-304 | pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/prometheus/TopicStats.java:540-549
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×2
  • Duplicated block (6 lines × 3) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentTopic.java:672 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentTopic.java:672-677 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:2448-2453 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:2560-2565
  • Duplicated block (6 lines × 3) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:1922 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:1922-1928 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:2575-2580 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:2697-2702
D1 · Cyclomatic Complexity · PulsarDecoder.channelRead (cyclomatic 80) · ×1
  • PulsarDecoder.channelRead (cyclomatic 80) pulsar-common/src/main/java/org/apache/pulsar/common/protocol/PulsarDecoder.java:118 — PulsarDecoder.channelRead has cyclomatic complexity 80 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · FunctionConfigUtils.convert (cyclomatic 70) · ×1
  • FunctionConfigUtils.convert (cyclomatic 70) pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/FunctionConfigUtils.java:102 — FunctionConfigUtils.convert has cyclomatic complexity 70 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TransferShedder.findBundlesForUnloading (cyclomatic 66) · ×1
  • TransferShedder.findBundlesForUnloading (cyclomatic 66) pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/scheduler/TransferShedder.java:317 — TransferShedder.findBundlesForUnloading has cyclomatic complexity 66 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FunctionDetailsCommand.processArguments (cyclomatic 66) · ×1
  • FunctionDetailsCommand.processArguments (cyclomatic 66) pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java:441 — FunctionDetailsCommand.processArguments has cyclomatic complexity 66 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PulsarService.closeAsync (cyclomatic 55) · ×1
  • PulsarService.closeAsync (cyclomatic 55) pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java:517 — PulsarService.closeAsync has cyclomatic complexity 55 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FunctionConfigUtils.doCommonChecks (cyclomatic 54) · ×1
  • FunctionConfigUtils.doCommonChecks (cyclomatic 54) pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/FunctionConfigUtils.java:793 — FunctionConfigUtils.doCommonChecks has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SinkConfigUtils.convert (cyclomatic 51) · ×1
  • SinkConfigUtils.convert (cyclomatic 51) pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/SinkConfigUtils.java:81 — SinkConfigUtils.convert has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PerformanceTransaction.run (cyclomatic 51) · ×1
  • PerformanceTransaction.run (cyclomatic 51) pulsar-testclient/src/main/java/org/apache/pulsar/testclient/PerformanceTransaction.java:191 — PerformanceTransaction.run has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TopicsImpl.getMessagesFromHttpResponse (cyclomatic 50) · ×1
  • TopicsImpl.getMessagesFromHttpResponse (cyclomatic 50) pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/TopicsImpl.java:1286 — TopicsImpl.getMessagesFromHttpResponse has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SinkDetailsCommand.processArguments (cyclomatic 46) · ×1
  • SinkDetailsCommand.processArguments (cyclomatic 46) pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdSinks.java:448 — SinkDetailsCommand.processArguments has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FunctionConfigUtils.validateUpdate (cyclomatic 46) · ×1
  • FunctionConfigUtils.validateUpdate (cyclomatic 46) pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/FunctionConfigUtils.java:989 — FunctionConfigUtils.validateUpdate has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PerformanceProducer.runProducer (cyclomatic 45) · ×1
  • PerformanceProducer.runProducer (cyclomatic 45) pulsar-testclient/src/main/java/org/apache/pulsar/testclient/PerformanceProducer.java:526 — PerformanceProducer.runProducer has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SinkConfigUtils.validateAndExtractDetails (cyclomatic 42) · ×1
  • SinkConfigUtils.validateAndExtractDetails (cyclomatic 42) pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/SinkConfigUtils.java:414 — SinkConfigUtils.validateAndExtractDetails has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AbstractBaseDispatcher.filterEntriesForConsumer (cyclomatic 40) · ×1
  • AbstractBaseDispatcher.filterEntriesForConsumer (cyclomatic 40) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/AbstractBaseDispatcher.java:126 — AbstractBaseDispatcher.filterEntriesForConsumer 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.
D1 · Cyclomatic Complexity · PulsarClientException.unwrap (cyclomatic 40) · ×1
  • PulsarClientException.unwrap (cyclomatic 40) pulsar-client-api/src/main/java/org/apache/pulsar/client/api/PulsarClientException.java:1055 — PulsarClientException.unwrap 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.
D1 · Cyclomatic Complexity · SinkConfigUtils.validateUpdate (cyclomatic 39) · ×1
  • SinkConfigUtils.validateUpdate (cyclomatic 39) pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/SinkConfigUtils.java:609 — SinkConfigUtils.validateUpdate has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PersistentTopic.internalSubscribe (cyclomatic 38) · ×1
  • PersistentTopic.internalSubscribe (cyclomatic 38) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:915 — PersistentTopic.internalSubscribe has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PulsarClientException.wrap (cyclomatic 38) · ×1
  • PulsarClientException.wrap (cyclomatic 38) pulsar-client-api/src/main/java/org/apache/pulsar/client/api/PulsarClientException.java:973 — PulsarClientException.wrap has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RuntimeUtils.getGoInstanceCmd (cyclomatic 38) · ×1
  • RuntimeUtils.getGoInstanceCmd (cyclomatic 38) pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/RuntimeUtils.java:132 — RuntimeUtils.getGoInstanceCmd has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ServerCnx.handleProducer (cyclomatic 37) · ×1
  • ServerCnx.handleProducer (cyclomatic 37) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:2248 — ServerCnx.handleProducer has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ServerCnx.handleSubscribe (cyclomatic 36) · ×1
  • ServerCnx.handleSubscribe (cyclomatic 36) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:1814 — ServerCnx.handleSubscribe has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PersistentTopicsBase.generateResponseWithEntry (cyclomatic 36) · ×1
  • PersistentTopicsBase.generateResponseWithEntry (cyclomatic 36) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:3219 — PersistentTopicsBase.generateResponseWithEntry has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ProducerImpl.connectionOpened (cyclomatic 34) · ×1
  • ProducerImpl.connectionOpened (cyclomatic 34) pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java:1933 — ProducerImpl.connectionOpened has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SourceDetailsCommand.processArguments (cyclomatic 34) · ×1
  • SourceDetailsCommand.processArguments (cyclomatic 34) pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdSources.java:395 — SourceDetailsCommand.processArguments has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RuntimeUtils.getCmd (cyclomatic 34) · ×1
  • RuntimeUtils.getCmd (cyclomatic 34) pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/RuntimeUtils.java:303 — RuntimeUtils.getCmd has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DefaultNamespaceBundleSplitStrategyImpl.findBundlesToSplit (cyclomatic 33) · ×1
  • DefaultNamespaceBundleSplitStrategyImpl.findBundlesToSplit (cyclomatic 33) pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/strategy/DefaultNamespaceBundleSplitStrategyImpl.java:74 — DefaultNamespaceBundleSplitStrategyImpl.findBundlesToSplit has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SinksImpl.updateSink (cyclomatic 33) · ×1
  • SinksImpl.updateSink (cyclomatic 33) pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/SinksImpl.java:265 — SinksImpl.updateSink has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ProducerImpl.sendAsync (cyclomatic 32) · ×1
  • ProducerImpl.sendAsync (cyclomatic 32) pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java:564 — ProducerImpl.sendAsync 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.
D1 · Cyclomatic Complexity · BrokerService.getManagedLedgerConfig (cyclomatic 31) · ×1
  • BrokerService.getManagedLedgerConfig (cyclomatic 31) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java:2168 — BrokerService.getManagedLedgerConfig has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FunctionDetailsCommand.mergeArgs (cyclomatic 31) · ×1
  • FunctionDetailsCommand.mergeArgs (cyclomatic 31) pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java:390 — FunctionDetailsCommand.mergeArgs has cyclomatic complexity 31 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · FunctionsImpl.updateFunction (cyclomatic 31) · ×1
  • FunctionsImpl.updateFunction (cyclomatic 31) pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/FunctionsImpl.java:259 — FunctionsImpl.updateFunction has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SourcesImpl.updateSource (cyclomatic 31) · ×1
  • SourcesImpl.updateSource (cyclomatic 31) pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/SourcesImpl.java:259 — SourcesImpl.updateSource has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PerformanceClient.runPerformanceTest (cyclomatic 31) · ×1
  • PerformanceClient.runPerformanceTest (cyclomatic 31) pulsar-testclient/src/main/java/org/apache/pulsar/proxy/socket/client/PerformanceClient.java:204 — PerformanceClient.runPerformanceTest has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConsumerBuilderImpl.subscribeAsync (cyclomatic 30) · ×1
  • ConsumerBuilderImpl.subscribeAsync (cyclomatic 30) pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerBuilderImpl.java:138 — ConsumerBuilderImpl.subscribeAsync has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SinksImpl.registerSink (cyclomatic 30) · ×1
  • SinksImpl.registerSink (cyclomatic 30) pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/SinksImpl.java:77 — SinksImpl.registerSink has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ServiceUnitStateChannelImpl.monitorOwnerships (cyclomatic 29) · ×1
  • ServiceUnitStateChannelImpl.monitorOwnerships (cyclomatic 29) pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/channel/ServiceUnitStateChannelImpl.java:1736 — ServiceUnitStateChannelImpl.monitorOwnerships has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ProducerImpl.recoverProcessOpSendMsgFrom (cyclomatic 29) · ×1
  • ProducerImpl.recoverProcessOpSendMsgFrom (cyclomatic 29) pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java:2620 — ProducerImpl.recoverProcessOpSendMsgFrom has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SourcesImpl.registerSource (cyclomatic 29) · ×1
  • SourcesImpl.registerSource (cyclomatic 29) pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/SourcesImpl.java:76 — SourcesImpl.registerSource has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PulsarService.start (cyclomatic 28) · ×1
  • PulsarService.start (cyclomatic 28) pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java:850 — PulsarService.start has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FunctionsImpl.registerFunction (cyclomatic 28) · ×1
  • FunctionsImpl.registerFunction (cyclomatic 28) pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/FunctionsImpl.java:78 — FunctionsImpl.registerFunction has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SourceConfigUtils.validateAndExtractDetails (cyclomatic 28) · ×1
  • SourceConfigUtils.validateAndExtractDetails (cyclomatic 28) pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/SourceConfigUtils.java:262 — SourceConfigUtils.validateAndExtractDetails has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PerformanceConsumer.pollLoop (cyclomatic 28) · ×1
  • PerformanceConsumer.pollLoop (cyclomatic 28) pulsar-testclient/src/main/java/org/apache/pulsar/testclient/PerformanceConsumer.java:458 — PerformanceConsumer.pollLoop has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PersistentStickyKeyDispatcherMultipleConsumers.filterAndGroupEntriesForDispatching (cyclomatic 27) · ×1
  • PersistentStickyKeyDispatcherMultipleConsumers.filterAndGroupEntriesForDispatching (cyclomatic 27) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentStickyKeyDispatcherMultipleConsumers.java:444 — PersistentStickyKeyDispatcherMultipleConsumers.filterAndGroupEntriesForDispatching 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.
D1 · Cyclomatic Complexity · ConsumerImpl.connectionOpened (cyclomatic 27) · ×1
  • ConsumerImpl.connectionOpened (cyclomatic 27) pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java:873 — ConsumerImpl.connectionOpened 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.
D1 · Cyclomatic Complexity · ProxyServiceStarter.<init> (cyclomatic 27) · ×1
  • ProxyServiceStarter.<init> (cyclomatic 27) pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/ProxyServiceStarter.java:130 — ProxyServiceStarter.<init> 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.
D1 · Cyclomatic Complexity · ServiceUnitStateDataConflictResolver.shouldKeepLeft (cyclomatic 26) · ×1
  • ServiceUnitStateDataConflictResolver.shouldKeepLeft (cyclomatic 26) pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/channel/ServiceUnitStateDataConflictResolver.java:69 — ServiceUnitStateDataConflictResolver.shouldKeepLeft has cyclomatic complexity 26 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · IsolatedBookieEnsemblePlacementPolicy.getExcludedBookiesWithIsolationGroups (cyclomatic 26) · ×1
  • IsolatedBookieEnsemblePlacementPolicy.getExcludedBookiesWithIsolationGroups (cyclomatic 26) pulsar-broker-common/src/main/java/org/apache/pulsar/bookie/rackawareness/IsolatedBookieEnsemblePlacementPolicy.java:199 — IsolatedBookieEnsemblePlacementPolicy.getExcludedBookiesWithIsolationGroups 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.
D1 · Cyclomatic Complexity · ConsumerImpl.messageReceived (cyclomatic 26) · ×1
  • ConsumerImpl.messageReceived (cyclomatic 26) pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java:1431 — ConsumerImpl.messageReceived 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.
D1 · Cyclomatic Complexity · PerformanceConsumer.run (cyclomatic 26) · ×1
  • PerformanceConsumer.run (cyclomatic 26) pulsar-testclient/src/main/java/org/apache/pulsar/testclient/PerformanceConsumer.java:249 — PerformanceConsumer.run 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.
D1 · Cyclomatic Complexity · RangeEntryCacheImpl.doAsyncReadEntriesByPosition (cyclomatic 26) · ×1
  • RangeEntryCacheImpl.doAsyncReadEntriesByPosition (cyclomatic 26) managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/cache/RangeEntryCacheImpl.java:385 — RangeEntryCacheImpl.doAsyncReadEntriesByPosition 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.
D1 · Cyclomatic Complexity · PersistentStickyKeyDispatcherMultipleConsumersClassic.trySendMessagesToConsumers (cyclomatic 25) · ×1
  • PersistentStickyKeyDispatcherMultipleConsumersClassic.trySendMessagesToConsumers (cyclomatic 25) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentStickyKeyDispatcherMultipleConsumersClassic.java:273 — PersistentStickyKeyDispatcherMultipleConsumersClassic.trySendMessagesToConsumers has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PulsarClientImpl.shutdown (cyclomatic 25) · ×1
  • PulsarClientImpl.shutdown (cyclomatic 25) pulsar-client/src/main/java/org/apache/pulsar/client/impl/PulsarClientImpl.java:1047 — PulsarClientImpl.shutdown has cyclomatic complexity 25 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · ClusterDetails.getClusterData (cyclomatic 25) · ×1
  • ClusterDetails.getClusterData (cyclomatic 25) pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdClusters.java:384 — ClusterDetails.getClusterData has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BasicKubernetesManifestCustomizer.mergeRuntimeOpts (cyclomatic 25) · ×1
  • BasicKubernetesManifestCustomizer.mergeRuntimeOpts (cyclomatic 25) pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/kubernetes/BasicKubernetesManifestCustomizer.java:193 — BasicKubernetesManifestCustomizer.mergeRuntimeOpts has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SinkConfigUtils.convertFromDetails (cyclomatic 25) · ×1
  • SinkConfigUtils.convertFromDetails (cyclomatic 25) pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/SinkConfigUtils.java:280 — SinkConfigUtils.convertFromDetails has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ManagedLedgerImpl.internalTrimLedgers (cyclomatic 25) · ×1
  • ManagedLedgerImpl.internalTrimLedgers (cyclomatic 25) managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java:3065 — ManagedLedgerImpl.internalTrimLedgers has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PersistentTopic.close (cyclomatic 24) · ×1
  • PersistentTopic.close (cyclomatic 24) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:1768 — PersistentTopic.close has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BrokerServiceException.getClientErrorCode (cyclomatic 24) · ×1
  • BrokerServiceException.getClientErrorCode (cyclomatic 24) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerServiceException.java:241 — BrokerServiceException.getClientErrorCode has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · UniformLoadShedder.findBundlesForUnloading (cyclomatic 24) · ×1
  • UniformLoadShedder.findBundlesForUnloading (cyclomatic 24) pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/UniformLoadShedder.java:60 — UniformLoadShedder.findBundlesForUnloading has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConsumerImpl.processMessageChunk (cyclomatic 24) · ×1
  • ConsumerImpl.processMessageChunk (cyclomatic 24) pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java:1575 — ConsumerImpl.processMessageChunk has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ProducerBuilderFactory.createProducerBuilder (cyclomatic 24) · ×1
  • ProducerBuilderFactory.createProducerBuilder (cyclomatic 24) pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/ProducerBuilderFactory.java:70 — ProducerBuilderFactory.createProducerBuilder has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · JavaInstanceStarter.inferringMissingTypeClassName (cyclomatic 24) · ×1
  • JavaInstanceStarter.inferringMissingTypeClassName (cyclomatic 24) pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/JavaInstanceStarter.java:330 — JavaInstanceStarter.inferringMissingTypeClassName has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FunctionConfigUtils.doJavaChecks (cyclomatic 24) · ×1
  • FunctionConfigUtils.doJavaChecks (cyclomatic 24) pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/FunctionConfigUtils.java:625 — FunctionConfigUtils.doJavaChecks has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SourceConfigUtils.convert (cyclomatic 24) · ×1
  • SourceConfigUtils.convert (cyclomatic 24) pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/SourceConfigUtils.java:69 — SourceConfigUtils.convert has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · EntryCountEstimator.internalEstimateEntryCountByBytesSize (cyclomatic 24) · ×1
  • EntryCountEstimator.internalEstimateEntryCountByBytesSize (cyclomatic 24) managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/EntryCountEstimator.java:71 — EntryCountEstimator.internalEstimateEntryCountByBytesSize has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ManagedCursorImpl.asyncDelete (cyclomatic 24) · ×1
  • ManagedCursorImpl.asyncDelete (cyclomatic 24) managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java:2575 — ManagedCursorImpl.asyncDelete has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PositionRangeSet.remove (cyclomatic 24) · ×1
  • PositionRangeSet.remove (cyclomatic 24) managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/PositionRangeSet.java:389 — PositionRangeSet.remove has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Consumer.individualAck (cyclomatic 23) · ×1
  • Consumer.individualAck (cyclomatic 23) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/Consumer.java:587 — Consumer.individualAck has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ComponentImpl.triggerFunction (cyclomatic 23) · ×1
  • ComponentImpl.triggerFunction (cyclomatic 23) pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/ComponentImpl.java:1098 — ComponentImpl.triggerFunction has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LocalRunner.start (cyclomatic 23) · ×1
  • LocalRunner.start (cyclomatic 23) pulsar-functions/localrun/src/main/java/org/apache/pulsar/functions/LocalRunner.java:347 — LocalRunner.start has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PulsarClusterMetadataSetup.initializeCluster (cyclomatic 23) · ×1
  • PulsarClusterMetadataSetup.initializeCluster (cyclomatic 23) pulsar-broker/src/main/java/org/apache/pulsar/PulsarClusterMetadataSetup.java:295 — PulsarClusterMetadataSetup.initializeCluster has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PersistentTopic.updateRates (cyclomatic 22) · ×1
  • PersistentTopic.updateRates (cyclomatic 22) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:2673 — PersistentTopic.updateRates has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConsumerHashAssignmentsSnapshot.diffRanges (cyclomatic 22) · ×1
  • ConsumerHashAssignmentsSnapshot.diffRanges (cyclomatic 22) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ConsumerHashAssignmentsSnapshot.java:176 — ConsumerHashAssignmentsSnapshot.diffRanges has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SimpleLoadManagerImpl.findBrokerForPlacement (cyclomatic 22) · ×1
  • SimpleLoadManagerImpl.findBrokerForPlacement (cyclomatic 22) pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/SimpleLoadManagerImpl.java:753 — SimpleLoadManagerImpl.findBrokerForPlacement has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TGTRefreshThread.run (cyclomatic 22) · ×1
  • TGTRefreshThread.run (cyclomatic 22) pulsar-common/src/main/java/org/apache/pulsar/common/sasl/TGTRefreshThread.java:99 — TGTRefreshThread.run has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MembershipManager.checkFailures (cyclomatic 22) · ×1
  • MembershipManager.checkFailures (cyclomatic 22) pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/MembershipManager.java:121 — MembershipManager.checkFailures has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PulsarWorkerService.stop (cyclomatic 22) · ×1
  • PulsarWorkerService.stop (cyclomatic 22) pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/PulsarWorkerService.java:622 — PulsarWorkerService.stop has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FunctionConfigUtils.convertFromDetails (cyclomatic 22) · ×1
  • FunctionConfigUtils.convertFromDetails (cyclomatic 22) pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/FunctionConfigUtils.java:402 — FunctionConfigUtils.convertFromDetails has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ServerCnx.channelInactive (cyclomatic 21) · ×1
  • ServerCnx.channelInactive (cyclomatic 21) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:437 — ServerCnx.channelInactive has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NamespacesBase.internalRetryableDeleteNamespaceAsync0 (cyclomatic 21) · ×1
  • NamespacesBase.internalRetryableDeleteNamespaceAsync0 (cyclomatic 21) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:288 — NamespacesBase.internalRetryableDeleteNamespaceAsync0 has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TopicPolicies.clone (cyclomatic 21) · ×1
  • TopicPolicies.clone (cyclomatic 21) pulsar-common/src/main/java/org/apache/pulsar/common/policies/data/TopicPolicies.java:96 — TopicPolicies.clone has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HttpClient.executeGet (cyclomatic 21) · ×1
  • HttpClient.executeGet (cyclomatic 21) pulsar-client/src/main/java/org/apache/pulsar/client/impl/HttpClient.java:200 — HttpClient.executeGet has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · JavaInstanceRunnable.setupInput (cyclomatic 21) · ×1
  • JavaInstanceRunnable.setupInput (cyclomatic 21) pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/JavaInstanceRunnable.java:833 — JavaInstanceRunnable.setupInput has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SourceConfigUtils.validateUpdate (cyclomatic 21) · ×1
  • SourceConfigUtils.validateUpdate (cyclomatic 21) pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/SourceConfigUtils.java:380 — SourceConfigUtils.validateUpdate has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ProducerHandler.onWebSocketText (cyclomatic 21) · ×1
  • ProducerHandler.onWebSocketText (cyclomatic 21) pulsar-websocket/src/main/java/org/apache/pulsar/websocket/ProducerHandler.java:179 — ProducerHandler.onWebSocketText has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BrokerStarter.call (cyclomatic 21) · ×1
  • BrokerStarter.call (cyclomatic 21) pulsar-broker/src/main/java/org/apache/pulsar/PulsarBrokerStarter.java:154 — BrokerStarter.call has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ManagedLedgerImpl.getNumberOfEntries (cyclomatic 21) · ×1
  • ManagedLedgerImpl.getNumberOfEntries (cyclomatic 21) managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java:4041 — ManagedLedgerImpl.getNumberOfEntries has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ThreadLeakDetectorListener.shouldSkipThread (cyclomatic 20) · ×1
  • ThreadLeakDetectorListener.shouldSkipThread (cyclomatic 20) buildtools/src/main/java/org/apache/pulsar/tests/ThreadLeakDetectorListener.java:230 — ThreadLeakDetectorListener.shouldSkipThread has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PersistentDispatcherMultipleConsumersClassic.readMoreEntries (cyclomatic 20) · ×1
  • PersistentDispatcherMultipleConsumersClassic.readMoreEntries (cyclomatic 20) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumersClassic.java:314 — PersistentDispatcherMultipleConsumersClassic.readMoreEntries has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AdminResource.internalCreatePartitionedTopic (cyclomatic 20) · ×1
  • AdminResource.internalCreatePartitionedTopic (cyclomatic 20) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/AdminResource.java:534 — AdminResource.internalCreatePartitionedTopic has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FieldSchemaBuilderImpl.build (cyclomatic 20) · ×1
  • FieldSchemaBuilderImpl.build (cyclomatic 20) pulsar-client/src/main/java/org/apache/pulsar/client/impl/schema/FieldSchemaBuilderImpl.java:102 — FieldSchemaBuilderImpl.build has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · PulsarClientImpl.<init> (cyclomatic 20) · ×1
  • PulsarClientImpl.<init> (cyclomatic 20) pulsar-client/src/main/java/org/apache/pulsar/client/impl/PulsarClientImpl.java:204 — PulsarClientImpl.<init> has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CmdConsume.consume (cyclomatic 20) · ×1
  • CmdConsume.consume (cyclomatic 20) pulsar-client-tools/src/main/java/org/apache/pulsar/client/cli/CmdConsume.java:178 — CmdConsume.consume has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AbstractTwoPhaseCompactor.phaseTwoLoop (cyclomatic 20) · ×1
  • AbstractTwoPhaseCompactor.phaseTwoLoop (cyclomatic 20) pulsar-broker/src/main/java/org/apache/pulsar/compaction/AbstractTwoPhaseCompactor.java:282 — AbstractTwoPhaseCompactor.phaseTwoLoop has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PulsarShell.run (cyclomatic 20) · ×1
  • PulsarShell.run (cyclomatic 20) pulsar-client-tools/src/main/java/org/apache/pulsar/shell/PulsarShell.java:337 — PulsarShell.run has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NonPersistentSubscription.addConsumer (cyclomatic 19) · ×1
  • NonPersistentSubscription.addConsumer (cyclomatic 19) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentSubscription.java:111 — NonPersistentSubscription.addConsumer has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · GeoPersistentReplicator.replicateEntries (cyclomatic 19) · ×1
  • GeoPersistentReplicator.replicateEntries (cyclomatic 19) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/GeoPersistentReplicator.java:149 — GeoPersistentReplicator.replicateEntries has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PersistentSubscription.getStatsAsync (cyclomatic 19) · ×1
  • PersistentSubscription.getStatsAsync (cyclomatic 19) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentSubscription.java:1419 — PersistentSubscription.getStatsAsync has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ServerCnx.handleConnect (cyclomatic 19) · ×1
  • ServerCnx.handleConnect (cyclomatic 19) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:1658 — ServerCnx.handleConnect has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PulsarPrometheusMetricsServlet.doGet (cyclomatic 19) · ×1
  • PulsarPrometheusMetricsServlet.doGet (cyclomatic 19) pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/prometheus/PulsarPrometheusMetricsServlet.java:67 — PulsarPrometheusMetricsServlet.doGet has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ServiceUnitStateChannelImpl.doCleanup (cyclomatic 19) · ×1
  • ServiceUnitStateChannelImpl.doCleanup (cyclomatic 19) pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/channel/ServiceUnitStateChannelImpl.java:1610 — ServiceUnitStateChannelImpl.doCleanup has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ClientCnx.revertClientExToErrorCode (cyclomatic 19) · ×1
  • ClientCnx.revertClientExToErrorCode (cyclomatic 19) pulsar-client/src/main/java/org/apache/pulsar/client/impl/ClientCnx.java:1760 — ClientCnx.revertClientExToErrorCode has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FunctionDetailsCommand.validateFunctionConfigs (cyclomatic 19) · ×1
  • FunctionDetailsCommand.validateFunctionConfigs (cyclomatic 19) pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java:695 — FunctionDetailsCommand.validateFunctionConfigs has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LocalRunner.mergeArgs (cyclomatic 19) · ×1
  • LocalRunner.mergeArgs (cyclomatic 19) pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java:814 — LocalRunner.mergeArgs has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · KubernetesRuntimeFactory.initialize (cyclomatic 19) · ×1
  • KubernetesRuntimeFactory.initialize (cyclomatic 19) pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/kubernetes/KubernetesRuntimeFactory.java:135 — KubernetesRuntimeFactory.initialize has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ComponentImpl.getFunctionPackageLocation (cyclomatic 19) · ×1
  • ComponentImpl.getFunctionPackageLocation (cyclomatic 19) pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/ComponentImpl.java:290 — ComponentImpl.getFunctionPackageLocation has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FunctionRuntimeCommon.getClassLoaderFromPackage (cyclomatic 19) · ×1
  • FunctionRuntimeCommon.getClassLoaderFromPackage (cyclomatic 19) pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/FunctionRuntimeCommon.java:47 — FunctionRuntimeCommon.getClassLoaderFromPackage has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PerformanceProducer.run (cyclomatic 19) · ×1
  • PerformanceProducer.run (cyclomatic 19) pulsar-testclient/src/main/java/org/apache/pulsar/testclient/PerformanceProducer.java:258 — PerformanceProducer.run has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ActiveManagedCursorContainerImpl.moveNodeToNewPosition (cyclomatic 19) · ×1
  • ActiveManagedCursorContainerImpl.moveNodeToNewPosition (cyclomatic 19) managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ActiveManagedCursorContainerImpl.java:464 — ActiveManagedCursorContainerImpl.moveNodeToNewPosition has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ShadowManagedLedgerImpl.processSourceManagedLedgerInfo (cyclomatic 19) · ×1
  • ShadowManagedLedgerImpl.processSourceManagedLedgerInfo (cyclomatic 19) managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ShadowManagedLedgerImpl.java:283 — ShadowManagedLedgerImpl.processSourceManagedLedgerInfo has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BucketDelayedDeliveryTracker.getScheduledMessages (cyclomatic 18) · ×1
  • BucketDelayedDeliveryTracker.getScheduledMessages (cyclomatic 18) pulsar-broker/src/main/java/org/apache/pulsar/broker/delayed/bucket/BucketDelayedDeliveryTracker.java:665 — BucketDelayedDeliveryTracker.getScheduledMessages has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PersistentStickyKeyDispatcherMultipleConsumers.trySendMessagesToConsumers (cyclomatic 18) · ×1
  • PersistentStickyKeyDispatcherMultipleConsumers.trySendMessagesToConsumers (cyclomatic 18) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentStickyKeyDispatcherMultipleConsumers.java:231 — PersistentStickyKeyDispatcherMultipleConsumers.trySendMessagesToConsumers has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PersistentTopic.delete (cyclomatic 18) · ×1
  • PersistentTopic.delete (cyclomatic 18) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:1563 — PersistentTopic.delete has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BrokerService.getTopic (cyclomatic 18) · ×1
  • BrokerService.getTopic (cyclomatic 18) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java:1298 — BrokerService.getTopic has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ServerCnx.handlePartitionMetadataRequest (cyclomatic 18) · ×1
  • ServerCnx.handlePartitionMetadataRequest (cyclomatic 18) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:1181 — ServerCnx.handlePartitionMetadataRequest has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MultipleListenerValidator.parseAdvertisedListeners (cyclomatic 18) · ×1
  • MultipleListenerValidator.parseAdvertisedListeners (cyclomatic 18) pulsar-broker-common/src/main/java/org/apache/pulsar/broker/validator/MultipleListenerValidator.java:162 — MultipleListenerValidator.parseAdvertisedListeners has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConcurrentOpenLongPairRangeSet.remove (cyclomatic 18) · ×1
  • ConcurrentOpenLongPairRangeSet.remove (cyclomatic 18) pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentOpenLongPairRangeSet.java:392 — ConcurrentOpenLongPairRangeSet.remove has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OpenLongPairRangeSet.remove (cyclomatic 18) · ×1
  • OpenLongPairRangeSet.remove (cyclomatic 18) pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/OpenLongPairRangeSet.java:394 — OpenLongPairRangeSet.remove has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConsumerImpl.receiveIndividualMessagesFromBatch (cyclomatic 18) · ×1
  • ConsumerImpl.receiveIndividualMessagesFromBatch (cyclomatic 18) pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java:1784 — ConsumerImpl.receiveIndividualMessagesFromBatch has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · GeoReplicationProducerImpl.ackReceivedReplicatedMsg (cyclomatic 18) · ×1
  • GeoReplicationProducerImpl.ackReceivedReplicatedMsg (cyclomatic 18) pulsar-client/src/main/java/org/apache/pulsar/client/impl/GeoReplicationProducerImpl.java:92 — GeoReplicationProducerImpl.ackReceivedReplicatedMsg has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · WindowConfigUtils.validate (cyclomatic 18) · ×1
  • WindowConfigUtils.validate (cyclomatic 18) pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/WindowConfigUtils.java:28 — WindowConfigUtils.validate has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ProxyService.close (cyclomatic 18) · ×1
  • ProxyService.close (cyclomatic 18) pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/ProxyService.java:393 — ProxyService.close has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · PerformanceClient.loadArguments (cyclomatic 18) · ×1
  • PerformanceClient.loadArguments (cyclomatic 18) pulsar-testclient/src/main/java/org/apache/pulsar/proxy/socket/client/PerformanceClient.java:143 — PerformanceClient.loadArguments has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PersistentDispatcherMultipleConsumers.readMoreEntries (cyclomatic 17) · ×1
  • PersistentDispatcherMultipleConsumers.readMoreEntries (cyclomatic 17) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:341 — PersistentDispatcherMultipleConsumers.readMoreEntries has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PersistentDispatcherMultipleConsumers.trySendMessagesToConsumers (cyclomatic 17) · ×1
  • PersistentDispatcherMultipleConsumers.trySendMessagesToConsumers (cyclomatic 17) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:780 — PersistentDispatcherMultipleConsumers.trySendMessagesToConsumers has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PersistentDispatcherMultipleConsumersClassic.trySendMessagesToConsumers (cyclomatic 17) · ×1
  • PersistentDispatcherMultipleConsumersClassic.trySendMessagesToConsumers (cyclomatic 17) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumersClassic.java:677 — PersistentDispatcherMultipleConsumersClassic.trySendMessagesToConsumers has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PersistentSubscription.reuseOrCreateDispatcher (cyclomatic 17) · ×1
  • PersistentSubscription.reuseOrCreateDispatcher (cyclomatic 17) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentSubscription.java:302 — PersistentSubscription.reuseOrCreateDispatcher has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AutoScaleConfig.applyOverride (cyclomatic 17) · ×1
  • AutoScaleConfig.applyOverride (cyclomatic 17) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/scalable/AutoScaleConfig.java:128 — AutoScaleConfig.applyOverride has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PersistentTopicsBase.internalUpdatePartitionedTopicAsync (cyclomatic 17) · ×1
  • PersistentTopicsBase.internalUpdatePartitionedTopicAsync (cyclomatic 17) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:382 — PersistentTopicsBase.internalUpdatePartitionedTopicAsync has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NonPersistentTopics.getPartitionedStats (cyclomatic 17) · ×1
  • NonPersistentTopics.getPartitionedStats (cyclomatic 17) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/NonPersistentTopics.java:252 — NonPersistentTopics.getPartitionedStats has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · Section.put (cyclomatic 17) · ×1
  • Section.put (cyclomatic 17) pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentLongHashMap.java:388 — Section.put has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SSLContextValidatorEngine.handshake (cyclomatic 17) · ×1
  • SSLContextValidatorEngine.handshake (cyclomatic 17) pulsar-common/src/main/java/org/apache/pulsar/common/util/keystoretls/SSLContextValidatorEngine.java:80 — SSLContextValidatorEngine.handshake has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · Reflections.loadClass (cyclomatic 17) · ×1
  • Reflections.loadClass (cyclomatic 17) pulsar-common/src/main/java/org/apache/pulsar/common/util/Reflections.java:282 — Reflections.loadClass has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OpenTelemetryConsumerInterceptor.onAcknowledgeCumulative (cyclomatic 17) · ×1
  • OpenTelemetryConsumerInterceptor.onAcknowledgeCumulative (cyclomatic 17) pulsar-client/src/main/java/org/apache/pulsar/client/impl/tracing/OpenTelemetryConsumerInterceptor.java:184 — OpenTelemetryConsumerInterceptor.onAcknowledgeCumulative has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConsumerImpl.<init> (cyclomatic 17) · ×1
  • ConsumerImpl.<init> (cyclomatic 17) pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java:293 — ConsumerImpl.<init> has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PartitionedProducerImpl.internalSendWithTxnAsync (cyclomatic 17) · ×1
  • PartitionedProducerImpl.internalSendWithTxnAsync (cyclomatic 17) pulsar-client/src/main/java/org/apache/pulsar/client/impl/PartitionedProducerImpl.java:239 — PartitionedProducerImpl.internalSendWithTxnAsync has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · ProducerImpl.serializeAndSendMessage (cyclomatic 17) · ×1
  • ProducerImpl.serializeAndSendMessage (cyclomatic 17) pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java:761 — ProducerImpl.serializeAndSendMessage has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CmdRead.read (cyclomatic 17) · ×1
  • CmdRead.read (cyclomatic 17) pulsar-client-tools/src/main/java/org/apache/pulsar/client/cli/CmdRead.java:138 — CmdRead.read has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SinkDetailsCommand.mergeArgs (cyclomatic 17) · ×1
  • SinkDetailsCommand.mergeArgs (cyclomatic 17) pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdSinks.java:419 — SinkDetailsCommand.mergeArgs has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ProxyServiceStarter.addWebServerHandlers (cyclomatic 17) · ×1
  • ProxyServiceStarter.addWebServerHandlers (cyclomatic 17) pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/ProxyServiceStarter.java:371 — ProxyServiceStarter.addWebServerHandlers has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ManagedLedgerWriter.run (cyclomatic 17) · ×1
  • ManagedLedgerWriter.run (cyclomatic 17) pulsar-testclient/src/main/java/org/apache/pulsar/testclient/ManagedLedgerWriter.java:142 — ManagedLedgerWriter.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.
D1 · Cyclomatic Complexity · PulsarClusterMetadataSetup.main (cyclomatic 17) · ×1
  • PulsarClusterMetadataSetup.main (cyclomatic 17) pulsar-broker/src/main/java/org/apache/pulsar/PulsarClusterMetadataSetup.java:221 — PulsarClusterMetadataSetup.main has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PersistentDispatcherSingleActiveConsumer.readMoreEntries (cyclomatic 16) · ×1
  • PersistentDispatcherSingleActiveConsumer.readMoreEntries (cyclomatic 16) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherSingleActiveConsumer.java:335 — PersistentDispatcherSingleActiveConsumer.readMoreEntries has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PersistentTopic.asyncGetStats (cyclomatic 16) · ×1
  • PersistentTopic.asyncGetStats (cyclomatic 16) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:2954 — PersistentTopic.asyncGetStats has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AbstractDispatcherSingleActiveConsumer.internalAddConsumer (cyclomatic 16) · ×1
  • AbstractDispatcherSingleActiveConsumer.internalAddConsumer (cyclomatic 16) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/AbstractDispatcherSingleActiveConsumer.java:170 — AbstractDispatcherSingleActiveConsumer.internalAddConsumer has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Consumer.sendMessages (cyclomatic 16) · ×1
  • Consumer.sendMessages (cyclomatic 16) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/Consumer.java:345 — Consumer.sendMessages has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AuthenticationProviderOpenID.verifyJWT (cyclomatic 16) · ×1
  • AuthenticationProviderOpenID.verifyJWT (cyclomatic 16) pulsar-broker-auth-oidc/src/main/java/org/apache/pulsar/broker/authentication/oidc/AuthenticationProviderOpenID.java:404 — AuthenticationProviderOpenID.verifyJWT 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.
D1 · Cyclomatic Complexity · PulsarAuthorizationProvider.checkPermission (cyclomatic 16) · ×1
  • PulsarAuthorizationProvider.checkPermission (cyclomatic 16) pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/PulsarAuthorizationProvider.java:495 — PulsarAuthorizationProvider.checkPermission has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · WebService.<init> (cyclomatic 16) · ×1
  • WebService.<init> (cyclomatic 16) pulsar-broker/src/main/java/org/apache/pulsar/broker/web/WebService.java:125 — WebService.<init> has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PersistentTopicsBase.internalCreateSubscription (cyclomatic 16) · ×1
  • PersistentTopicsBase.internalCreateSubscription (cyclomatic 16) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:2359 — PersistentTopicsBase.internalCreateSubscription has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SimpleLoadManagerImpl.writeLoadReportOnZookeeper (cyclomatic 16) · ×1
  • SimpleLoadManagerImpl.writeLoadReportOnZookeeper (cyclomatic 16) pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/SimpleLoadManagerImpl.java:1148 — SimpleLoadManagerImpl.writeLoadReportOnZookeeper has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LocalBookkeeperEnsemble.stop (cyclomatic 16) · ×1
  • LocalBookkeeperEnsemble.stop (cyclomatic 16) pulsar-broker/src/main/java/org/apache/pulsar/zookeeper/LocalBookkeeperEnsemble.java:480 — LocalBookkeeperEnsemble.stop 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.
D1 · Cyclomatic Complexity · ConsumerImpl.doReconsumeLater (cyclomatic 16) · ×1
  • ConsumerImpl.doReconsumeLater (cyclomatic 16) pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java:683 — ConsumerImpl.doReconsumeLater has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PersistentAcknowledgmentsGroupingTracker.flushAsync (cyclomatic 16) · ×1
  • PersistentAcknowledgmentsGroupingTracker.flushAsync (cyclomatic 16) pulsar-client/src/main/java/org/apache/pulsar/client/impl/PersistentAcknowledgmentsGroupingTracker.java:440 — PersistentAcknowledgmentsGroupingTracker.flushAsync has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PulsarClientImpl.subscribeAsync (cyclomatic 16) · ×1
  • PulsarClientImpl.subscribeAsync (cyclomatic 16) pulsar-client/src/main/java/org/apache/pulsar/client/impl/PulsarClientImpl.java:670 — PulsarClientImpl.subscribeAsync has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CmdConsume.consumeFromWebSocket (cyclomatic 16) · ×1
  • CmdConsume.consumeFromWebSocket (cyclomatic 16) pulsar-client-tools/src/main/java/org/apache/pulsar/client/cli/CmdConsume.java:309 — CmdConsume.consumeFromWebSocket 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.
D1 · Cyclomatic Complexity · CmdRead.readFromWebSocket (cyclomatic 16) · ×1
  • CmdRead.readFromWebSocket (cyclomatic 16) pulsar-client-tools/src/main/java/org/apache/pulsar/client/cli/CmdRead.java:223 — CmdRead.readFromWebSocket 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.
D1 · Cyclomatic Complexity · PulsarSource.createConsumeBuilder (cyclomatic 16) · ×1
  • PulsarSource.createConsumeBuilder (cyclomatic 16) pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/source/PulsarSource.java:62 — PulsarSource.createConsumeBuilder has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SinksImpl.validateUpdateRequestParams (cyclomatic 16) · ×1
  • SinksImpl.validateUpdateRequestParams (cyclomatic 16) pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/SinksImpl.java:746 — SinksImpl.validateUpdateRequestParams has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ProxyConnection.channelRead (cyclomatic 16) · ×1
  • ProxyConnection.channelRead (cyclomatic 16) pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/ProxyConnection.java:290 — ProxyConnection.channelRead has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConsumerHandler.getConsumerConfiguration (cyclomatic 16) · ×1
  • ConsumerHandler.getConsumerConfiguration (cyclomatic 16) pulsar-websocket/src/main/java/org/apache/pulsar/websocket/ConsumerHandler.java:446 — ConsumerHandler.getConsumerConfiguration has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PulsarStandaloneStarter.<init> (cyclomatic 16) · ×1
  • PulsarStandaloneStarter.<init> (cyclomatic 16) pulsar-broker/src/main/java/org/apache/pulsar/PulsarStandaloneStarter.java:48 — PulsarStandaloneStarter.<init> has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ManagedCursorImpl.recoverFromLedger (cyclomatic 16) · ×1
  • ManagedCursorImpl.recoverFromLedger (cyclomatic 16) managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java:611 — ManagedCursorImpl.recoverFromLedger 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.
D1 · Cyclomatic Complexity · ManagedLedgerImpl.maybeOffload (cyclomatic 16) · ×1
  • ManagedLedgerImpl.maybeOffload (cyclomatic 16) managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java:2892 — ManagedLedgerImpl.maybeOffload has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OpFindNewest.readEntryFailed (cyclomatic 16) · ×1
  • OpFindNewest.readEntryFailed (cyclomatic 16) managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/OpFindNewest.java:147 — OpFindNewest.readEntryFailed has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BlobStoreBackedReadHandleImplV2.readAsync (cyclomatic 16) · ×1
  • BlobStoreBackedReadHandleImplV2.readAsync (cyclomatic 16) tiered-storage/jcloud/src/main/java/org/apache/bookkeeper/mledger/offload/jcloud/impl/BlobStoreBackedReadHandleImplV2.java:173 — BlobStoreBackedReadHandleImplV2.readAsync 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.
D19 · Documentation Quality · LLM evaluation failed · ×1
  • LLM evaluation failed — JSON parse error: Expected end of string, but instead reached end of data. Path: $.findings[0].issue | LineNumber: 0 | BytePositionInLine: 1081.
D2 · Cognitive Complexity · TransferShedder.findBundlesForUnloading (cognitive 182) · ×1
  • TransferShedder.findBundlesForUnloading (cognitive 182) pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/scheduler/TransferShedder.java:317 — TransferShedder.findBundlesForUnloading has cognitive complexity 182 (threshold 15). Drivers by points: if/else 161, loops 8, boolean chains 6, ternaries 5, error handling 2 (nesting depth added 111). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PerformanceTransaction.run (cognitive 130) · ×1
  • PerformanceTransaction.run (cognitive 130) pulsar-testclient/src/main/java/org/apache/pulsar/testclient/PerformanceTransaction.java:191 — PerformanceTransaction.run has cognitive complexity 130 (threshold 15). Drivers by points: if/else 73, error handling 26, loops 26, ternaries 3, boolean chains 2 (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.
D2 · Cognitive Complexity · PerformanceProducer.runProducer (cognitive 111) · ×1
  • PerformanceProducer.runProducer (cognitive 111) pulsar-testclient/src/main/java/org/apache/pulsar/testclient/PerformanceProducer.java:526 — PerformanceProducer.runProducer has cognitive complexity 111 (threshold 15). Drivers by points: if/else 81, error handling 17, loops 12, boolean chains 1 (nesting depth added 61). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionConfigUtils.convert (cognitive 87) · ×1
  • FunctionConfigUtils.convert (cognitive 87) pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/FunctionConfigUtils.java:102 — FunctionConfigUtils.convert has cognitive complexity 87 (threshold 15). Drivers by points: if/else 75, boolean chains 9, error handling 3 (nesting depth added 10). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · AbstractBaseDispatcher.filterEntriesForConsumer (cognitive 84) · ×1
  • AbstractBaseDispatcher.filterEntriesForConsumer (cognitive 84) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/AbstractBaseDispatcher.java:126 — AbstractBaseDispatcher.filterEntriesForConsumer has cognitive complexity 84 (threshold 15). Drivers by points: if/else 71, boolean chains 6, ternaries 6, loops 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.
D2 · Cognitive Complexity · FunctionDetailsCommand.processArguments (cognitive 81) · ×1
  • FunctionDetailsCommand.processArguments (cognitive 81) pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java:441 — FunctionDetailsCommand.processArguments has cognitive complexity 81 (threshold 15). Drivers by points: if/else 80, boolean chains 1 (nesting depth added 13). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · IsolatedBookieEnsemblePlacementPolicy.getExcludedBookiesWithIsolationGroups (cognitive 71) · ×1
  • IsolatedBookieEnsemblePlacementPolicy.getExcludedBookiesWithIsolationGroups (cognitive 71) pulsar-broker-common/src/main/java/org/apache/pulsar/bookie/rackawareness/IsolatedBookieEnsemblePlacementPolicy.java:199 — IsolatedBookieEnsemblePlacementPolicy.getExcludedBookiesWithIsolationGroups has cognitive complexity 71 (threshold 15). Drivers by points: if/else 34, loops 27, ternaries 6, boolean chains 3, error handling 1 (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DefaultNamespaceBundleSplitStrategyImpl.findBundlesToSplit (cognitive 70) · ×1
  • DefaultNamespaceBundleSplitStrategyImpl.findBundlesToSplit (cognitive 70) pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/strategy/DefaultNamespaceBundleSplitStrategyImpl.java:74 — DefaultNamespaceBundleSplitStrategyImpl.findBundlesToSplit has cognitive complexity 70 (threshold 15). Drivers by points: if/else 60, error handling 4, loops 4, 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.
D2 · Cognitive Complexity · PerformanceClient.runPerformanceTest (cognitive 70) · ×1
  • PerformanceClient.runPerformanceTest (cognitive 70) pulsar-testclient/src/main/java/org/apache/pulsar/proxy/socket/client/PerformanceClient.java:204 — PerformanceClient.runPerformanceTest has cognitive complexity 70 (threshold 15). Drivers by points: if/else 40, loops 13, error handling 10, ternaries 4, boolean chains 3 (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.
D2 · Cognitive Complexity · ProducerImpl.recoverProcessOpSendMsgFrom (cognitive 69) · ×1
  • ProducerImpl.recoverProcessOpSendMsgFrom (cognitive 69) pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java:2620 — ProducerImpl.recoverProcessOpSendMsgFrom has cognitive complexity 69 (threshold 15). Drivers by points: if/else 50, ternaries 10, error handling 5, boolean chains 3, loops 1 (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SinkConfigUtils.validateAndExtractDetails (cognitive 68) · ×1
  • SinkConfigUtils.validateAndExtractDetails (cognitive 68) pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/SinkConfigUtils.java:414 — SinkConfigUtils.validateAndExtractDetails has cognitive complexity 68 (threshold 15). Drivers by points: if/else 53, loops 7, boolean chains 5, error handling 3 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PerformanceConsumer.pollLoop (cognitive 68) · ×1
  • PerformanceConsumer.pollLoop (cognitive 68) pulsar-testclient/src/main/java/org/apache/pulsar/testclient/PerformanceConsumer.java:458 — PerformanceConsumer.pollLoop has cognitive complexity 68 (threshold 15). Drivers by points: if/else 45, error handling 15, boolean chains 4, loops 4 (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PulsarService.closeAsync (cognitive 67) · ×1
  • PulsarService.closeAsync (cognitive 67) pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java:517 — PulsarService.closeAsync has cognitive complexity 67 (threshold 15). Drivers by points: if/else 51, error handling 13, boolean chains 3 (nesting depth added 10). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · TGTRefreshThread.run (cognitive 66) · ×1
  • TGTRefreshThread.run (cognitive 66) pulsar-common/src/main/java/org/apache/pulsar/common/sasl/TGTRefreshThread.java:99 — TGTRefreshThread.run has cognitive complexity 66 (threshold 15). Drivers by points: if/else 34, error handling 24, loops 6, boolean chains 2 (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PersistentStickyKeyDispatcherMultipleConsumers.filterAndGroupEntriesForDispatching (cognitive 65) · ×1
  • PersistentStickyKeyDispatcherMultipleConsumers.filterAndGroupEntriesForDispatching (cognitive 65) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentStickyKeyDispatcherMultipleConsumers.java:444 — PersistentStickyKeyDispatcherMultipleConsumers.filterAndGroupEntriesForDispatching has cognitive complexity 65 (threshold 15). Drivers by points: if/else 52, loops 7, boolean chains 4, ternaries 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.
D2 · Cognitive Complexity · FunctionConfigUtils.doCommonChecks (cognitive 65) · ×1
  • FunctionConfigUtils.doCommonChecks (cognitive 65) pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/FunctionConfigUtils.java:793 — FunctionConfigUtils.doCommonChecks has cognitive complexity 65 (threshold 15). Drivers by points: if/else 48, boolean chains 16, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RangeEntryCacheImpl.doAsyncReadEntriesByPosition (cognitive 64) · ×1
  • RangeEntryCacheImpl.doAsyncReadEntriesByPosition (cognitive 64) managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/cache/RangeEntryCacheImpl.java:385 — RangeEntryCacheImpl.doAsyncReadEntriesByPosition has cognitive complexity 64 (threshold 15). Drivers by points: if/else 41, loops 20, boolean chains 3 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RuntimeUtils.getCmd (cognitive 61) · ×1
  • RuntimeUtils.getCmd (cognitive 61) pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/RuntimeUtils.java:303 — RuntimeUtils.getCmd has cognitive complexity 61 (threshold 15). Drivers by points: if/else 58, boolean chains 3 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConsumerHashAssignmentsSnapshot.diffRanges (cognitive 60) · ×1
  • ConsumerHashAssignmentsSnapshot.diffRanges (cognitive 60) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ConsumerHashAssignmentsSnapshot.java:176 — ConsumerHashAssignmentsSnapshot.diffRanges has cognitive complexity 60 (threshold 15). Drivers by points: ternaries 33, if/else 23, loops 3, boolean chains 1 (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TopicsImpl.getMessagesFromHttpResponse (cognitive 59) · ×1
  • TopicsImpl.getMessagesFromHttpResponse (cognitive 59) pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/TopicsImpl.java:1286 — TopicsImpl.getMessagesFromHttpResponse has cognitive complexity 59 (threshold 15). Drivers by points: if/else 50, loops 5, boolean chains 4 (nesting depth added 8). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · SinkConfigUtils.convert (cognitive 58) · ×1
  • SinkConfigUtils.convert (cognitive 58) pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/SinkConfigUtils.java:81 — SinkConfigUtils.convert has cognitive complexity 58 (threshold 15). Drivers by points: if/else 48, boolean chains 8, ternaries 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ComponentImpl.getFunctionPackageLocation (cognitive 52) · ×1
  • ComponentImpl.getFunctionPackageLocation (cognitive 52) pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/ComponentImpl.java:290 — ComponentImpl.getFunctionPackageLocation has cognitive complexity 52 (threshold 15). Drivers by points: if/else 47, match/switch 3, boolean chains 2 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SinkDetailsCommand.processArguments (cognitive 50) · ×1
  • SinkDetailsCommand.processArguments (cognitive 50) pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdSinks.java:448 — SinkDetailsCommand.processArguments has cognitive complexity 50 (threshold 15). Drivers by points: if/else 46, boolean chains 3, error handling 1 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ServerCnx.handleProducer (cognitive 49) · ×1
  • ServerCnx.handleProducer (cognitive 49) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:2248 — ServerCnx.handleProducer has cognitive complexity 49 (threshold 15). Drivers by points: if/else 40, ternaries 5, boolean chains 4 (nesting depth added 10). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · MultipleListenerValidator.parseAdvertisedListeners (cognitive 49) · ×1
  • MultipleListenerValidator.parseAdvertisedListeners (cognitive 49) pulsar-broker-common/src/main/java/org/apache/pulsar/broker/validator/MultipleListenerValidator.java:162 — MultipleListenerValidator.parseAdvertisedListeners has cognitive complexity 49 (threshold 15). Drivers by points: if/else 42, loops 4, error handling 3 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Section.put (cognitive 49) · ×1
  • Section.put (cognitive 49) pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentLongHashMap.java:388 — Section.put has cognitive complexity 49 (threshold 15). Drivers by points: ternaries 26, if/else 22, loops 1 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProducerBuilderFactory.createProducerBuilder (cognitive 49) · ×1
  • ProducerBuilderFactory.createProducerBuilder (cognitive 49) pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/ProducerBuilderFactory.java:70 — ProducerBuilderFactory.createProducerBuilder has cognitive complexity 49 (threshold 15). Drivers by points: if/else 40, boolean chains 6, loops 3 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MembershipManager.checkFailures (cognitive 49) · ×1
  • MembershipManager.checkFailures (cognitive 49) pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/MembershipManager.java:121 — MembershipManager.checkFailures has cognitive complexity 49 (threshold 15). Drivers by points: if/else 38, loops 11 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ServerCnx.handleSubscribe (cognitive 48) · ×1
  • ServerCnx.handleSubscribe (cognitive 48) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:1814 — ServerCnx.handleSubscribe has cognitive complexity 48 (threshold 15). Drivers by points: if/else 26, ternaries 10, error handling 7, boolean chains 5 (nesting depth added 8). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · SimpleLoadManagerImpl.writeLoadReportOnZookeeper (cognitive 48) · ×1
  • SimpleLoadManagerImpl.writeLoadReportOnZookeeper (cognitive 48) pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/SimpleLoadManagerImpl.java:1148 — SimpleLoadManagerImpl.writeLoadReportOnZookeeper has cognitive complexity 48 (threshold 15). Drivers by points: ternaries 25, if/else 21, boolean chains 2 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProducerImpl.connectionOpened (cognitive 47) · ×1
  • ProducerImpl.connectionOpened (cognitive 47) pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java:1933 — ProducerImpl.connectionOpened has cognitive complexity 47 (threshold 15). Drivers by points: if/else 38, boolean chains 9 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProducerImpl.sendAsync (cognitive 47) · ×1
  • ProducerImpl.sendAsync (cognitive 47) pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java:564 — ProducerImpl.sendAsync has cognitive complexity 47 (threshold 15). Drivers by points: if/else 26, ternaries 9, boolean chains 8, error handling 2, loops 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PersistentDispatcherMultipleConsumersClassic.readMoreEntries (cognitive 46) · ×1
  • PersistentDispatcherMultipleConsumersClassic.readMoreEntries (cognitive 46) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumersClassic.java:314 — PersistentDispatcherMultipleConsumersClassic.readMoreEntries has cognitive complexity 46 (threshold 15). Drivers by points: if/else 40, boolean chains 3, ternaries 3 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PersistentStickyKeyDispatcherMultipleConsumersClassic.trySendMessagesToConsumers (cognitive 46) · ×1
  • PersistentStickyKeyDispatcherMultipleConsumersClassic.trySendMessagesToConsumers (cognitive 46) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentStickyKeyDispatcherMultipleConsumersClassic.java:273 — PersistentStickyKeyDispatcherMultipleConsumersClassic.trySendMessagesToConsumers has cognitive complexity 46 (threshold 15). Drivers by points: if/else 33, loops 9, boolean chains 4 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PersistentTopic.internalSubscribe (cognitive 46) · ×1
  • PersistentTopic.internalSubscribe (cognitive 46) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:915 — PersistentTopic.internalSubscribe has cognitive complexity 46 (threshold 15). Drivers by points: if/else 27, boolean chains 11, error handling 5, ternaries 3 (nesting depth added 7). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · FunctionConfigUtils.validateUpdate (cognitive 45) · ×1
  • FunctionConfigUtils.validateUpdate (cognitive 45) pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/FunctionConfigUtils.java:989 — FunctionConfigUtils.validateUpdate has cognitive complexity 45 (threshold 15). Drivers by points: if/else 36, boolean chains 9. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · Consumer.individualAck (cognitive 44) · ×1
  • Consumer.individualAck (cognitive 44) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/Consumer.java:587 — Consumer.individualAck has cognitive complexity 44 (threshold 15). Drivers by points: if/else 30, loops 5, ternaries 5, boolean chains 4 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpenTelemetryConsumerInterceptor.onAcknowledgeCumulative (cognitive 44) · ×1
  • OpenTelemetryConsumerInterceptor.onAcknowledgeCumulative (cognitive 44) pulsar-client/src/main/java/org/apache/pulsar/client/impl/tracing/OpenTelemetryConsumerInterceptor.java:184 — OpenTelemetryConsumerInterceptor.onAcknowledgeCumulative has cognitive complexity 44 (threshold 15). Drivers by points: if/else 32, error handling 10, loops 2 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConsumerBuilderImpl.subscribeAsync (cognitive 44) · ×1
  • ConsumerBuilderImpl.subscribeAsync (cognitive 44) pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerBuilderImpl.java:138 — ConsumerBuilderImpl.subscribeAsync has cognitive complexity 44 (threshold 15). Drivers by points: if/else 34, boolean chains 10 (nesting depth added 8). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · FunctionRuntimeCommon.getClassLoaderFromPackage (cognitive 43) · ×1
  • FunctionRuntimeCommon.getClassLoaderFromPackage (cognitive 43) pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/FunctionRuntimeCommon.java:47 — FunctionRuntimeCommon.getClassLoaderFromPackage has cognitive complexity 43 (threshold 15). Drivers by points: if/else 25, error handling 18 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LocalRunner.start (cognitive 43) · ×1
  • LocalRunner.start (cognitive 43) pulsar-functions/localrun/src/main/java/org/apache/pulsar/functions/LocalRunner.java:347 — LocalRunner.start has cognitive complexity 43 (threshold 15). Drivers by points: if/else 29, loops 6, ternaries 5, boolean chains 3 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Consumer.sendMessages (cognitive 42) · ×1
  • Consumer.sendMessages (cognitive 42) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/Consumer.java:345 — Consumer.sendMessages has cognitive complexity 42 (threshold 15). Drivers by points: if/else 35, ternaries 5, boolean chains 1, loops 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PersistentAcknowledgmentsGroupingTracker.flushAsync (cognitive 41) · ×1
  • PersistentAcknowledgmentsGroupingTracker.flushAsync (cognitive 41) pulsar-client/src/main/java/org/apache/pulsar/client/impl/PersistentAcknowledgmentsGroupingTracker.java:440 — PersistentAcknowledgmentsGroupingTracker.flushAsync has cognitive complexity 41 (threshold 15). Drivers by points: if/else 28, loops 12, boolean chains 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PulsarClientException.unwrap (cognitive 40) · ×1
  • PulsarClientException.unwrap (cognitive 40) pulsar-client-api/src/main/java/org/apache/pulsar/client/api/PulsarClientException.java:1055 — PulsarClientException.unwrap has cognitive complexity 40 (threshold 15). Drivers by points: if/else 40. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · RuntimeUtils.getGoInstanceCmd (cognitive 40) · ×1
  • RuntimeUtils.getGoInstanceCmd (cognitive 40) pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/RuntimeUtils.java:132 — RuntimeUtils.getGoInstanceCmd has cognitive complexity 40 (threshold 15). Drivers by points: if/else 36, boolean chains 4 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ManagedCursorImpl.asyncDelete (cognitive 40) · ×1
  • ManagedCursorImpl.asyncDelete (cognitive 40) managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java:2575 — ManagedCursorImpl.asyncDelete has cognitive complexity 40 (threshold 15). Drivers by points: if/else 34, boolean chains 3, error handling 2, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConsumerImpl.messageReceived (cognitive 39) · ×1
  • ConsumerImpl.messageReceived (cognitive 39) pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java:1431 — ConsumerImpl.messageReceived has cognitive complexity 39 (threshold 15). Drivers by points: if/else 28, boolean chains 6, loops 2, ternaries 2, error handling 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SinksImpl.updateSink (cognitive 39) · ×1
  • SinksImpl.updateSink (cognitive 39) pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/SinksImpl.java:265 — SinksImpl.updateSink has cognitive complexity 39 (threshold 15). Drivers by points: if/else 22, boolean chains 10, error handling 7 (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ProxyServiceStarter.addWebServerHandlers (cognitive 39) · ×1
  • ProxyServiceStarter.addWebServerHandlers (cognitive 39) pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/ProxyServiceStarter.java:371 — ProxyServiceStarter.addWebServerHandlers has cognitive complexity 39 (threshold 15). Drivers by points: if/else 18, error handling 14, loops 3, match/switch 3, boolean chains 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PersistentTopicsBase.generateResponseWithEntry (cognitive 38) · ×1
  • PersistentTopicsBase.generateResponseWithEntry (cognitive 38) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:3219 — PersistentTopicsBase.generateResponseWithEntry has cognitive complexity 38 (threshold 15). Drivers by points: if/else 34, loops 2, boolean chains 1, ternaries 1 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ConsumerImpl.processMessageChunk (cognitive 38) · ×1
  • ConsumerImpl.processMessageChunk (cognitive 38) pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java:1575 — ConsumerImpl.processMessageChunk has cognitive complexity 38 (threshold 15). Drivers by points: if/else 29, boolean chains 7, ternaries 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SourceDetailsCommand.processArguments (cognitive 38) · ×1
  • SourceDetailsCommand.processArguments (cognitive 38) pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdSources.java:395 — SourceDetailsCommand.processArguments has cognitive complexity 38 (threshold 15). Drivers by points: if/else 35, boolean chains 2, error handling 1 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · JavaInstanceStarter.inferringMissingTypeClassName (cognitive 38) · ×1
  • JavaInstanceStarter.inferringMissingTypeClassName (cognitive 38) pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/JavaInstanceStarter.java:330 — JavaInstanceStarter.inferringMissingTypeClassName has cognitive complexity 38 (threshold 15). Drivers by points: if/else 21, boolean chains 10, ternaries 6, match/switch 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SinkConfigUtils.validateUpdate (cognitive 38) · ×1
  • SinkConfigUtils.validateUpdate (cognitive 38) pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/SinkConfigUtils.java:609 — SinkConfigUtils.validateUpdate has cognitive complexity 38 (threshold 15). Drivers by points: if/else 32, boolean chains 6. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · EntryCountEstimator.internalEstimateEntryCountByBytesSize (cognitive 38) · ×1
  • EntryCountEstimator.internalEstimateEntryCountByBytesSize (cognitive 38) managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/EntryCountEstimator.java:71 — EntryCountEstimator.internalEstimateEntryCountByBytesSize has cognitive complexity 38 (threshold 15). Drivers by points: if/else 25, boolean chains 8, loops 4, error handling 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PersistentTopic.delete (cognitive 37) · ×1
  • PersistentTopic.delete (cognitive 37) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:1563 — PersistentTopic.delete has cognitive complexity 37 (threshold 15). Drivers by points: if/else 30, ternaries 5, boolean chains 1, error handling 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BrokerService.getManagedLedgerConfig (cognitive 37) · ×1
  • BrokerService.getManagedLedgerConfig (cognitive 37) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java:2168 — BrokerService.getManagedLedgerConfig has cognitive complexity 37 (threshold 15). Drivers by points: if/else 23, boolean chains 10, error handling 2, ternaries 2 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PulsarClientException.wrap (cognitive 37) · ×1
  • PulsarClientException.wrap (cognitive 37) pulsar-client-api/src/main/java/org/apache/pulsar/client/api/PulsarClientException.java:973 — PulsarClientException.wrap has cognitive complexity 37 (threshold 15). Drivers by points: if/else 37. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ProducerImpl.serializeAndSendMessage (cognitive 37) · ×1
  • ProducerImpl.serializeAndSendMessage (cognitive 37) pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java:761 — ProducerImpl.serializeAndSendMessage has cognitive complexity 37 (threshold 15). Drivers by points: if/else 32, boolean chains 3, ternaries 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionsImpl.updateFunction (cognitive 37) · ×1
  • FunctionsImpl.updateFunction (cognitive 37) pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/FunctionsImpl.java:259 — FunctionsImpl.updateFunction has cognitive complexity 37 (threshold 15). Drivers by points: if/else 21, boolean chains 9, error handling 7 (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · SourcesImpl.updateSource (cognitive 37) · ×1
  • SourcesImpl.updateSource (cognitive 37) pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/SourcesImpl.java:259 — SourcesImpl.updateSource has cognitive complexity 37 (threshold 15). Drivers by points: if/else 21, boolean chains 9, error handling 7 (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ThreadLeakDetectorListener.compareThreads (cognitive 36) · ×1
  • ThreadLeakDetectorListener.compareThreads (cognitive 36) buildtools/src/main/java/org/apache/pulsar/tests/ThreadLeakDetectorListener.java:185 — ThreadLeakDetectorListener.compareThreads has cognitive complexity 36 (threshold 15). Drivers by points: if/else 30, boolean chains 4, loops 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PrometheusMetricsGenerator.parseMetricsToPrometheusMetrics (cognitive 36) · ×1
  • PrometheusMetricsGenerator.parseMetricsToPrometheusMetrics (cognitive 36) pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/prometheus/PrometheusMetricsGenerator.java:429 — PrometheusMetricsGenerator.parseMetricsToPrometheusMetrics has cognitive complexity 36 (threshold 15). Drivers by points: if/else 24, loops 6, error handling 4, boolean chains 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AbstractTwoPhaseCompactor.phaseTwoLoop (cognitive 36) · ×1
  • AbstractTwoPhaseCompactor.phaseTwoLoop (cognitive 36) pulsar-broker/src/main/java/org/apache/pulsar/compaction/AbstractTwoPhaseCompactor.java:282 — AbstractTwoPhaseCompactor.phaseTwoLoop has cognitive complexity 36 (threshold 15). Drivers by points: if/else 23, error handling 8, ternaries 4, boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionRuntimeManager.updateAssignment (cognitive 36) · ×1
  • FunctionRuntimeManager.updateAssignment (cognitive 36) pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/FunctionRuntimeManager.java:729 — FunctionRuntimeManager.updateAssignment has cognitive complexity 36 (threshold 15). Drivers by points: if/else 36 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ManagedLedgerImpl.internalTrimLedgers (cognitive 36) · ×1
  • ManagedLedgerImpl.internalTrimLedgers (cognitive 36) managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java:3065 — ManagedLedgerImpl.internalTrimLedgers has cognitive complexity 36 (threshold 15). Drivers by points: if/else 26, boolean chains 5, loops 4, 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.
D2 · Cognitive Complexity · NamespacesBase.internalRetryableDeleteNamespaceAsync0 (cognitive 35) · ×1
  • NamespacesBase.internalRetryableDeleteNamespaceAsync0 (cognitive 35) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:288 — NamespacesBase.internalRetryableDeleteNamespaceAsync0 has cognitive complexity 35 (threshold 15). Drivers by points: if/else 28, boolean chains 3, error handling 2, loops 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ServiceUnitStateChannelImpl.monitorOwnerships (cognitive 35) · ×1
  • ServiceUnitStateChannelImpl.monitorOwnerships (cognitive 35) pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/channel/ServiceUnitStateChannelImpl.java:1736 — ServiceUnitStateChannelImpl.monitorOwnerships has cognitive complexity 35 (threshold 15). Drivers by points: if/else 20, boolean chains 8, loops 5, error handling 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PulsarShell.run (cognitive 35) · ×1
  • PulsarShell.run (cognitive 35) pulsar-client-tools/src/main/java/org/apache/pulsar/shell/PulsarShell.java:337 — PulsarShell.run has cognitive complexity 35 (threshold 15). Drivers by points: if/else 20, error handling 7, loops 5, boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SinksImpl.registerSink (cognitive 35) · ×1
  • SinksImpl.registerSink (cognitive 35) pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/SinksImpl.java:77 — SinksImpl.registerSink has cognitive complexity 35 (threshold 15). Drivers by points: if/else 21, error handling 8, boolean chains 6 (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · FunctionRuntimeManager.restartFunctionInstances (cognitive 35) · ×1
  • FunctionRuntimeManager.restartFunctionInstances (cognitive 35) pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/FunctionRuntimeManager.java:406 — FunctionRuntimeManager.restartFunctionInstances has cognitive complexity 35 (threshold 15). Drivers by points: if/else 26, loops 9 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PerformanceConsumer.run (cognitive 35) · ×1
  • PerformanceConsumer.run (cognitive 35) pulsar-testclient/src/main/java/org/apache/pulsar/testclient/PerformanceConsumer.java:249 — PerformanceConsumer.run has cognitive complexity 35 (threshold 15). Drivers by points: if/else 20, loops 9, error handling 3, boolean chains 2, ternaries 1 (nesting depth added 9). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · TransactionLogReplayer.start (cognitive 35) · ×1
  • TransactionLogReplayer.start (cognitive 35) pulsar-transaction/coordinator/src/main/java/org/apache/pulsar/transaction/coordinator/impl/MLTransactionLogImpl.java:248 — TransactionLogReplayer.start has cognitive complexity 35 (threshold 15). Drivers by points: if/else 24, loops 6, error handling 3, boolean chains 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SourcesImpl.registerSource (cognitive 34) · ×1
  • SourcesImpl.registerSource (cognitive 34) pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/SourcesImpl.java:76 — SourcesImpl.registerSource has cognitive complexity 34 (threshold 15). Drivers by points: if/else 20, error handling 8, boolean chains 6 (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · SourceConfigUtils.validateAndExtractDetails (cognitive 34) · ×1
  • SourceConfigUtils.validateAndExtractDetails (cognitive 34) pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/SourceConfigUtils.java:262 — SourceConfigUtils.validateAndExtractDetails has cognitive complexity 34 (threshold 15). Drivers by points: if/else 27, boolean chains 5, error handling 2 (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PerformanceClient.loadArguments (cognitive 34) · ×1
  • PerformanceClient.loadArguments (cognitive 34) pulsar-testclient/src/main/java/org/apache/pulsar/proxy/socket/client/PerformanceClient.java:143 — PerformanceClient.loadArguments has cognitive complexity 34 (threshold 15). Drivers by points: if/else 25, ternaries 4, boolean chains 3, error handling 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PerformanceProducer.run (cognitive 34) · ×1
  • PerformanceProducer.run (cognitive 34) pulsar-testclient/src/main/java/org/apache/pulsar/testclient/PerformanceProducer.java:258 — PerformanceProducer.run has cognitive complexity 34 (threshold 15). Drivers by points: if/else 18, loops 8, error handling 5, ternaries 2, boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ActiveManagedCursorContainerImpl.moveNodeToNewPosition (cognitive 34) · ×1
  • ActiveManagedCursorContainerImpl.moveNodeToNewPosition (cognitive 34) managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ActiveManagedCursorContainerImpl.java:464 — ActiveManagedCursorContainerImpl.moveNodeToNewPosition has cognitive complexity 34 (threshold 15). Drivers by points: if/else 22, boolean chains 4, loops 4, ternaries 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.
D2 · Cognitive Complexity · ThreadLeakDetectorListener.shouldSkipThread (cognitive 33) · ×1
  • ThreadLeakDetectorListener.shouldSkipThread (cognitive 33) buildtools/src/main/java/org/apache/pulsar/tests/ThreadLeakDetectorListener.java:230 — ThreadLeakDetectorListener.shouldSkipThread has cognitive complexity 33 (threshold 15). Drivers by points: if/else 32, boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PersistentDispatcherMultipleConsumers.readMoreEntries (cognitive 33) · ×1
  • PersistentDispatcherMultipleConsumers.readMoreEntries (cognitive 33) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:341 — PersistentDispatcherMultipleConsumers.readMoreEntries has cognitive complexity 33 (threshold 15). Drivers by points: if/else 26, ternaries 5, boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SubscriptionCoordinator.computeAssignment (cognitive 33) · ×1
  • SubscriptionCoordinator.computeAssignment (cognitive 33) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/scalable/SubscriptionCoordinator.java:559 — SubscriptionCoordinator.computeAssignment has cognitive complexity 33 (threshold 15). Drivers by points: loops 15, if/else 11, ternaries 5, boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SimpleLoadManagerImpl.findBrokerForPlacement (cognitive 33) · ×1
  • SimpleLoadManagerImpl.findBrokerForPlacement (cognitive 33) pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/SimpleLoadManagerImpl.java:753 — SimpleLoadManagerImpl.findBrokerForPlacement has cognitive complexity 33 (threshold 15). Drivers by points: if/else 21, ternaries 6, boolean chains 5, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PersistentAcknowledgmentsGroupingTracker.newMessageAckCommandAndWrite (cognitive 33) · ×1
  • PersistentAcknowledgmentsGroupingTracker.newMessageAckCommandAndWrite (cognitive 33) pulsar-client/src/main/java/org/apache/pulsar/client/impl/PersistentAcknowledgmentsGroupingTracker.java:581 — PersistentAcknowledgmentsGroupingTracker.newMessageAckCommandAndWrite has cognitive complexity 33 (threshold 15). Drivers by points: if/else 33 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KubernetesRuntimeFactory.initialize (cognitive 33) · ×1
  • KubernetesRuntimeFactory.initialize (cognitive 33) pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/kubernetes/KubernetesRuntimeFactory.java:135 — KubernetesRuntimeFactory.initialize has cognitive complexity 33 (threshold 15). Drivers by points: if/else 28, ternaries 4, error handling 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · FunctionsImpl.registerFunction (cognitive 33) · ×1
  • FunctionsImpl.registerFunction (cognitive 33) pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/FunctionsImpl.java:78 — FunctionsImpl.registerFunction has cognitive complexity 33 (threshold 15). Drivers by points: if/else 20, error handling 8, boolean chains 5 (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ServerCnx.handlePartitionMetadataRequest (cognitive 32) · ×1
  • ServerCnx.handlePartitionMetadataRequest (cognitive 32) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:1181 — ServerCnx.handlePartitionMetadataRequest has cognitive complexity 32 (threshold 15). Drivers by points: if/else 31, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Reflections.loadClass (cognitive 32) · ×1
  • Reflections.loadClass (cognitive 32) pulsar-common/src/main/java/org/apache/pulsar/common/util/Reflections.java:282 — Reflections.loadClass has cognitive complexity 32 (threshold 15). Drivers by points: if/else 21, loops 6, error handling 4, boolean chains 1 (nesting depth added 13). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ConsumerImpl.<init> (cognitive 32) · ×1
  • ConsumerImpl.<init> (cognitive 32) pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java:293 — ConsumerImpl.<init> has cognitive complexity 32 (threshold 15). Drivers by points: if/else 26, error handling 3, boolean chains 2, ternaries 1 (nesting depth added 7). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · HttpClient.executeGet (cognitive 32) · ×1
  • HttpClient.executeGet (cognitive 32) pulsar-client/src/main/java/org/apache/pulsar/client/impl/HttpClient.java:200 — HttpClient.executeGet has cognitive complexity 32 (threshold 15). Drivers by points: if/else 22, error handling 7, boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ManagedLedgerImpl.getNumberOfEntries (cognitive 32) · ×1
  • ManagedLedgerImpl.getNumberOfEntries (cognitive 32) managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java:4041 — ManagedLedgerImpl.getNumberOfEntries has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 13, if/else 11, boolean chains 7, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpFindNewest.readEntryFailed (cognitive 32) · ×1
  • OpFindNewest.readEntryFailed (cognitive 32) managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/OpFindNewest.java:147 — OpFindNewest.readEntryFailed has cognitive complexity 32 (threshold 15). Drivers by points: if/else 24, boolean chains 6, error handling 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GeoPersistentReplicator.replicateEntries (cognitive 31) · ×1
  • GeoPersistentReplicator.replicateEntries (cognitive 31) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/GeoPersistentReplicator.java:149 — GeoPersistentReplicator.replicateEntries has cognitive complexity 31 (threshold 15). Drivers by points: if/else 23, boolean chains 4, error handling 3, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PendingAcksMap.internalRemoveAllUpTo (cognitive 31) · ×1
  • PendingAcksMap.internalRemoveAllUpTo (cognitive 31) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/PendingAcksMap.java:437 — PendingAcksMap.internalRemoveAllUpTo has cognitive complexity 31 (threshold 15). Drivers by points: if/else 28, loops 3 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PulsarAuthorizationProvider.checkPermission (cognitive 31) · ×1
  • PulsarAuthorizationProvider.checkPermission (cognitive 31) pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/PulsarAuthorizationProvider.java:495 — PulsarAuthorizationProvider.checkPermission has cognitive complexity 31 (threshold 15). Drivers by points: if/else 26, boolean chains 5 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ServiceUnitStateDataConflictResolver.shouldKeepLeft (cognitive 31) · ×1
  • ServiceUnitStateDataConflictResolver.shouldKeepLeft (cognitive 31) pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/channel/ServiceUnitStateDataConflictResolver.java:69 — ServiceUnitStateDataConflictResolver.shouldKeepLeft has cognitive complexity 31 (threshold 15). Drivers by points: match/switch 17, if/else 10, boolean chains 4 (nesting depth added 12). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · PulsarService.addBrokerAdditionalServlets (cognitive 31) · ×1
  • PulsarService.addBrokerAdditionalServlets (cognitive 31) pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java:1273 — PulsarService.addBrokerAdditionalServlets has cognitive complexity 31 (threshold 15). Drivers by points: error handling 14, if/else 12, match/switch 3, loops 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GenericJsonRecord.getField (cognitive 31) · ×1
  • GenericJsonRecord.getField (cognitive 31) pulsar-client/src/main/java/org/apache/pulsar/client/impl/schema/generic/GenericJsonRecord.java:61 — GenericJsonRecord.getField has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16, error handling 15 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AutoClusterFailover.probeAndUpdateServiceUrl (cognitive 31) · ×1
  • AutoClusterFailover.probeAndUpdateServiceUrl (cognitive 31) pulsar-client/src/main/java/org/apache/pulsar/client/impl/AutoClusterFailover.java:194 — AutoClusterFailover.probeAndUpdateServiceUrl has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 20, if/else 8, loops 3 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PulsarClientImpl.shutdown (cognitive 31) · ×1
  • PulsarClientImpl.shutdown (cognitive 31) pulsar-client/src/main/java/org/apache/pulsar/client/impl/PulsarClientImpl.java:1047 — PulsarClientImpl.shutdown has cognitive complexity 31 (threshold 15). Drivers by points: error handling 18, if/else 10, boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JavaInstanceRunnable.setupInput (cognitive 31) · ×1
  • JavaInstanceRunnable.setupInput (cognitive 31) pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/JavaInstanceRunnable.java:833 — JavaInstanceRunnable.setupInput has cognitive complexity 31 (threshold 15). Drivers by points: if/else 26, boolean chains 2, ternaries 2, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ManagedLedgerWriter.run (cognitive 31) · ×1
  • ManagedLedgerWriter.run (cognitive 31) pulsar-testclient/src/main/java/org/apache/pulsar/testclient/ManagedLedgerWriter.java:142 — ManagedLedgerWriter.run has cognitive complexity 31 (threshold 15). Drivers by points: if/else 21, loops 6, error handling 3, boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BucketDelayedDeliveryTracker.getScheduledMessages (cognitive 30) · ×1
  • BucketDelayedDeliveryTracker.getScheduledMessages (cognitive 30) pulsar-broker/src/main/java/org/apache/pulsar/broker/delayed/bucket/BucketDelayedDeliveryTracker.java:665 — BucketDelayedDeliveryTracker.getScheduledMessages has cognitive complexity 30 (threshold 15). Drivers by points: if/else 22, boolean chains 4, loops 2, ternaries 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PersistentStickyKeyDispatcherMultipleConsumers.trySendMessagesToConsumers (cognitive 30) · ×1
  • PersistentStickyKeyDispatcherMultipleConsumers.trySendMessagesToConsumers (cognitive 30) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentStickyKeyDispatcherMultipleConsumers.java:231 — PersistentStickyKeyDispatcherMultipleConsumers.trySendMessagesToConsumers has cognitive complexity 30 (threshold 15). Drivers by points: if/else 23, loops 4, boolean chains 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FormerPendingAcksMapStore.internalRemoveAllUpTo (cognitive 30) · ×1
  • FormerPendingAcksMapStore.internalRemoveAllUpTo (cognitive 30) microbench/src/main/java/org/apache/pulsar/broker/service/PendingAcksMapPackingBenchmark.java:379 — FormerPendingAcksMapStore.internalRemoveAllUpTo has cognitive complexity 30 (threshold 15). Drivers by points: if/else 25, loops 3, ternaries 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PulsarService.start (cognitive 30) · ×1
  • PulsarService.start (cognitive 30) pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java:850 — PulsarService.start has cognitive complexity 30 (threshold 15). Drivers by points: if/else 17, ternaries 8, boolean chains 4, error handling 1 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · Section.remove (cognitive 30) · ×1
  • Section.remove (cognitive 30) pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentLongHashMap.java:460 — Section.remove has cognitive complexity 30 (threshold 15). Drivers by points: if/else 20, loops 6, boolean chains 4 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionDetailsCommand.mergeArgs (cognitive 30) · ×1
  • FunctionDetailsCommand.mergeArgs (cognitive 30) pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java:390 — FunctionDetailsCommand.mergeArgs has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 15, if/else 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.
D2 · Cognitive Complexity · KubernetesRuntimeFactory.validateResourcesGranularityAndProportion (cognitive 30) · ×1
  • KubernetesRuntimeFactory.validateResourcesGranularityAndProportion (cognitive 30) pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/kubernetes/KubernetesRuntimeFactory.java:496 — KubernetesRuntimeFactory.validateResourcesGranularityAndProportion has cognitive complexity 30 (threshold 15). Drivers by points: if/else 26, boolean chains 4 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProxyServiceStarter.<init> (cognitive 30) · ×1
  • ProxyServiceStarter.<init> (cognitive 30) pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/ProxyServiceStarter.java:130 — ProxyServiceStarter.<init> has cognitive complexity 30 (threshold 15). Drivers by points: if/else 22, boolean chains 6, error handling 2 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ManagedLedgerImpl.internalReadFromLedger (cognitive 30) · ×1
  • ManagedLedgerImpl.internalReadFromLedger (cognitive 30) managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java:2353 — ManagedLedgerImpl.internalReadFromLedger has cognitive complexity 30 (threshold 15). Drivers by points: if/else 27, loops 2, boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NonPersistentSubscription.addConsumer (cognitive 29) · ×1
  • NonPersistentSubscription.addConsumer (cognitive 29) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentSubscription.java:111 — NonPersistentSubscription.addConsumer has cognitive complexity 29 (threshold 15). Drivers by points: if/else 22, boolean chains 5, match/switch 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ServiceUnitStateChannelImpl.doCleanup (cognitive 29) · ×1
  • ServiceUnitStateChannelImpl.doCleanup (cognitive 29) pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/channel/ServiceUnitStateChannelImpl.java:1610 — ServiceUnitStateChannelImpl.doCleanup has cognitive complexity 29 (threshold 15). Drivers by points: if/else 17, error handling 6, boolean chains 4, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UniformLoadShedder.findBundlesForUnloading (cognitive 29) · ×1
  • UniformLoadShedder.findBundlesForUnloading (cognitive 29) pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/UniformLoadShedder.java:60 — UniformLoadShedder.findBundlesForUnloading has cognitive complexity 29 (threshold 15). Drivers by points: if/else 20, boolean chains 9 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConsumerImpl.connectionOpened (cognitive 29) · ×1
  • ConsumerImpl.connectionOpened (cognitive 29) pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java:873 — ConsumerImpl.connectionOpened has cognitive complexity 29 (threshold 15). Drivers by points: if/else 17, boolean chains 11, ternaries 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · BasicKubernetesManifestCustomizer.mergeRuntimeOpts (cognitive 29) · ×1
  • BasicKubernetesManifestCustomizer.mergeRuntimeOpts (cognitive 29) pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/kubernetes/BasicKubernetesManifestCustomizer.java:193 — BasicKubernetesManifestCustomizer.mergeRuntimeOpts has cognitive complexity 29 (threshold 15). Drivers by points: if/else 21, boolean chains 6, loops 2 (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · FunctionRuntimeManager.getFunctionStats (cognitive 29) · ×1
  • FunctionRuntimeManager.getFunctionStats (cognitive 29) pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/FunctionRuntimeManager.java:621 — FunctionRuntimeManager.getFunctionStats has cognitive complexity 29 (threshold 15). Drivers by points: if/else 21, loops 8 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ThreadLeakDetectorListener.detectLeakedThreads (cognitive 28) · ×1
  • ThreadLeakDetectorListener.detectLeakedThreads (cognitive 28) buildtools/src/main/java/org/apache/pulsar/tests/ThreadLeakDetectorListener.java:129 — ThreadLeakDetectorListener.detectLeakedThreads has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15, error handling 10, loops 2, boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PersistentTopic.close (cognitive 28) · ×1
  • PersistentTopic.close (cognitive 28) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:1768 — PersistentTopic.close has cognitive complexity 28 (threshold 15). Drivers by points: if/else 21, error handling 3, boolean chains 2, match/switch 2 (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PersistentTopic.updateRates (cognitive 28) · ×1
  • PersistentTopic.updateRates (cognitive 28) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:2673 — PersistentTopic.updateRates has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16, ternaries 9, error handling 2, loops 1 (nesting depth added 6). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · BrokerService.getTopic (cognitive 28) · ×1
  • BrokerService.getTopic (cognitive 28) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java:1298 — BrokerService.getTopic has cognitive complexity 28 (threshold 15). Drivers by points: if/else 24, boolean chains 2, error handling 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PulsarPrometheusMetricsServlet.doGet (cognitive 28) · ×1
  • PulsarPrometheusMetricsServlet.doGet (cognitive 28) pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/prometheus/PulsarPrometheusMetricsServlet.java:67 — PulsarPrometheusMetricsServlet.doGet has cognitive complexity 28 (threshold 15). Drivers by points: if/else 20, boolean chains 3, loops 3, error handling 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SimpleLoadManagerImpl.doNamespaceBundleSplit (cognitive 28) · ×1
  • SimpleLoadManagerImpl.doNamespaceBundleSplit (cognitive 28) pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/SimpleLoadManagerImpl.java:1369 — SimpleLoadManagerImpl.doNamespaceBundleSplit has cognitive complexity 28 (threshold 15). Drivers by points: if/else 19, boolean chains 3, error handling 3, loops 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TopicPolicies.clone (cognitive 28) · ×1
  • TopicPolicies.clone (cognitive 28) pulsar-common/src/main/java/org/apache/pulsar/common/policies/data/TopicPolicies.java:96 — TopicPolicies.clone has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 20, if/else 4, loops 4 (nesting depth added 6). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ConsumerImpl.doTransactionAcknowledgeForResponse (cognitive 28) · ×1
  • ConsumerImpl.doTransactionAcknowledgeForResponse (cognitive 28) pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java:3204 — ConsumerImpl.doTransactionAcknowledgeForResponse has cognitive complexity 28 (threshold 15). Drivers by points: if/else 18, loops 8, boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ComponentImpl.triggerFunction (cognitive 28) · ×1
  • ComponentImpl.triggerFunction (cognitive 28) pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/ComponentImpl.java:1098 — ComponentImpl.triggerFunction has cognitive complexity 28 (threshold 15). Drivers by points: if/else 19, error handling 5, boolean chains 3, loops 1 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · BlobStoreBackedReadHandleImplV2.readAsync (cognitive 28) · ×1
  • BlobStoreBackedReadHandleImplV2.readAsync (cognitive 28) tiered-storage/jcloud/src/main/java/org/apache/bookkeeper/mledger/offload/jcloud/impl/BlobStoreBackedReadHandleImplV2.java:173 — BlobStoreBackedReadHandleImplV2.readAsync has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16, loops 7, error handling 3, boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ServerCnx.authChallengeSuccessCallback (cognitive 27) · ×1
  • ServerCnx.authChallengeSuccessCallback (cognitive 27) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:1480 — ServerCnx.authChallengeSuccessCallback has cognitive complexity 27 (threshold 15). Drivers by points: if/else 24, ternaries 2, error handling 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConsumerImpl.receiveIndividualMessagesFromBatch (cognitive 27) · ×1
  • ConsumerImpl.receiveIndividualMessagesFromBatch (cognitive 27) pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java:1784 — ConsumerImpl.receiveIndividualMessagesFromBatch has cognitive complexity 27 (threshold 15). Drivers by points: if/else 22, boolean chains 3, error handling 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PulsarClientImpl.<init> (cognitive 27) · ×1
  • PulsarClientImpl.<init> (cognitive 27) pulsar-client/src/main/java/org/apache/pulsar/client/impl/PulsarClientImpl.java:204 — PulsarClientImpl.<init> has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15, ternaries 7, error handling 3, boolean chains 2 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · CmdConsume.consume (cognitive 27) · ×1
  • CmdConsume.consume (cognitive 27) pulsar-client-tools/src/main/java/org/apache/pulsar/client/cli/CmdConsume.java:178 — CmdConsume.consume has cognitive complexity 27 (threshold 15). Drivers by points: if/else 21, boolean chains 3, error handling 1, loops 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SinkConfigUtils.convertFromDetails (cognitive 27) · ×1
  • SinkConfigUtils.convertFromDetails (cognitive 27) pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/SinkConfigUtils.java:280 — SinkConfigUtils.convertFromDetails has cognitive complexity 27 (threshold 15). Drivers by points: if/else 25, error handling 2 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · WindowConfigUtils.validate (cognitive 27) · ×1
  • WindowConfigUtils.validate (cognitive 27) pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/WindowConfigUtils.java:28 — WindowConfigUtils.validate has cognitive complexity 27 (threshold 15). Drivers by points: if/else 25, boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PulsarLedgerUnderreplicationManager.markLedgerReplicated (cognitive 27) · ×1
  • PulsarLedgerUnderreplicationManager.markLedgerReplicated (cognitive 27) pulsar-metadata/src/main/java/org/apache/pulsar/metadata/bookkeeper/PulsarLedgerUnderreplicationManager.java:430 — PulsarLedgerUnderreplicationManager.markLedgerReplicated has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15, error handling 6, boolean chains 3, loops 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProxyConnection.channelRead (cognitive 27) · ×1
  • ProxyConnection.channelRead (cognitive 27) pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/ProxyConnection.java:290 — ProxyConnection.channelRead has cognitive complexity 27 (threshold 15). Drivers by points: if/else 19, ternaries 5, boolean chains 2, match/switch 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PositionRangeSet.remove (cognitive 27) · ×1
  • PositionRangeSet.remove (cognitive 27) managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/PositionRangeSet.java:389 — PositionRangeSet.remove has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11, boolean chains 8, ternaries 8 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ShadowManagedLedgerImpl.processSourceManagedLedgerInfo (cognitive 27) · ×1
  • ShadowManagedLedgerImpl.processSourceManagedLedgerInfo (cognitive 27) managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ShadowManagedLedgerImpl.java:283 — ShadowManagedLedgerImpl.processSourceManagedLedgerInfo has cognitive complexity 27 (threshold 15). Drivers by points: if/else 18, boolean chains 5, error handling 2, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PersistentSubscription.getStatsAsync (cognitive 26) · ×1
  • PersistentSubscription.getStatsAsync (cognitive 26) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentSubscription.java:1419 — PersistentSubscription.getStatsAsync has cognitive complexity 26 (threshold 15). Drivers by points: if/else 21, ternaries 3, boolean chains 2 (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ExtensibleLoadManagerImpl.playLeader (cognitive 26) · ×1
  • ExtensibleLoadManagerImpl.playLeader (cognitive 26) pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/ExtensibleLoadManagerImpl.java:881 — ExtensibleLoadManagerImpl.playLeader has cognitive complexity 26 (threshold 15). Drivers by points: if/else 17, error handling 7, boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SimpleLoadManagerImpl.updateRealtimeResourceQuota (cognitive 26) · ×1
  • SimpleLoadManagerImpl.updateRealtimeResourceQuota (cognitive 26) pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/SimpleLoadManagerImpl.java:492 — SimpleLoadManagerImpl.updateRealtimeResourceQuota has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14, loops 10, boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GracefulExecutorServicesTerminationHandler.awaitTermination (cognitive 26) · ×1
  • GracefulExecutorServicesTerminationHandler.awaitTermination (cognitive 26) pulsar-common/src/main/java/org/apache/pulsar/common/util/GracefulExecutorServicesTerminationHandler.java:109 — GracefulExecutorServicesTerminationHandler.awaitTermination has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13, error handling 5, loops 5, boolean chains 3 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TopicName.<init> (cognitive 26) · ×1
  • TopicName.<init> (cognitive 26) pulsar-common/src/main/java/org/apache/pulsar/common/naming/TopicName.java:119 — TopicName.<init> has cognitive complexity 26 (threshold 15). Drivers by points: if/else 22, ternaries 2, boolean chains 1, error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProducerImpl.<init> (cognitive 26) · ×1
  • ProducerImpl.<init> (cognitive 26) pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java:203 — ProducerImpl.<init> has cognitive complexity 26 (threshold 15). Drivers by points: if/else 21, error handling 4, ternaries 1 (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · GetStatus.getComponentInstanceStatus (cognitive 26) · ×1
  • GetStatus.getComponentInstanceStatus (cognitive 26) pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/ComponentImpl.java:127 — GetStatus.getComponentInstanceStatus has cognitive complexity 26 (threshold 15). Drivers by points: if/else 18, error handling 3, ternaries 3, loops 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PulsarWorkerService.stop (cognitive 26) · ×1
  • PulsarWorkerService.stop (cognitive 26) pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/PulsarWorkerService.java:622 — PulsarWorkerService.stop has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16, error handling 10 (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · FunctionFilePackage.<init> (cognitive 26) · ×1
  • FunctionFilePackage.<init> (cognitive 26) pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/FunctionFilePackage.java:54 — FunctionFilePackage.<init> has cognitive complexity 26 (threshold 15). Drivers by points: error handling 10, if/else 10, ternaries 3, loops 2, boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SourceConfigUtils.convert (cognitive 26) · ×1
  • SourceConfigUtils.convert (cognitive 26) pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/SourceConfigUtils.java:69 — SourceConfigUtils.convert has cognitive complexity 26 (threshold 15). Drivers by points: if/else 24, boolean chains 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · LocalMemoryMetadataStore.storePut (cognitive 26) · ×1
  • LocalMemoryMetadataStore.storePut (cognitive 26) pulsar-metadata/src/main/java/org/apache/pulsar/metadata/impl/LocalMemoryMetadataStore.java:196 — LocalMemoryMetadataStore.storePut has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13, ternaries 11, boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PulsarClusterMetadataSetup.initializeCluster (cognitive 26) · ×1
  • PulsarClusterMetadataSetup.initializeCluster (cognitive 26) pulsar-broker/src/main/java/org/apache/pulsar/PulsarClusterMetadataSetup.java:295 — PulsarClusterMetadataSetup.initializeCluster has cognitive complexity 26 (threshold 15). Drivers by points: if/else 21, boolean chains 3, error handling 2 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ManagedLedgerImpl.getPositionAfterN (cognitive 26) · ×1
  • ManagedLedgerImpl.getPositionAfterN (cognitive 26) managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java:4134 — ManagedLedgerImpl.getPositionAfterN has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16, ternaries 8, 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.
D2 · Cognitive Complexity · PersistentDispatcherMultipleConsumers.trySendMessagesToConsumers (cognitive 25) · ×1
  • PersistentDispatcherMultipleConsumers.trySendMessagesToConsumers (cognitive 25) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:780 — PersistentDispatcherMultipleConsumers.trySendMessagesToConsumers has cognitive complexity 25 (threshold 15). Drivers by points: if/else 18, ternaries 3, boolean chains 2, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PersistentDispatcherSingleActiveConsumer.readMoreEntries (cognitive 25) · ×1
  • PersistentDispatcherSingleActiveConsumer.readMoreEntries (cognitive 25) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherSingleActiveConsumer.java:335 — PersistentDispatcherSingleActiveConsumer.readMoreEntries has cognitive complexity 25 (threshold 15). Drivers by points: if/else 17, ternaries 5, boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PersistentTopicsBase.internalCreateSubscription (cognitive 25) · ×1
  • PersistentTopicsBase.internalCreateSubscription (cognitive 25) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:2359 — PersistentTopicsBase.internalCreateSubscription has cognitive complexity 25 (threshold 15). Drivers by points: if/else 18, error handling 3, loops 2, boolean chains 1, ternaries 1 (nesting depth added 6). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · NonPersistentTopics.getPartitionedStats (cognitive 25) · ×1
  • NonPersistentTopics.getPartitionedStats (cognitive 25) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/NonPersistentTopics.java:252 — NonPersistentTopics.getPartitionedStats has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11, error handling 10, boolean chains 2, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Section.get (cognitive 25) · ×1
  • Section.get (cognitive 25) pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentLongHashMap.java:335 — Section.get has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15, ternaries 8, boolean chains 1, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LocalBookkeeperEnsemble.stop (cognitive 25) · ×1
  • LocalBookkeeperEnsemble.stop (cognitive 25) pulsar-broker/src/main/java/org/apache/pulsar/zookeeper/LocalBookkeeperEnsemble.java:480 — LocalBookkeeperEnsemble.stop has cognitive complexity 25 (threshold 15). Drivers by points: error handling 13, if/else 9, loops 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClusterDetails.getClusterData (cognitive 25) · ×1
  • ClusterDetails.getClusterData (cognitive 25) pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdClusters.java:384 — ClusterDetails.getClusterData has cognitive complexity 25 (threshold 15). Drivers by points: if/else 25. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · FunctionsStatsGenerator.generate (cognitive 25) · ×1
  • FunctionsStatsGenerator.generate (cognitive 25) pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/FunctionsStatsGenerator.java:35 — FunctionsStatsGenerator.generate has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15, error handling 7, loops 2, boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionConfigUtils.convertFromDetails (cognitive 25) · ×1
  • FunctionConfigUtils.convertFromDetails (cognitive 25) pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/FunctionConfigUtils.java:402 — FunctionConfigUtils.convertFromDetails has cognitive complexity 25 (threshold 15). Drivers by points: if/else 25 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · FunctionConfigUtils.doJavaChecks (cognitive 25) · ×1
  • FunctionConfigUtils.doJavaChecks (cognitive 25) pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/FunctionConfigUtils.java:625 — FunctionConfigUtils.doJavaChecks has cognitive complexity 25 (threshold 15). Drivers by points: if/else 19, boolean chains 4, error handling 2 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ProducerHandler.onWebSocketText (cognitive 25) · ×1
  • ProducerHandler.onWebSocketText (cognitive 25) pulsar-websocket/src/main/java/org/apache/pulsar/websocket/ProducerHandler.java:179 — ProducerHandler.onWebSocketText has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14, error handling 8, boolean chains 3 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · BrokerStarter.call (cognitive 25) · ×1
  • BrokerStarter.call (cognitive 25) pulsar-broker/src/main/java/org/apache/pulsar/PulsarBrokerStarter.java:154 — BrokerStarter.call has cognitive complexity 25 (threshold 15). Drivers by points: if/else 21, boolean chains 4. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PersistentDispatcherMultipleConsumersClassic.trySendMessagesToConsumers (cognitive 24) · ×1
  • PersistentDispatcherMultipleConsumersClassic.trySendMessagesToConsumers (cognitive 24) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumersClassic.java:677 — PersistentDispatcherMultipleConsumersClassic.trySendMessagesToConsumers has cognitive complexity 24 (threshold 15). Drivers by points: if/else 17, ternaries 3, boolean chains 2, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PersistentReplicator.readMoreEntries (cognitive 24) · ×1
  • PersistentReplicator.readMoreEntries (cognitive 24) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentReplicator.java:300 — PersistentReplicator.readMoreEntries has cognitive complexity 24 (threshold 15). Drivers by points: if/else 23, boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PersistentSubscription.acknowledgeMessageAsync (cognitive 24) · ×1
  • PersistentSubscription.acknowledgeMessageAsync (cognitive 24) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentSubscription.java:458 — PersistentSubscription.acknowledgeMessageAsync has cognitive complexity 24 (threshold 15). Drivers by points: if/else 21, boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PersistentSubscription.reuseOrCreateDispatcher (cognitive 24) · ×1
  • PersistentSubscription.reuseOrCreateDispatcher (cognitive 24) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentSubscription.java:302 — PersistentSubscription.reuseOrCreateDispatcher has cognitive complexity 24 (threshold 15). Drivers by points: if/else 19, boolean chains 4, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BrokerServiceException.getClientErrorCode (cognitive 24) · ×1
  • BrokerServiceException.getClientErrorCode (cognitive 24) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerServiceException.java:241 — BrokerServiceException.getClientErrorCode has cognitive complexity 24 (threshold 15). Drivers by points: if/else 22, boolean chains 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · Consumer.applyPendingAckCompletions (cognitive 24) · ×1
  • Consumer.applyPendingAckCompletions (cognitive 24) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/Consumer.java:733 — Consumer.applyPendingAckCompletions has cognitive complexity 24 (threshold 15). Drivers by points: if/else 22, boolean chains 1, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ServerCnx.channelInactive (cognitive 24) · ×1
  • ServerCnx.channelInactive (cognitive 24) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:437 — ServerCnx.channelInactive has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14, boolean chains 5, error handling 5 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · WebService.<init> (cognitive 24) · ×1
  • WebService.<init> (cognitive 24) pulsar-broker/src/main/java/org/apache/pulsar/broker/web/WebService.java:125 — WebService.<init> has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18, boolean chains 3, error handling 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExtensibleLoadManagerImpl.playFollower (cognitive 24) · ×1
  • ExtensibleLoadManagerImpl.playFollower (cognitive 24) pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/ExtensibleLoadManagerImpl.java:957 — ExtensibleLoadManagerImpl.playFollower has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15, error handling 7, 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.
D2 · Cognitive Complexity · PendingAckReplay.run (cognitive 24) · ×1
  • PendingAckReplay.run (cognitive 24) pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/pendingack/impl/MLPendingAckStore.java:405 — PendingAckReplay.run has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13, loops 6, error handling 4, boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MessageImpl.init (cognitive 24) · ×1
  • MessageImpl.init (cognitive 24) pulsar-client/src/main/java/org/apache/pulsar/client/impl/MessageImpl.java:188 — MessageImpl.init has cognitive complexity 24 (threshold 15). Drivers by points: if/else 20, loops 3, ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MetadataStoreTableViewImpl.handleSessionEvent (cognitive 24) · ×1
  • MetadataStoreTableViewImpl.handleSessionEvent (cognitive 24) pulsar-metadata/src/main/java/org/apache/pulsar/metadata/tableview/impl/MetadataStoreTableViewImpl.java:212 — MetadataStoreTableViewImpl.handleSessionEvent has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15, loops 5, error handling 4 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PulsarStandaloneStarter.<init> (cognitive 24) · ×1
  • PulsarStandaloneStarter.<init> (cognitive 24) pulsar-broker/src/main/java/org/apache/pulsar/PulsarStandaloneStarter.java:48 — PulsarStandaloneStarter.<init> has cognitive complexity 24 (threshold 15). Drivers by points: if/else 21, boolean chains 2, 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.
D2 · Cognitive Complexity · ScalableTopicResources.handleNotification (cognitive 23) · ×1
  • ScalableTopicResources.handleNotification (cognitive 23) pulsar-broker-common/src/main/java/org/apache/pulsar/broker/resources/ScalableTopicResources.java:201 — ScalableTopicResources.handleNotification has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11, error handling 7, loops 4, boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AdminResource.internalCreatePartitionedTopic (cognitive 23) · ×1
  • AdminResource.internalCreatePartitionedTopic (cognitive 23) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/AdminResource.java:534 — AdminResource.internalCreatePartitionedTopic has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15, boolean chains 6, loops 1, ternaries 1 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ServiceUnitStateChannelImpl.waitForCleanups (cognitive 23) · ×1
  • ServiceUnitStateChannelImpl.waitForCleanups (cognitive 23) pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/channel/ServiceUnitStateChannelImpl.java:1522 — ServiceUnitStateChannelImpl.waitForCleanups has cognitive complexity 23 (threshold 15). Drivers by points: error handling 9, if/else 9, loops 3, boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TopicsBase.buildMessage (cognitive 23) · ×1
  • TopicsBase.buildMessage (cognitive 23) pulsar-broker/src/main/java/org/apache/pulsar/broker/rest/TopicsBase.java:563 — TopicsBase.buildMessage has cognitive complexity 23 (threshold 15). Drivers by points: if/else 20, boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConsumerImpl.doReconsumeLater (cognitive 23) · ×1
  • ConsumerImpl.doReconsumeLater (cognitive 23) pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java:683 — ConsumerImpl.doReconsumeLater has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15, error handling 4, boolean chains 2, ternaries 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GeoReplicationProducerImpl.ackReceivedReplicatedMsg (cognitive 23) · ×1
  • GeoReplicationProducerImpl.ackReceivedReplicatedMsg (cognitive 23) pulsar-client/src/main/java/org/apache/pulsar/client/impl/GeoReplicationProducerImpl.java:92 — GeoReplicationProducerImpl.ackReceivedReplicatedMsg has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14, boolean chains 8, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CmdConsume.consumeFromWebSocket (cognitive 23) · ×1
  • CmdConsume.consumeFromWebSocket (cognitive 23) pulsar-client-tools/src/main/java/org/apache/pulsar/client/cli/CmdConsume.java:309 — CmdConsume.consumeFromWebSocket has cognitive complexity 23 (threshold 15). Drivers by points: error handling 9, if/else 8, loops 4, boolean chains 1, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CmdRead.readFromWebSocket (cognitive 23) · ×1
  • CmdRead.readFromWebSocket (cognitive 23) pulsar-client-tools/src/main/java/org/apache/pulsar/client/cli/CmdRead.java:223 — CmdRead.readFromWebSocket has cognitive complexity 23 (threshold 15). Drivers by points: error handling 9, if/else 8, loops 4, boolean chains 1, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionActioner.getDeleteSubscriptionSupplier (cognitive 23) · ×1
  • FunctionActioner.getDeleteSubscriptionSupplier (cognitive 23) pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/FunctionActioner.java:442 — FunctionActioner.getDeleteSubscriptionSupplier has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12, error handling 8, ternaries 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IOConfigUtils.loadWithSecrets (cognitive 23) · ×1
  • IOConfigUtils.loadWithSecrets (cognitive 23) pulsar-io/common/src/main/java/org/apache/pulsar/io/common/IOConfigUtils.java:58 — IOConfigUtils.loadWithSecrets has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14, error handling 5, loops 3, boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PulsarLedgerUnderreplicationManager.getLedgerToRereplicateFromHierarchy (cognitive 23) · ×1
  • PulsarLedgerUnderreplicationManager.getLedgerToRereplicateFromHierarchy (cognitive 23) pulsar-metadata/src/main/java/org/apache/pulsar/metadata/bookkeeper/PulsarLedgerUnderreplicationManager.java:556 — PulsarLedgerUnderreplicationManager.getLedgerToRereplicateFromHierarchy has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14, error handling 6, loops 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 1.hasNext (cognitive 23) · ×1
  • 1.hasNext (cognitive 23) pulsar-metadata/src/main/java/org/apache/pulsar/metadata/bookkeeper/PulsarLedgerUnderreplicationManager.java:515 — 1.hasNext has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14, error handling 4, loops 3, boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AbstractWebSocketHandler.checkAuth (cognitive 23) · ×1
  • AbstractWebSocketHandler.checkAuth (cognitive 23) pulsar-websocket/src/main/java/org/apache/pulsar/websocket/AbstractWebSocketHandler.java:94 — AbstractWebSocketHandler.checkAuth has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12, error handling 10, boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PersistentTopic.addFailed (cognitive 22) · ×1
  • PersistentTopic.addFailed (cognitive 22) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:766 — PersistentTopic.addFailed has cognitive complexity 22 (threshold 15). Drivers by points: if/else 20, boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SchemaRegistryServiceImpl.getSchemaVersionBySchemaData (cognitive 22) · ×1
  • SchemaRegistryServiceImpl.getSchemaVersionBySchemaData (cognitive 22) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/schema/SchemaRegistryServiceImpl.java:397 — SchemaRegistryServiceImpl.getSchemaVersionBySchemaData has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14, boolean chains 4, loops 4 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BrokerService.unloadServiceUnit (cognitive 22) · ×1
  • BrokerService.unloadServiceUnit (cognitive 22) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java:2650 — BrokerService.unloadServiceUnit has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15, boolean chains 3, error handling 3, ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ServerCnx.handleConnect (cognitive 22) · ×1
  • ServerCnx.handleConnect (cognitive 22) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:1658 — ServerCnx.handleConnect has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16, ternaries 3, boolean chains 2, error handling 1 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PrometheusMetricsGeneratorUtils.generateSystemMetrics (cognitive 22) · ×1
  • PrometheusMetricsGeneratorUtils.generateSystemMetrics (cognitive 22) pulsar-broker-common/src/main/java/org/apache/pulsar/broker/stats/prometheus/PrometheusMetricsGeneratorUtils.java:56 — PrometheusMetricsGeneratorUtils.generateSystemMetrics has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15, loops 6, boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PersistentTopicsBase.internalGetPartitionedStats (cognitive 22) · ×1
  • PersistentTopicsBase.internalGetPartitionedStats (cognitive 22) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:1552 — PersistentTopicsBase.internalGetPartitionedStats has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13, error handling 5, boolean chains 2, loops 2 (nesting depth added 6). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · MetadataTransactionBuffer.recomputeMaxReadPositionLocked (cognitive 22) · ×1
  • MetadataTransactionBuffer.recomputeMaxReadPositionLocked (cognitive 22) pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/buffer/impl/MetadataTransactionBuffer.java:600 — MetadataTransactionBuffer.recomputeMaxReadPositionLocked has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14, boolean chains 3, ternaries 3, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TransactionMetadataStoreService.handleTcClientConnect (cognitive 22) · ×1
  • TransactionMetadataStoreService.handleTcClientConnect (cognitive 22) pulsar-broker/src/main/java/org/apache/pulsar/broker/TransactionMetadataStoreService.java:109 — TransactionMetadataStoreService.handleTcClientConnect has cognitive complexity 22 (threshold 15). Drivers by points: if/else 20, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Section.put (cognitive 22) · ×1
  • Section.put (cognitive 22) pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentLongLongPairHashMap.java:400 — Section.put has cognitive complexity 22 (threshold 15). Drivers by points: if/else 20, boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NamespaceBundleFactory.splitBundles (cognitive 22) · ×1
  • NamespaceBundleFactory.splitBundles (cognitive 22) pulsar-broker/src/main/java/org/apache/pulsar/common/naming/NamespaceBundleFactory.java:325 — NamespaceBundleFactory.splitBundles has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9, loops 9, boolean chains 4 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FileUtils.deleteFilesInDirectory (cognitive 22) · ×1
  • FileUtils.deleteFilesInDirectory (cognitive 22) pulsar-common/src/main/java/org/apache/pulsar/common/nar/FileUtils.java:145 — FileUtils.deleteFilesInDirectory has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13, boolean chains 4, ternaries 3, loops 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClientCnx.handleLookupResponse (cognitive 22) · ×1
  • ClientCnx.handleLookupResponse (cognitive 22) pulsar-client/src/main/java/org/apache/pulsar/client/impl/ClientCnx.java:699 — ClientCnx.handleLookupResponse has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11, ternaries 9, boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PulsarClientImpl.shutdownExecutors (cognitive 22) · ×1
  • PulsarClientImpl.shutdownExecutors (cognitive 22) pulsar-client/src/main/java/org/apache/pulsar/client/impl/PulsarClientImpl.java:1169 — PulsarClientImpl.shutdownExecutors has cognitive complexity 22 (threshold 15). Drivers by points: error handling 10, if/else 8, 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.
D2 · Cognitive Complexity · CmdRead.read (cognitive 22) · ×1
  • CmdRead.read (cognitive 22) pulsar-client-tools/src/main/java/org/apache/pulsar/client/cli/CmdRead.java:138 — CmdRead.read has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16, boolean chains 2, ternaries 2, error handling 1, loops 1 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · CmdTopics.printMessages (cognitive 22) · ×1
  • CmdTopics.printMessages (cognitive 22) pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdTopics.java:1349 — CmdTopics.printMessages has cognitive complexity 22 (threshold 15). Drivers by points: if/else 20, boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeleteCmd.run (cognitive 22) · ×1
  • DeleteCmd.run (cognitive 22) pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdTopics.java:631 — DeleteCmd.run has cognitive complexity 22 (threshold 15). Drivers by points: error handling 10, if/else 6, loops 5, boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SinksImpl.validateUpdateRequestParams (cognitive 22) · ×1
  • SinksImpl.validateUpdateRequestParams (cognitive 22) pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/SinksImpl.java:746 — SinksImpl.validateUpdateRequestParams has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15, error handling 4, boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LocalRunner.extractClassLoader (cognitive 22) · ×1
  • LocalRunner.extractClassLoader (cognitive 22) pulsar-functions/localrun/src/main/java/org/apache/pulsar/functions/LocalRunner.java:486 — LocalRunner.extractClassLoader has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 10, if/else 9, boolean chains 2, ternaries 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ZKMetadataStoreBatchStrategy.nextBatch (cognitive 22) · ×1
  • ZKMetadataStoreBatchStrategy.nextBatch (cognitive 22) pulsar-metadata/src/main/java/org/apache/pulsar/metadata/impl/batching/ZKMetadataStoreBatchStrategy.java:64 — ZKMetadataStoreBatchStrategy.nextBatch has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17, boolean chains 2, match/switch 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProxyService.close (cognitive 22) · ×1
  • ProxyService.close (cognitive 22) pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/ProxyService.java:393 — ProxyService.close has cognitive complexity 22 (threshold 15). Drivers by points: error handling 12, if/else 9, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FixedColumnLengthTableMaker.make (cognitive 22) · ×1
  • FixedColumnLengthTableMaker.make (cognitive 22) pulsar-testclient/src/main/java/org/apache/pulsar/testclient/utils/FixedColumnLengthTableMaker.java:103 — FixedColumnLengthTableMaker.make has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13, loops 7, boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 1.handleMetadataEntry (cognitive 22) · ×1
  • 1.handleMetadataEntry (cognitive 22) pulsar-transaction/coordinator/src/main/java/org/apache/pulsar/transaction/coordinator/impl/MLTransactionMetadataStore.java:147 — 1.handleMetadataEntry has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16, ternaries 3, boolean chains 1, error handling 1, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ActiveManagedCursorContainerImpl.add (cognitive 22) · ×1
  • ActiveManagedCursorContainerImpl.add (cognitive 22) managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ActiveManagedCursorContainerImpl.java:105 — ActiveManagedCursorContainerImpl.add has cognitive complexity 22 (threshold 15). Drivers by points: if/else 22 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ActiveManagedCursorContainerImpl.checkOrderingAndNumberOfCursorsState (cognitive 22) · ×1
  • ActiveManagedCursorContainerImpl.checkOrderingAndNumberOfCursorsState (cognitive 22) managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ActiveManagedCursorContainerImpl.java:786 — ActiveManagedCursorContainerImpl.checkOrderingAndNumberOfCursorsState has cognitive complexity 22 (threshold 15). Drivers by points: if/else 19, boolean chains 2, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AbstractDispatcherSingleActiveConsumer.internalAddConsumer (cognitive 21) · ×1
  • AbstractDispatcherSingleActiveConsumer.internalAddConsumer (cognitive 21) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/AbstractDispatcherSingleActiveConsumer.java:170 — AbstractDispatcherSingleActiveConsumer.internalAddConsumer has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17, boolean chains 4 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PrometheusMetricsGenerator.renderToBuffer (cognitive 21) · ×1
  • PrometheusMetricsGenerator.renderToBuffer (cognitive 21) pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/prometheus/PrometheusMetricsGenerator.java:521 — PrometheusMetricsGenerator.renderToBuffer has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13, boolean chains 4, ternaries 2, error handling 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ServiceUnitStateChannelImpl.getActiveOwnerAsync (cognitive 21) · ×1
  • ServiceUnitStateChannelImpl.getActiveOwnerAsync (cognitive 21) pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/channel/ServiceUnitStateChannelImpl.java:469 — ServiceUnitStateChannelImpl.getActiveOwnerAsync has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18, match/switch 2, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LoadStats.update (cognitive 21) · ×1
  • LoadStats.update (cognitive 21) pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/scheduler/TransferShedder.java:202 — LoadStats.update has cognitive complexity 21 (threshold 15). Drivers by points: if/else 20, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LoadManagerShared.applyNamespacePolicies (cognitive 21) · ×1
  • LoadManagerShared.applyNamespacePolicies (cognitive 21) pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/LoadManagerShared.java:87 — LoadManagerShared.applyNamespacePolicies has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15, boolean chains 2, error handling 2, loops 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LoadManagerShared.applyNamespacePoliciesAsync (cognitive 21) · ×1
  • LoadManagerShared.applyNamespacePoliciesAsync (cognitive 21) pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/LoadManagerShared.java:173 — LoadManagerShared.applyNamespacePoliciesAsync has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15, boolean chains 2, error handling 2, loops 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ModularLoadManagerImpl.updateBundleData (cognitive 21) · ×1
  • ModularLoadManagerImpl.updateBundleData (cognitive 21) pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/ModularLoadManagerImpl.java:547 — ModularLoadManagerImpl.updateBundleData has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12, loops 6, boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionStatsImpl.calculateOverall (cognitive 21) · ×1
  • FunctionStatsImpl.calculateOverall (cognitive 21) pulsar-common/src/main/java/org/apache/pulsar/common/policies/data/FunctionStatsImpl.java:80 — FunctionStatsImpl.calculateOverall has cognitive complexity 21 (threshold 15). Drivers by points: if/else 19, boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RawBatchConverter.rebatchMessage (cognitive 21) · ×1
  • RawBatchConverter.rebatchMessage (cognitive 21) pulsar-broker/src/main/java/org/apache/pulsar/client/impl/RawBatchConverter.java:124 — RawBatchConverter.rebatchMessage has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17, loops 3, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClientCnx.checkRequestTimeout (cognitive 21) · ×1
  • ClientCnx.checkRequestTimeout (cognitive 21) pulsar-client/src/main/java/org/apache/pulsar/client/impl/ClientCnx.java:1814 — ClientCnx.checkRequestTimeout has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18, boolean chains 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PatternTopicsChangedListener.onTopicsAdded (cognitive 21) · ×1
  • PatternTopicsChangedListener.onTopicsAdded (cognitive 21) pulsar-client/src/main/java/org/apache/pulsar/client/impl/PatternMultiTopicsConsumerImpl.java:384 — PatternTopicsChangedListener.onTopicsAdded has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17, loops 3, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TableViewImpl.handleMessage (cognitive 21) · ×1
  • TableViewImpl.handleMessage (cognitive 21) pulsar-client/src/main/java/org/apache/pulsar/client/impl/TableViewImpl.java:208 — TableViewImpl.handleMessage has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12, error handling 4, loops 3, ternaries 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CmdProduce.publish (cognitive 21) · ×1
  • CmdProduce.publish (cognitive 21) pulsar-client-tools/src/main/java/org/apache/pulsar/client/cli/CmdProduce.java:283 — CmdProduce.publish has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13, loops 4, boolean chains 2, error handling 1, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GetStatus.getComponentStatus (cognitive 21) · ×1
  • GetStatus.getComponentStatus (cognitive 21) pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/ComponentImpl.java:209 — GetStatus.getComponentStatus has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16, loops 3, error handling 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PulsarWorkerService.initializeStandaloneWorkerService (cognitive 21) · ×1
  • PulsarWorkerService.initializeStandaloneWorkerService (cognitive 21) pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/PulsarWorkerService.java:208 — PulsarWorkerService.initializeStandaloneWorkerService has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12, error handling 8, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LocalRunner.startThreadedMode (cognitive 21) · ×1
  • LocalRunner.startThreadedMode (cognitive 21) pulsar-functions/localrun/src/main/java/org/apache/pulsar/functions/LocalRunner.java:625 — LocalRunner.startThreadedMode has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17, boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BlobStoreManagedLedgerOffloader.scanContainer (cognitive 21) · ×1
  • BlobStoreManagedLedgerOffloader.scanContainer (cognitive 21) tiered-storage/jcloud/src/main/java/org/apache/bookkeeper/mledger/offload/jcloud/impl/BlobStoreManagedLedgerOffloader.java:724 — BlobStoreManagedLedgerOffloader.scanContainer has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 10, if/else 8, error handling 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PersistentDispatcherSingleActiveConsumer.readEntriesComplete (cognitive 20) · ×1
  • PersistentDispatcherSingleActiveConsumer.readEntriesComplete (cognitive 20) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherSingleActiveConsumer.java:167 — PersistentDispatcherSingleActiveConsumer.readEntriesComplete has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, boolean chains 2, loops 2, ternaries 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PersistentReplicator.readEntriesComplete (cognitive 20) · ×1
  • PersistentReplicator.readEntriesComplete (cognitive 20) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentReplicator.java:353 — PersistentReplicator.readEntriesComplete has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, boolean chains 4, loops 2 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · AutoScalePolicyEvaluator.tryMerge (cognitive 20) · ×1
  • AutoScalePolicyEvaluator.tryMerge (cognitive 20) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/scalable/AutoScalePolicyEvaluator.java:155 — AutoScalePolicyEvaluator.tryMerge has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, loops 3, boolean chains 2, ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DagWatchSession.buildDagProto (cognitive 20) · ×1
  • DagWatchSession.buildDagProto (cognitive 20) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/scalable/DagWatchSession.java:315 — DagWatchSession.buildDagProto has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9, loops 9, ternaries 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SchemaRegistryServiceImpl.checkCompatibilityWithAll (cognitive 20) · ×1
  • SchemaRegistryServiceImpl.checkCompatibilityWithAll (cognitive 20) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/schema/SchemaRegistryServiceImpl.java:482 — SchemaRegistryServiceImpl.checkCompatibilityWithAll has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, error handling 3, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BacklogQuotaManager.dropBacklogForTimeLimit (cognitive 20) · ×1
  • BacklogQuotaManager.dropBacklogForTimeLimit (cognitive 20) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BacklogQuotaManager.java:235 — BacklogQuotaManager.dropBacklogForTimeLimit has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, error handling 2, loops 2, boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BrokerService.createPersistentTopic0 (cognitive 20) · ×1
  • BrokerService.createPersistentTopic0 (cognitive 20) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java:1962 — BrokerService.createPersistentTopic0 has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, loops 2, ternaries 2, boolean chains 1 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · BrokerService.unloadNamespaceBundlesGracefully (cognitive 20) · ×1
  • BrokerService.unloadNamespaceBundlesGracefully (cognitive 20) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java:1131 — BrokerService.unloadNamespaceBundlesGracefully has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10, error handling 5, ternaries 3, boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ServerCnx.buildProducerAndAddTopic (cognitive 20) · ×1
  • ServerCnx.buildProducerAndAddTopic (cognitive 20) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:2533 — ServerCnx.buildProducerAndAddTopic has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, error handling 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AuthenticationService.<init> (cognitive 20) · ×1
  • AuthenticationService.<init> (cognitive 20) pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authentication/AuthenticationService.java:57 — AuthenticationService.<init> has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, loops 4, error handling 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PersistentTopicsBase.internalUnloadTopic (cognitive 20) · ×1
  • PersistentTopicsBase.internalUnloadTopic (cognitive 20) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:974 — PersistentTopicsBase.internalUnloadTopic has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, error handling 3, loops 2 (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · LeastResourceUsageWithWeight.select (cognitive 20) · ×1
  • LeastResourceUsageWithWeight.select (cognitive 20) pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/strategy/LeastResourceUsageWithWeight.java:82 — LeastResourceUsageWithWeight.select has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, loops 3, boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DefaultPulsarSslFactory.initialize (cognitive 20) · ×1
  • DefaultPulsarSslFactory.initialize (cognitive 20) pulsar-common/src/main/java/org/apache/pulsar/common/util/DefaultPulsarSslFactory.java:67 — DefaultPulsarSslFactory.initialize has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18, boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PulsarConfigurationLoader.isComplete (cognitive 20) · ×1
  • PulsarConfigurationLoader.isComplete (cognitive 20) pulsar-broker-common/src/main/java/org/apache/pulsar/common/configuration/PulsarConfigurationLoader.java:119 — PulsarConfigurationLoader.isComplete has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13, boolean chains 3, error handling 3, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TopicName.toFullTopicName (cognitive 20) · ×1
  • TopicName.toFullTopicName (cognitive 20) pulsar-common/src/main/java/org/apache/pulsar/common/naming/TopicName.java:518 — TopicName.toFullTopicName has cognitive complexity 20 (threshold 15). Drivers by points: if/else 19, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NegativeAcksTracker.triggerRedelivery (cognitive 20) · ×1
  • NegativeAcksTracker.triggerRedelivery (cognitive 20) pulsar-client/src/main/java/org/apache/pulsar/client/impl/NegativeAcksTracker.java:74 — NegativeAcksTracker.triggerRedelivery has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, loops 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BaseResource.getApiException (cognitive 20) · ×1
  • BaseResource.getApiException (cognitive 20) pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/BaseResource.java:268 — BaseResource.getApiException has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, match/switch 6 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PublishingOrderCompactor.compactBatchMessage (cognitive 20) · ×1
  • PublishingOrderCompactor.compactBatchMessage (cognitive 20) pulsar-broker/src/main/java/org/apache/pulsar/compaction/PublishingOrderCompactor.java:76 — PublishingOrderCompactor.compactBatchMessage has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18, error handling 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JavaInstanceRunnable.augmentAndFilterConnectorConfig (cognitive 20) · ×1
  • JavaInstanceRunnable.augmentAndFilterConnectorConfig (cognitive 20) pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/JavaInstanceRunnable.java:1009 — JavaInstanceRunnable.augmentAndFilterConnectorConfig has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11, error handling 3, loops 3, boolean chains 2, ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SourceConfigUtils.convertFromDetails (cognitive 20) · ×1
  • SourceConfigUtils.convertFromDetails (cognitive 20) pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/SourceConfigUtils.java:191 — SourceConfigUtils.convertFromDetails has cognitive complexity 20 (threshold 15). Drivers by points: if/else 20 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SourceConfigUtils.validateUpdate (cognitive 20) · ×1
  • SourceConfigUtils.validateUpdate (cognitive 20) pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/SourceConfigUtils.java:380 — SourceConfigUtils.validateUpdate has cognitive complexity 20 (threshold 15). Drivers by points: if/else 19, boolean chains 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ProxyConnection.completeConnect (cognitive 20) · ×1
  • ProxyConnection.completeConnect (cognitive 20) pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/ProxyConnection.java:372 — ProxyConnection.completeConnect has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, boolean chains 2, ternaries 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DefaultMessageFormatter.formatMessage (cognitive 20) · ×1
  • DefaultMessageFormatter.formatMessage (cognitive 20) pulsar-testclient/src/main/java/org/apache/pulsar/testclient/DefaultMessageFormatter.java:30 — DefaultMessageFormatter.formatMessage has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, boolean chains 3, loops 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ManagedLedgerImpl.asyncOffloadPrefix (cognitive 20) · ×1
  • ManagedLedgerImpl.asyncOffloadPrefix (cognitive 20) managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java:3648 — ManagedLedgerImpl.asyncOffloadPrefix has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, boolean chains 4, loops 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ManagedLedgerImpl.internalAsyncAddEntry (cognitive 20) · ×1
  • ManagedLedgerImpl.internalAsyncAddEntry (cognitive 20) managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java:862 — ManagedLedgerImpl.internalAsyncAddEntry has cognitive complexity 20 (threshold 15). Drivers by points: if/else 19, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ManagedLedgerImpl.isValidPosition (cognitive 20) · ×1
  • ManagedLedgerImpl.isValidPosition (cognitive 20) managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java:4265 — ManagedLedgerImpl.isValidPosition has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ManagedLedgerImpl.maybeOffload (cognitive 20) · ×1
  • ManagedLedgerImpl.maybeOffload (cognitive 20) managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java:2892 — ManagedLedgerImpl.maybeOffload has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12, boolean chains 5, error handling 2, loops 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · FastThreadLocalStateCleaner.cleanupAllFastThreadLocals (cognitive 19) · ×1
  • FastThreadLocalStateCleaner.cleanupAllFastThreadLocals (cognitive 19) buildtools/src/main/java/org/apache/pulsar/tests/FastThreadLocalStateCleaner.java:99 — FastThreadLocalStateCleaner.cleanupAllFastThreadLocals has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, loops 2, boolean chains 1, 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.
D2 · Cognitive Complexity · InMemoryDelayedDeliveryTracker.getScheduledMessages (cognitive 19) · ×1
  • InMemoryDelayedDeliveryTracker.getScheduledMessages (cognitive 19) pulsar-broker/src/main/java/org/apache/pulsar/broker/delayed/InMemoryDelayedDeliveryTracker.java:221 — InMemoryDelayedDeliveryTracker.getScheduledMessages has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13, loops 5, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MessageDeduplication.setContextPropsIfRepl (cognitive 19) · ×1
  • MessageDeduplication.setContextPropsIfRepl (cognitive 19) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/MessageDeduplication.java:339 — MessageDeduplication.setContextPropsIfRepl has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, boolean chains 2, loops 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PersistentDispatcherMultipleConsumers.addUnAckedMessages (cognitive 19) · ×1
  • PersistentDispatcherMultipleConsumers.addUnAckedMessages (cognitive 19) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:1174 — PersistentDispatcherMultipleConsumers.addUnAckedMessages has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, 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.
D2 · Cognitive Complexity · PersistentDispatcherMultipleConsumersClassic.addUnAckedMessages (cognitive 19) · ×1
  • PersistentDispatcherMultipleConsumersClassic.addUnAckedMessages (cognitive 19) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumersClassic.java:1023 — PersistentDispatcherMultipleConsumersClassic.addUnAckedMessages has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, 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.
D2 · Cognitive Complexity · PersistentTopic.getInternalStats (cognitive 19) · ×1
  • PersistentTopic.getInternalStats (cognitive 19) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:3156 — PersistentTopic.getInternalStats has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, boolean chains 2, error handling 2 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ServerCnx.getLargestBatchIndexWhenPossible (cognitive 19) · ×1
  • ServerCnx.getLargestBatchIndexWhenPossible (cognitive 19) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:3101 — ServerCnx.getLargestBatchIndexWhenPossible has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12, ternaries 4, boolean chains 3 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ServerCnx.handleLookup (cognitive 19) · ×1
  • ServerCnx.handleLookup (cognitive 19) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:672 — ServerCnx.handleLookup has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11, ternaries 4, loops 3, boolean chains 1 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · AuthenticationService.authenticateHttpRequest (cognitive 19) · ×1
  • AuthenticationService.authenticateHttpRequest (cognitive 19) pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authentication/AuthenticationService.java:124 — AuthenticationService.authenticateHttpRequest has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11, error handling 5, loops 2, boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PersistentTopicsBase.internalGetManagedLedgerInfo (cognitive 19) · ×1
  • PersistentTopicsBase.internalGetManagedLedgerInfo (cognitive 19) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:1427 — PersistentTopicsBase.internalGetManagedLedgerInfo has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11, error handling 4, loops 4 (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PersistentTopicsBase.internalGetSubscriptions (cognitive 19) · ×1
  • PersistentTopicsBase.internalGetSubscriptions (cognitive 19) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:1269 — PersistentTopicsBase.internalGetSubscriptions has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9, loops 6, error handling 3, boolean chains 1 (nesting depth added 6). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · TransactionsBase.internalGetSlowTransactions (cognitive 19) · ×1
  • TransactionsBase.internalGetSlowTransactions (cognitive 19) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/TransactionsBase.java:300 — TransactionsBase.internalGetSlowTransactions has cognitive complexity 19 (threshold 15). Drivers by points: error handling 7, if/else 7, loops 5 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PendingAckHandleImpl.internalIndividualAcknowledgeMessage (cognitive 19) · ×1
  • PendingAckHandleImpl.internalIndividualAcknowledgeMessage (cognitive 19) pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/pendingack/impl/PendingAckHandleImpl.java:219 — PendingAckHandleImpl.internalIndividualAcknowledgeMessage has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Section.get (cognitive 19) · ×1
  • Section.get (cognitive 19) pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentLongLongPairHashMap.java:345 — Section.get has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Section.contains (cognitive 19) · ×1
  • Section.contains (cognitive 19) pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentLongPairSet.java:352 — Section.contains has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VipStatus.checkStatus (cognitive 19) · ×1
  • VipStatus.checkStatus (cognitive 19) pulsar-broker-common/src/main/java/org/apache/pulsar/common/configuration/VipStatus.java:85 — VipStatus.checkStatus has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, boolean chains 2, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Commands.newSubscribe (cognitive 19) · ×1
  • Commands.newSubscribe (cognitive 19) pulsar-common/src/main/java/org/apache/pulsar/common/protocol/Commands.java:659 — Commands.newSubscribe has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, loops 3, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MessageIdV5.toByteArray (cognitive 19) · ×1
  • MessageIdV5.toByteArray (cognitive 19) pulsar-client-v5/src/main/java/org/apache/pulsar/client/impl/v5/MessageIdV5.java:186 — MessageIdV5.toByteArray has cognitive complexity 19 (threshold 15). Drivers by points: loops 12, if/else 5, ternaries 2 (nesting depth added 6). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · ClientCnx.handlePartitionResponse (cognitive 19) · ×1
  • ClientCnx.handlePartitionResponse (cognitive 19) pulsar-client/src/main/java/org/apache/pulsar/client/impl/ClientCnx.java:743 — ClientCnx.handlePartitionResponse has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11, ternaries 6, boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConsumerBase.<init> (cognitive 19) · ×1
  • ConsumerBase.<init> (cognitive 19) pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerBase.java:137 — ConsumerBase.<init> has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13, ternaries 4, boolean chains 2 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PatternTopicsChangedListener.onTopicsRemoved (cognitive 19) · ×1
  • PatternTopicsChangedListener.onTopicsRemoved (cognitive 19) pulsar-client/src/main/java/org/apache/pulsar/client/impl/PatternMultiTopicsConsumerImpl.java:319 — PatternTopicsChangedListener.onTopicsRemoved has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, loops 5 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PulsarClientImpl.subscribeAsync (cognitive 19) · ×1
  • PulsarClientImpl.subscribeAsync (cognitive 19) pulsar-client/src/main/java/org/apache/pulsar/client/impl/PulsarClientImpl.java:670 — PulsarClientImpl.subscribeAsync has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, boolean chains 4, loops 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · CmdProduce.publishToWebSocket (cognitive 19) · ×1
  • CmdProduce.publishToWebSocket (cognitive 19) pulsar-client-tools/src/main/java/org/apache/pulsar/client/cli/CmdProduce.java:395 — CmdProduce.publishToWebSocket has cognitive complexity 19 (threshold 15). Drivers by points: error handling 6, if/else 6, loops 6, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EventTimeOrderCompactor.compactBatchMessage (cognitive 19) · ×1
  • EventTimeOrderCompactor.compactBatchMessage (cognitive 19) pulsar-broker/src/main/java/org/apache/pulsar/compaction/EventTimeOrderCompactor.java:91 — EventTimeOrderCompactor.compactBatchMessage has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, boolean chains 1, error handling 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionDetailsCommand.validateFunctionConfigs (cognitive 19) · ×1
  • FunctionDetailsCommand.validateFunctionConfigs (cognitive 19) pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java:695 — FunctionDetailsCommand.validateFunctionConfigs has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12, boolean chains 7 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · CustomCommandsUtils.generateCustomCommand (cognitive 19) · ×1
  • CustomCommandsUtils.generateCustomCommand (cognitive 19) pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CustomCommandsUtils.java:134 — CustomCommandsUtils.generateCustomCommand has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8, loops 4, ternaries 3, match/switch 2, boolean chains 1, error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JavaInstanceRunnable.setupOutput (cognitive 19) · ×1
  • JavaInstanceRunnable.setupOutput (cognitive 19) pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/JavaInstanceRunnable.java:1091 — JavaInstanceRunnable.setupOutput has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12, ternaries 6, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ComponentImpl.getPackageFile (cognitive 19) · ×1
  • ComponentImpl.getPackageFile (cognitive 19) pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/ComponentImpl.java:1922 — ComponentImpl.getPackageFile has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, error handling 3, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KubernetesSecretsProviderConfigurator.doAdmissionChecks (cognitive 19) · ×1
  • KubernetesSecretsProviderConfigurator.doAdmissionChecks (cognitive 19) pulsar-functions/secrets/src/main/java/org/apache/pulsar/functions/secretsproviderconfigurator/KubernetesSecretsProviderConfigurator.java:117 — KubernetesSecretsProviderConfigurator.doAdmissionChecks has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17, loops 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RocksdbMetadataStore.storeScanChildren (cognitive 19) · ×1
  • RocksdbMetadataStore.storeScanChildren (cognitive 19) pulsar-metadata/src/main/java/org/apache/pulsar/metadata/impl/RocksdbMetadataStore.java:411 — RocksdbMetadataStore.storeScanChildren has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12, error handling 2, loops 2, ternaries 2, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PulsarStandalone.start (cognitive 19) · ×1
  • PulsarStandalone.start (cognitive 19) pulsar-broker/src/main/java/org/apache/pulsar/PulsarStandalone.java:267 — PulsarStandalone.start has cognitive complexity 19 (threshold 15). Drivers by points: if/else 19 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · MockZooKeeper.delete (cognitive 19) · ×1
  • MockZooKeeper.delete (cognitive 19) testmocks/src/main/java/org/apache/zookeeper/MockZooKeeper.java:917 — MockZooKeeper.delete has cognitive complexity 19 (threshold 15). Drivers by points: if/else 18, error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ManagedLedgerFactoryImpl.asyncOpen (cognitive 19) · ×1
  • ManagedLedgerFactoryImpl.asyncOpen (cognitive 19) managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerFactoryImpl.java:432 — ManagedLedgerFactoryImpl.asyncOpen has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, error handling 3, boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ManagedLedgerFactoryImpl.shutdownAsync (cognitive 19) · ×1
  • ManagedLedgerFactoryImpl.shutdownAsync (cognitive 19) managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerFactoryImpl.java:659 — ManagedLedgerFactoryImpl.shutdownAsync has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11, error handling 4, boolean chains 2, loops 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpReadEntry.internalReadEntriesFailed (cognitive 19) · ×1
  • OpReadEntry.internalReadEntriesFailed (cognitive 19) managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/OpReadEntry.java:137 — OpReadEntry.internalReadEntriesFailed has cognitive complexity 19 (threshold 15). Drivers by points: if/else 18, boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReadTask.skipPreviousEntry (cognitive 19) · ×1
  • ReadTask.skipPreviousEntry (cognitive 19) tiered-storage/jcloud/src/main/java/org/apache/bookkeeper/mledger/offload/jcloud/impl/BlobStoreBackedReadHandleImpl.java:230 — ReadTask.skipPreviousEntry has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 10, if/else 8, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BlobStoreBackedReadHandleImplV2.closeAsync (cognitive 19) · ×1
  • BlobStoreBackedReadHandleImplV2.closeAsync (cognitive 19) tiered-storage/jcloud/src/main/java/org/apache/bookkeeper/mledger/offload/jcloud/impl/BlobStoreBackedReadHandleImplV2.java:127 — BlobStoreBackedReadHandleImplV2.closeAsync has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11, error handling 5, loops 2, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PersistentTopic.asyncGetStats (cognitive 18) · ×1
  • PersistentTopic.asyncGetStats (cognitive 18) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:2954 — PersistentTopic.asyncGetStats has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11, boolean chains 3, loops 2, ternaries 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PersistentTopic.getNonDurableSubscription (cognitive 18) · ×1
  • PersistentTopic.getNonDurableSubscription (cognitive 18) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:1208 — PersistentTopic.getNonDurableSubscription has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11, boolean chains 3, error handling 2, ternaries 2 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · SchemaRegistryServiceImpl.putSchemaIfAbsent (cognitive 18) · ×1
  • SchemaRegistryServiceImpl.putSchemaIfAbsent (cognitive 18) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/schema/SchemaRegistryServiceImpl.java:182 — SchemaRegistryServiceImpl.putSchemaIfAbsent has cognitive complexity 18 (threshold 15). Drivers by points: if/else 18 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BrokerService.start (cognitive 18) · ×1
  • BrokerService.start (cognitive 18) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java:629 — BrokerService.start has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, boolean chains 3, error handling 2, ternaries 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Consumer.messageAcked (cognitive 18) · ×1
  • Consumer.messageAcked (cognitive 18) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/Consumer.java:523 — Consumer.messageAcked has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, loops 3, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SystemTopicBasedTopicPoliciesService.refreshTopicPoliciesCache (cognitive 18) · ×1
  • SystemTopicBasedTopicPoliciesService.refreshTopicPoliciesCache (cognitive 18) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/SystemTopicBasedTopicPoliciesService.java:1043 — SystemTopicBasedTopicPoliciesService.refreshTopicPoliciesCache has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, ternaries 3, match/switch 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SystemTopicBasedTopicPoliciesService.updateTopicPoliciesAsync (cognitive 18) · ×1
  • SystemTopicBasedTopicPoliciesService.updateTopicPoliciesAsync (cognitive 18) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/SystemTopicBasedTopicPoliciesService.java:235 — SystemTopicBasedTopicPoliciesService.updateTopicPoliciesAsync has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, boolean chains 4, ternaries 4 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · AuthenticationProviderToken.authenticateToken (cognitive 18) · ×1
  • AuthenticationProviderToken.authenticateToken (cognitive 18) pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authentication/AuthenticationProviderToken.java:233 — AuthenticationProviderToken.authenticateToken has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, error handling 1, ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PulsarAuthorizationProvider.canConsumeAsync (cognitive 18) · ×1
  • PulsarAuthorizationProvider.canConsumeAsync (cognitive 18) pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/PulsarAuthorizationProvider.java:109 — PulsarAuthorizationProvider.canConsumeAsync has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, match/switch 4, boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PulsarWebResource.validateAdminAccessForTenantAsync (cognitive 18) · ×1
  • PulsarWebResource.validateAdminAccessForTenantAsync (cognitive 18) pulsar-broker/src/main/java/org/apache/pulsar/broker/web/PulsarWebResource.java:325 — PulsarWebResource.validateAdminAccessForTenantAsync has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, boolean chains 2 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PersistentTopicsBase.internalExpireMessagesByTimestamp (cognitive 18) · ×1
  • PersistentTopicsBase.internalExpireMessagesByTimestamp (cognitive 18) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:4092 — PersistentTopicsBase.internalExpireMessagesByTimestamp has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, error handling 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PersistentTopicsBase.internalGetReplicatedSubscriptionStatus (cognitive 18) · ×1
  • PersistentTopicsBase.internalGetReplicatedSubscriptionStatus (cognitive 18) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:5391 — PersistentTopicsBase.internalGetReplicatedSubscriptionStatus has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, error handling 2, loops 2 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ExtensibleLoadManagerImpl.monitor (cognitive 18) · ×1
  • ExtensibleLoadManagerImpl.monitor (cognitive 18) pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/ExtensibleLoadManagerImpl.java:1057 — ExtensibleLoadManagerImpl.monitor has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, error handling 2, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LoadManagerShared.shouldAntiAffinityNamespaceUnload (cognitive 18) · ×1
  • LoadManagerShared.shouldAntiAffinityNamespaceUnload (cognitive 18) pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/LoadManagerShared.java:649 — LoadManagerShared.shouldAntiAffinityNamespaceUnload has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, loops 4, boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TransactionBufferHandlerImpl.checkPendingRequests (cognitive 18) · ×1
  • TransactionBufferHandlerImpl.checkPendingRequests (cognitive 18) pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/buffer/impl/TransactionBufferHandlerImpl.java:249 — TransactionBufferHandlerImpl.checkPendingRequests has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Section.add (cognitive 18) · ×1
  • Section.add (cognitive 18) pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentLongPairSet.java:405 — Section.add has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PulsarDecoder.channelRead (cognitive 18) · ×1
  • PulsarDecoder.channelRead (cognitive 18) pulsar-common/src/main/java/org/apache/pulsar/common/protocol/PulsarDecoder.java:118 — PulsarDecoder.channelRead has cognitive complexity 18 (threshold 15). Drivers by points: error handling 16, if/else 1, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClientCnx.revertClientExToErrorCode (cognitive 18) · ×1
  • ClientCnx.revertClientExToErrorCode (cognitive 18) pulsar-client/src/main/java/org/apache/pulsar/client/impl/ClientCnx.java:1760 — ClientCnx.revertClientExToErrorCode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 18. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ConsumerImpl.hasMessageAvailableAsync (cognitive 18) · ×1
  • ConsumerImpl.hasMessageAvailableAsync (cognitive 18) pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java:2734 — ConsumerImpl.hasMessageAvailableAsync has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, boolean chains 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SameAuthParamsLookupAutoClusterFailover.checkPulsarServices (cognitive 18) · ×1
  • SameAuthParamsLookupAutoClusterFailover.checkPulsarServices (cognitive 18) pulsar-client/src/main/java/org/apache/pulsar/client/impl/SameAuthParamsLookupAutoClusterFailover.java:170 — SameAuthParamsLookupAutoClusterFailover.checkPulsarServices has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11, match/switch 6, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LocalRunner.mergeArgs (cognitive 18) · ×1
  • LocalRunner.mergeArgs (cognitive 18) pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java:814 — LocalRunner.mergeArgs has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, if/else 9. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · CmdNamespaceIsolationPolicy.createNamespaceIsolationData (cognitive 18) · ×1
  • CmdNamespaceIsolationPolicy.createNamespaceIsolationData (cognitive 18) pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdNamespaceIsolationPolicy.java:176 — CmdNamespaceIsolationPolicy.createNamespaceIsolationData has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, loops 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionActioner.getDeleteTopicSupplier (cognitive 18) · ×1
  • FunctionActioner.getDeleteTopicSupplier (cognitive 18) pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/FunctionActioner.java:499 — FunctionActioner.getDeleteTopicSupplier has cognitive complexity 18 (threshold 15). Drivers by points: error handling 8, if/else 7, ternaries 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConnectorUtils.getConnectorConfigDefinition (cognitive 18) · ×1
  • ConnectorUtils.getConnectorConfigDefinition (cognitive 18) pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/io/ConnectorUtils.java:121 — ConnectorUtils.getConnectorConfigDefinition has cognitive complexity 18 (threshold 15). Drivers by points: loops 7, if/else 5, ternaries 5, boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PulsarLedgerUnderreplicationManager.checkLayout (cognitive 18) · ×1
  • PulsarLedgerUnderreplicationManager.checkLayout (cognitive 18) pulsar-metadata/src/main/java/org/apache/pulsar/metadata/bookkeeper/PulsarLedgerUnderreplicationManager.java:183 — PulsarLedgerUnderreplicationManager.checkLayout has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, error handling 6, boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ZKSessionWatcher.checkState (cognitive 18) · ×1
  • ZKSessionWatcher.checkState (cognitive 18) pulsar-metadata/src/main/java/org/apache/pulsar/metadata/impl/ZKSessionWatcher.java:152 — ZKSessionWatcher.checkState has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, boolean chains 1, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConsumerHandler.getConsumerConfiguration (cognitive 18) · ×1
  • ConsumerHandler.getConsumerConfiguration (cognitive 18) pulsar-websocket/src/main/java/org/apache/pulsar/websocket/ConsumerHandler.java:446 — ConsumerHandler.getConsumerConfiguration has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, error handling 2, boolean chains 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ActiveManagedCursorContainerImpl.insertNodeIntoList (cognitive 18) · ×1
  • ActiveManagedCursorContainerImpl.insertNodeIntoList (cognitive 18) managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ActiveManagedCursorContainerImpl.java:149 — ActiveManagedCursorContainerImpl.insertNodeIntoList has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, boolean chains 1, loops 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BlobStoreManagedLedgerOffloader.offload (cognitive 18) · ×1
  • BlobStoreManagedLedgerOffloader.offload (cognitive 18) tiered-storage/jcloud/src/main/java/org/apache/bookkeeper/mledger/offload/jcloud/impl/BlobStoreManagedLedgerOffloader.java:201 — BlobStoreManagedLedgerOffloader.offload has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9, error handling 7, boolean chains 1, loops 1 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PersistentTopic.checkReplication (cognitive 17) · ×1
  • PersistentTopic.checkReplication (cognitive 17) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:2027 — PersistentTopic.checkReplication has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, boolean chains 2, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SharedConsumerAssignor.assign (cognitive 17) · ×1
  • SharedConsumerAssignor.assign (cognitive 17) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/SharedConsumerAssignor.java:57 — SharedConsumerAssignor.assign has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, loops 2, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PersistentTopicsBase.internalUpdatePartitionedTopicAsync (cognitive 17) · ×1
  • PersistentTopicsBase.internalUpdatePartitionedTopicAsync (cognitive 17) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:382 — PersistentTopicsBase.internalUpdatePartitionedTopicAsync has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, boolean chains 3, error handling 1, loops 1, ternaries 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · SimpleLoadManagerImpl.doLoadShedding (cognitive 17) · ×1
  • SimpleLoadManagerImpl.doLoadShedding (cognitive 17) pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/SimpleLoadManagerImpl.java:1311 — SimpleLoadManagerImpl.doLoadShedding has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, loops 4 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NamespaceService.checkNonPersistentNonPartitionedTopicExists (cognitive 17) · ×1
  • NamespaceService.checkNonPersistentNonPartitionedTopicExists (cognitive 17) pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java:1499 — NamespaceService.checkNonPersistentNonPartitionedTopicExists has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, boolean chains 2, error handling 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · NamespaceService.splitAndOwnBundleOnceAndRetry (cognitive 17) · ×1
  • NamespaceService.splitAndOwnBundleOnceAndRetry (cognitive 17) pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java:970 — NamespaceService.splitAndOwnBundleOnceAndRetry has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, error handling 3, boolean chains 2, loops 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ResourceGroupNamespaceConfigListener.accept (cognitive 17) · ×1
  • ResourceGroupNamespaceConfigListener.accept (cognitive 17) pulsar-broker/src/main/java/org/apache/pulsar/broker/resourcegroup/ResourceGroupNamespaceConfigListener.java:144 — ResourceGroupNamespaceConfigListener.accept has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, error handling 5, match/switch 3, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PendingAckHandleImpl.handleIndividualAckRecover (cognitive 17) · ×1
  • PendingAckHandleImpl.handleIndividualAckRecover (cognitive 17) pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/pendingack/impl/PendingAckHandleImpl.java:886 — PendingAckHandleImpl.handleIndividualAckRecover has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Section.remove (cognitive 17) · ×1
  • Section.remove (cognitive 17) pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentLongLongPairHashMap.java:460 — Section.remove has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, boolean chains 5, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConcurrentOpenLongPairRangeSet.remove (cognitive 17) · ×1
  • ConcurrentOpenLongPairRangeSet.remove (cognitive 17) pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentOpenLongPairRangeSet.java:392 — ConcurrentOpenLongPairRangeSet.remove has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, boolean chains 4, ternaries 4. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · OpenLongPairRangeSet.remove (cognitive 17) · ×1
  • OpenLongPairRangeSet.remove (cognitive 17) pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/OpenLongPairRangeSet.java:394 — OpenLongPairRangeSet.remove has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, boolean chains 4, ternaries 4. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · AutoTopicCreationOverrideImpl.validateOverride (cognitive 17) · ×1
  • AutoTopicCreationOverrideImpl.validateOverride (cognitive 17) pulsar-client-admin-api/src/main/java/org/apache/pulsar/common/policies/data/impl/AutoTopicCreationOverrideImpl.java:39 — AutoTopicCreationOverrideImpl.validateOverride has cognitive complexity 17 (threshold 15). Drivers by points: if/else 17 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TopicStatsImpl.add (cognitive 17) · ×1
  • TopicStatsImpl.add (cognitive 17) pulsar-common/src/main/java/org/apache/pulsar/common/policies/data/stats/TopicStatsImpl.java:271 — TopicStatsImpl.add has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, boolean chains 3, loops 3 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MessageCryptoBc.decrypt (cognitive 17) · ×1
  • MessageCryptoBc.decrypt (cognitive 17) pulsar-client-messagecrypto-bc/src/main/java/org/apache/pulsar/client/impl/crypto/MessageCryptoBc.java:606 — MessageCryptoBc.decrypt has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, loops 2, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MessageIdV5.fromByteArray (cognitive 17) · ×1
  • MessageIdV5.fromByteArray (cognitive 17) pulsar-client-v5/src/main/java/org/apache/pulsar/client/impl/v5/MessageIdV5.java:265 — MessageIdV5.fromByteArray has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, loops 3, boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConsumerBase.doPendingBatchReceiveTask (cognitive 17) · ×1
  • ConsumerBase.doPendingBatchReceiveTask (cognitive 17) pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerBase.java:1146 — ConsumerBase.doPendingBatchReceiveTask has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PersistentAcknowledgmentsGroupingTracker.newImmediateAckAndFlush (cognitive 17) · ×1
  • PersistentAcknowledgmentsGroupingTracker.newImmediateAckAndFlush (cognitive 17) pulsar-client/src/main/java/org/apache/pulsar/client/impl/PersistentAcknowledgmentsGroupingTracker.java:549 — PersistentAcknowledgmentsGroupingTracker.newImmediateAckAndFlush has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, loops 6, boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProducerImpl.run (cognitive 17) · ×1
  • ProducerImpl.run (cognitive 17) pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java:2316 — ProducerImpl.run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PulsarClientSharedResourcesImpl.<init> (cognitive 17) · ×1
  • PulsarClientSharedResourcesImpl.<init> (cognitive 17) pulsar-client/src/main/java/org/apache/pulsar/client/impl/PulsarClientSharedResourcesImpl.java:60 — PulsarClientSharedResourcesImpl.<init> has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 9, if/else 7, boolean chains 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · TransactionMetaStoreHandler.run (cognitive 17) · ×1
  • TransactionMetaStoreHandler.run (cognitive 17) pulsar-client/src/main/java/org/apache/pulsar/client/impl/TransactionMetaStoreHandler.java:802 — TransactionMetaStoreHandler.run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, boolean chains 3, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionCommand.processArguments (cognitive 17) · ×1
  • FunctionCommand.processArguments (cognitive 17) pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java:138 — FunctionCommand.processArguments has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GetMessageById.run (cognitive 17) · ×1
  • GetMessageById.run (cognitive 17) pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdTopics.java:1207 — GetMessageById.run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 17 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BatchSourceExecutor.stop (cognitive 17) · ×1
  • BatchSourceExecutor.stop (cognitive 17) pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/source/batch/BatchSourceExecutor.java:218 — BatchSourceExecutor.stop has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, error handling 7 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PulsarSource.createConsumeBuilder (cognitive 17) · ×1
  • PulsarSource.createConsumeBuilder (cognitive 17) pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/source/PulsarSource.java:62 — PulsarSource.createConsumeBuilder has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, boolean chains 4 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · KubernetesRuntime.deleteStatefulSet (cognitive 17) · ×1
  • KubernetesRuntime.deleteStatefulSet (cognitive 17) pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/kubernetes/KubernetesRuntime.java:600 — KubernetesRuntime.deleteStatefulSet has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, ternaries 6, error handling 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KubernetesRuntime.getFunctionContainer (cognitive 17) · ×1
  • KubernetesRuntime.getFunctionContainer (cognitive 17) pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/kubernetes/KubernetesRuntime.java:1017 — KubernetesRuntime.getFunctionContainer has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, boolean chains 2, match/switch 2, ternaries 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionsImpl.validateUpdateRequestParams (cognitive 17) · ×1
  • FunctionsImpl.validateUpdateRequestParams (cognitive 17) pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/FunctionsImpl.java:779 — FunctionsImpl.validateUpdateRequestParams has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, boolean chains 2, error handling 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionRuntimeManager.getFunctionInstanceStats (cognitive 17) · ×1
  • FunctionRuntimeManager.getFunctionInstanceStats (cognitive 17) pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/FunctionRuntimeManager.java:560 — FunctionRuntimeManager.getFunctionInstanceStats has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LegacyHierarchicalLedgerRangeIterator.preload (cognitive 17) · ×1
  • LegacyHierarchicalLedgerRangeIterator.preload (cognitive 17) pulsar-metadata/src/main/java/org/apache/pulsar/metadata/bookkeeper/LegacyHierarchicalLedgerRangeIterator.java:99 — LegacyHierarchicalLedgerRangeIterator.preload has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, error handling 4, boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PulsarRegistrationClient.getBookiesThenFreshCache (cognitive 17) · ×1
  • PulsarRegistrationClient.getBookiesThenFreshCache (cognitive 17) pulsar-metadata/src/main/java/org/apache/pulsar/metadata/bookkeeper/PulsarRegistrationClient.java:137 — PulsarRegistrationClient.getBookiesThenFreshCache has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, boolean chains 4, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PulsarRegistrationClient.updatedBookies (cognitive 17) · ×1
  • PulsarRegistrationClient.updatedBookies (cognitive 17) pulsar-metadata/src/main/java/org/apache/pulsar/metadata/bookkeeper/PulsarRegistrationClient.java:219 — PulsarRegistrationClient.updatedBookies has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, boolean chains 2, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AbstractMetadataStore.put (cognitive 17) · ×1
  • AbstractMetadataStore.put (cognitive 17) pulsar-metadata/src/main/java/org/apache/pulsar/metadata/impl/AbstractMetadataStore.java:671 — AbstractMetadataStore.put has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, ternaries 6, boolean chains 2 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · RocksdbMetadataStore.storePut (cognitive 17) · ×1
  • RocksdbMetadataStore.storePut (cognitive 17) pulsar-metadata/src/main/java/org/apache/pulsar/metadata/impl/RocksdbMetadataStore.java:592 — RocksdbMetadataStore.storePut has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, ternaries 4, boolean chains 3, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProducerHandler.popularProducerBuilderForServerSideEncrypt (cognitive 17) · ×1
  • ProducerHandler.popularProducerBuilderForServerSideEncrypt (cognitive 17) pulsar-websocket/src/main/java/org/apache/pulsar/websocket/ProducerHandler.java:500 — ProducerHandler.popularProducerBuilderForServerSideEncrypt has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PulsarClusterMetadataSetup.main (cognitive 17) · ×1
  • PulsarClusterMetadataSetup.main (cognitive 17) pulsar-broker/src/main/java/org/apache/pulsar/PulsarClusterMetadataSetup.java:221 — PulsarClusterMetadataSetup.main has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, boolean chains 4, ternaries 3, error handling 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PulsarClusterMetadataTeardown.main (cognitive 17) · ×1
  • PulsarClusterMetadataTeardown.main (cognitive 17) pulsar-broker/src/main/java/org/apache/pulsar/PulsarClusterMetadataTeardown.java:103 — PulsarClusterMetadataTeardown.main has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6, loops 6, error handling 3, 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.
D2 · Cognitive Complexity · PendingReadsManager.findPendingRead (cognitive 17) · ×1
  • PendingReadsManager.findPendingRead (cognitive 17) managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/cache/PendingReadsManager.java:146 — PendingReadsManager.findPendingRead has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, boolean chains 3, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ManagedCursorContainerImpl.siftDown (cognitive 17) · ×1
  • ManagedCursorContainerImpl.siftDown (cognitive 17) managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorContainerImpl.java:349 — ManagedCursorContainerImpl.siftDown has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ManagedCursorImpl.setAcknowledgedPosition (cognitive 17) · ×1
  • ManagedCursorImpl.setAcknowledgedPosition (cognitive 17) managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java:2179 — ManagedCursorImpl.setAcknowledgedPosition has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, ternaries 3, loops 2, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ManagedLedgerImpl.checkCursorsToCacheEntries (cognitive 17) · ×1
  • ManagedLedgerImpl.checkCursorsToCacheEntries (cognitive 17) managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java:5205 — ManagedLedgerImpl.checkCursorsToCacheEntries has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, loops 4, boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ManagedLedgerImpl.internalEvictOffloadedLedgers (cognitive 17) · ×1
  • ManagedLedgerImpl.internalEvictOffloadedLedgers (cognitive 17) managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java:3012 — ManagedLedgerImpl.internalEvictOffloadedLedgers has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ManagedLedgerImpl.maybeUpdateCursorBeforeTrimmingConsumedLedger (cognitive 17) · ×1
  • ManagedLedgerImpl.maybeUpdateCursorBeforeTrimmingConsumedLedger (cognitive 17) managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java:2737 — ManagedLedgerImpl.maybeUpdateCursorBeforeTrimmingConsumedLedger has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ManagedLedgerImpl.offloadLoop (cognitive 17) · ×1
  • ManagedLedgerImpl.offloadLoop (cognitive 17) managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java:3739 — ManagedLedgerImpl.offloadLoop has cognitive complexity 17 (threshold 15). Drivers by points: if/else 17 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · 1.operationComplete (cognitive 17) · ×1
  • 1.operationComplete (cognitive 17) managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java:443 — 1.operationComplete has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, loops 3, boolean chains 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · BucketDelayedDeliveryTracker.recoverBucketSnapshot (cognitive 16) · ×1
  • BucketDelayedDeliveryTracker.recoverBucketSnapshot (cognitive 16) pulsar-broker/src/main/java/org/apache/pulsar/broker/delayed/bucket/BucketDelayedDeliveryTracker.java:185 — BucketDelayedDeliveryTracker.recoverBucketSnapshot has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, loops 7, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BucketDelayedDeliveryTracker.selectMergedBuckets (cognitive 16) · ×1
  • BucketDelayedDeliveryTracker.selectMergedBuckets (cognitive 16) pulsar-broker/src/main/java/org/apache/pulsar/broker/delayed/bucket/BucketDelayedDeliveryTracker.java:469 — BucketDelayedDeliveryTracker.selectMergedBuckets has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MutableBucket.createImmutableBucketAndAsyncPersistent (cognitive 16) · ×1
  • MutableBucket.createImmutableBucketAndAsyncPersistent (cognitive 16) pulsar-broker/src/main/java/org/apache/pulsar/broker/delayed/bucket/MutableBucket.java:60 — MutableBucket.createImmutableBucketAndAsyncPersistent has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, loops 5, boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NonPersistentTopic.internalSubscribe (cognitive 16) · ×1
  • NonPersistentTopic.internalSubscribe (cognitive 16) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentTopic.java:292 — NonPersistentTopic.internalSubscribe has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, error handling 2, boolean chains 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · AutoScaleConfig.applyOverride (cognitive 16) · ×1
  • AutoScaleConfig.applyOverride (cognitive 16) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/scalable/AutoScaleConfig.java:128 — AutoScaleConfig.applyOverride has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · AbstractTopic.incrementTopicEpochIfNeeded (cognitive 16) · ×1
  • AbstractTopic.incrementTopicEpochIfNeeded (cognitive 16) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/AbstractTopic.java:957 — AbstractTopic.incrementTopicEpochIfNeeded has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, boolean chains 4, error handling 1, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BrokerService.closeAsync (cognitive 16) · ×1
  • BrokerService.closeAsync (cognitive 16) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java:939 — BrokerService.closeAsync has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, error handling 5, loops 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · Consumer.getAckOwnerConsumerAndBatchSize (cognitive 16) · ×1
  • Consumer.getAckOwnerConsumerAndBatchSize (cognitive 16) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/Consumer.java:842 — Consumer.getAckOwnerConsumerAndBatchSize has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, loops 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DrainingHashesTracker.reduceRefCount (cognitive 16) · ×1
  • DrainingHashesTracker.reduceRefCount (cognitive 16) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/DrainingHashesTracker.java:327 — DrainingHashesTracker.reduceRefCount has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MultiRolesTokenAuthorizationProvider.getRoles (cognitive 16) · ×1
  • MultiRolesTokenAuthorizationProvider.getRoles (cognitive 16) pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/MultiRolesTokenAuthorizationProvider.java:156 — MultiRolesTokenAuthorizationProvider.getRoles has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, boolean chains 3 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · GzipByteBufferWriter.compressAndAppend (cognitive 16) · ×1
  • GzipByteBufferWriter.compressAndAppend (cognitive 16) pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/prometheus/PrometheusMetricsGenerator.java:220 — GzipByteBufferWriter.compressAndAppend has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, boolean chains 3, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PersistentTopicsBase.internalGetMessageIDByIndexAsync (cognitive 16) · ×1
  • PersistentTopicsBase.internalGetMessageIDByIndexAsync (cognitive 16) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:5700 — PersistentTopicsBase.internalGetMessageIDByIndexAsync has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, boolean chains 2, error handling 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PersistentTopicsBase.internalSetReplicatedSubscriptionStatus (cognitive 16) · ×1
  • PersistentTopicsBase.internalSetReplicatedSubscriptionStatus (cognitive 16) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:5238 — PersistentTopicsBase.internalSetReplicatedSubscriptionStatus has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, error handling 3, loops 2 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PersistentTopicsBase.internalTriggerCompaction (cognitive 16) · ×1
  • PersistentTopicsBase.internalTriggerCompaction (cognitive 16) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:4424 — PersistentTopicsBase.internalTriggerCompaction has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, error handling 3, loops 2 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · UnloadScheduler.execute (cognitive 16) · ×1
  • UnloadScheduler.execute (cognitive 16) pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/scheduler/UnloadScheduler.java:113 — UnloadScheduler.execute has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, error handling 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · BundleSplitterTask.findBundlesToSplit (cognitive 16) · ×1
  • BundleSplitterTask.findBundlesToSplit (cognitive 16) pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/BundleSplitterTask.java:64 — BundleSplitterTask.findBundlesToSplit has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, error handling 3, boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SimpleLoadManagerImpl.doLoadRanking (cognitive 16) · ×1
  • SimpleLoadManagerImpl.doLoadRanking (cognitive 16) pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/SimpleLoadManagerImpl.java:650 — SimpleLoadManagerImpl.doLoadRanking has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ResourceGroupService.calculateQuotaForAllResourceGroups (cognitive 16) · ×1
  • ResourceGroupService.calculateQuotaForAllResourceGroups (cognitive 16) pulsar-broker/src/main/java/org/apache/pulsar/broker/resourcegroup/ResourceGroupService.java:634 — ResourceGroupService.calculateQuotaForAllResourceGroups has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, error handling 2, boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TopicTransactionBufferRecover.run (cognitive 16) · ×1
  • TopicTransactionBufferRecover.run (cognitive 16) pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/buffer/impl/TopicTransactionBuffer.java:820 — TopicTransactionBufferRecover.run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, error handling 5, loops 2, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PendingAckHandleImpl.checkPositionInPendingAckState (cognitive 16) · ×1
  • PendingAckHandleImpl.checkPositionInPendingAckState (cognitive 16) pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/pendingack/impl/PendingAckHandleImpl.java:1099 — PendingAckHandleImpl.checkPositionInPendingAckState has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PendingAckHandleImpl.handleIndividualAck (cognitive 16) · ×1
  • PendingAckHandleImpl.handleIndividualAck (cognitive 16) pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/pendingack/impl/PendingAckHandleImpl.java:809 — PendingAckHandleImpl.handleIndividualAck has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DefaultPulsarSslFactory.createSSLEngine (cognitive 16) · ×1
  • DefaultPulsarSslFactory.createSSLEngine (cognitive 16) pulsar-common/src/main/java/org/apache/pulsar/common/util/DefaultPulsarSslFactory.java:307 — DefaultPulsarSslFactory.createSSLEngine has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 2 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · FlowOrQpsEquallyDivideBundleSplitAlgorithm.getSplitBoundary (cognitive 16) · ×1
  • FlowOrQpsEquallyDivideBundleSplitAlgorithm.getSplitBoundary (cognitive 16) pulsar-broker/src/main/java/org/apache/pulsar/common/naming/FlowOrQpsEquallyDivideBundleSplitAlgorithm.java:50 — FlowOrQpsEquallyDivideBundleSplitAlgorithm.getSplitBoundary has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 5, loops 2 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OffloadPoliciesImpl.mergeConfiguration (cognitive 16) · ×1
  • OffloadPoliciesImpl.mergeConfiguration (cognitive 16) pulsar-common/src/main/java/org/apache/pulsar/common/policies/data/OffloadPoliciesImpl.java:432 — OffloadPoliciesImpl.mergeConfiguration has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, boolean chains 2, error handling 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NarUnpacker.doUnpackNar (cognitive 16) · ×1
  • NarUnpacker.doUnpackNar (cognitive 16) pulsar-common/src/main/java/org/apache/pulsar/common/nar/NarUnpacker.java:68 — NarUnpacker.doUnpackNar has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, error handling 5 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AsyncSemaphoreImpl.internalProcessQueue (cognitive 16) · ×1
  • AsyncSemaphoreImpl.internalProcessQueue (cognitive 16) pulsar-common/src/main/java/org/apache/pulsar/common/semaphore/AsyncSemaphoreImpl.java:241 — AsyncSemaphoreImpl.internalProcessQueue has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PublicSuffixMatcher.getDomainRoot (cognitive 16) · ×1
  • PublicSuffixMatcher.getDomainRoot (cognitive 16) pulsar-common/src/main/java/org/apache/pulsar/common/tls/PublicSuffixMatcher.java:134 — PublicSuffixMatcher.getDomainRoot has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, ternaries 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BatchMessageContainerImpl.add (cognitive 16) · ×1
  • BatchMessageContainerImpl.add (cognitive 16) pulsar-client/src/main/java/org/apache/pulsar/client/impl/BatchMessageContainerImpl.java:115 — BatchMessageContainerImpl.add has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, boolean chains 2, error handling 2, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConnectionHandler.grabCnx (cognitive 16) · ×1
  • ConnectionHandler.grabCnx (cognitive 16) pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConnectionHandler.java:115 — ConnectionHandler.grabCnx has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 1, error handling 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ConsumerBase.callMessageListener (cognitive 16) · ×1
  • ConsumerBase.callMessageListener (cognitive 16) pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerBase.java:1245 — ConsumerBase.callMessageListener has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 3, ternaries 3, error handling 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ProducerImpl.failPendingMessages (cognitive 16) · ×1
  • ProducerImpl.failPendingMessages (cognitive 16) pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java:2380 — ProducerImpl.failPendingMessages has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, error handling 3, ternaries 3, loops 2, boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SinkDetailsCommand.mergeArgs (cognitive 16) · ×1
  • SinkDetailsCommand.mergeArgs (cognitive 16) pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdSinks.java:419 — SinkDetailsCommand.mergeArgs has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 8. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · BKStateStoreProviderImpl.createStateTable (cognitive 16) · ×1
  • BKStateStoreProviderImpl.createStateTable (cognitive 16) pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/state/BKStateStoreProviderImpl.java:95 — BKStateStoreProviderImpl.createStateTable has cognitive complexity 16 (threshold 15). Drivers by points: error handling 15, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JavaInstance.handleMessage (cognitive 16) · ×1
  • JavaInstance.handleMessage (cognitive 16) pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/JavaInstance.java:115 — JavaInstance.handleMessage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, error handling 4, ternaries 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ProcessRuntimeFactory.initialize (cognitive 16) · ×1
  • ProcessRuntimeFactory.initialize (cognitive 16) pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/process/ProcessRuntimeFactory.java:117 — ProcessRuntimeFactory.initialize has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ComponentImpl.getStreamingOutput (cognitive 16) · ×1
  • ComponentImpl.getStreamingOutput (cognitive 16) pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/ComponentImpl.java:1454 — ComponentImpl.getStreamingOutput has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, error handling 5, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WorkerServer.init (cognitive 16) · ×1
  • WorkerServer.init (cognitive 16) pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/WorkerServer.java:103 — WorkerServer.init has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, error handling 3, boolean chains 1, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WorkerUtils.getFunctionInstanceStats (cognitive 16) · ×1
  • WorkerUtils.getFunctionInstanceStats (cognitive 16) pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/WorkerUtils.java:327 — WorkerUtils.getFunctionInstanceStats has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 9, if/else 4, error handling 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MigrationCoordinator.copyPersistentData (cognitive 16) · ×1
  • MigrationCoordinator.copyPersistentData (cognitive 16) pulsar-metadata/src/main/java/org/apache/pulsar/metadata/coordination/impl/MigrationCoordinator.java:182 — MigrationCoordinator.copyPersistentData has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ZooWorker.syncCallWithRetries (cognitive 16) · ×1
  • ZooWorker.syncCallWithRetries (cognitive 16) pulsar-metadata/src/main/java/org/apache/pulsar/metadata/impl/PulsarZooKeeperClient.java:1573 — ZooWorker.syncCallWithRetries has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, boolean chains 3, error handling 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ZKMetadataStore.internalStorePut (cognitive 16) · ×1
  • ZKMetadataStore.internalStorePut (cognitive 16) pulsar-metadata/src/main/java/org/apache/pulsar/metadata/impl/ZKMetadataStore.java:438 — ZKMetadataStore.internalStorePut has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 1, error handling 1 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ManagedCursorImpl.asyncFindNewestMatching (cognitive 16) · ×1
  • ManagedCursorImpl.asyncFindNewestMatching (cognitive 16) managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java:1506 — ManagedCursorImpl.asyncFindNewestMatching has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, ternaries 7, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ManagedCursorImpl.recoverFromLedger (cognitive 16) · ×1
  • ManagedCursorImpl.recoverFromLedger (cognitive 16) managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java:611 — ManagedCursorImpl.recoverFromLedger has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, boolean chains 5, error handling 2, loops 2 (nesting depth added 1). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpAddEntry.initiate (cognitive 16) · ×1
  • OpAddEntry.initiate (cognitive 16) managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/OpAddEntry.java:129 — OpAddEntry.initiate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, error handling 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReadTask.run (cognitive 16) · ×1
  • ReadTask.run (cognitive 16) tiered-storage/jcloud/src/main/java/org/apache/bookkeeper/mledger/offload/jcloud/impl/BlobStoreBackedReadHandleImpl.java:138 — ReadTask.run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, loops 4, boolean chains 1, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D35 · Change Coupling · Change coupling clique · ×1
  • Change coupling clique: PersistentSubscription.java, AggregatedSubscriptionStats.java, SubscriptionStats.java pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentSubscription.java — 3 files — `pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentSubscription.java`, `pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/prometheus/AggregatedSubscriptionStats.java`, `pulsar-client-admin-api/src/main/java/org/apache/pulsar/common/policies/data/SubscriptionStats.java` — all change together with no explicit dependency: a fully-connected co-change clique, not 3 separate couplings. They share one concern (thin parallel siblings over a common abstraction), so extract the shared part into ONE unit and the whole clique's coupling clears at once — you do not need to break each pair individually.
D36 · Supply-chain Provenance & Signing · Unpinned build actions · ×1
  • Unpinned build actions — CI references GitHub Actions by a floating ref (@main / @tag) rather than a pinned commit SHA, weakening build integrity. 62 floating ref(s) across 8 workflow file(s), 3 of them mutable BRANCH refs (reported separately, pin those first): `actions/github-script@v8` (.github/workflows/pulsar-ci.yaml:91), `actions/checkout@v6` (.github/workflows/pulsar-ci.yaml:110), `actions/checkout@v6` (.github/workflows/pulsar-ci.yaml:148), `actions/setup-java@v5` (.github/workflows/pulsar-ci.yaml:162), `actions/upload-artifact@v4` (.github/workflows/pulsar-ci.yaml:185), `actions/upload-artifact@v7` (.github/workflows/pulsar-ci.yaml:203), `actions/checkout@v6` (.github/workflows/pulsar-ci.yaml:269), `actions/setup-java@v5` (.github/workflows/pulsar-ci.yaml:287), … (+51 more)
D36 · Supply-chain Provenance & Signing · PR-triggered workflow without a permissions block · ×1
  • PR-triggered workflow without a permissions block — 3 workflow(s) triggered by pull_request declare no `permissions:` block (pulsar-ci-flaky.yaml, ci-semantic-pull-request.yml, ci-go-functions.yaml) and so run with the repository's default GITHUB_TOKEN scope, while sibling workflows in the same repository are already scoped. Pull-request runs build the least-trusted code in the repository; give each of these workflows its own least-privilege block — `permissions: {contents: read}` at the top of the workflow, widened per job only where a job genuinely writes.
D38 · OSV Dependency Vulnerabilities · Medium vulnerability · ×1
  • Medium vulnerability: GO-2026-5841 pulsar-function-go/go.mod — github.com/klauspost/compress 1.18.0 (github.com/klauspost/compress/s2): GO-2026-5841 — github.com/klauspost/compress is not a DIRECT requirement of this module: go.mod records it as `// indirect`, pulled in transitively, so raise it in place (run `go get github.com/klauspost/compress@v1.18.7`, which updates the require line go.mod already holds for it).
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×1
  • Duplicated block (21 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:1229 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:1229-1249 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumersClassic.java:1078-1098
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×1
  • Duplicated block (20 lines × 2) pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:534 — pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:534-553 | pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumersClassic.java:458-477
D4 · Code Duplication · Duplicated block (15 lines × 4) · ×1
  • Duplicated block (15 lines × 4) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:1026 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:1026-1040 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:1331-1345 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:1489-1503 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:4478-4492
D4 · Code Duplication · Duplicated block (15 lines × 3) · ×1
  • Duplicated block (15 lines × 3) pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/FunctionsImpl.java:181 — pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/FunctionsImpl.java:181-195 | pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/FunctionsImpl.java:687-701 | pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/FunctionsImpl.java:729-743
D4 · Code Duplication · Duplicated block (14 lines × 8) · ×1
  • Duplicated block (14 lines × 8) pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/FunctionsImpl.java:272 — pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/FunctionsImpl.java:272-285 | pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/FunctionsImpl.java:473-486 | pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/FunctionsImpl.java:570-583 | pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/PackagesImpl.java:164-177 | pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/SinksImpl.java:157-170 | pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/SinksImpl.java:245-258 | pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/SourcesImpl.java:136-149 | pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/SourcesImpl.java:214-227
D4 · Code Duplication · Duplicated block (13 lines × 3) · ×1
  • Duplicated block (13 lines × 3) pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/BaseResource.java:126 — pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/BaseResource.java:126-138 | pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/BaseResource.java:160-172 | pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/BaseResource.java:239-251
D4 · Code Duplication · Duplicated block (12 lines × 11) · ×1
  • Duplicated block (12 lines × 11) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/NonPersistentTopics.java:158 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/NonPersistentTopics.java:158-169 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:1128-1139 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:1490-1502 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:1534-1545 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:2328-2339 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:3879-3890 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:3990-4001 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v3/Transactions.java:129-140 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v3/Transactions.java:172-183 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v3/Transactions.java:215-226 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v3/Transactions.java:257-268
D4 · Code Duplication · Duplicated block (12 lines × 6) · ×1
  • Duplicated block (12 lines × 6) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:2460 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:2460-2471 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:2493-2505 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:2522-2533 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:2549-2561 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:2587-2599 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java:2616-2628
D4 · Code Duplication · Duplicated block (11 lines × 6) · ×1
  • Duplicated block (11 lines × 6) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:839 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:839-849 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:871-881 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:934-944 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:967-977 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:1003-1013 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:1060-1070
D4 · Code Duplication · Duplicated block (11 lines × 5) · ×1
  • Duplicated block (11 lines × 5) pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/PulsarAuthorizationProvider.java:317 — pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/PulsarAuthorizationProvider.java:317-327 | pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/PulsarAuthorizationProvider.java:777-787 | pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/PulsarAuthorizationProvider.java:825-835 | pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/PulsarAuthorizationProvider.java:852-864 | pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/PulsarAuthorizationProvider.java:880-892
D4 · Code Duplication · Duplicated block (10 lines × 19) · ×1
  • Duplicated block (10 lines × 19) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:600 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:600-609 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:624-633 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:753-762 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:1282-1291 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:1334-1343 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:1355-1364 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:1403-1412 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:1454-1463 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:1475-1484 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:1498-1507 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:1705-1714 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:1726-1735 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:1752-1761 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:1802-1811 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:1852-1861 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:3197-3206 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:3221-3230 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:3678-3687 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java:3702-3711
D4 · Code Duplication · Duplicated block (10 lines × 10) · ×1
  • Duplicated block (10 lines × 10) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:3113 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:3113-3122 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:3148-3157 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:3183-3192 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:3320-3329 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:3423-3432 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:3526-3535 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:3628-3637 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:3730-3739 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:3834-3843 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:4913-4922
D4 · Code Duplication · Duplicated block (10 lines × 5) · ×1
  • Duplicated block (10 lines × 5) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:4260 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:4260-4269 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:4368-4377 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:4587-4596 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:4695-4704 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:5250-5259
D4 · Code Duplication · Duplicated block (9 lines × 7) · ×1
  • Duplicated block (9 lines × 7) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/ScalableTopics.java:755 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/ScalableTopics.java:755-763 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/ScalableTopics.java:796-804 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/ScalableTopics.java:842-850 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/ScalableTopics.java:884-892 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/ScalableTopics.java:924-932 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Segments.java:220-228 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Segments.java:275-283
D4 · Code Duplication · Duplicated block (9 lines × 5) · ×1
  • Duplicated block (9 lines × 5) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:4218 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:4218-4226 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:4326-4334 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:4545-4553 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:4652-4661 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java:4871-4880
D4 · Code Duplication · Duplicated block (8 lines × 7) · ×1
  • Duplicated block (8 lines × 7) pulsar-broker-common/src/main/java/org/apache/pulsar/broker/resources/BaseResources.java:86 — pulsar-broker-common/src/main/java/org/apache/pulsar/broker/resources/BaseResources.java:86-93 | pulsar-broker-common/src/main/java/org/apache/pulsar/broker/resources/BaseResources.java:132-139 | pulsar-broker-common/src/main/java/org/apache/pulsar/broker/resources/BaseResources.java:154-161 | pulsar-broker-common/src/main/java/org/apache/pulsar/broker/resources/BaseResources.java:169-176 | pulsar-broker-common/src/main/java/org/apache/pulsar/broker/resources/BaseResources.java:184-191 | pulsar-broker-common/src/main/java/org/apache/pulsar/broker/resources/BaseResources.java:199-206 | pulsar-broker-common/src/main/java/org/apache/pulsar/broker/resources/BaseResources.java:232-239
D4 · Code Duplication · Duplicated block (6 lines × 6) · ×1
  • Duplicated block (6 lines × 6) pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/ScalableTopics.java:279 — pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/ScalableTopics.java:279-284 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/ScalableTopics.java:750-756 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/ScalableTopics.java:791-797 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/ScalableTopics.java:879-885 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/ScalableTopics.java:919-925 | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Segments.java:215-221
D4 · Code Duplication · Duplicated block (6 lines × 5) · ×1
  • Duplicated block (6 lines × 5) pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/ScalableTopicsImpl.java:347 — pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/ScalableTopicsImpl.java:347-352 | pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/ScalableTopicsImpl.java:358-363 | pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/ScalableTopicsImpl.java:369-374 | pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/ScalableTopicsImpl.java:381-386 | pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/ScalableTopicsImpl.java:393-398
D4 · Code Duplication · Duplicated block (6 lines × 4) · ×1
  • Duplicated block (6 lines × 4) pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/SinksImpl.java:119 — pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/SinksImpl.java:119-124 | pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/SinksImpl.java:325-330 | pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/SinksImpl.java:357-362 | pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/SinksImpl.java:389-394
D4 · Code Duplication · Duplicated block (28 lines × 2) · ×1
  • Duplicated block (28 lines × 2) pulsar-broker-common/src/main/java/org/apache/pulsar/broker/web/plugin/servlet/AdditionalServletUtils.java:126 — pulsar-broker-common/src/main/java/org/apache/pulsar/broker/web/plugin/servlet/AdditionalServletUtils.java:126-154 | pulsar-broker/src/main/java/org/apache/pulsar/broker/protocol/ProtocolHandlerUtils.java:122-149
Recommendation — 15 finding(s)
D16 · Bus Factor · Off-boarding risk · ×4
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 81 significant file(s) lose their only recent owner: pulsar-broker/src/main/java/org/apache/pulsar/broker/service/scalable/ScalableTopicController.java, pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/buffer/impl/MetadataTransactionBuffer.java, pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/coordinator/v5/TransactionCoordinatorV5.java, pulsar-broker/src/main/java/org/apache/pulsar/broker/service/scalable/SubscriptionCoordinator.java, pulsar-client-v5/src/main/java/org/apache/pulsar/client/impl/v5/ScalableStreamConsumer.java, pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/metadata/TxnMetadataStore.java, pulsar-broker-common/src/main/java/org/apache/pulsar/broker/resources/ScalableTopicResources.java, pulsar-client-v5/src/main/java/org/apache/pulsar/client/impl/v5/ScalableQueueConsumer.java (+73 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 8 significant file(s) lose their only recent owner: pulsar-package-management/core/src/main/java/org/apache/pulsar/packages/management/core/impl/PackagesManagementImpl.java, pulsar-broker/src/main/java/org/apache/pulsar/broker/service/TopicPolicyListenerWrapper.java, pulsar-common/src/main/java/org/apache/pulsar/common/util/netty/PulsarFlowControlHandler.java, pulsar-package-management/core/src/main/java/org/apache/pulsar/packages/management/core/common/PackageMetadataUtil.java, build-logic/conventions/src/main/kotlin/CheckBinaryLicenseTask.kt, pulsar-common/src/main/java/org/apache/pulsar/Pulsar...

    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.