Public report of apache/iggy, published 28 October 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.10.5). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey →
Signed and filed in the standard's public register, 28 October 2026, 07:50 UTC · Survey ID cd_40971b46614043d5bc6bb2322b07ce41
apache/iggy
Measured 28 October 2026, 07:40 UTC, at code version 419be1a
Regression: 1 dimension fell since the last survey
A regression is a drop of 0.5 points or more in the score, or of 2.5 or more out of 10 in a dimension, since the last survey.
CAI scoreAdequate
CriticalWeakAdequateStrongExemplary
Down 2 since the last survey
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A very large codebase: 719,666 lines of product code in 65 projects, tests not counted · Estimated rebuild effort: about 10.2 person-years · Weakest lens: Production Readiness, 47
Findings by how serious they are
321 critical1932 serious146 minor
7 dimensions are left out of the score. For each one, Watchdog either couldn't measure it in this code, or found no evidence of the safeguard it looks for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
28 October 2026, 07:40 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds Watchdog. It is open to any tool that
implements it, and today Watchdog is the only one that does.
The score is deterministic, which means the same code always gets the same score. Watchdog works it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
91of 91 dimensions measured by tools.
2316of 2399 findings point to an exact file and line, so you can open each one in the code. The other 83 concern the repository as a whole, such as missing documentation.
91dimensions across 7 lenses, read from 719,666 lines of product code in 65 projects.
apache/iggy falls short of our standard for a preview release, in part because 28 passwords or keys sit in the current code. It scores 56 out of 100 and is rated Adequate, and 317 of its 321 critical findings are security problems.
Production Readiness, at 47, is the weakest lens, level with Security and Compliance, and counts most in the score. The best first step for the work it takes is updating the outdated dependencies, worth about 6 points. Replacing the 28 exposed passwords or keys and switching the old ones off would lift Production Readiness itself, worth about 8 points. Raising Production Readiness to 62 would lift the score to about 60.
162 pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Forty-four pipeline steps put outside input straight into a shell command, so an attacker can run commands in the build pipeline, and thirty-nine settings leave the servers or containers unsafe. Pinning each tool to an exact version, passing outside input through environment variables and correcting the unsafe settings would close these risks. Limiting each secret to its own step would fix the 18 secrets exposed to more of the pipeline than needed, and the 28 passwords or keys in the code and the 16 passwords or keys in the code's history need replacing, with the old ones switched off. The three errors that are caught and ignored need handling or logging instead of being ignored.
The product code is 719,666 lines, about €1,500,000 to rebuild.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts forThe lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
If Production Readiness rose from 47 to 62, the lowest score rated Strong, the score would rise from 56 to about 60.
Code composition: what the lines of code are
Business logic 3%Supporting code 3%Tests 94%
New since the last survey: 691 findings
These 691 critical or serious findings weren't in the previous survey, on 14 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.
Watchdog compares every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.
Fixed since the last survey: 380 findings
These 380 critical or serious findings were in the previous survey, on 14 October 2026, and are gone from this one. The first 100 are listed here.
God Classes · ClassTooLong: TcpClient core/sdk/src/tcp/tcp_client.rs
God Classes · ClassTooLong: WebSocketClient core/sdk/src/websocket/websocket_client.rs
God Classes · FileTooLong: tcp/tcp_client.rs core/sdk/src/tcp/tcp_client.rs
God Classes · ClassTooLong: QuicClient core/sdk/src/quic/quic_client.rs
God Classes · FileTooLong: websocket/websocket_client.rs core/sdk/src/websocket/websocket_client.rs
God Classes · FileTooLong: quic/quic_client.rs core/sdk/src/quic/quic_client.rs
God Classes · FileTooLong: REDACTED REDACTED
God Classes · MethodTooLong: WebSocketClient.send_raw_with_context core/sdk/src/websocket/websocket_client.rs
God Classes · MethodTooLong: QuicClient.send_raw_with_context core/sdk/src/quic/quic_client.rs
God Classes · MethodTooLong: QuicClient.connect_inner core/sdk/src/quic/quic_client.rs
God Classes · ClassTooLong: IggyTcpClient REDACTED
God Classes · TooManyMethods: IggyConsumer foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.Logging.cs
God Classes · MethodTooLong: IggyTcpClient.Connect REDACTED
God Classes · MethodTooLong: IggyConsumer.poll_next core/sdk/src/clients/consumer.rs
God Classes · MethodTooLong: WebSocketClient.connect_inner core/sdk/src/websocket/websocket_client.rs
God Classes · MethodTooLong: CommandResponseStream._sendOnPrimary foreign/node/src/client/client.socket.ts
God Classes · MethodTooLong: TcpClient.connect_inner core/sdk/src/tcp/tcp_client.rs
God Classes · TooManyFields: IggyTcpClient REDACTED
God Classes · MethodTooLong: TcpClient.send_raw_retaining_header core/sdk/src/tcp/tcp_client.rs
God Classes · FileTooLong: stm/lifecycle.rs core/metadata/src/stm/lifecycle.rs
God Classes · MethodTooLong: TcpClient.send_raw_vsr_exchange core/sdk/src/tcp/tcp_client.rs
God Classes · MethodTooLong: WebSocketClient.send_raw_exchange core/sdk/src/websocket/websocket_client.rs
Code Duplication · Near-duplicate member family (3 members, 67 shared lines) core/sdk/src/quic/quic_client.rs
Code Duplication · Near-duplicate member pair (77 shared lines) core/message_bus/src/transports/ws.rs
Code Duplication · Near-duplicate member pair (67 shared lines) core/message_bus/src/installer/replica.rs
Code Duplication · Near-duplicate member pair (52 shared lines) core/sdk/src/websocket/websocket_connection_stream.rs
Code Duplication · Edited copy of a member (22 corresponding lines) core/integration/src/harness/handle/connectors_runtime.rs
Code Duplication · Members sharing a duplicated core (13 members, 50+ identical tokens) core/consensus/src/observability.rs
Code Duplication · Members sharing a duplicated core (10 members, 50+ identical tokens) core/binary_protocol/src/requests/consumer_groups/create_consumer_group.rs
Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) foreign/go/internal/command/offset.go
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) core/binary_protocol/src/requests/consumer_offsets/delete_consumer_offset.rs
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) core/message_bus/src/lifecycle/connection_registry.rs
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) core/shard/src/lib.rs
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) gateways/kafka/src/protocol/bounds_guard.rs
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) gateways/kafka/src/protocol/bounds_guard.rs
Rebuild cost: about €1,500,000 · Estimate
Cost to rebuild
€490,000 to €2,500,000, for 8,223 to 26,143 hours of work, about 10.2 person-years for 6 to 20 engineers
Difficulty of the problem
High, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.8 at a score of 56. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Very large: 719,666 lines of product code
Comment lines
The estimate prices 716,525 lines. Comment lines count towards the size of 719,666 lines but aren't priced as work.
What it is not
Not a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.
How the estimate is made: Watchdog prices the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Resolve the 1 Outdated (npm) finding(s) in Dependency Hygiene.
Resolve the 28 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (7), REDACTED (6), REDACTED (6).
Raises the score by about 8 points · Medium effort · REDACTED Scanning
3
Codify backups + geo-recovery in IaC and document RTO/RPO and the restore procedure — a persistence guard alone is not disaster recovery.
Raises the score by about 4 points · Medium effort · DR & Backup
Diagnosis: what the measurements show together
Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.
Where the investment is most exposed · Value at risk
This code would cost about €1,500,000 to build again, about 10.2 person-years of work. Its weakest lens is Production Readiness, at 47 (Weak). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Resolve the 1 Outdated (npm) finding(s) in Dependency Hygiene. Of all the actions in this report, it raises the score most for the work it takes: about 6 points for low effort, because it clears the 1 Dependency Hygiene findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
Architecture — module dependency graph
Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.
Architecture: which parts of the code depend on which
The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.
1130 modules, with 3520 dependencies between them. 24 loops run through 193 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 1090 more are left out to keep it readable.
Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
configs.server_config.server uses iggy_common.traits.validatable, so a change to iggy_common.traits.validatable can break configs.server_config.server, while a change to configs.server_config.server can't break iggy_common.traits.validatable.
Position
Below the diagonal: configs.server_config.server uses a module listed above it, which is the healthy direction.
consensus.oneshot uses iggy_connector_sdk, so a change to iggy_connector_sdk can break consensus.oneshot, while a change to consensus.oneshot can't break iggy_connector_sdk.
Position
Below the diagonal: consensus.oneshot uses a module listed above it, which is the healthy direction.
26 pairs of types, where a type in iggy_binary_protocol.consensus.header uses a type in iggy_binary_protocol.consensus.operation. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
iggy_binary_protocol.consensus.header uses iggy_binary_protocol.consensus.operation, so a change to iggy_binary_protocol.consensus.operation can break iggy_binary_protocol.consensus.header, while a change to iggy_binary_protocol.consensus.header can't break iggy_binary_protocol.consensus.operation.
Position
Below the diagonal: iggy_binary_protocol.consensus.header uses a module listed above it, which is the healthy direction.
iggy_binary_protocol.primitives.identifier uses iggy_binary_protocol.codec, so a change to iggy_binary_protocol.codec can break iggy_binary_protocol.primitives.identifier, while a change to iggy_binary_protocol.primitives.identifier can't break iggy_binary_protocol.codec.
Position
Below the diagonal: iggy_binary_protocol.primitives.identifier uses a module listed above it, which is the healthy direction.
iggy_common.utils.duration uses iggy_connector_sdk, so a change to iggy_connector_sdk can break iggy_common.utils.duration, while a change to iggy_common.utils.duration can't break iggy_connector_sdk.
Position
Below the diagonal: iggy_common.utils.duration uses a module listed above it, which is the healthy direction.
simulator.workload.options uses server_common.sharding.namespace, so a change to server_common.sharding.namespace can break simulator.workload.options, while a change to simulator.workload.options can't break server_common.sharding.namespace.
Position
Below the diagonal: simulator.workload.options uses a module listed above it, which is the healthy direction.
iggy.links.replicas uses iggy_common.error.iggy_error, so a change to iggy_common.error.iggy_error can break iggy.links.replicas, while a change to iggy.links.replicas can't break iggy_common.error.iggy_error.
Position
Below the diagonal: iggy.links.replicas uses a module listed above it, which is the healthy direction.
iggy.links.replicas uses iggy_mcp.service.requests, so a change to iggy_mcp.service.requests can break iggy.links.replicas, while a change to iggy.links.replicas can't break iggy_mcp.service.requests.
Position
Below the diagonal: iggy.links.replicas uses a module listed above it, which is the healthy direction.
iggy.links.replicas uses consensus.oneshot, so a change to consensus.oneshot can break iggy.links.replicas, while a change to iggy.links.replicas can't break consensus.oneshot.
Position
Below the diagonal: iggy.links.replicas uses a module listed above it, which is the healthy direction.
iggy_binary_protocol.primitives.partition_history uses iggy_binary_protocol.codec, so a change to iggy_binary_protocol.codec can break iggy_binary_protocol.primitives.partition_history, while a change to iggy_binary_protocol.primitives.partition_history can't break iggy_binary_protocol.codec.
Position
Below the diagonal: iggy_binary_protocol.primitives.partition_history uses a module listed above it, which is the healthy direction.
iggy_binary_protocol.primitives.partition_history uses iggy_binary_protocol.consensus.header, so a change to iggy_binary_protocol.consensus.header can break iggy_binary_protocol.primitives.partition_history, while a change to iggy_binary_protocol.primitives.partition_history can't break iggy_binary_protocol.consensus.header.
Position
Below the diagonal: iggy_binary_protocol.primitives.partition_history uses a module listed above it, which is the healthy direction.
iggy_common.traits.client uses consensus.oneshot, so a change to consensus.oneshot can break iggy_common.traits.client, while a change to iggy_common.traits.client can't break consensus.oneshot.
Position
Below the diagonal: iggy_common.traits.client uses a module listed above it, which is the healthy direction.
iggy_common.utils.byte_size uses iggy_common.utils.duration, so a change to iggy_common.utils.duration can break iggy_common.utils.byte_size, while a change to iggy_common.utils.byte_size can't break iggy_common.utils.duration.
Position
Below the diagonal: iggy_common.utils.byte_size uses a module listed above it, which is the healthy direction.
iggy_common.utils.timestamp uses iggy_common.utils.duration, so a change to iggy_common.utils.duration can break iggy_common.utils.timestamp, while a change to iggy_common.utils.timestamp can't break iggy_common.utils.duration.
Position
Below the diagonal: iggy_common.utils.timestamp uses a module listed above it, which is the healthy direction.
consensus.impls uses iggy_mcp.service.requests, so a change to iggy_mcp.service.requests can break consensus.impls, while a change to consensus.impls can't break iggy_mcp.service.requests.
Position
Below the diagonal: consensus.impls uses a module listed above it, which is the healthy direction.
consensus.impls uses consensus.oneshot, so a change to consensus.oneshot can break consensus.impls, while a change to consensus.impls can't break consensus.oneshot.
Position
Below the diagonal: consensus.impls uses a module listed above it, which is the healthy direction.
consensus.impls uses iggy_binary_protocol.consensus.header, so a change to iggy_binary_protocol.consensus.header can break consensus.impls, while a change to consensus.impls can't break iggy_binary_protocol.consensus.header.
Position
Below the diagonal: consensus.impls uses a module listed above it, which is the healthy direction.
consensus.impls uses iggy_common.utils.timestamp, so a change to iggy_common.utils.timestamp can break consensus.impls, while a change to consensus.impls can't break iggy_common.utils.timestamp.
Position
Below the diagonal: consensus.impls uses a module listed above it, which is the healthy direction.
iggy_common.types.identifier uses iggy_common.traits.validatable, so a change to iggy_common.traits.validatable can break iggy_common.types.identifier, while a change to iggy_common.types.identifier can't break iggy_common.traits.validatable.
Position
Below the diagonal: iggy_common.types.identifier uses a module listed above it, which is the healthy direction.
iggy_common.types.identifier uses iggy_binary_protocol.primitives.identifier, so a change to iggy_binary_protocol.primitives.identifier can break iggy_common.types.identifier, while a change to iggy_common.types.identifier can't break iggy_binary_protocol.primitives.identifier.
Position
Below the diagonal: iggy_common.types.identifier uses a module listed above it, which is the healthy direction.
iggy_common.types.identifier uses iggy_common.utils.byte_size, so a change to iggy_common.utils.byte_size can break iggy_common.types.identifier, while a change to iggy_common.types.identifier can't break iggy_common.utils.byte_size.
Position
Below the diagonal: iggy_common.types.identifier uses a module listed above it, which is the healthy direction.
iggy_common.types.options uses iggy_mcp.service.requests, so a change to iggy_mcp.service.requests can break iggy_common.types.options, while a change to iggy_common.types.options can't break iggy_mcp.service.requests.
Position
Below the diagonal: iggy_common.types.options uses a module listed above it, which is the healthy direction.
iggy_common.types.options uses iggy_common.utils.byte_size, so a change to iggy_common.utils.byte_size can break iggy_common.types.options, while a change to iggy_common.types.options can't break iggy_common.utils.byte_size.
Position
Below the diagonal: iggy_common.types.options uses a module listed above it, which is the healthy direction.
simulator.workload.shadow uses server_common.sharding.namespace, so a change to server_common.sharding.namespace can break simulator.workload.shadow, while a change to simulator.workload.shadow can't break server_common.sharding.namespace.
Position
Below the diagonal: simulator.workload.shadow uses a module listed above it, which is the healthy direction.
simulator.workload.shadow uses simulator.workload.effect, so a change to simulator.workload.effect can break simulator.workload.shadow, while a change to simulator.workload.shadow can't break simulator.workload.effect.
Position
Below the diagonal: simulator.workload.shadow uses a module listed above it, which is the healthy direction.
simulator.workload.shadow uses iggy_binary_protocol.primitives.partition_history, so a change to iggy_binary_protocol.primitives.partition_history can break simulator.workload.shadow, while a change to simulator.workload.shadow can't break iggy_binary_protocol.primitives.partition_history.
Position
Below the diagonal: simulator.workload.shadow uses a module listed above it, which is the healthy direction.
iggy_common.types.consumer.consumer_kind uses iggy_common.traits.validatable, so a change to iggy_common.traits.validatable can break iggy_common.types.consumer.consumer_kind, while a change to iggy_common.types.consumer.consumer_kind can't break iggy_common.traits.validatable.
Position
Below the diagonal: iggy_common.types.consumer.consumer_kind uses a module listed above it, which is the healthy direction.
iggy_common.types.consumer.consumer_kind uses iggy_common.types.identifier, so a change to iggy_common.types.identifier can break iggy_common.types.consumer.consumer_kind, while a change to iggy_common.types.consumer.consumer_kind can't break iggy_common.types.identifier.
Position
Below the diagonal: iggy_common.types.consumer.consumer_kind uses a module listed above it, which is the healthy direction.
simulator.client uses iggy_binary_protocol.consensus.operation, so a change to iggy_binary_protocol.consensus.operation can break simulator.client, while a change to simulator.client can't break iggy_binary_protocol.consensus.operation.
Position
Below the diagonal: simulator.client uses a module listed above it, which is the healthy direction.
simulator.client uses iggy_mcp.service.requests, so a change to iggy_mcp.service.requests can break simulator.client, while a change to simulator.client can't break iggy_mcp.service.requests.
Position
Below the diagonal: simulator.client uses a module listed above it, which is the healthy direction.
simulator.client uses server_common.sharding.namespace, so a change to server_common.sharding.namespace can break simulator.client, while a change to simulator.client can't break server_common.sharding.namespace.
Position
Below the diagonal: simulator.client uses a module listed above it, which is the healthy direction.
simulator.client uses iggy_binary_protocol.consensus.header, so a change to iggy_binary_protocol.consensus.header can break simulator.client, while a change to simulator.client can't break iggy_binary_protocol.consensus.header.
Position
Below the diagonal: simulator.client uses a module listed above it, which is the healthy direction.
simulator.client uses iggy_binary_protocol.primitives.partition_history, so a change to iggy_binary_protocol.primitives.partition_history can break simulator.client, while a change to simulator.client can't break iggy_binary_protocol.primitives.partition_history.
Position
Below the diagonal: simulator.client uses a module listed above it, which is the healthy direction.
simulator.client uses iggy_common.types.options, so a change to iggy_common.types.options can break simulator.client, while a change to simulator.client can't break iggy_common.types.options.
Position
Below the diagonal: simulator.client uses a module listed above it, which is the healthy direction.
iggy.client_wrappers.client_wrapper uses consensus.oneshot, so a change to consensus.oneshot can break iggy.client_wrappers.client_wrapper, while a change to iggy.client_wrappers.client_wrapper can't break consensus.oneshot.
Position
Below the diagonal: iggy.client_wrappers.client_wrapper uses a module listed above it, which is the healthy direction.
iggy.client_wrappers.client_wrapper uses iggy_common.utils.duration, so a change to iggy_common.utils.duration can break iggy.client_wrappers.client_wrapper, while a change to iggy.client_wrappers.client_wrapper can't break iggy_common.utils.duration.
Position
Below the diagonal: iggy.client_wrappers.client_wrapper uses a module listed above it, which is the healthy direction.
iggy.client_wrappers.client_wrapper uses iggy_common.traits.client, so a change to iggy_common.traits.client can break iggy.client_wrappers.client_wrapper, while a change to iggy.client_wrappers.client_wrapper can't break iggy_common.traits.client.
Position
Below the diagonal: iggy.client_wrappers.client_wrapper uses a module listed above it, which is the healthy direction.
iggy.client_wrappers.client_wrapper uses iggy_common.types.identifier, so a change to iggy_common.types.identifier can break iggy.client_wrappers.client_wrapper, while a change to iggy.client_wrappers.client_wrapper can't break iggy_common.types.identifier.
Position
Below the diagonal: iggy.client_wrappers.client_wrapper uses a module listed above it, which is the healthy direction.
iggy.client_wrappers.client_wrapper uses iggy_common.types.options, so a change to iggy_common.types.options can break iggy.client_wrappers.client_wrapper, while a change to iggy.client_wrappers.client_wrapper can't break iggy_common.types.options.
Position
Below the diagonal: iggy.client_wrappers.client_wrapper uses a module listed above it, which is the healthy direction.
iggy.client_wrappers.client_wrapper uses iggy_common.types.consumer.consumer_kind, so a change to iggy_common.types.consumer.consumer_kind can break iggy.client_wrappers.client_wrapper, while a change to iggy.client_wrappers.client_wrapper can't break iggy_common.types.consumer.consumer_kind.
Position
Below the diagonal: iggy.client_wrappers.client_wrapper uses a module listed above it, which is the healthy direction.
iggy.http.http_client uses iggy_common.error.iggy_error, so a change to iggy_common.error.iggy_error can break iggy.http.http_client, while a change to iggy.http.http_client can't break iggy_common.error.iggy_error.
Position
Below the diagonal: iggy.http.http_client uses a module listed above it, which is the healthy direction.
iggy.http.http_client uses iggy_mcp.service.requests, so a change to iggy_mcp.service.requests can break iggy.http.http_client, while a change to iggy.http.http_client can't break iggy_mcp.service.requests.
Position
Below the diagonal: iggy.http.http_client uses a module listed above it, which is the healthy direction.
iggy.http.http_client uses consensus.oneshot, so a change to consensus.oneshot can break iggy.http.http_client, while a change to iggy.http.http_client can't break consensus.oneshot.
Position
Below the diagonal: iggy.http.http_client uses a module listed above it, which is the healthy direction.
iggy.http.http_client uses iggy_common.utils.duration, so a change to iggy_common.utils.duration can break iggy.http.http_client, while a change to iggy.http.http_client can't break iggy_common.utils.duration.
Position
Below the diagonal: iggy.http.http_client uses a module listed above it, which is the healthy direction.
iggy.http.http_client uses iggy_common.traits.client, so a change to iggy_common.traits.client can break iggy.http.http_client, while a change to iggy.http.http_client can't break iggy_common.traits.client.
Position
Below the diagonal: iggy.http.http_client uses a module listed above it, which is the healthy direction.
iggy.http.http_client uses iggy_common.types.identifier, so a change to iggy_common.types.identifier can break iggy.http.http_client, while a change to iggy.http.http_client can't break iggy_common.types.identifier.
Position
Below the diagonal: iggy.http.http_client uses a module listed above it, which is the healthy direction.
iggy.http.http_client uses iggy_common.types.options, so a change to iggy_common.types.options can break iggy.http.http_client, while a change to iggy.http.http_client can't break iggy_common.types.options.
Position
Below the diagonal: iggy.http.http_client uses a module listed above it, which is the healthy direction.
iggy.http.http_client uses iggy_common.types.consumer.consumer_kind, so a change to iggy_common.types.consumer.consumer_kind can break iggy.http.http_client, while a change to iggy.http.http_client can't break iggy_common.types.consumer.consumer_kind.
Position
Below the diagonal: iggy.http.http_client uses a module listed above it, which is the healthy direction.
partitions.iggy_partition uses iggy_binary_protocol.consensus.operation, so a change to iggy_binary_protocol.consensus.operation can break partitions.iggy_partition, while a change to partitions.iggy_partition can't break iggy_binary_protocol.consensus.operation.
Position
Below the diagonal: partitions.iggy_partition uses a module listed above it, which is the healthy direction.
partitions.iggy_partition uses iggy_common.error.iggy_error, so a change to iggy_common.error.iggy_error can break partitions.iggy_partition, while a change to partitions.iggy_partition can't break iggy_common.error.iggy_error.
Position
Below the diagonal: partitions.iggy_partition uses a module listed above it, which is the healthy direction.
partitions.iggy_partition uses iggy_mcp.service.requests, so a change to iggy_mcp.service.requests can break partitions.iggy_partition, while a change to partitions.iggy_partition can't break iggy_mcp.service.requests.
Position
Below the diagonal: partitions.iggy_partition uses a module listed above it, which is the healthy direction.
partitions.iggy_partition uses server_common.sharding.namespace, so a change to server_common.sharding.namespace can break partitions.iggy_partition, while a change to partitions.iggy_partition can't break server_common.sharding.namespace.
Position
Below the diagonal: partitions.iggy_partition uses a module listed above it, which is the healthy direction.
partitions.iggy_partition uses consensus.oneshot, so a change to consensus.oneshot can break partitions.iggy_partition, while a change to partitions.iggy_partition can't break consensus.oneshot.
Position
Below the diagonal: partitions.iggy_partition uses a module listed above it, which is the healthy direction.
partitions.iggy_partition uses iggy_binary_protocol.consensus.header, so a change to iggy_binary_protocol.consensus.header can break partitions.iggy_partition, while a change to partitions.iggy_partition can't break iggy_binary_protocol.consensus.header.
Position
Below the diagonal: partitions.iggy_partition uses a module listed above it, which is the healthy direction.
partitions.iggy_partition uses iggy_binary_protocol.primitives.partition_history, so a change to iggy_binary_protocol.primitives.partition_history can break partitions.iggy_partition, while a change to partitions.iggy_partition can't break iggy_binary_protocol.primitives.partition_history.
Position
Below the diagonal: partitions.iggy_partition uses a module listed above it, which is the healthy direction.
partitions.iggy_partition uses iggy_common.utils.byte_size, so a change to iggy_common.utils.byte_size can break partitions.iggy_partition, while a change to partitions.iggy_partition can't break iggy_common.utils.byte_size.
Position
Below the diagonal: partitions.iggy_partition uses a module listed above it, which is the healthy direction.
partitions.iggy_partition uses iggy_common.utils.timestamp, so a change to iggy_common.utils.timestamp can break partitions.iggy_partition, while a change to partitions.iggy_partition can't break iggy_common.utils.timestamp.
Position
Below the diagonal: partitions.iggy_partition uses a module listed above it, which is the healthy direction.
partitions.iggy_partition uses consensus.impls, so a change to consensus.impls can break partitions.iggy_partition, while a change to partitions.iggy_partition can't break consensus.impls.
Position
Below the diagonal: partitions.iggy_partition uses a module listed above it, which is the healthy direction.
partitions.iggy_partition uses iggy_common.types.options, so a change to iggy_common.types.options can break partitions.iggy_partition, while a change to partitions.iggy_partition can't break iggy_common.types.options.
Position
Below the diagonal: partitions.iggy_partition uses a module listed above it, which is the healthy direction.
partitions.iggy_partition uses iggy_common.types.consumer.consumer_kind, so a change to iggy_common.types.consumer.consumer_kind can break partitions.iggy_partition, while a change to partitions.iggy_partition can't break iggy_common.types.consumer.consumer_kind.
Position
Below the diagonal: partitions.iggy_partition uses a module listed above it, which is the healthy direction.
simulator.workload.ops.delete_consumer_offset uses iggy_mcp.service.requests, so a change to iggy_mcp.service.requests can break simulator.workload.ops.delete_consumer_offset, while a change to simulator.workload.ops.delete_consumer_offset can't break iggy_mcp.service.requests.
Position
Below the diagonal: simulator.workload.ops.delete_consumer_offset uses a module listed above it, which is the healthy direction.
simulator.workload.ops.delete_consumer_offset uses server_common.sharding.namespace, so a change to server_common.sharding.namespace can break simulator.workload.ops.delete_consumer_offset, while a change to simulator.workload.ops.delete_consumer_offset can't break server_common.sharding.namespace.
Position
Below the diagonal: simulator.workload.ops.delete_consumer_offset uses a module listed above it, which is the healthy direction.
simulator.workload.ops.delete_consumer_offset uses simulator.workload.effect, so a change to simulator.workload.effect can break simulator.workload.ops.delete_consumer_offset, while a change to simulator.workload.ops.delete_consumer_offset can't break simulator.workload.effect.
Position
Below the diagonal: simulator.workload.ops.delete_consumer_offset uses a module listed above it, which is the healthy direction.
simulator.workload.ops.delete_consumer_offset uses simulator.workload.options, so a change to simulator.workload.options can break simulator.workload.ops.delete_consumer_offset, while a change to simulator.workload.ops.delete_consumer_offset can't break simulator.workload.options.
Position
Below the diagonal: simulator.workload.ops.delete_consumer_offset uses a module listed above it, which is the healthy direction.
simulator.workload.ops.delete_consumer_offset uses simulator.workload.shadow, so a change to simulator.workload.shadow can break simulator.workload.ops.delete_consumer_offset, while a change to simulator.workload.ops.delete_consumer_offset can't break simulator.workload.shadow.
Position
Below the diagonal: simulator.workload.ops.delete_consumer_offset uses a module listed above it, which is the healthy direction.
simulator.workload.ops.delete_consumer_offset uses simulator.client, so a change to simulator.client can break simulator.workload.ops.delete_consumer_offset, while a change to simulator.workload.ops.delete_consumer_offset can't break simulator.client.
Position
Below the diagonal: simulator.workload.ops.delete_consumer_offset uses a module listed above it, which is the healthy direction.
30→32 simulator.workload.ops.delete_consumer_offset uses simulator.workload.ops.change_passwordpart of a loop✕
Connections
1 pair of types, where a type in simulator.workload.ops.delete_consumer_offset uses a type in simulator.workload.ops.change_password.
simulator.workload.ops.delete_consumer_offset uses simulator.workload.ops.change_password, so a change to simulator.workload.ops.change_password can break simulator.workload.ops.delete_consumer_offset, while a change to simulator.workload.ops.delete_consumer_offset can't break simulator.workload.ops.change_password.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
iggy.clients.client uses consensus.oneshot, so a change to consensus.oneshot can break iggy.clients.client, while a change to iggy.clients.client can't break consensus.oneshot.
Position
Below the diagonal: iggy.clients.client uses a module listed above it, which is the healthy direction.
iggy.clients.client uses iggy_common.utils.duration, so a change to iggy_common.utils.duration can break iggy.clients.client, while a change to iggy.clients.client can't break iggy_common.utils.duration.
Position
Below the diagonal: iggy.clients.client uses a module listed above it, which is the healthy direction.
iggy.clients.client uses iggy_common.traits.client, so a change to iggy_common.traits.client can break iggy.clients.client, while a change to iggy.clients.client can't break iggy_common.traits.client.
Position
Below the diagonal: iggy.clients.client uses a module listed above it, which is the healthy direction.
iggy.clients.client uses iggy_common.types.identifier, so a change to iggy_common.types.identifier can break iggy.clients.client, while a change to iggy.clients.client can't break iggy_common.types.identifier.
Position
Below the diagonal: iggy.clients.client uses a module listed above it, which is the healthy direction.
iggy.clients.client uses iggy_common.types.options, so a change to iggy_common.types.options can break iggy.clients.client, while a change to iggy.clients.client can't break iggy_common.types.options.
Position
Below the diagonal: iggy.clients.client uses a module listed above it, which is the healthy direction.
iggy.clients.client uses iggy_common.types.consumer.consumer_kind, so a change to iggy_common.types.consumer.consumer_kind can break iggy.clients.client, while a change to iggy.clients.client can't break iggy_common.types.consumer.consumer_kind.
Position
Below the diagonal: iggy.clients.client uses a module listed above it, which is the healthy direction.
iggy.clients.client uses iggy.client_wrappers.client_wrapper, so a change to iggy.client_wrappers.client_wrapper can break iggy.clients.client, while a change to iggy.clients.client can't break iggy.client_wrappers.client_wrapper.
Position
Below the diagonal: iggy.clients.client uses a module listed above it, which is the healthy direction.
simulator.workload.ops.change_password uses iggy_mcp.service.requests, so a change to iggy_mcp.service.requests can break simulator.workload.ops.change_password, while a change to simulator.workload.ops.change_password can't break iggy_mcp.service.requests.
Position
Below the diagonal: simulator.workload.ops.change_password uses a module listed above it, which is the healthy direction.
simulator.workload.ops.change_password uses simulator.workload.effect, so a change to simulator.workload.effect can break simulator.workload.ops.change_password, while a change to simulator.workload.ops.change_password can't break simulator.workload.effect.
Position
Below the diagonal: simulator.workload.ops.change_password uses a module listed above it, which is the healthy direction.
simulator.workload.ops.change_password uses simulator.workload.options, so a change to simulator.workload.options can break simulator.workload.ops.change_password, while a change to simulator.workload.ops.change_password can't break simulator.workload.options.
Position
Below the diagonal: simulator.workload.ops.change_password uses a module listed above it, which is the healthy direction.
simulator.workload.ops.change_password uses simulator.workload.shadow, so a change to simulator.workload.shadow can break simulator.workload.ops.change_password, while a change to simulator.workload.ops.change_password can't break simulator.workload.shadow.
Position
Below the diagonal: simulator.workload.ops.change_password uses a module listed above it, which is the healthy direction.
simulator.workload.ops.change_password uses simulator.client, so a change to simulator.client can break simulator.workload.ops.change_password, while a change to simulator.workload.ops.change_password can't break simulator.client.
Position
Below the diagonal: simulator.workload.ops.change_password uses a module listed above it, which is the healthy direction.
simulator.workload.ops.change_password uses simulator.workload.ops.delete_consumer_offset, so a change to simulator.workload.ops.delete_consumer_offset can break simulator.workload.ops.change_password, while a change to simulator.workload.ops.change_password can't break simulator.workload.ops.delete_consumer_offset.
Position
Below the diagonal: simulator.workload.ops.change_password uses a module listed above it, which is the healthy direction.
iggy_gateway_kafka.bridge.iggy_bridge uses iggy_common.types.identifier, so a change to iggy_common.types.identifier can break iggy_gateway_kafka.bridge.iggy_bridge, while a change to iggy_gateway_kafka.bridge.iggy_bridge can't break iggy_common.types.identifier.
Position
Below the diagonal: iggy_gateway_kafka.bridge.iggy_bridge uses a module listed above it, which is the healthy direction.
iggy_gateway_kafka.bridge.iggy_bridge uses iggy.clients.client, so a change to iggy.clients.client can break iggy_gateway_kafka.bridge.iggy_bridge, while a change to iggy_gateway_kafka.bridge.iggy_bridge can't break iggy.clients.client.
Position
Below the diagonal: iggy_gateway_kafka.bridge.iggy_bridge uses a module listed above it, which is the healthy direction.
metadata.stm uses iggy_connector_sdk, so a change to iggy_connector_sdk can break metadata.stm, while a change to metadata.stm can't break iggy_connector_sdk.
Position
Below the diagonal: metadata.stm uses a module listed above it, which is the healthy direction.
metadata.stm uses iggy_binary_protocol.consensus.header, so a change to iggy_binary_protocol.consensus.header can break metadata.stm, while a change to metadata.stm can't break iggy_binary_protocol.consensus.header.
Position
Below the diagonal: metadata.stm uses a module listed above it, which is the healthy direction.
metadata.stm uses iggy_common.utils.timestamp, so a change to iggy_common.utils.timestamp can break metadata.stm, while a change to metadata.stm can't break iggy_common.utils.timestamp.
Position
Below the diagonal: metadata.stm uses a module listed above it, which is the healthy direction.
metadata.stm uses simulator.workload.ops.change_password, so a change to simulator.workload.ops.change_password can break metadata.stm, while a change to metadata.stm can't break simulator.workload.ops.change_password.
Position
Below the diagonal: metadata.stm uses a module listed above it, which is the healthy direction.
metadata.stm.stream uses iggy_binary_protocol.codec, so a change to iggy_binary_protocol.codec can break metadata.stm.stream, while a change to metadata.stm.stream can't break iggy_binary_protocol.codec.
Position
Below the diagonal: metadata.stm.stream uses a module listed above it, which is the healthy direction.
metadata.stm.stream uses iggy_binary_protocol.consensus.operation, so a change to iggy_binary_protocol.consensus.operation can break metadata.stm.stream, while a change to metadata.stm.stream can't break iggy_binary_protocol.consensus.operation.
Position
Below the diagonal: metadata.stm.stream uses a module listed above it, which is the healthy direction.
metadata.stm.stream uses iggy_mcp.service.requests, so a change to iggy_mcp.service.requests can break metadata.stm.stream, while a change to metadata.stm.stream can't break iggy_mcp.service.requests.
Position
Below the diagonal: metadata.stm.stream uses a module listed above it, which is the healthy direction.
metadata.stm.stream uses server_common.sharding.namespace, so a change to server_common.sharding.namespace can break metadata.stm.stream, while a change to metadata.stm.stream can't break server_common.sharding.namespace.
Position
Below the diagonal: metadata.stm.stream uses a module listed above it, which is the healthy direction.
metadata.stm.stream uses iggy_binary_protocol.primitives.identifier, so a change to iggy_binary_protocol.primitives.identifier can break metadata.stm.stream, while a change to metadata.stm.stream can't break iggy_binary_protocol.primitives.identifier.
Position
Below the diagonal: metadata.stm.stream uses a module listed above it, which is the healthy direction.
metadata.stm.stream uses iggy_binary_protocol.primitives.partition_history, so a change to iggy_binary_protocol.primitives.partition_history can break metadata.stm.stream, while a change to metadata.stm.stream can't break iggy_binary_protocol.primitives.partition_history.
Position
Below the diagonal: metadata.stm.stream uses a module listed above it, which is the healthy direction.
metadata.stm.stream uses iggy_common.utils.byte_size, so a change to iggy_common.utils.byte_size can break metadata.stm.stream, while a change to metadata.stm.stream can't break iggy_common.utils.byte_size.
Position
Below the diagonal: metadata.stm.stream uses a module listed above it, which is the healthy direction.
metadata.stm.stream uses iggy_common.utils.timestamp, so a change to iggy_common.utils.timestamp can break metadata.stm.stream, while a change to metadata.stm.stream can't break iggy_common.utils.timestamp.
Position
Below the diagonal: metadata.stm.stream uses a module listed above it, which is the healthy direction.
metadata.stm.stream uses iggy_common.types.options, so a change to iggy_common.types.options can break metadata.stm.stream, while a change to metadata.stm.stream can't break iggy_common.types.options.
Position
Below the diagonal: metadata.stm.stream uses a module listed above it, which is the healthy direction.
metadata.stm.stream uses metadata.stm, so a change to metadata.stm can break metadata.stm.stream, while a change to metadata.stm.stream can't break metadata.stm.
Position
Below the diagonal: metadata.stm.stream uses a module listed above it, which is the healthy direction.
metadata.impls.metadata uses iggy_binary_protocol.consensus.operation, so a change to iggy_binary_protocol.consensus.operation can break metadata.impls.metadata, while a change to metadata.impls.metadata can't break iggy_binary_protocol.consensus.operation.
Position
Below the diagonal: metadata.impls.metadata uses a module listed above it, which is the healthy direction.
metadata.impls.metadata uses iggy_common.error.iggy_error, so a change to iggy_common.error.iggy_error can break metadata.impls.metadata, while a change to metadata.impls.metadata can't break iggy_common.error.iggy_error.
Position
Below the diagonal: metadata.impls.metadata uses a module listed above it, which is the healthy direction.
metadata.impls.metadata uses iggy_connector_sdk, so a change to iggy_connector_sdk can break metadata.impls.metadata, while a change to metadata.impls.metadata can't break iggy_connector_sdk.
Position
Below the diagonal: metadata.impls.metadata uses a module listed above it, which is the healthy direction.
metadata.impls.metadata uses iggy_mcp.service.requests, so a change to iggy_mcp.service.requests can break metadata.impls.metadata, while a change to metadata.impls.metadata can't break iggy_mcp.service.requests.
Position
Below the diagonal: metadata.impls.metadata uses a module listed above it, which is the healthy direction.
metadata.impls.metadata uses server_common.sharding.namespace, so a change to server_common.sharding.namespace can break metadata.impls.metadata, while a change to metadata.impls.metadata can't break server_common.sharding.namespace.
Position
Below the diagonal: metadata.impls.metadata uses a module listed above it, which is the healthy direction.
metadata.impls.metadata uses iggy_binary_protocol.consensus.header, so a change to iggy_binary_protocol.consensus.header can break metadata.impls.metadata, while a change to metadata.impls.metadata can't break iggy_binary_protocol.consensus.header.
Position
Below the diagonal: metadata.impls.metadata uses a module listed above it, which is the healthy direction.
metadata.impls.metadata uses iggy_binary_protocol.primitives.identifier, so a change to iggy_binary_protocol.primitives.identifier can break metadata.impls.metadata, while a change to metadata.impls.metadata can't break iggy_binary_protocol.primitives.identifier.
Position
Below the diagonal: metadata.impls.metadata uses a module listed above it, which is the healthy direction.
metadata.impls.metadata uses consensus.impls, so a change to consensus.impls can break metadata.impls.metadata, while a change to metadata.impls.metadata can't break consensus.impls.
Position
Below the diagonal: metadata.impls.metadata uses a module listed above it, which is the healthy direction.
metadata.impls.metadata uses metadata.stm, so a change to metadata.stm can break metadata.impls.metadata, while a change to metadata.impls.metadata can't break metadata.stm.
Position
Below the diagonal: metadata.impls.metadata uses a module listed above it, which is the healthy direction.
metadata.impls.metadata uses metadata.stm.stream, so a change to metadata.stm.stream can break metadata.impls.metadata, while a change to metadata.impls.metadata can't break metadata.stm.stream.
Position
Below the diagonal: metadata.impls.metadata uses a module listed above it, which is the healthy direction.
shard uses iggy_binary_protocol.consensus.operation, so a change to iggy_binary_protocol.consensus.operation can break shard, while a change to shard can't break iggy_binary_protocol.consensus.operation.
Position
Below the diagonal: shard uses a module listed above it, which is the healthy direction.
shard uses iggy_common.error.iggy_error, so a change to iggy_common.error.iggy_error can break shard, while a change to shard can't break iggy_common.error.iggy_error.
Position
Below the diagonal: shard uses a module listed above it, which is the healthy direction.
shard uses iggy_mcp.service.requests, so a change to iggy_mcp.service.requests can break shard, while a change to shard can't break iggy_mcp.service.requests.
Position
Below the diagonal: shard uses a module listed above it, which is the healthy direction.
shard uses server_common.sharding.namespace, so a change to server_common.sharding.namespace can break shard, while a change to shard can't break server_common.sharding.namespace.
Position
Below the diagonal: shard uses a module listed above it, which is the healthy direction.
shard uses iggy_binary_protocol.consensus.header, so a change to iggy_binary_protocol.consensus.header can break shard, while a change to shard can't break iggy_binary_protocol.consensus.header.
Position
Below the diagonal: shard uses a module listed above it, which is the healthy direction.
shard uses iggy_common.utils.timestamp, so a change to iggy_common.utils.timestamp can break shard, while a change to shard can't break iggy_common.utils.timestamp.
Position
Below the diagonal: shard uses a module listed above it, which is the healthy direction.
shard uses partitions.iggy_partition, so a change to partitions.iggy_partition can break shard, while a change to shard can't break partitions.iggy_partition.
Position
Below the diagonal: shard uses a module listed above it, which is the healthy direction.
shard uses metadata.impls.metadata, so a change to metadata.impls.metadata can break shard, while a change to shard can't break metadata.impls.metadata.
Position
Below the diagonal: shard uses a module listed above it, which is the healthy direction.
iggy_gateway_kafka.protocol.api uses iggy_gateway_kafka.bridge.iggy_bridge, so a change to iggy_gateway_kafka.bridge.iggy_bridge can break iggy_gateway_kafka.protocol.api, while a change to iggy_gateway_kafka.protocol.api can't break iggy_gateway_kafka.bridge.iggy_bridge.
Position
Below the diagonal: iggy_gateway_kafka.protocol.api uses a module listed above it, which is the healthy direction.
iggy_gateway_kafka.protocol.api uses server.session_manager, so a change to server.session_manager can break iggy_gateway_kafka.protocol.api, while a change to iggy_gateway_kafka.protocol.api can't break server.session_manager.
Position
Below the diagonal: iggy_gateway_kafka.protocol.api uses a module listed above it, which is the healthy direction.
message_bus uses configs.server_config.server, so a change to configs.server_config.server can break message_bus, while a change to message_bus can't break configs.server_config.server.
Position
Below the diagonal: message_bus uses a module listed above it, which is the healthy direction.
message_bus uses server.session_manager, so a change to server.session_manager can break message_bus, while a change to message_bus can't break server.session_manager.
Position
Below the diagonal: message_bus uses a module listed above it, which is the healthy direction.
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A05:2025 — Injection
241
High / Critical
A02:2025 — Security Misconfiguration
102
High / Critical
A03:2025 — Software Supply Chain Failures
61
High / Critical
A07:2025 — Authentication Failures
45
High / Critical
Roadmap
Immediately resolve all leaked secrets in source files and git history to eliminate security exposure. Update outdated npm dependencies and codify disaster recovery procedures, including backups and restore documentation, within the infrastructure code. Finally, implement a benchmarking harness in CI to monitor performance regressions on critical code paths.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 1 Outdated (npm) finding(s) in Dependency Hygiene.
Add a benchmarking harness for the hot paths and run it in CI to catch regressions (for .NET, a BenchmarkDotNet project with [MemoryDiagnoser] to track allocations).
Per-file score 0–10 — a quality signature. Of 533 files carrying findings, judged against the Preview bar: 3% slop · 11% mixed · 86% near-clean.
File
Score
Band
Worst signal
REDACTED
0.0
Slop
REDACTED Scanning: Leaked secret: REDACTED
REDACTED
0.0
Slop
IaC & Container Security: High IaC: REDACTED
REDACTED
0.2
Slop
IaC & Container Security: High IaC: REDACTED
REDACTED
0.9
Slop
IaC & Container Security: High IaC: REDACTED
REDACTED
1.3
Slop
Static Analysis (SAST): High: REDACTED
REDACTED
1.3
Slop
IaC & Container Security: High IaC: REDACTED
REDACTED
1.6
Slop
REDACTED Scanning: Leaked secret: REDACTED
foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs
1.7
Slop
Explicit Debt: EmptyCatchBlock
REDACTED
2.0
Slop
REDACTED Scanning: Leaked secret: REDACTED
REDACTED
2.3
Slop
REDACTED Scanning: Leaked secret: REDACTED
REDACTED
2.7
Slop
IaC & Container Security: High IaC: REDACTED
REDACTED
2.7
Slop
IaC & Container Security: High IaC: REDACTED
REDACTED
2.7
Slop
IaC & Container Security: High IaC: REDACTED
REDACTED
2.7
Slop
IaC & Container Security: High IaC: REDACTED
REDACTED
3.0
Mixed
REDACTED Scanning: Leaked secret: REDACTED
REDACTED
3.0
Mixed
REDACTED Scanning: Leaked secret: REDACTED
REDACTED
3.0
Mixed
IaC & Container Security: High IaC: REDACTED
REDACTED
3.0
Mixed
IaC & Container Security: High IaC: REDACTED
REDACTED
3.3
Mixed
IaC & Container Security: High IaC: REDACTED
REDACTED
3.5
Mixed
IaC & Container Security: High IaC: REDACTED
How the grades work
Every finding carries one of four grades. Three say how serious it is. The fourth says this
survey could not settle it — and it is a grade, not a gap.
Critical — 321
A definite problem that already costs you something and drags the score down: a
missing authorisation check, a dependency with a known exploit, a build that does not reproduce. Failure here
tends to cause failures elsewhere.
Serious — 1932
Likely wrong, but not failing yet. It degrades
the codebase over a longer horizon and can cause failures elsewhere — not urgent this week, not something to
carry for two years either.
Minor — 146
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 7
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 91 of 91 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); none rely on LLM judgement. Overall confidence is 0.9 — 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 — 91 dimensions across the health lenses
Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.
How to trust any code-health report — three questions
Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 2316 of 2399 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D8 Code Coverage — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: the .NET half could not be measured — no coverage produced (collector absent, or test run exceeded the inline budget); the JavaScript/TypeScript half measured 98.0% (node:test via `npm ci --ignore-scripts` in foreign/node/; node:test via `npm ci --ignore-scripts` in web/). This repository's production source spans both ecosystems, and no partial figure is published as if it were the whole: coverage is excluded from the score rather than counted as a near-zero. This is OUR limitation, not a defect in the repo — a Codecov configuration (codecov.yml, target 50%) and a coverage step in CI (`cargo llvm-cov`) shows coverage is measured in your own CI. Commit the lcov/Cobertura report it produces and the real number is read on the next scan. You can widen what we reach: optional: commit the lcov/Cobertura report your CI produces, and the real number is read on the next scan.
D10 Test Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 1,041 test(s) behind this row are the ones the C# collector could read, and this repository also carries at least 885 test source file(s) (.rs, .java, .swift, .py, .php, .ts, .go, .mjs) that it cannot: it parses C# syntax and matches C# test attributes, so a vitest/jest/JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability NOT SCORED: this repository's production source spans .cs, .rs, and the rust executor ran against the .rs half and never executed — so reliability was not measured for the repository as a whole. The .NET suite did build and re-run, and came back with 0 flaky across 3 measured tier(s) (integration: measured (0 flaky); BDD: measured (0 flaky); JavaScript/TypeScript (node:test via `npm ci --ignore-scripts` in foreign/node/ (731 tests); node:test via `npm ci --ignore-scripts` in web/ (27 tests)): measured (0 flaky)) — but that is a figure for one half of the product, and we do not publish a partial one as if it were complete. This is OUR limitation, not a defect in the repo — test reliability is excluded from the score rather than counted. The half was driven by a runner we ship, so this is not a missing-runner gap.
D14 License Compliance — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares a Cargo manifest, but the licence verdict published here was taken over its NuGet package dependencies. Nothing was read about its Cargo dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
D14 License Compliance — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares package.json, but the licence verdict published here was taken over its NuGet package dependencies. Nothing was read about its npm dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
D15 Churn × Complexity Hotspots — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. A hotspot's complexity is meant to be the worst body its churn actually touched. For core/simulator/src/workload/ops/mod.rs that could not be established — the complexity reader for the file reports no body extents, or the history carries no per-line attribution — so the row quotes the file's worst body, which the counted changes may never have touched. The churn count is unaffected.
D17 Explicit Debt — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 10 deducted marker(s) and the 0.6/KLoC density on this row were taken over this repository's .NET projects ALONE: .rs (589,742 lines, 82% of production source) went unread, because every marker collector on this path is reached through a C# workspace. A read-only sweep of that source finds at least 50 task marker(s) (TODO/FIXME/HACK/XXX) across 36 file(s) that this score does not count — a floor, since only line comments are read there and D17's other eight marker kinds (suppressions, NoWarn, editorconfig severities, empty catches, commented-out code, Obsolete, dead code, preprocessor branches) need a compiler we do not have for that language. The debt in that source is UNMEASURED — its absence from the score above is a gap in this analyzer's language coverage, not a finding that the code carries none.
D19 Documentation Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
D19 Documentation Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
D21 Naming Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D21's deterministic naming rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. Until then its declarations carry no naming verdict this run — this says nothing about whether its names are consistent.
D23 Boundary Type-Coupling — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 2 bounded context(s) were resolved, but of the 2676 public type(s) this run scanned, none could be attributed to any of them — so no cross-boundary leak was reachable and an empty result was guaranteed regardless of the code. This happens when the scored code model is a non-.NET (sidecar) primary while the contexts were resolved from .NET project directories, which key on assembly name. Not scored: this is a gap in the analyzer, not a verdict about this repository. You can widen what we reach: declare this codebase's bounded contexts by module-path or namespace prefix so they resolve against the languages actually scanned. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
D27 Navigability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
D31 IaC & Container Security — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Gateways/kafka/REDACTED.dockerignore carries no `FROM` instruction, so it declares no build stage and every REDACTED rule this engine owns — the runtime-hardening, key-material, mutable-clone, no-op-shim, build-context, trust-anchor, install-guard, setuid and world-writable-path rules — is outside its own premise there and returned nothing. That silence is deliberate and correct: with no base image there is no image to reason about. It is reported here because it is NOT the same fact as a clean file, and coverage is stated as 47 of 48 Infrastructure-as-Code manifest(s) fully judged rather than as 100%. The vendor scanners (trivy, checkov) do read these files and their findings above stand; only this engine's own stage-keyed rules are absent. No owner action: a build file with no FROM is a legitimate include fragment.
D32 Data Compliance (PII/GDPR) — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `foreign/csharp/Iggy_SDK/Exceptions/VsrLaneBlockedException.cs`, `foreign/csharp/Iggy_SDK/Exceptions/VsrOperationNotRetainedException.cs`, `foreign/csharp/Iggy_SDK/Exceptions/VsrRequestOutcomeUnknownException.cs`, `foreign/csharp/Iggy_SDK/Exceptions/VsrSessionEvictedException.cs`, `foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.ReplicaLinks.cs`, … (+17 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
D39 IL Efficiency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. IL NOT MEASURED: the analyzer's own build of this repository failed for an ENVIRONMENT reason (exit 1) — MSBuild's engine or the CLR gave up, or our image does not carry the SDK band/targeting pack this repository needs. This is OUR limitation, not a defect in the repo, and it is not a statement that this repository fails to build. D18 owns the question of whether this repository builds; it was not answered here.
D41 Kernel & Syscall Confinement — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Helm/charts/iggy/templates/deployment.yaml:32, REDACTED:220 did not read as a pod spec (a templated manifest such as Helm's that is not YAML until rendered, or a workload whose pod spec this check does not locate), so the seccomp/AppArmor profile in force there was not judged and no row about them can appear on this card.
AXR1 Runtime accessibility — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via DockerCompose (REDACTED). compose up failed (exit 15 — the compose project is invalid) — error while interpolating services.iggy-server.environment.[]: required variable IGGY_ROOT_PASSWORD is missing a value: set IGGY_ROOT_PASSWORD; runtime evidence skipped.
M4 Documentation accuracy — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
P8 Schema migrations — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. The schema may be created by a runner, a deploy script or a config file outside what this check reads, so an absence here is our blind spot rather than a missing migration strategy. The card abstains instead of scoring. You can widen what we reach: if the schema is created and evolved by a tool this check does not name, naming it lets us teach the detector to read it.
PF3 Async & latency hygiene — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 337 further occurrence(s) are not listed individually; the score already reflects all 377.
R10 Code Duplication — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 6 further occurrence(s) are not listed individually; the score already reflects all 46.
R4 Test Coverage — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 91 further occurrence(s) are not listed individually; the score already reflects all 131.
Repo exclusion declarations: 14 pattern(s) declared (.gitattributes linguist-generated/vendored, .editorconfig generated_code) excluded 0 source file(s) from code-quality scoring. Declarations are the repo's own visible statement that a tree is machine-written or vendored — auditable in any diff, honored by GitHub the same way.
Limitations & what we did not check
Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
D13 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
D22 Internal API Consistency: API-surface coherence is an LLM judgement over a sample of the public surface — consistency of intent across the whole API is approximated, not exhaustively verified.
D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D40 Network Egress Confinement: Egress confinement is read from committed Kubernetes manifests — a policy applied out-of-band (cluster-default deny, a service mesh, or a cloud firewall/security group off-repo) is invisible, and a present NetworkPolicy is declared config, not proof the cluster admission-controller actually enforces it at runtime.
D41 Kernel & Syscall Confinement: Syscall/MAC confinement is read from committed manifests — a profile applied by a cluster-wide PodSecurity default or a mutating webhook off-repo isn't seen, and a declared seccomp/AppArmor profile is config presence, not proof the node's kernel actually loaded and enforced it.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (REDACTED, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
ED5 Idempotency: Idempotency is read from the handler body and one hop below: a mutation is flagged only on structural double-apply evidence (a fresh-identity insert, an accumulation, a growing list, an unkeyed POST/send/charge), so a duplicate effect through a home-grown gateway two hops down, or an insert keyed on the message with no unique constraint, is not flagged but counted as not classified; a guard enforced by a database constraint or a broker's exactly-once delivery is invisible either way. It flags the at-least-once double-apply SHAPE, not a runtime proof of a duplicate effect.
M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
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.
207 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was CommandResponseStream.drive at 149. A further 72 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 IggyErrorCode.name at 261 — they are counted neither in the figure above nor in this dimension's score. 44 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: foreign/swift/Sources/Iggy/Errors/IggyErrorCode.swift (IggyErrorCode.name at 261), foreign/node/src/wire/error.code.ts (error.code.translateErrorCode at 256), core/binary_protocol/src/dispatch.rs (iggy_binary_protocol::dispatch::lookup_command at 53), foreign/swift/Sources/Iggy/Protocol/CommandCode.swift (CommandCode.name at 50), core/consensus/src/observability.rs (consensus::observability::operation_as_str at 40), and 39 more not listed here. They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.
+ 127 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 6 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with CommandResponseStream.drive (cyclomatic 149), TcpMessageStream.RunClientOperationAsync (cyclomatic 140), IggyTcpClient.driveOperation (cyclomatic 133). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 6 together lifts Cyclomatic Complexity from 5.6 to about 6.5/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How hard the code is for a person to follow, beyond raw branching.
Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.
+ 225 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 4 bodies over 120 down to 120 or less in Cognitive Complexity — start with IggyTcpClient.driveOperation (cognitive 269), CommandResponseStream.drive (cognitive 242), TcpMessageStream.RunClientOperationAsync (cognitive 238). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 4 together lifts Cognitive Complexity from 5.0 to about 5.8/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes8.9 / 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.
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 117 FileTooLong finding(s) in God Classes — start with REDACTED (13), mod.rs (5), client.rs (4). — One of this dimension's main actionable groups (117 warning-level).
Resolve the 54 TooManyMethods finding(s) in God Classes — start with REDACTED (4), mod.rs (4), client.rs (3). — One of this dimension's main actionable groups (54 warning-level).
Resolve the 44 ClassTooLong finding(s) in God Classes — start with REDACTED (8), client.rs (4), mod.rs (2). — One of this dimension's main actionable groups (44 warning-level).
Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Copy-pasted code that should be shared instead.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.
467 duplicated block group(s) detected. A further 20 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 74 of the 487 are in trees this repository does not ship — vendored, example/demo, project-template, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.
+ 116 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 40 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with REDACTED (3), client.rs (2), config.rs (2). — One of this dimension's main actionable groups (40 warning-level).
Resolve the 31 Duplicated block (11 lines × 2) finding(s) in Code Duplication — start with sink.rs (3), REDACTED (2), alter_configs.rs (2). — One of this dimension's main actionable groups (31 warning-level).
Resolve the 29 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with sink.rs (3), body.rs (2), type_conversion.rs (2). — One of this dimension's main actionable groups (29 warning-level).
Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling9.2 / 10Stronggated by 6 serious findings✓ Tool-verified
What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.
Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.
Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.
65 production modules (Gradle+Cargo+npm+Go+SwiftPM+Bazel), 0 dependency cycle(s), 1 unstable depended-on module(s). Read from the build's own module declarations; edges a convention plugin adds from buildSrc or build-logic are not visible there; 6 module(s) off the main sequence, with abstractness counted on 58 of the 65 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).
Off the main sequence: cpu_allocation · ×5
Unstable project server
Off the main sequence: iggy_common
What to do
Resolve the 5 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (5 warning-level).
Resolve the 1 Unstable project server finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Enforce Coupling in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
D9 · Test Distribution9.8 / 10Exemplary✓ Tool-verified
What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.
Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.
13578 test methods: 10403 unit, 2916 integration, 29 BDD, 230 e2e. The JavaScript/TypeScript suite contributes 671 `it`/`test` case(s) across 67 test file(s) declaring at least one beside 2055 .NET test method(s); its tier split is read from package names and paths only. The Rust suite contributes 9217 `#[test]` function(s) across 775 file(s) declaring at least one; its unit/integration split is Cargo's own — 154 of those file(s) are integration-test targets under a crate's tests/ directory, and the rest are #[test] functions compiled into the crate they test. The Python suite contributes 586 test function(s) across 22 file(s) declaring at least one — every `def test…` in a file pytest or unittest would collect, which is those frameworks' own definition of a case; a parametrize table counts once, so this is a floor. Its tier split is read from file names and paths only. The Go suite contributes 594 test case(s) across 62 `_test.go` file(s) declaring at least one — every `func Test…(t *testing.T)` that `go test` would collect, plus the suite methods a testify-style runner reaches; a table-driven case list counts once, so this is a floor. Its tier split is INFERRED from file names, paths and build constraints, not declared: 7 of those file(s) use Go's external test package (`package x_test`), which is a visibility boundary rather than a pyramid tier and was not read as one. The swift suite(s) contribute 455 test method(s), read from the language model's own test census — every XCTest `test…` method on an XCTestCase, every swift-testing `@Test` and every JUnit/TestNG `@Test`-annotated method, which is those frameworks' own discovery rule. Their tier split is INFERRED from the test target's name and path only, not declared.
✓ On the Gold path — maintain.
Detailed fixes: d9_recommendation.md.
Do you agree with this assessment?
D10 · Test Quality9.9 / 10Stronggated by 8 serious findings✓ Tool-verified
What it measures: Whether the tests truly assert behaviour rather than just running the code.
Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.
0 skipped, 8 zero-assertion, 1 mock references across 1041 tests. Measured on the C# suite only — at least 885 test source file(s) (.rs, .java, .swift, .py, .php, .ts, .go, .mjs) went unread, so its test quality is unmeasured and is not in these counts.
No assertions: CreateClient_TcpClientDisposesTwice · ×8foreign/csharp/Iggy_SDK_Tests/ClientTests/IggyClientFactoryTests.cs:114
Mock framework: Moq
What to do
Resolve the 8 No assertions finding(s) in Test Quality — start with CredentialBoundsTests.cs (2), IggyClientFactoryTests.cs, MetadataChangesTests.cs. — One of this dimension's main actionable groups (8 warning-level).
Enforce Test Quality in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d10_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether dependencies are current, secure, and not bloated.
Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (saturating for vulnerabilities, capped-linear for deprecation/outdated) per KLoC. Exhaustive, deterministic.
10 outdated, 0 vulnerable, 0 deprecated packages. Those are the NuGet packages; this repository's npm dependencies were read too — 48 outdated of 113 package(s) across 4 lockfile(s).
Resolve the 1 Outdated (npm) finding(s) in Dependency Hygiene. — One of this dimension's main actionable groups (1 recommendation-level).
Enforce Dependency Hygiene in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
Resolve the 28 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (7), REDACTED (6), REDACTED (6). — One of this dimension's main actionable groups (28 issue-level).
Enforce REDACTED Scanning in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d13_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the licenses of third-party packages are compatible with your policy.
Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.
0 of 138 packages use a banned license. ★ DEPTH: this repository's MSBuild projects declare 18 direct `PackageReference`(s), and 96 further package(s) were reached beyond them by closing the graph over nuget.org's own nuspec dependency graph — so a banned licence pulled in only by a dependency's OWN dependencies is inside this verdict. A package whose licence nuget.org could not be asked for is not graded, and version ranges are taken at their lower bound, so this is the closure as that graph states it rather than a restored consumer's exact resolution. ★ COVERAGE OF THIS VERDICT: it grades this repository's NuGet package dependencies and nothing else. The repository also declares a Cargo manifest and package.json, and the licences of those dependency graphs were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
Top hotspots: core/shard/src/lib.rs (71×89=6319); core/partitions/src/iggy_partition.rs (66×82=5412); foreign/node/src/wire/error.code.ts (13×256=3328) Repeated repair below the complexity floor: core/shard/src/metrics.rs (13 of 25 changes were fixes); core/server/src/shell.rs (4 of 7 changes were fixes); core/common/src/traits/client.rs (4 of 6 changes were fixes)
Resolve the 105 Hotspot finding(s) in Churn × Complexity Hotspots — start with REDACTED (5), mod.rs (5), REDACTED (3). — One of this dimension's main actionable groups (105 warning-level).
Resolve the 8 Repeated repair finding(s) in Churn × Complexity Hotspots — start with metrics.rs (2), REDACTED (2), shell.rs. — One of this dimension's main actionable groups (8 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D16 · Bus Factor9.4 / 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.
7 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is foreign/csharp/Iggy_SDK/Publishers/IggyPublisherOfT.cs. Counted over 114 of the 221 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Off-boarding risk: anonymized user #1
✓ On the Gold path — maintain.
Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.
Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.
10 deducted debt markers + 63 dead symbols across 29957 LoC in the .NET projects (0.6/KLoC) → score 8.8. Measured on the .NET source only: .rs (82% of production source) was not read, and carries at least 50 uncounted task marker(s) in 36 file(s).
Resolve the 3 EmptyCatchBlock finding(s) in Explicit Debt — start with IggyConsumer.cs (2), TcpMessageStream.Vsr.cs. — One of this dimension's main actionable groups (3 issue-level).
Resolve the 63 Dead code finding(s) in Explicit Debt — start with ErrorFactory.cs (51), DummyObjFactory.cs (2), PermissionsFactory.cs (2). — One of this dimension's main actionable groups (63 warning-level).
Resolve the 7 TodoComment finding(s) in Explicit Debt — start with HttpMessageStream.cs (5), IggyConsumer.cs, ErrorFactory.cs. — One of this dimension's main actionable groups (7 warning-level).
Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.
2 of 2 documentation facets pass in full. 70 document(s) read across 4 unit(s).
✓ On the Gold path — maintain.
Detailed fixes: d19_recommendation.md.
Do you agree with this assessment?
D22 · Internal API Consistency9.4 / 10Stronggated by 1 serious finding✓ Tool-verified
What it measures: Whether the internal API surface is consistent and coherent.
Method: Judged by language model at low temperature over a sample of the public API surface (IsPackable or .Contracts types). Sampled, advisory; confidence discounted by model uncertainty.
1 API inconsistencies among 179 exposed members measured against a convention their peers follow.
`IIggyClient.AbandonOperationAsync` has no CancellationToken; its 3 sibling async members take oneforeign/csharp/Iggy_SDK/IggyClient/IIggyClient.cs:119
What to do
Resolve the 1 `IIggyClient.AbandonOperationAsync` has no CancellationToken; its 3… finding(s) in Internal API Consistency — start with IIggyClient.cs. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d22_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).
Method: Every inline C# comment compared word by word with the identifiers, literals and constructs of the code it annotates (taken from the syntax); a comment whose words that code already contains is redundant, as are closing-brace labels and generator template text. Comments giving a reason or a reference are kept; other scripts and languages are not judged. Deterministic, exhaustive, advisory.
1 of 19 projects flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion
What to do
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: REDACTED scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.
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.
REDACTED
REDACTED
REDACTED
What to do
Resolve the 11 REDACTED finding(s) in Secrets (history) — start with REDACTED (6), REDACTED (3), REDACTED (2). — One of this dimension's main actionable groups (11 issue-level).
Resolve the 5 High secret finding(s) in Secrets (history) — start with REDACTED (2), REDACTED, REDACTED. — One of this dimension's main actionable groups (5 issue-level).
Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d28_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.
Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.
Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).
241 finding(s): 0 critical, 233 high, 7 medium, 1 low. 128 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 54 file(s) — `bdd/java/gradlew` (line 74, line 250), `core/sdk/src/driver.rs` (line 3072), `core/server/src/http/forward.rs` (line 2907), `core/server/src/http/handlers.rs` (line 1329, line 1508, line 1659, …), `core/shard/src/lib.rs` (line 13310, line 17158), … (+49 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. In 20 of those file(s) — `foreign/csharp/Iggy_SDK.Tests.Integration/Attributes/SkipHttpAttribute.cs`, `foreign/csharp/Iggy_SDK.Tests.Integration/Attributes/SkipTcpAttribute.cs`, `foreign/csharp/Iggy_SDK/Exceptions/VsrLaneBlockedException.cs`, `foreign/csharp/Iggy_SDK/Exceptions/VsrOperationNotRetainedException.cs`, `foreign/csharp/Iggy_SDK/Exceptions/VsrRequestOutcomeUnknownException.cs`, … (+15 more) — the break is a C# primary constructor, which semgrep's grammar cannot parse and which hides the type from every rule scoped to it; those files were re-scanned from a shadow copy with the constructor's parameter list blanked (line and column preserving), which restores the type to the rules, and 0 additional row(s) came from that pass. Only the header's own parameter list is unread in them. In 1 of those file(s) — `foreign/csharp/Iggy_SDK_Tests/ClientTests/HttpPartitionContextTests.cs` — the break is at a TYPE DECLARATION (a C# primary constructor semgrep's grammar cannot parse), so the loss is wider than the named lines: rules scoped to that type see no type to scope to and are blind over its whole body, while rules matching statements keep working there. Absence of a type-scoped finding in those types is not evidence of anything. Separately, one or more rules could not re-parse an embedded snippet in 30 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
+ 7 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 43 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (33), REDACTED (5), REDACTED (5). — One of this dimension's main actionable groups (43 issue-level).
Resolve the 34 REDACTED finding(s) charged to Static Analysis (SAST) — the other 128 are reported here at file:line but scored by D36 (supply-chain provenance), which charges them once. — One of this dimension's main actionable groups (162 issue-level, 34 of them charged here).
Resolve the 17 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (7), REDACTED (7), REDACTED. — One of this dimension's main actionable groups (17 issue-level).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.
Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05.
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 20 Medium advisory (unsound) finding(s) in Dependency Vulnerabilities — start with REDACTED (20). — One of this dimension's main actionable groups (20 warning-level).
Resolve the 12 Medium advisory (unmaintained) finding(s) in Dependency Vulnerabilities — start with REDACTED (12). — One of this dimension's main actionable groups (12 warning-level).
Resolve the 1 Critical vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 45 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (29), REDACTED (7), REDACTED (6). — One of this dimension's main actionable groups (45 warning-level).
Resolve the 39 High IaC finding(s) in IaC & Container Security — start with REDACTED (27), REDACTED (5), REDACTED.test (5). — One of this dimension's main actionable groups (39 issue-level).
Resolve the 18 Low IaC finding(s) in IaC & Container Security — start with REDACTED (11), REDACTED (7). — One of this dimension's main actionable groups (18 recommendation-level).
Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
Every significant source file has living knowledge — recently and meaningfully worked. Counted over 114 of the 221 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
Resolve the 5 Change coupling finding(s) in Change Coupling — start with quic_client.rs, partition_helpers.rs, benchmark_producer.rs. — One of this dimension's main actionable groups (5 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.
Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.
Resolve the 2 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED (2). — One of this dimension's main actionable groups (2 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.
Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.
What it measures: Whether Kubernetes workloads restrict network EGRESS with a NetworkPolicy (or Cilium policy), limiting where a compromised pod can send data or reach a command-and-control server. Presence of committed egress-restricting policy, not runtime enforcement.
Method: Deterministic YAML-manifest inspection (no external tool, no Roslyn — language-agnostic): Kubernetes workloads gate applicability; credits a NetworkPolicy / Cilium policy that restricts egress (policyTypes: [Egress] / egress rules). Reward-leaning (neutral floor climbing to 10, never a deduction — baseline misconfigs stay with D31). Deterministic.
What it measures: Whether Kubernetes workloads confine the kernel boundary — a seccomp profile (RuntimeDefault/Localhost) plus an AppArmor/SELinux mandatory-access-control layer — shrinking the syscall attack surface a container escape would use. Presence of committed confinement config, not runtime enforcement.
Method: Deterministic YAML-manifest inspection (no external tool, no Roslyn): on Kubernetes workloads, credits a seccomp profile (RuntimeDefault/Localhost) and an AppArmor/SELinux MAC layer. Reward-leaning (neutral floor climbing to 10); NotApplicable without workloads. Deterministic.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Scored apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. SCORED, not informational.
What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.
Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 25 platform declaration(s) and 45 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
What to do
The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
The namespaces Apache.Iggy.Contracts ↔ Apache.Iggy.Contracts.Auth ↔ Apache.Iggy.Contracts.Http ↔ Apache.Iggy.Exceptions ↔ Apache.Iggy.JsonConverters ↔ Apache.Iggy.Kinds ↔ Apache.Iggy.Vsr depend on each other. The lightest dependency in the cycle is Apache.Iggy.Contracts → Apache.Iggy.Exceptions (Apache.Iggy.Contracts.MetadataChangesQuery → Apache.Iggy.Exceptions.IggyInvalidStatusCodeException, 1 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface. — foreign/csharp/Iggy_SDK/Contracts/MetadataChangesQuery.cs:20
What to do
Break namespace cycles inside a project by moving the shared type to a namespace both sides can use, or by inverting the back edge behind an interface.
Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.
Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.
Other · Architecture — Whether the codebase has a recognisable, scale-appropriate structure (a named architectural style, or modular enough for its size) rather than being an ad-hoc ball of mud.
Method: Roslyn plus csproj analysis: architecture style detection (DDD, clean, vertical-slice, CQRS) and structure fitness for repo size. Deterministic.
Other · Architecture — Whether interfaces stay focused rather than fat — the Interface-Segregation principle (SOLID 'I').
Method: Roslyn scan: public interface declared-member counts (accessors fold into their property/event); fat-interface threshold (over 15 declared members) flagged per type. Each finding also reports the distinct-OPERATION count — members counted by name, so an overload group counts once — which decides whether it states the caller-side ISP harm or the implementer-side burden of an overload set. TypeScript: exported interfaces that declare behaviour, counted over their REQUIRED operations (method signatures and function-typed properties with no `?`, once per signature) — data-shape interfaces and ambient .d.ts declarations are outside the population; JavaScript declares no interfaces and is not applicable. Deterministic, type-level.
Do you agree with this assessment?
AX8 · Test isolation10.0 / 10Exemplary✓ Tool-verified
Other · Architecture — Whether production projects stay free of references to test projects — tests may depend on production, never the reverse.
Method: Csproj graph: each production project checked for references to test projects (identified by test-framework presence, not name). Zero violations is clean. Deterministic.
Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.
Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.
Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.
Other · Readiness — Whether retry-prone mutations (command handlers + message/event consumers) are idempotent so an at-least-once redelivery or client retry doesn't double-apply the effect — heuristic at-risk detection confirmed by language model, advisory.
Method: Roslyn (any mutation, ungated): each persistent write of a command handler or message/event consumer is idempotent when a guard is visible (an exists/dedup read that gates an exit, upsert, idempotency-key/inbox used in a condition or store call, versioned or fixed-value write, dedup envelope or pipeline), at risk only on positive double-apply evidence (a fresh-identity insert, an accumulation on a loaded and saved object, a growing member list, an unkeyed POST/SMTP send/Stripe charge), and otherwise not classified. Deterministic, no model; not scored when more than half are not classified. Advisory.
Coverage: Population: retry-prone mutations — command handlers (CQRS write side) + message/event consumers (IConsumer/I*EventHandler) — that mutate persistent state; runs on any repo with mutations, not only event-driven ones. Every mutation is classified exhaustively and deterministically: guarded, at risk on positive evidence, or not classified; the score is over the classified ones and is withheld when they are fewer than half.
Other · Event Sourcing — Whether the recovery-replay fold is deterministic — state derived purely from each event's own fields, no clock/random/IO on the replay path.
Method: Roslyn syntax scan (event-sourcing gated): Apply/When folds checked for forbidden tokens (DateTime.Now, Guid.NewGuid, Random, IO), stripped of comments/strings. Deterministic, hard fact per fold.
Other · Event Sourcing — Whether domain events stay immutable (private fields, set once) rather than carrying mutable state.
Method: Roslyn scan (event-sourcing gated): persisted events checked for public setters; immutability verified per property/field. Deterministic, hard fact.
Other · Code Health — Unreviewed-generation residue: shipped members still throwing NotImplementedException, and placeholder string literals left in non-test, non-generated code. Scored as a quality signature, never as a claim about authorship.
Method: Roslyn syntax scan: NotImplementedException throws and placeholder string literals in non-test, non-generated shipped code. Deterministic, code-shape signature.
A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface. (×5) — foreign/csharp/Iggy_SDK/JsonConverters/ConsumerConverter.cs:27, foreign/csharp/Iggy_SDK/JsonConverters/ExpiryConverter.cs:37, foreign/csharp/Iggy_SDK/JsonConverters/MessageConverter.cs:27, …
What to do
Finish or delete NotImplementedException stubs and replace placeholder literals before shipping.
Other · Code Health — Unfinished work detected by code SHAPE, not keywords: members that only throw a "not implemented" exception, methods that take inputs and return a constant, async methods that never await, dead `if (false)` / `#if false` branches, and skeleton types most of whose members are holes. A real, objective slice of technical debt.
Method: Roslyn syntax scan: incompleteness by code shape (constant-returning methods, async-never-await, #if false branches, guards that return what the code already falls through to, tests an earlier guard already decided, comparisons against NaN, skeleton types), not keyword-gated. Deterministic, code-shape heuristic.
`Write` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. (×2) — foreign/csharp/Iggy_SDK/JsonConverters/ExpiryConverter.cs:37, foreign/csharp/Iggy_SDK/JsonConverters/SizeConverter.cs:50
What to do
Finish or delete the unfinished stubs (NotImplementedException / empty / constant-returning bodies) — they are dead surface that looks live.
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
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
Add a README to the 18 of 19 project(s) that lack one — worth up to 1.9 pts.
Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).
Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.
Readiness · Readiness — Whether 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.
Do you agree with this assessment?
P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged
Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.
Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.
Readiness · Readiness — Whether behaviour is captured as executable Gherkin specifications (a plus for shared understanding) — only assessed when a BDD framework is present.
Method: Filesystem scan: BDD framework presence (SpecFlow, Gherkin files) when a project references a BDD tool. Exhaustive, deterministic.
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
Dependabot is configured but does not watch `pip`, `composer`, `bundler` — add those `package-ecosystem` entries to .github/dependabot.yml so those dependencies get the same automatic update and advisory pressure as the ones it already covers.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
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.
Do you agree with this assessment?
P5 · DR & Backup0.0 / 10Critical✓ Tool-verified
Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.
Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.
A persistence guard (data volume / purge-protection) was found, but no backup, geo-recovery or RTO/RPO controls were evidenced — a volume that survives a container recreate is not a tested restore from catastrophic loss.
What to do
Codify backups + geo-recovery in IaC and document RTO/RPO and the restore procedure — a persistence guard alone is not disaster recovery.
Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.
Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.
No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
What to do
Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
Readiness · Performance — Whether the code protects its performance with benchmarks — a benchmark suite, allocation/memory measurement, and (ideally) a CI gate. Presence is credited as a bonus, never a deduction.
Method: Repo + source scan: BenchmarkDotNet referenced (csproj/source), [Benchmark]/[MemoryDiagnoser] attribute counts, and a benchmark step in CI; off .NET, the same ladder over Go testing.B, Rust criterion/#[bench]/divan, JMH/kotlinx-benchmark, pytest-benchmark/asv/pyperf, tinybench/mitata/vitest bench/benchmark.js and Swift package-benchmark — scored as a bonus ladder (absence is neutral, never a deduction). Deterministic, presence detection.
No benchmark suite was found by the two searches this check runs. FIRST, a BenchmarkDotNet package reference in any project file — every project the workspace loaded, plus a walk of project files on disk that never loaded, because a benchmark suite is exactly the project a partial load drops. SECOND, a script harness: a file whose name contains `benchmark` and ends `.py`, `.sh`, `.ps1`, `.bash`, `.rb`, `.js` or `.mjs`, credited ONLY when this repository's CI text also mentions benchmarks — a harness no pipeline runs is read as a fixture, deliberately. Neither search can see a benchmark suite in another ecosystem's idiom (a Go `testing.B` file, a JMH or criterion project, a pytest-benchmark run), so this is 'no benchmark found by those two searches', not a verdict that the repository has none. Where code is performance-sensitive, a benchmark guards against silent regressions — but it's a bonus here, not a deduction.
What to do
Add a benchmarking harness for the hot paths and run it in CI to catch regressions (for .NET, a BenchmarkDotNet project with [MemoryDiagnoser] to track allocations).
Readiness · Performance — Whether the code is written to minimise allocations so it doesn't pressure its host's memory manager — buffer/slice views over copies, object pooling, stack or value-type allocation, and buffer writers. Reward-only: credited where present, never penalised where a simpler style is fine.
Method: Production-source scan: density (per 1k LoC) of allocation-aware APIs — in .NET Span/Memory, ArrayPool/ObjectPool, stackalloc, ValueTask, value-type structs, IBufferWriter, string.Create, SkipLocalsInit; off .NET, with comments and strings blanked, Go's sync.Pool, preallocated slices/maps, Grow, strconv.Append* and buf[:0] reuse; the JVM's NIO buffer views, MemorySegment, primitive collections, pools and literal presizes (plus Kotlin primitive arrays and value classes, Scala AnyVal and @specialized); Swift's reserveCapacity, ContiguousArray, withUnsafe* access and ~Copyable. Activated off .NET on the same floor (400 lines, and benchmarks or 8 uses); Rust and garbage-collected scripting languages are not applicable. Reward-only. Deterministic, syntax/text detection.
Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.
Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from the language model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
Only 0/376 awaits in library code use ConfigureAwait(false). A library that captures the caller's context can stall or deadlock its host — the classic way a dependency drags an app down.
`await _connectionStateSemaphore.WaitAsync()` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`. (×2) — foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:148, foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:960
`await _offsetSemaphore.WaitAsync()` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`. — foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:156
`await WithLaneRecoveryAsync(token => _client.StoreOffsetAsync(_config.Consumer, _co...` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`. — foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:175
`await LeaveConsumerGroupAsync(_consumerGroupName)` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`. — foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:193
`await _client.LogoutUserAsync()` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`. — foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:204
`await _connectionStateSemaphore.WaitAsync(ct)` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`. (×2) — foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:282, foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:876
`await _client.ConnectAsync(ct)` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`. — foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:297
`await _client.LoginUserAsync(_config.Login, _config.Password, ct)` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`. — foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:301
`await InitializeConsumerGroupAsync(ct)` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`. — foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:304
`await PollMessagesAsync(ct)` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`. — foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:341
`await CommitDeliveredAsync(message.CurrentOffset, message.PartitionId, message.Cont...` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`. — foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:353
`await StoreOffsetCoreAsync(offset, partitionId, context, ct)` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`. (×2) — foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:380, foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:401
`await _offsetSemaphore.WaitAsync(cancellation.Token)` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`. — foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:412
`await WithLaneRecoveryAsync(token => context is { } captured ? _client.StoreOffsetA...` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`. — foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:417
`await WithLaneRecoveryAsync(token => _client.DeleteOffsetAsync(_config.Consumer, _c...` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`. — foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:449
`await _client.GetConsumerGroupByIdAsync(_config.StreamId, _config.TopicId, Identifi...` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`. — foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:505
`await TryCreateConsumerGroupAsync(_consumerGroupName, ct)` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`. — foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:512
`await _client.JoinConsumerGroupAsync(_config.StreamId, _config.TopicId, Identifier....` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`. — foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:528
`await _client.LeaveConsumerGroupAsync(_config.StreamId, _config.TopicId, Identifier...` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`. — foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:547
`await _client.CreateConsumerGroupAsync(_config.StreamId, _config.TopicId, groupName...` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`. — foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:564
`await TryRecoverGroupMembershipAsync(ct)` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`. — foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:612
`await _pollingSemaphore.WaitAsync(ct)` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`. — foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:618
`await WaitBeforePollingAsync(ct)` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`. — foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:625
`await _client.PollMessagesAsync(_config.StreamId, _config.TopicId, _config.Partitio...` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`. — foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:628
`await Task.Delay(NoAssignedPartitionBackoffMs, ct)` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`. — foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:642
`await _channel.Writer.WriteAsync(receivedMessage, ct)` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`. — foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:671
`await StoreOffsetAsync(lastPolledPartitionOffset, messages.PartitionId, messages.Co...` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`. — foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:682
`await ReportPollFailureAsync(ex, polledPartition, ct)` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`. — foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:704
`await Task.Delay(PollRetryDelayMs, ct)` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`. — foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:733
`await operation(cancellation.Token)` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`. (×2) — foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:745, foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:785
`await _client.ResolveOperationAsync(blocked.OperationId, TimeSpan.FromMilliseconds(...` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`. — foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:758
`await RejoinConsumerGroupOnReconnectionAsync()` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`. — foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:888
`await Task.Delay(GroupRejoinRetryDelayMs, ct)` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`. — foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:902
`await Task.Delay(intervalMs, ct)` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`. — foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:923
`await Task.Delay((int)remainingMs, ct)` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`. — foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:941
What to do
In library code, append .ConfigureAwait(false) to every await (or set <ConfigureAwait>false</ConfigureAwait> / use the analyzer CA2007) so the library never captures the host's context.
Do you agree with this assessment?
R1 · Type Safety9.7 / 10Exemplary✓ Tool-verified
React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.
Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.
What to do
Migrate the remaining .js/.jsx files to TypeScript.
React / JS · Code Health — Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm over JS/TS tokens, D-386): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.
Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Deterministic.
18 duplicated blocks under foreign/node/src/wire/ have copies in at least two of the sibling directories client, consumer-group, message, partition, session, stream (+4 more sibling(s) not listed) — 11 of them are reported below, and 7 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 18 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 18 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 18 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — foreign/node/src/wire/client/get-clients.command.ts:23
web/src/lib/components/Modals/AddPartitionsModal.svelte:49 · web/src/lib/components/Modals/DeletePartitionsModal.svelte:65 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — web/src/lib/components/Modals/AddPartitionsModal.svelte:49
web/src/lib/components/Modals/AddTopicModal.svelte:72 · web/src/lib/components/Modals/AddUserModal.svelte:67 · web/src/lib/components/Modals/StreamSettingsModal.svelte:73 — the 3 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — web/src/lib/components/Modals/AddTopicModal.svelte:72
web/src/lib/components/Modals/EditUserModal.svelte:50 · web/src/lib/components/Modals/StreamSettingsModal.svelte:58 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — web/src/lib/components/Modals/EditUserModal.svelte:50
web/src/lib/components/Modals/AddStreamModal.svelte:74 · web/src/lib/components/Modals/EditUserModal.svelte:65 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — web/src/lib/components/Modals/AddStreamModal.svelte:74
web/src/lib/components/Modals/AddTopicModal.svelte:72 · web/src/lib/components/Modals/StreamSettingsModal.svelte:73 · web/src/lib/components/Modals/TopicSettingsModal.svelte:98 — the 3 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — web/src/lib/components/Modals/AddTopicModal.svelte:72
web/src/lib/components/RouteComponents/Settings/UsersTab.svelte:46 · web/src/routes/dashboard/settings/users/+page.svelte:49 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — web/src/lib/components/RouteComponents/Settings/UsersTab.svelte:46
web/src/lib/components/SlimSortableList.svelte:24 · web/src/lib/components/SortableList.svelte:28 — the two spans are one implementation copied and then locally edited — 213 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web/src/lib/components/SlimSortableList.svelte:24
foreign/node/src/debug-send.ts:94 · foreign/node/src/debug.ts:92 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — foreign/node/src/debug-send.ts:94
foreign/node/src/wire/message/header.utils.ts:314 · foreign/node/src/wire/message/header.utils.ts:333 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — foreign/node/src/wire/message/header.utils.ts:314
foreign/node/src/wire/client/get-clients.command.ts:23 · foreign/node/src/wire/stream/get-streams.command.ts:27 — the 2 copies are spread across 2 files, and the CITED SPAN is a run of MODULE-LEVEL DECLARATIONS — bindings the module declares and exports — rather than statements with a call site. Do not read this as an extract-a-helper row: a call expression cannot stand where a declaration was, and putting one there would delete the names themselves, which are what the rest of the codebase imports. What actually repeats here is the INITIALISER — the same expression shape written once per binding. So give that expression one name (a small helper the initialisers call, or a shared base value they are each derived from) and keep every binding under the name it already has. Where the run is an enumeration — one binding per distinct thing, differing precisely in the thing each one names — the repetition IS the enumeration and collapsing it would delete entries; consider instead whether the set belongs in one exported table the individual names are read out of. Reported because the copies drift apart the first time only one of them is edited. — foreign/node/src/wire/client/get-clients.command.ts:23
foreign/node/src/duration.utils.ts:175 · foreign/node/src/duration.utils.ts:258 — the two spans are one implementation copied and then locally edited — 81 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — foreign/node/src/duration.utils.ts:175
foreign/node/src/debug-send.ts:52 · foreign/node/src/debug.ts:49 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — foreign/node/src/debug-send.ts:52
foreign/node/src/wire/stream/get-stream.command.ts:27 · foreign/node/src/wire/user/get-user.command.ts:28 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — foreign/node/src/wire/stream/get-stream.command.ts:27
foreign/node/src/wire/user/permissions.utils.ts:291 · foreign/node/src/wire/user/permissions.utils.ts:349 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — foreign/node/src/wire/user/permissions.utils.ts:291
foreign/node/src/wire/vsr/register.ts:61 · foreign/node/src/wire/vsr/register.ts:81 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — foreign/node/src/wire/vsr/register.ts:61
web/src/lib/components/Modals/InspectMessage.svelte:52 · web/src/lib/components/Modals/InspectMessage.svelte:65 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — web/src/lib/components/Modals/InspectMessage.svelte:52
foreign/node/src/client/client.frame.ts:140 · foreign/node/src/client/client.frame.ts:158 — the two spans are one implementation copied and then locally edited — 78 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — foreign/node/src/client/client.frame.ts:140
foreign/node/src/wire/session/login-with-token.command.ts:37 · foreign/node/src/wire/session/login.command.ts:34 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — foreign/node/src/wire/session/login-with-token.command.ts:37
foreign/node/src/wire/stream/get-stream.command.ts:21 · foreign/node/src/wire/topic/get-topics.command.ts:21 · foreign/node/src/wire/user/get-user.command.ts:21 — the 3 copies are spread across 3 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — foreign/node/src/wire/stream/get-stream.command.ts:21
web/src/lib/api/clientApi.ts:35 · web/src/lib/api/fetchRouteApi.ts:28 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — web/src/lib/api/clientApi.ts:35
web/src/lib/auth/authStore.svelte.ts:58 · web/src/lib/auth/authStore.svelte.ts:75 — the two spans are one implementation copied and then locally edited — 65 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web/src/lib/auth/authStore.svelte.ts:58
foreign/node/src/wire/number.utils.ts:26 · foreign/node/src/wire/number.utils.ts:50 · foreign/node/src/wire/number.utils.ts:74 · foreign/node/src/wire/number.utils.ts:98 · +1 more site(s) not listed — all 5 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — foreign/node/src/wire/number.utils.ts:26
foreign/node/src/wire/session/login.utils.ts:90 · foreign/node/src/wire/token/delete-token.command.ts:38 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — foreign/node/src/wire/session/login.utils.ts:90
foreign/node/src/wire/token/token.utils.ts:100 · foreign/node/src/wire/user/user.utils.ts:142 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — foreign/node/src/wire/token/token.utils.ts:100
foreign/node/src/debug-send.ts:68 · foreign/node/src/debug.ts:67 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — foreign/node/src/debug-send.ts:68
foreign/node/src/wire/client/client.utils.ts:31 · foreign/node/src/wire/user/user.utils.ts:69 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — foreign/node/src/wire/client/client.utils.ts:31
foreign/node/src/wire/consumer-group/get-group.command.ts:37 · foreign/node/src/wire/topic/get-topic.command.ts:45 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — foreign/node/src/wire/consumer-group/get-group.command.ts:37
foreign/node/src/wire/topic/create-topic.command.ts:132 · foreign/node/src/wire/topic/update-topic.command.ts:84 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — foreign/node/src/wire/topic/create-topic.command.ts:132
web/src/lib/api/clientApi.ts:47 · web/src/lib/api/fetchApi.ts:37 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — web/src/lib/api/clientApi.ts:47
REDACTED:255 · REDACTED:263 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:255
foreign/node/src/wire/cluster/cluster.utils.ts:56 · foreign/node/src/wire/cluster/cluster.utils.ts:131 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — foreign/node/src/wire/cluster/cluster.utils.ts:56
foreign/node/src/wire/session/login.utils.ts:54 · foreign/node/src/wire/user/create-user.command.ts:60 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — foreign/node/src/wire/session/login.utils.ts:54
foreign/node/src/wire/stream/stream.utils.ts:70 · foreign/node/src/wire/topic/topic.utils.ts:142 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — foreign/node/src/wire/stream/stream.utils.ts:70
foreign/node/src/wire/user/permissions.utils.ts:251 · foreign/node/src/wire/user/permissions.utils.ts:318 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — foreign/node/src/wire/user/permissions.utils.ts:251
foreign/node/src/bdd/metadata-changes.ts:169 · foreign/node/src/bdd/resource-options.ts:148 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — foreign/node/src/bdd/metadata-changes.ts:169
foreign/node/src/wire/cluster/cluster.utils.ts:72 · foreign/node/src/wire/cluster/cluster.utils.ts:137 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — foreign/node/src/wire/cluster/cluster.utils.ts:72
foreign/node/src/wire/message/iggy-header.utils.ts:87 · foreign/node/src/wire/message/iggy-header.utils.ts:157 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — foreign/node/src/wire/message/iggy-header.utils.ts:87
foreign/node/src/wire/system/metadata-changes.utils.ts:895 · foreign/node/src/wire/system/metadata-changes.utils.ts:903 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — foreign/node/src/wire/system/metadata-changes.utils.ts:895
foreign/node/src/wire/user/permissions.utils.ts:159 · foreign/node/src/wire/user/permissions.utils.ts:243 — all 2 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases. — foreign/node/src/wire/user/permissions.utils.ts:159
What to do
Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
React / JS · Code Health — Per-function cyclomatic/cognitive complexity from the token-level function scanner (D-386) — real branching, not a regex heuristic.
Method: Per-function cyclomatic/cognitive complexity from a token-level function scanner (real branching, not a regex heuristic), computed over every frontend function. Deterministic.
drive has cyclomatic complexity 151 and cognitive complexity 254; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — foreign/node/src/client/client.socket.ts:282
(anonymous) has cyclomatic complexity 36 and cognitive complexity 60; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — foreign/node/src/client/client.socket.test.ts:2844
(anonymous) has cyclomatic complexity 27 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — foreign/node/src/client/client.config.ts:38
(anonymous) has cyclomatic complexity 26 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — foreign/node/src/wire/system/get-metadata-changes.command.ts:212
(anonymous) has cyclomatic complexity 25 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — foreign/node/src/wire/system/update-resource.command.ts:123
(anonymous) has cyclomatic complexity 25 and cognitive complexity 24; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:59
routeFor has cyclomatic complexity 24 and cognitive complexity 41; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — foreign/node/src/client/client.socket.ts:613
enter has cyclomatic complexity 23 and cognitive complexity 36; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — foreign/node/src/client/client.operation.ts:228
(anonymous) has cyclomatic complexity 23 and cognitive complexity 32; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — foreign/node/src/wire/message/poll-messages.command.ts:155
runReplica has cyclomatic complexity 21 and cognitive complexity 41; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — foreign/node/src/client/client.socket.ts:864
serialize has cyclomatic complexity 20 and cognitive complexity 24; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — foreign/node/src/wire/topic/create-topic.command.ts:95
(anonymous) has cyclomatic complexity 19 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:158
readyLink has cyclomatic complexity 18 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — foreign/node/src/client/client.socket.ts:785
sendCommand has cyclomatic complexity 18 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — foreign/node/src/client/client.socket.ts:200
(anonymous) has cyclomatic complexity 17 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — foreign/node/src/client/client.socket.test.ts:4320
exchange has cyclomatic complexity 17 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — foreign/node/src/client/client.socket.ts:561
What to do
Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
Do you agree with this assessment?
R3 · Large Files9.1 / 10Exemplary✓ Tool-verified
React / JS · Code Health — How many source files exceed the large-file threshold.
Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.
foreign/node/src/client/client.socket.ts has 1361 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — foreign/node/src/client/client.socket.ts:1
foreign/node/src/wire/system/metadata-changes.utils.ts has 1041 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — foreign/node/src/wire/system/metadata-changes.utils.ts:1
web/src/routes/dashboard/changes/+page.svelte has 537 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/routes/dashboard/changes/+page.svelte:1
foreign/node/src/wire/message/header.utils.ts has 514 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — foreign/node/src/wire/message/header.utils.ts:1
web/src/lib/components/PermissionsManager.svelte has 428 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/src/lib/components/PermissionsManager.svelte:1
foreign/node/src/client/client.operation.ts has 404 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — foreign/node/src/client/client.operation.ts:1
What to do
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Do you agree with this assessment?
R4 · Test Coverage4.5 / 10Adequate✓ Tool-verified
React / JS · Readiness — Static test reachability (D-386): the share of production files reachable from any test via the import graph — measured without running anything.
Method: Static test reachability: the share of production files reachable from any test via the import graph — measured without running anything. Deterministic.
No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×40) — web/src/lib/components/PermissionsManager.svelte:1, REDACTED:1, web/src/routes/dashboard/changes/+page.svelte:1, …
What to do
Add tests that import the unreached modules (directly or through their public entry).
React / JS · Readiness — How outdated the npm dependencies are (a maturity signal). JS/npm CVEs are scored separately in D30 (JS/npm Dependency Vulnerabilities).
Method: npm dependency staleness from manifest/registry metadata (a maturity signal; JS/npm CVEs are scored separately in D30, which answers dependency vulnerabilities for every ecosystem). Deterministic.
What to do
Bump outdated dependencies to current versions to limit upgrade debt.
Do you agree with this assessment?
R6 · Tooling10.0 / 10Exemplary✓ Tool-verified
React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each package.json script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.
Method: package.json scanned for test/lint/typecheck script wiring. Deterministic presence check.
Do you agree with this assessment?
R7 · Dead Code8.1 / 10Strong✓ Tool-verified
React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).
Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.
Unreachable from the 40 application, 10 tooling and 82 test entry point(s) detected in this repo. Gate removals on `npm run build` — an undetected custom entry would make these reachable.
no import path from any entry point (40 application, 10 tooling, 82 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make (×19) — web/src/lib/utils/addOnKeyDownListener.ts, foreign/node/src/debug-send.ts, foreign/node/src/debug.ts, …
no import path from any entry point (40 application, 10 tooling, 82 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/src/lib/components/RouteComponents/Settings/UsersTabActions.svelte) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — web/src/lib/components/RouteComponents/Settings/UsersTab.svelte
Nothing imports this binding — it is safe to review for removal. (×12) — foreign/node/src/client/client.ts:72, foreign/node/src/tcp.sm.utils.ts:80, foreign/node/src/wire/message/iggy-header.utils.ts:198, …
Nothing ultimately consumes this binding: its only referrer is the re-export in foreign/node/src/wire/cluster/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in foreign/node/src/wire/cluster/index.ts in the same commit, or the barrel will import a name that no longer exists. — foreign/node/src/wire/cluster/cluster.type.ts:84
Nothing ultimately consumes this binding: its only referrer is the re-export in foreign/node/src/wire/consumer-group/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in foreign/node/src/wire/consumer-group/index.ts in the same commit, or the barrel will import a name that no longer exists. — foreign/node/src/wire/consumer-group/sync-group.command.ts:65
Nothing ultimately consumes this binding: its only referrer is the re-export in foreign/node/src/wire/message/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in foreign/node/src/wire/message/index.ts in the same commit, or the barrel will import a name that no longer exists. (×4) — foreign/node/src/wire/message/poll.utils.ts:52, foreign/node/src/wire/message/poll.utils.ts:54, foreign/node/src/wire/message/poll.utils.ts:210, …
Nothing ultimately consumes this binding: its only referrer is the re-export in foreign/node/src/wire/system/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in foreign/node/src/wire/system/index.ts in the same commit, or the barrel will import a name that no longer exists. — foreign/node/src/wire/system/snapshot.command.ts:55
What to do
Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
React / JS · Readiness — npm dependency truthfulness (D-386): unused dependencies, imports not declared anywhere, and type-/test-only packages shipped as production deps.
Method: npm dependency truthfulness: unused dependencies, imports declared nowhere, and type-/test-only packages shipped as production deps — from the manifest + import graph. Deterministic.
Declared in the root package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Declared in foreign/node/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Declared in web/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
What to do
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.
Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.
Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.
Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.
Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.
Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.
Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.
Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.
Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X15 · Unvalidated length from an untrusted reader10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.
Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.
Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X17 · Uncapped recursion over a caller-supplied document10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.
Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.
Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.
`_client` is never created by `IggyConsumer` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 209). Its declared type `IIggyClient` is an interface, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed. — foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:209
`IggyConsumer` implements `IDisposable` — so it has told every caller it holds something worth releasing — and it constructs `_pollingSemaphore` itself (line 88), which makes that instance its own. But `_pollingSemaphore` is named in none of the methods the disposal search covered: `DisposeAsync` (line 136), `CompleteReceiveChannels` (line 226), `SamePartition` (line 258), `LeaveConsumerGroupAsync` (line 543), `WithLaneRecoveryAsync` (line 736) — that is `Dispose` plus every method `Dispose` calls BY NAME, so a release reached through an interface, a delegate or a base class is not followed and is worth checking before acting. On what was read, the type's disposal releases everything except the one thing it owns. A disposable the owner never disposes is held until finalization if its type has a finalizer, and forever if it does not — which for a synchronisation primitive, a timer, a stream or a handle means the resource accumulates once per instance for the life of the process. Release it in `Dispose` (`_pollingSemaphore?.Dispose();`), or, if it truly does not need releasing, drop `IDisposable` from the type so the claim and the behaviour agree. — foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:88
`_owner` is never created by `PolledMessagesRental` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 74). Its declared type `IMemoryOwner` is an interface, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed. — foreign/csharp/Iggy_SDK/Contracts/PolledMessagesRental.cs:74
`TcpMessageStream` implements `IDisposable` — so it has told every caller it holds something worth releasing — and it constructs `_connectGate` itself (line 64), which makes that instance its own. But `_connectGate` is named in none of the methods the disposal search covered: `Dispose` (line 115), `StopHeartbeat` (line 889), `SetConnectionState` (line 1316) — that is `Dispose` plus every method `Dispose` calls BY NAME, so a release reached through an interface, a delegate or a base class is not followed and is worth checking before acting. On what was read, the type's disposal releases everything except the one thing it owns. A disposable the owner never disposes is held until finalization if its type has a finalizer, and forever if it does not — which for a synchronisation primitive, a timer, a stream or a handle means the resource accumulates once per instance for the life of the process. Release it in `Dispose` (`_connectGate?.Dispose();`), or, if it truly does not need releasing, drop `IDisposable` from the type so the claim and the behaviour agree. — foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.cs:64
`TcpMessageStream` implements `IDisposable` — so it has told every caller it holds something worth releasing — and it constructs `_sendingSemaphore` itself (line 71), which makes that instance its own. But `_sendingSemaphore` is named in none of the methods the disposal search covered: `Dispose` (line 115), `StopHeartbeat` (line 889), `SetConnectionState` (line 1316) — that is `Dispose` plus every method `Dispose` calls BY NAME, so a release reached through an interface, a delegate or a base class is not followed and is worth checking before acting. On what was read, the type's disposal releases everything except the one thing it owns. A disposable the owner never disposes is held until finalization if its type has a finalizer, and forever if it does not — which for a synchronisation primitive, a timer, a stream or a handle means the resource accumulates once per instance for the life of the process. Release it in `Dispose` (`_sendingSemaphore?.Dispose();`), or, if it truly does not need releasing, drop `IDisposable` from the type so the claim and the behaviour agree. — foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.cs:71
`Client` is never created by `IggyPublisher` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 118). Its declared type `IIggyClient` is an interface, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed. — foreign/csharp/Iggy_SDK/Publishers/IggyPublisher.cs:118
`VsrConnection` implements `IDisposable` — so it has told every caller it holds something worth releasing — and it constructs `_pendingCapacity` itself (line 56), which makes that instance its own. But `_pendingCapacity` is named in none of the methods the disposal search covered: `Dispose` (line 89), `Fail` (line 483) — that is `Dispose` plus every method `Dispose` calls BY NAME, so a release reached through an interface, a delegate or a base class is not followed and is worth checking before acting. On what was read, the type's disposal releases everything except the one thing it owns. A disposable the owner never disposes is held until finalization if its type has a finalizer, and forever if it does not — which for a synchronisation primitive, a timer, a stream or a handle means the resource accumulates once per instance for the life of the process. Release it in `Dispose` (`_pendingCapacity?.Dispose();`), or, if it truly does not need releasing, drop `IDisposable` from the type so the claim and the behaviour agree. — foreign/csharp/Iggy_SDK/Vsr/VsrConnection.cs:56
What to do
Each finding names the value and the span that decides who owns it — the `new` that created it, or the constructor parameter that handed it over. Confirm ownership from that span, then make the disposal match it: release what this type created, leave what it was injected with to whoever created THAT, and drop a finalizer whose type holds nothing unmanaged to release.
Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.
Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether async methods accept a CancellationToken so work can be cancelled (adoption curve).
Method: Roslyn scan: every async method (excluding framework-fixed overrides/Blazor handlers) checked for CancellationToken parameter presence. Deterministic, adoption percentage. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same question: every named async function that itself makes a request an AbortSignal can cancel (global `fetch`, axios and its file-local instances, ky, ofetch) counts, and it is compliant when its parameters or body name a signal or it hands one of its own parameters to the request as options; signatures a framework fixes (JSX event handlers, route and lifecycle exports, request-first handlers, `override`, `'use server'` modules, TanStack `mutationFn`) are exempt unless they take a signal. Deterministic, adoption percentage.
Only 168/193 async methods accept a CancellationToken, so in-flight work can't be stopped early when the caller gives up — whatever ends it in your host (shutdown signal, timeout, abandoned request, user cancel). Thread a token through the call chain and honour it at each await and loop; where a method genuinely cannot be interrupted, omitting it is a deliberate choice — judge against your hosting model.
No CancellationToken parameter — this work can't be stopped early once started. (×18) — foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:543, foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:951, foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:1011, …
No CancellationToken parameter — the body observes an ambient token instead (a field or a context object), so the work does stop on cancellation, but a caller cannot cancel this call independently of the owner that created that token. (×4) — foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.ReplicaLinks.cs:100, foreign/csharp/Iggy_SDK/Vsr/VsrConnection.cs:269, foreign/csharp/Iggy_SDK/Vsr/VsrConnection.cs:304, …
Neither takes a CancellationToken nor reads the one of the function it sits in, while it calls something that takes one — this work can't be stopped early once started. Take the token, or pass on the enclosing one. (×3) — examples/csharp/src/TcpTls/Iggy_SDK.Examples.TcpTls.Producer/Program.cs:71, examples/csharp/src/TcpTls/Iggy_SDK.Examples.TcpTls.Producer/Program.cs:99, examples/csharp/src/TcpTls/Iggy_SDK.Examples.TcpTls.Consumer/Program.cs:68
What to do
Thread a CancellationToken through async methods so work stops promptly on cancellation.
Other · Code Health — Whether an argument guard throws the exception its own condition describes — a guard that rejects a value for being EMPTY and reports it as `ArgumentNullException` tells the caller a parameter was null when it provably was not.
Method: Roslyn syntax: `throw new ArgumentNullException(nameof(p))` statements controlled by an `if`, whose condition is read for a test that is true of a NON-null `p` — an emptiness test that dereferences it (`p.Count == 0`, `!p.Any()`) or a BCL predicate documented true of the empty value (`string.IsNullOrEmpty(p)`). Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.
Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back.
Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.
Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X24 · Document value interpolated into markup unescaped2.2 / 10Critical✓ Tool-verified
Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.
Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.
`name` is text this program did not author, and it is written into the text of an element through Handlebars' raw `{{{ }}}` output with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — about.hbs:16
`crate.name` is text this program did not author, and it is written into the text of an element through Handlebars' raw `{{{ }}}` output with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — about.hbs:18
`text` is text this program did not author, and it is written into the text of an element through Handlebars' raw `{{{ }}}` output with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — about.hbs:21
What to do
Each finding names the expression, the attribute it lands in and the line. Confirm the value's origin from the read this analyzer traced, then escape it at the sink or validate it against the shape the attribute accepts before interpolating.
Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.
Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.
Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a `foreach` leaves the collection it is walking alone — a body that adds to or removes from the very collection the loop is enumerating invalidates the enumerator it is holding, so the next `MoveNext` throws `InvalidOperationException` and the remaining items are never seen.
Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.
Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.
Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.
Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.
An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×5) — foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:433, foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:770, foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.Vsr.cs:221, …
`throw blocked;` resets the exception's stack trace to this line, hiding where it really came from. Use a bare `throw;` to preserve the original stack. (×2) — foreign/csharp/Iggy_SDK/Publishers/BackgroundMessageProcessor.cs:615, foreign/csharp/Iggy_SDK/Publishers/BackgroundMessageProcessor.cs:619
What to do
Swallowed exception (empty catch)
Do you agree with this assessment?
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.
Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X32 · Type resolved by simple name across every loaded assembly10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a plugin lookup names the type it means — searching every assembly loaded into the process for a candidate whose SIMPLE name equals a string supplied at runtime, and taking the first one found, is decided by assembly LOAD ORDER rather than by this source, so the same name can resolve to a different type on the next run.
Method: Roslyn syntax only, no semantic model: every invocation of `First`/`FirstOrDefault`/`Single`/`SingleOrDefault` whose OWN expression subtree contains both a `GetAssemblies()` call and a `GetTypes()`/`GetExportedTypes()` call — a single-element pick out of every type loaded into the process. A nested selector in the same chain sees no `GetAssemblies()` in its own subtree and is outside the population, so one lookup counts once however many links its chain has. A finding additionally needs both remaining halves: the selector must be `First`/`FirstOrDefault` (`Single`/`SingleOrDefault` reports the ambiguity rather than resolving it, and is counted and never reported), and the chain must carry an `==` comparison of `<lambda parameter>.Name` against something that is not a literal. The receiver must be a plain identifier bound by one of the chain’s own lambdas, which places `assembly.GetName().Name == "X"` outside the rule by construction. One exemption: a `.Name` test joined by `&&` to a `FullName`/`AssemblyQualifiedName` test on the same identifier is spared; joined by `||` it is not. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.
Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `package.json` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.
Other · Code Health — Whether nullable reference types are enabled and not undermined by heavy `!` suppression.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
~0.4 `!` suppressions per 1k syntax nodes — 40 suppression(s) across the 108142 syntax node(s) in code where nullable warnings are ENABLED, which is the only code a `!` can suppress anything in (a `!` under `#nullable disable` is inert and is not counted, and its file's nodes are not in the denominator). Each one tells the compiler to trust you about null, suppressing the very safety NRTs provide.
What to do
Enable <Nullable>enable</Nullable> across all projects and resolve warnings rather than suppressing with `!`.
Do you agree with this assessment?
Reference — by lens
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 3 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
P12 CI test-gate honesty — 1 observation(s) recorded · Reported, not scored — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
X10 Duplicated predicate — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 10 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not included — 41 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AC1 Text alternatives — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
AC2 Forms & labels — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
AC3 Page structure — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
AC4 Keyboard semantics — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
AC5 ARIA correctness — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
AC6 Visual & motion safety — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
AC7 A11y enforcement — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
AX1 Captive dependencies — no DI registrations detected
AX2 Stateful singletons — no singleton implementations detected
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — compose up failed (exit 15 — the compose project is invalid) — error while interpolating services.iggy-server.environment.[]: required variable IGGY_ROOT_PASSWORD is missing a value: set IGGY_ROOT_PASSWORD; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
C1 Data Protection — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
C2 Access Controls — No access-control surface detected in the analyzed source — no web/app surface to authorize (no HTTP API or web-UI project) and no authorization code at all (no [Authorize]/policies, no imperative guard methods). Access control is therefore N/A here — this is a library/CLI, which is authorized by its CALLER, not by itself. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
C3 Audit Trail — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
C4 Data Retention — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
C5 Data-Subject Rights — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
D11 Test Reliability — Test reliability not scored — polyglot repository, one half's runner produced no measurement
D18 Solution Shape — D18 scores the shape of a C#/VB .NET solution, but this repository's production source is mostly .cpp, .go, .java, .php, .py, .rs, .swift, .ts, which the C#/VB workspace does not load — the projects that loaded are an immaterial minority, so solution shape was not assessed for this repository. Not scored — this is a gap in the analyzer's reach, not a verdict about this repository.
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.
D21 Naming Consistency — Naming consistency is measured on C# only; Go, Java, JavaScript, PHP, Python, Rust, Swift, TypeScript, html not measured.
D23 Boundary Type-Coupling — Cross-context type coupling was not assessed: no type reached this dimension's context map.
D25 ADR Conformance — no ADRs to check
D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.rs), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D32 Data Compliance (PII/GDPR) — 22 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D39 IL Efficiency — IL not measured — the analyzer's build of the target did not succeed
D42 Runtime Threat Enforcement — The repository ships application workloads but no cluster-governance resources (CRDs, admission webhooks, or a committed policy engine). Runtime threat-detection (Falco/Tetragon) and admission control (Kyverno/OPA-Gatekeeper/PodSecurity) are cluster-OPERATOR controls owned by the platform, not shipped by an application repo/chart — nothing for this repo to assess.
D7 Architectural Integrity — no checkable ADRs and no dependency cycles — architectural integrity not assessed
D8 Code Coverage — Coverage not measured — .NET suite
DM1 Domain Modelling — applicable but not scored (4 signals for this style, 2 needed — the count is met but a required primary signal is absent): 3 aggregate root(s) (types guarding their own state behind command methods — this language has no AggregateRoot base to inherit); 392 value object(s); 3 domain event(s); its domain events are published by services or handlers — no domain entity raises one; a Domain/Aggregates/ValueObjects layer; a top-level examples/ tree: a library or framework whose examples are its consumers — these types are building blocks, not a domain
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and this analysis resolves a call's owner only where the receiver's type is written down in the source. Reported as guidance rather than measured
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and a call made through an inferred or generic receiver has no resolvable owner in the source. Reported as guidance rather than measured
P2 Observability — This repo is a library, not a deployed service — it has no process to operate, so production observability (structured logging, tracing/metrics, health checks) is N/A. A library may log via an injected ILogger, but the absence of operational telemetry is not a defect here. If it grows a host (web API, worker), the dimension reactivates.
P7 Outbound HTTP resilience — not applicable — this isn't a service/API/worker
P8 Schema migrations — sqlx is declared, but the schema-migration mechanism could not be identified. Our limit, not a verdict on this repository.
P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
S1 Web-Security Posture — No web surface detected in the analyzed source — no HTTP API or web-UI project (no controllers/minimal-API endpoints, no Razor/Blazor views) and no web middleware (HTTPS redirection, HSTS, security headers, cookies). Transport security, security headers, secure cookies, CSRF/input-validation and middleware-order controls are therefore N/A here — this is a library/CLI/worker, not a web app. Crypto hygiene was still checked and found nothing to flag. If this codebase becomes web-facing, the dimension reactivates automatically.
SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
EmptyCatchBlock foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:433— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:770— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.Vsr.cs:221— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
Namespace dependency cycle foreign/csharp/Iggy_SDK/Contracts/MetadataChangesQuery.cs:20— The namespaces Apache.Iggy.Contracts ↔ Apache.Iggy.Contracts.Auth ↔ Apache.Iggy.Contracts.Http ↔ Apache.Iggy.Exceptions ↔ Apache.Iggy.JsonConverters ↔ Apache.Iggy.Kinds ↔ Apache.Iggy.Vsr depend on each other. The lightest dependency in the cycle is Apache.Iggy.Contracts → Apache.Iggy.Exceptions (Apache.Iggy.Contracts.MetadataChangesQuery → Apache.Iggy.Exceptions.IggyInvalidStatusCodeException, 1 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface.
FileTooLong: src/iggy_partition.rs core/partitions/src/iggy_partition.rs— FileTooLong — 8608 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 8108 over it, 17.22× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: REDACTED core/shard/src/lib.rs— FileTooLong — 7460 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 74% of them inside a single declaration: IggyShard (3 blocks, 1596-11666), declaring 68 free functions. The bar is 500 significant lines; this is 6960 over it, 14.92× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: impls/metadata.rs core/metadata/src/impls/metadata.rs— FileTooLong — 3127 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 2627 over it, 6.25× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/impls.rs core/consensus/src/impls.rs— FileTooLong — 2751 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 75% of them inside a single declaration: VsrConsensus (5 blocks, 426-5777). The bar is 500 significant lines; this is 2251 over it, 5.50× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: src/state_transfer.rs core/partitions/src/state_transfer.rs— FileTooLong — 2628 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 2128 over it, 5.26× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: stm/stream.rs core/metadata/src/stm/stream.rs— FileTooLong — 2071 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 1571 over it, 4.14× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: REDACTED core/connectors/sources/postgres_source/src/lib.rs— FileTooLong — 1801 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 34 free functions. The bar is 500 significant lines; this is 1301 over it, 3.60× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/segment_recovery.rs core/partitions/src/segment_recovery.rs— FileTooLong — 1725 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 1225 over it, 3.45× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: consensus/header.rs core/binary_protocol/src/consensus/header.rs— FileTooLong — 1718 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 1218 over it, 3.44× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: http/handlers.rs core/server/src/http/handlers.rs— FileTooLong — 1507 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 55 free functions. The bar is 500 significant lines; this is 1007 over it, 3.01× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: tcp/AsyncTcpConnection.java foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/AsyncTcpConnection.java— FileTooLong — 1373 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: AsyncTcpConnection (93-1990). The bar is 500 significant lines; this is 873 over it, 2.75× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: REDACTED REDACTED— FileTooLong — 1310 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 810 over it, 2.62× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/client.rs foreign/cpp/src/client.rs— FileTooLong — 1281 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 81% of them inside a single declaration: Client (2 blocks, 117-1524). The bar is 500 significant lines; this is 781 over it, 2.56× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: src/type_conversion.rs foreign/cpp/src/type_conversion.rs— FileTooLong — 1273 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 773 over it, 2.55× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: REDACTED core/simulator/src/lib.rs— FileTooLong — 1264 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 83% of them inside a single declaration: Simulator (2 blocks, 215-2061). The bar is 500 significant lines; this is 764 over it, 2.53× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: group/state.rs gateways/kafka/src/group/state.rs— FileTooLong — 1263 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 42 free functions. The bar is 500 significant lines; this is 763 over it, 2.53× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/metadata_changes.rs foreign/php/src/metadata_changes.rs— FileTooLong — 1230 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 730 over it, 2.46× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: tcp/PollRouter.java foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/PollRouter.java— FileTooLong — 1212 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: PollRouter (81-1716). The bar is 500 significant lines; this is 712 over it, 2.42× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: src/metadata_changes.rs foreign/python/src/metadata_changes.rs— FileTooLong — 1195 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 695 over it, 2.39× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/partition_journal.rs core/journal/src/partition_journal.rs— FileTooLong — 1187 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 78% of them inside a single declaration: PartitionPrepareJournal (4 blocks, 109-1518). The bar is 500 significant lines; this is 687 over it, 2.37× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: workload/mod.rs core/simulator/src/workload/mod.rs— FileTooLong — 1135 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 635 over it, 2.27× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/persistence.rs core/partitions/src/persistence.rs— FileTooLong — 1123 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 75% of them inside a single declaration: PartitionPersistence (3 blocks, 130-1609). The bar is 500 significant lines; this is 623 over it, 2.25× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: dispatch/partition.rs core/server/src/dispatch/partition.rs— FileTooLong — 1100 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 600 over it, 2.20× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/partition_reconciler.rs core/server/src/partition_reconciler.rs— FileTooLong — 1098 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 598 over it, 2.20× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: handlers/fetch.rs gateways/kafka/src/protocol/handlers/fetch.rs— FileTooLong — 1089 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 45 free functions. The bar is 500 significant lines; this is 589 over it, 2.18× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
Hotspot: core/shard/src/lib.rs core/shard/src/lib.rs:8501— core/shard/src/lib.rs changed 71 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 89 in IggyShard::tick_partitions at line 8501. 36 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 06:16:38 +01:00' --until='2026-10-28 06:16:38 +01:00' --full-history --no-merges -- core/shard/src/lib.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/partitions/src/iggy_partition.rs core/partitions/src/iggy_partition.rs:5992— core/partitions/src/iggy_partition.rs changed 66 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 82 in IggyPartition::resume_io_inner at line 5992. 30 of those changes were fix/bug commits, and the other 36 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 06:16:38 +01:00' --until='2026-10-28 06:16:38 +01:00' --full-history --no-merges -- core/partitions/src/iggy_partition.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: foreign/node/src/wire/error.code.ts foreign/node/src/wire/error.code.ts:18— foreign/node/src/wire/error.code.ts changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 256 in error.code.translateErrorCode at line 18. 4 of those changes were fix/bug commits, and the other 9 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 06:16:38 +01:00' --until='2026-10-28 06:16:38 +01:00' --full-history --no-merges -- foreign/node/src/wire/error.code.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: foreign/node/src/client/client.socket.ts foreign/node/src/client/client.socket.ts:282— foreign/node/src/client/client.socket.ts changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 149 in CommandResponseStream.drive at line 282. 2 of those changes were fix/bug commits, and the other 15 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 06:16:38 +01:00' --until='2026-10-28 06:16:38 +01:00' --full-history --no-merges -- foreign/node/src/client/client.socket.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: foreign/swift/Sources/Iggy/Errors/IggyErrorCode.swift foreign/swift/Sources/Iggy/Errors/IggyErrorCode.swift:291— foreign/swift/Sources/Iggy/Errors/IggyErrorCode.swift changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 261 in IggyErrorCode.name at line 291. 1 of those changes was a fix/bug commit, and the other 8 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 06:16:38 +01:00' --until='2026-10-28 06:16:38 +01:00' --full-history --no-merges -- foreign/swift/Sources/Iggy/Errors/IggyErrorCode.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/metadata/src/impls/metadata.rs core/metadata/src/impls/metadata.rs:2494— core/metadata/src/impls/metadata.rs changed 46 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 43 in IggyMetadata::install_state_transfer at line 2494. 18 of those changes were fix/bug commits, and the other 28 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 06:16:38 +01:00' --until='2026-10-28 06:16:38 +01:00' --full-history --no-merges -- core/metadata/src/impls/metadata.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/shard/src/router.rs core/shard/src/router.rs:848— core/shard/src/router.rs changed 35 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 35 in IggyShard::process_lifecycle at line 848. 11 of those changes were fix/bug commits, and the other 24 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 06:16:38 +01:00' --until='2026-10-28 06:16:38 +01:00' --full-history --no-merges -- core/shard/src/router.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.PollRouting.cs foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.PollRouting.cs:178— foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.PollRouting.cs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 140 in TcpMessageStream.RunClientOperationAsync at line 178. 1 of those changes was a fix/bug commit, and the other 7 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 06:16:38 +01:00' --until='2026-10-28 06:16:38 +01:00' --full-history --no-merges -- foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.PollRouting.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/partitions/src/state_transfer.rs core/partitions/src/state_transfer.rs:3434— core/partitions/src/state_transfer.rs changed 27 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 41 in IggyPartition::drive_install_io at line 3434. 12 of those changes were fix/bug commits, and the other 15 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 06:16:38 +01:00' --until='2026-10-28 06:16:38 +01:00' --full-history --no-merges -- core/partitions/src/state_transfer.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/server/src/partition_reconciler.rs core/server/src/partition_reconciler.rs:673— core/server/src/partition_reconciler.rs changed 48 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in server::partition_reconciler::reconcile_additions at line 673. 17 of those changes were fix/bug commits, and the other 31 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 06:16:38 +01:00' --until='2026-10-28 06:16:38 +01:00' --full-history --no-merges -- core/server/src/partition_reconciler.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/server/src/partition_helpers.rs core/server/src/partition_helpers.rs:177— core/server/src/partition_helpers.rs changed 33 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in server::partition_helpers::load_partition_or_fence at line 177. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 06:16:38 +01:00' --until='2026-10-28 06:16:38 +01:00' --full-history --no-merges -- core/server/src/partition_helpers.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/simulator/src/replica.rs core/simulator/src/replica.rs:152— core/simulator/src/replica.rs changed 31 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in simulator::replica::new_shard at line 152. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 06:16:38 +01:00' --until='2026-10-28 06:16:38 +01:00' --full-history --no-merges -- core/simulator/src/replica.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/simulator/src/lib.rs core/simulator/src/lib.rs:963— core/simulator/src/lib.rs changed 52 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in Simulator::step_with_senders at line 963. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 06:16:38 +01:00' --until='2026-10-28 06:16:38 +01:00' --full-history --no-merges -- core/simulator/src/lib.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/server/src/boot/mod.rs core/server/src/boot/mod.rs:512— core/server/src/boot/mod.rs changed 25 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in server::boot::shard_main at line 512. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 06:16:38 +01:00' --until='2026-10-28 06:16:38 +01:00' --full-history --no-merges -- core/server/src/boot/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/consensus/src/impls.rs core/consensus/src/impls.rs:3154— core/consensus/src/impls.rs changed 39 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in VsrConsensus::tick_with_history_fence at line 3154. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 06:16:38 +01:00' --until='2026-10-28 06:16:38 +01:00' --full-history --no-merges -- core/consensus/src/impls.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/configs/src/server_config/cluster.rs core/configs/src/server_config/cluster.rs:899— core/configs/src/server_config/cluster.rs changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 49 in ClusterConfig::validate at line 899. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 06:16:38 +01:00' --until='2026-10-28 06:16:38 +01:00' --full-history --no-merges -- core/configs/src/server_config/cluster.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/binary_protocol/src/dispatch.rs core/binary_protocol/src/dispatch.rs:204— core/binary_protocol/src/dispatch.rs changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 53 in iggy_binary_protocol::dispatch::lookup_command at line 204. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 06:16:38 +01:00' --until='2026-10-28 06:16:38 +01:00' --full-history --no-merges -- core/binary_protocol/src/dispatch.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/server/src/dispatch/mod.rs core/server/src/dispatch/mod.rs:785— core/server/src/dispatch/mod.rs changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in server::dispatch::handle_client_request at line 785. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 06:16:38 +01:00' --until='2026-10-28 06:16:38 +01:00' --full-history --no-merges -- core/server/src/dispatch/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/metadata/src/stm/stream.rs core/metadata/src/stm/stream.rs:2905— core/metadata/src/stm/stream.rs changed 31 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in CreatePartitionsWithAssignmentsRequest::apply at line 2905. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 06:16:38 +01:00' --until='2026-10-28 06:16:38 +01:00' --full-history --no-merges -- core/metadata/src/stm/stream.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/metadata/src/stm/authz.rs core/metadata/src/stm/authz.rs:241— core/metadata/src/stm/authz.rs changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 35 in metadata::stm::authz::authorize at line 241. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 06:16:38 +01:00' --until='2026-10-28 06:16:38 +01:00' --full-history --no-merges -- core/metadata/src/stm/authz.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/shard/src/poll.rs core/shard/src/poll.rs:163— core/shard/src/poll.rs changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 43 in IggyShard::on_partition_read at line 163. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 06:16:38 +01:00' --until='2026-10-28 06:16:38 +01:00' --full-history --no-merges -- core/shard/src/poll.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/metadata/src/impls/recovery.rs core/metadata/src/impls/recovery.rs:433— core/metadata/src/impls/recovery.rs changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in metadata::impls::recovery::recover at line 433. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 06:16:38 +01:00' --until='2026-10-28 06:16:38 +01:00' --full-history --no-merges -- core/metadata/src/impls/recovery.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/consensus/src/observability.rs core/consensus/src/observability.rs:735— core/consensus/src/observability.rs changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in consensus::observability::operation_as_str at line 735. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 06:16:38 +01:00' --until='2026-10-28 06:16:38 +01:00' --full-history --no-merges -- core/consensus/src/observability.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/sdk/src/clients/consumer.rs core/sdk/src/clients/consumer.rs:1416— core/sdk/src/clients/consumer.rs changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in IggyConsumer::poll_next at line 1416. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 06:16:38 +01:00' --until='2026-10-28 06:16:38 +01:00' --full-history --no-merges -- core/sdk/src/clients/consumer.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.Vsr.cs foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.Vsr.cs:178— foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.Vsr.cs changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in TcpMessageStream.LoginRegisterCoreAsync at line 178. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 06:16:38 +01:00' --until='2026-10-28 06:16:38 +01:00' --full-history --no-merges -- foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.Vsr.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Dead code: MaxStackAllocBytes foreign/csharp/Iggy_SDK/Contracts/Tcp/TcpContracts.cs:40— Field MaxStackAllocBytes — Roslyn's SymbolFinder walked every project the solution loads, including Iggy_SDK(net8.0), and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: ErrorFactory foreign/csharp/Iggy_SDK/Errors/ErrorFactory.cs:22— NamedType ErrorFactory — Roslyn's SymbolFinder walked every project the solution loads, including Iggy_SDK(net8.0), and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: IoError foreign/csharp/Iggy_SDK/Errors/ErrorFactory.cs:97— Method IoError — Roslyn's SymbolFinder walked every project the solution loads, including Iggy_SDK(net8.0), and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: CannotCreateStreamDirectory foreign/csharp/Iggy_SDK/Errors/ErrorFactory.cs:102— Method CannotCreateStreamDirectory — Roslyn's SymbolFinder walked every project the solution loads, including Iggy_SDK(net8.0), and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: CannotCreateStreamInfo foreign/csharp/Iggy_SDK/Errors/ErrorFactory.cs:108— Method CannotCreateStreamInfo — Roslyn's SymbolFinder walked every project the solution loads, including Iggy_SDK(net8.0), and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: CannotUpdateStreamInfo foreign/csharp/Iggy_SDK/Errors/ErrorFactory.cs:114— Method CannotUpdateStreamInfo — Roslyn's SymbolFinder walked every project the solution loads, including Iggy_SDK(net8.0), and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: CannotOpenStreamInfo foreign/csharp/Iggy_SDK/Errors/ErrorFactory.cs:120— Method CannotOpenStreamInfo — Roslyn's SymbolFinder walked every project the solution loads, including Iggy_SDK(net8.0), and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: CannotReadStreamInfo foreign/csharp/Iggy_SDK/Errors/ErrorFactory.cs:126— Method CannotReadStreamInfo — Roslyn's SymbolFinder walked every project the solution loads, including Iggy_SDK(net8.0), and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: CannotCreateStream foreign/csharp/Iggy_SDK/Errors/ErrorFactory.cs:132— Method CannotCreateStream — Roslyn's SymbolFinder walked every project the solution loads, including Iggy_SDK(net8.0), and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: CannotDeleteStream foreign/csharp/Iggy_SDK/Errors/ErrorFactory.cs:137— Method CannotDeleteStream — Roslyn's SymbolFinder walked every project the solution loads, including Iggy_SDK(net8.0), and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: CannotDeleteStreamDirectory foreign/csharp/Iggy_SDK/Errors/ErrorFactory.cs:142— Method CannotDeleteStreamDirectory — Roslyn's SymbolFinder walked every project the solution loads, including Iggy_SDK(net8.0), and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: StreamNotFound foreign/csharp/Iggy_SDK/Errors/ErrorFactory.cs:148— Method StreamNotFound — Roslyn's SymbolFinder walked every project the solution loads, including Iggy_SDK(net8.0), and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: StreamAlreadyExists foreign/csharp/Iggy_SDK/Errors/ErrorFactory.cs:153— Method StreamAlreadyExists — Roslyn's SymbolFinder walked every project the solution loads, including Iggy_SDK(net8.0), and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: CannotCreateTopicsDirectory foreign/csharp/Iggy_SDK/Errors/ErrorFactory.cs:158— Method CannotCreateTopicsDirectory — Roslyn's SymbolFinder walked every project the solution loads, including Iggy_SDK(net8.0), and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: CannotCreateTopicDirectory foreign/csharp/Iggy_SDK/Errors/ErrorFactory.cs:164— Method CannotCreateTopicDirectory — Roslyn's SymbolFinder walked every project the solution loads, including Iggy_SDK(net8.0), and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: CannotCreateTopicInfo foreign/csharp/Iggy_SDK/Errors/ErrorFactory.cs:170— Method CannotCreateTopicInfo — Roslyn's SymbolFinder walked every project the solution loads, including Iggy_SDK(net8.0), and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: CannotUpdateTopicInfo foreign/csharp/Iggy_SDK/Errors/ErrorFactory.cs:176— Method CannotUpdateTopicInfo — Roslyn's SymbolFinder walked every project the solution loads, including Iggy_SDK(net8.0), and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: CannotOpenTopicInfo foreign/csharp/Iggy_SDK/Errors/ErrorFactory.cs:182— Method CannotOpenTopicInfo — Roslyn's SymbolFinder walked every project the solution loads, including Iggy_SDK(net8.0), and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: CannotReadTopicInfo foreign/csharp/Iggy_SDK/Errors/ErrorFactory.cs:188— Method CannotReadTopicInfo — Roslyn's SymbolFinder walked every project the solution loads, including Iggy_SDK(net8.0), and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: CannotCreateTopic foreign/csharp/Iggy_SDK/Errors/ErrorFactory.cs:194— Method CannotCreateTopic — Roslyn's SymbolFinder walked every project the solution loads, including Iggy_SDK(net8.0), and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: CannotDeleteTopic foreign/csharp/Iggy_SDK/Errors/ErrorFactory.cs:200— Method CannotDeleteTopic — Roslyn's SymbolFinder walked every project the solution loads, including Iggy_SDK(net8.0), and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: CannotDeleteTopicDirectory foreign/csharp/Iggy_SDK/Errors/ErrorFactory.cs:206— Method CannotDeleteTopicDirectory — Roslyn's SymbolFinder walked every project the solution loads, including Iggy_SDK(net8.0), and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: TopicNotFound foreign/csharp/Iggy_SDK/Errors/ErrorFactory.cs:212— Method TopicNotFound — Roslyn's SymbolFinder walked every project the solution loads, including Iggy_SDK(net8.0), and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: TopicAlreadyExists foreign/csharp/Iggy_SDK/Errors/ErrorFactory.cs:218— Method TopicAlreadyExists — Roslyn's SymbolFinder walked every project the solution loads, including Iggy_SDK(net8.0), and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: CannotCreatePartition foreign/csharp/Iggy_SDK/Errors/ErrorFactory.cs:224— Method CannotCreatePartition — Roslyn's SymbolFinder walked every project the solution loads, including Iggy_SDK(net8.0), and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
TooManyMethods: IggyPartition core/partitions/src/iggy_partition.rs:124— TooManyMethods — 409 methods, declared across 2 files: src/iggy_partition.rs (375), src/state_transfer.rs (34). The bar is 30 methods; this is 379 over it, 13.63× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: IggyShard core/shard/src/lib.rs:1596— TooManyMethods — 203 methods, declared across 6 files: REDACTED (149), poll/deferred.rs (23), src/router.rs (14), src/primary_rebalance.rs (11), +2 more file(s). The bar is 30 methods; this is 173 over it, 6.77× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: VsrConsensus core/consensus/src/impls.rs:1281— TooManyMethods — 186 methods. The bar is 30 methods; this is 156 over it, 6.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: TcpMessageStream foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.cs— TooManyMethods — 1897 significant lines (blank, comment-only and punctuation-only lines excluded), 155 methods, declared across 4 files: Implementations/TcpMessageStream.cs (86), Implementations/TcpMessageStream.PollRouting.cs (28), Implementations/TcpMessageStream.ReplicaLinks.cs (22), Implementations/TcpMessageStream.Vsr.cs (19). The bar is 30 methods; this is 125 over it, 5.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: IggyTcpClient REDACTED:46— TooManyMethods — 108 methods, declared across 17 files: tcp/tcp_session_management.go (19), REDACTED (18), tcp/tcp_driver.go (11), tcp/tcp_user_management.go (9), +13 more file(s). The bar is 30 methods; this is 78 over it, 3.60× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: AsyncTcpConnection foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/AsyncTcpConnection.java:93— TooManyMethods — 99 methods. The bar is 30 methods; this is 69 over it, 3.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: BinaryMapper foreign/csharp/Iggy_SDK/Mappers/BinaryMapper.cs— TooManyMethods — 1221 significant lines (blank, comment-only and punctuation-only lines excluded), 77 methods, declared across 2 files: Mappers/BinaryMapper.cs (47), Mappers/BinaryMapper.MetadataChanges.cs (30). The bar is 30 methods; this is 47 over it, 2.57× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: IggyClient foreign/swift/Sources/Iggy/Client/IggyClient.swift:63— TooManyMethods — 77 methods, declared across 5 files: Client/IggyClient+Resources.swift (33), Client/IggyClient.swift (25), Client/IggyClient+Messages.swift (16), Consumer/IggyConsumer.swift (2), +1 more file(s). The bar is 30 methods; this is 47 over it, 2.57× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: AsyncIggyTcpClient foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/AsyncIggyTcpClient.java:145— TooManyMethods — 70 methods. The bar is 30 methods; this is 40 over it, 2.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: HttpMessageStream foreign/csharp/Iggy_SDK/IggyClient/Implementations/HttpMessageStream.cs— TooManyMethods — 513 significant lines (blank, comment-only and punctuation-only lines excluded), 68 methods. The bar is 30 methods; this is 38 over it, 2.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: IggyMetadata core/metadata/src/impls/metadata.rs:1170— TooManyMethods — 68 methods. The bar is 30 methods; this is 38 over it, 2.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: PartitionPersistence core/partitions/src/persistence.rs:130— TooManyMethods — 68 methods. The bar is 30 methods; this is 38 over it, 2.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: PollRouter foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/PollRouter.java:81— TooManyMethods — 67 methods. The bar is 30 methods; this is 37 over it, 2.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ClientCore foreign/swift/Sources/Iggy/Client/ClientCore.swift:38— TooManyMethods — 65 methods. The bar is 30 methods; this is 35 over it, 2.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: PartitionPrepareJournal core/journal/src/partition_journal.rs:109— TooManyMethods — 65 methods, declared across 2 files: src/partition_journal.rs (44), partition_journal/segments.rs (21). The bar is 30 methods; this is 35 over it, 2.17× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: TestHarness core/integration/src/harness/orchestrator/harness.rs:47— TooManyMethods — 63 methods. The bar is 30 methods; this is 33 over it, 2.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ServerHandle core/integration/src/harness/handle/server.rs:88— TooManyMethods — 61 methods. The bar is 30 methods; this is 31 over it, 2.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: IggyConsumer foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs— TooManyMethods — 622 significant lines (blank, comment-only and punctuation-only lines excluded), 58 methods, declared across 3 files: Consumers/IggyConsumer.cs (31), Consumers/IggyConsumer.Logging.cs (23), Consumers/IggyConsumer.Rented.cs (4). The bar is 30 methods; this is 28 over it, 1.93× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Simulator core/simulator/src/lib.rs:215— TooManyMethods — 57 methods. The bar is 30 methods; this is 27 over it, 1.90× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: IggyBridge gateways/kafka/src/bridge/iggy_bridge/mod.rs:152— TooManyMethods — 57 methods, declared across 7 files: iggy_bridge/group_offsets.rs (15), iggy_bridge/topics.rs (15), iggy_bridge/mod.rs (7), iggy_bridge/cluster_id.rs (6), +3 more file(s). The bar is 30 methods; this is 27 over it, 1.90× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: IggyMessageBus core/message_bus/src/lib.rs:795— TooManyMethods — 56 methods. The bar is 30 methods; this is 26 over it, 1.87× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ConsensusSession foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/vsr/ConsensusSession.java:53— TooManyMethods — 54 methods. The bar is 30 methods; this is 24 over it, 1.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Client foreign/cpp/src/client.rs:117— TooManyMethods — 53 methods. The bar is 30 methods; this is 23 over it, 1.77× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: IggyPartitions core/partitions/src/iggy_partitions.rs:78— TooManyMethods — 52 methods. The bar is 30 methods; this is 22 over it, 1.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ErrorFactory foreign/csharp/Iggy_SDK/Errors/ErrorFactory.cs— TooManyMethods — 184 significant lines (blank, comment-only and punctuation-only lines excluded), 50 methods. The bar is 30 methods; this is 20 over it, 1.67× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
ClassTooLong: IggyShard core/shard/src/lib.rs:1596— ClassTooLong — 5547 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 203 methods, 3 blocks, lines 1596-11666. The bar is 400 significant lines; this is 5147 over it, 13.87× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: VsrConsensus core/consensus/src/impls.rs:1281— ClassTooLong — 2056 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 186 methods, 5 blocks, lines 426-5777. The bar is 400 significant lines; this is 1656 over it, 5.14× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: AsyncTcpConnection foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/AsyncTcpConnection.java:93— ClassTooLong — 1307 significant lines (blank, comment-only and punctuation-only lines excluded), 99 methods. The bar is 400 significant lines; this is 907 over it, 3.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: PollRouter foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/PollRouter.java:81— ClassTooLong — 1159 significant lines (blank, comment-only and punctuation-only lines excluded), 67 methods. The bar is 400 significant lines; this is 759 over it, 2.90× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Simulator core/simulator/src/lib.rs:215— ClassTooLong — 1050 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 57 methods, 2 blocks, lines 215-2061. The bar is 400 significant lines; this is 650 over it, 2.63× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Client foreign/cpp/src/client.rs:117— ClassTooLong — 1041 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 53 methods, 2 blocks, lines 117-1524. The bar is 400 significant lines; this is 641 over it, 2.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: PostgresSource core/connectors/sources/postgres_source/src/lib.rs:57— ClassTooLong — 972 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 34 methods, 4 blocks, lines 57-1550. The bar is 400 significant lines; this is 572 over it, 2.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: AsyncIggyTcpClient foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/AsyncIggyTcpClient.java:145— ClassTooLong — 926 significant lines (blank, comment-only and punctuation-only lines excluded), 70 methods. The bar is 400 significant lines; this is 526 over it, 2.32× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: PartitionPrepareJournal core/journal/src/partition_journal.rs:109— ClassTooLong — 926 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 65 methods, 4 blocks, lines 109-1518. The bar is 400 significant lines; this is 526 over it, 2.32× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: IggyClient foreign/python/src/client.rs:70— ClassTooLong — 907 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 46 methods, 2 blocks, lines 70-1972. The bar is 400 significant lines; this is 507 over it, 2.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: CommandResponseStream foreign/node/src/client/client.socket.ts:145— ClassTooLong — 898 significant lines (blank, comment-only and punctuation-only lines excluded), 40 methods. The bar is 400 significant lines; this is 498 over it, 2.25× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: PartitionPersistence core/partitions/src/persistence.rs:130— ClassTooLong — 839 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 68 methods, 3 blocks, lines 130-1609. The bar is 400 significant lines; this is 439 over it, 2.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ServerHandle core/integration/src/harness/handle/server.rs:88— ClassTooLong — 760 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 61 methods, 8 blocks, lines 88-1387. The bar is 400 significant lines; this is 360 over it, 1.90× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: OperationDriver core/sdk/src/driver.rs:140— ClassTooLong — 759 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 40 methods, 2 blocks, lines 140-1257. The bar is 400 significant lines; this is 359 over it, 1.90× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ClientTable core/consensus/src/client_table.rs:552— ClassTooLong — 731 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 37 methods, 3 blocks, lines 552-1814. The bar is 400 significant lines; this is 331 over it, 1.83× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Streams core/metadata/src/stm/stream.rs:781— ClassTooLong — 723 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 42 methods, 2 blocks, lines 1169-3216. The bar is 400 significant lines; this is 323 over it, 1.81× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: IggyConsumer core/sdk/src/clients/consumer.rs:544— ClassTooLong — 640 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 24 methods, 5 blocks, lines 544-1714. The bar is 400 significant lines; this is 240 over it, 1.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: HttpSink core/connectors/sinks/http_sink/src/lib.rs:203— ClassTooLong — 639 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 14 methods, 3 blocks, lines 203-1252. The bar is 400 significant lines; this is 239 over it, 1.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ConsensusSession foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/vsr/ConsensusSession.java:53— ClassTooLong — 629 significant lines (blank, comment-only and punctuation-only lines excluded), 54 methods. The bar is 400 significant lines; this is 229 over it, 1.57× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Worker core/sdk/src/clients/consumer/deferred.rs:253— ClassTooLong — 615 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 25 methods, 2 blocks, lines 253-1131. The bar is 400 significant lines; this is 215 over it, 1.54× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: IggyError core/common/src/error/iggy_error.rs:40— ClassTooLong — 565 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 5 methods, 3 blocks, lines 40-681. The bar is 400 significant lines; this is 165 over it, 1.41× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: IggyService core/ai/mcp/src/service/mod.rs:48— ClassTooLong — 563 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 42 methods, 3 blocks, lines 48-764. The bar is 400 significant lines; this is 163 over it, 1.41× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: LinksShared core/sdk/src/links/replicas.rs:142— ClassTooLong — 559 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 33 methods, 2 blocks, lines 142-1315. The bar is 400 significant lines; this is 159 over it, 1.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: SimClient core/simulator/src/client.rs:96— ClassTooLong — 557 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 49 methods, 2 blocks, lines 96-1042. The bar is 400 significant lines; this is 157 over it, 1.39× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: PartitionJournal core/partitions/src/journal.rs:157— ClassTooLong — 535 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 39 methods, 6 blocks, lines 157-1223. The bar is 400 significant lines; this is 135 over it, 1.34× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Duplicated block (8 lines × 2) core/ai/mcp/src/service/mod.rs:822— core/ai/mcp/src/service/mod.rs:822-829 | core/cli/src/args/common.rs:161-168 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 2) core/ai/mcp/src/stream.rs:75— core/ai/mcp/src/stream.rs:75-82 | core/connectors/runtime/src/stream.rs:118-125 — before extracting anything, compare `core/ai/mcp/src/stream.rs` and `core/connectors/runtime/src/stream.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) core/binary_protocol/src/requests/users/create_user.rs:59— core/binary_protocol/src/requests/users/create_user.rs:59-66 | core/binary_protocol/src/requests/users/login_user.rs:51-58 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) core/connectors/sinks/http_sink/src/lib.rs:742— core/connectors/sinks/http_sink/src/lib.rs:742-749 | core/connectors/sinks/http_sink/src/lib.rs:824-831 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) core/connectors/sources/mqtt_source/src/driver.rs:1003— core/connectors/sources/mqtt_source/src/driver.rs:1003-1010 | core/connectors/sources/mqtt_source/src/driver.rs:1034-1041 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) core/connectors/sources/postgres_source/src/lib.rs:771— core/connectors/sources/postgres_source/src/lib.rs:771-778 | core/connectors/sources/postgres_source/src/lib.rs:1499-1506 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) core/integration/src/harness/handle/client.rs:116— core/integration/src/harness/handle/client.rs:116-123 | core/integration/src/harness/handle/client.rs:189-196 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) core/metadata/src/impls/metadata.rs:3544— core/metadata/src/impls/metadata.rs:3544-3552 | core/metadata/src/impls/metadata.rs:3598-3605 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) core/partitions/src/journal.rs:657— core/partitions/src/journal.rs:657-664 | core/partitions/src/journal.rs:1200-1207 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) core/partitions/src/persistence.rs:334— core/partitions/src/persistence.rs:334-341 | core/partitions/src/persistence.rs:374-381 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) core/server/src/rewrite.rs:155— core/server/src/rewrite.rs:155-163 | core/server/src/rewrite.rs:200-207 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) core/simulator/src/client.rs:990— core/simulator/src/client.rs:990-997 | core/simulator/src/client.rs:1011-1018 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) core/simulator/src/lib.rs:666— core/simulator/src/lib.rs:666-673 | core/simulator/src/lib.rs:703-710 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) gateways/kafka/src/bridge/iggy_bridge/topics.rs:302— gateways/kafka/src/bridge/iggy_bridge/topics.rs:302-309 | gateways/kafka/src/bridge/iggy_bridge/topics.rs:518-525 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) gateways/kafka/src/protocol/handlers/alter_configs.rs:301— gateways/kafka/src/protocol/handlers/alter_configs.rs:301-308 | gateways/kafka/src/protocol/handlers/incremental_alter_configs.rs:318-325 — before extracting anything, compare `gateways/kafka/src/protocol/handlers/alter_configs.rs` and `gateways/kafka/src/protocol/handlers/incremental_alter_configs.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 84 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) gateways/kafka/tools/kafka-tool/src/response.rs:306— gateways/kafka/tools/kafka-tool/src/response.rs:306-313 | gateways/kafka/tools/kafka-tool/src/response.rs:330-337 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) core/common/src/types/message/deferred_poll_options.rs:101— core/common/src/types/message/deferred_poll_options.rs:101-108 | core/server/src/http/wire.rs:148-155 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 2) core/connectors/sdk/src/decoders/proto.rs:85— core/connectors/sdk/src/decoders/proto.rs:85-92 | core/connectors/sdk/src/encoders/proto.rs:107-114 — `core/connectors/sdk/src/decoders/proto.rs` and `core/connectors/sdk/src/encoders/proto.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 116 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (8 lines × 2) foreign/python/src/config.rs:1578— foreign/python/src/config.rs:1578-1585 | foreign/python/src/producer.rs:879-886 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) core/cli/src/commands/binary_consumer_groups/get_consumer_groups.rs:33— core/cli/src/commands/binary_consumer_groups/get_consumer_groups.rs:33-40 | core/cli/src/commands/binary_topics/get_topics.rs:33-40 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 2) core/connectors/runtime/src/sink.rs:530— core/connectors/runtime/src/sink.rs:530-537 | core/connectors/runtime/src/source.rs:296-303 — before extracting anything, compare `core/connectors/runtime/src/sink.rs` and `core/connectors/runtime/src/source.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) core/simulator/src/workload/ops/delete_personal_access_token.rs:68— core/simulator/src/workload/ops/delete_personal_access_token.rs:68-75 | core/simulator/src/workload/ops/delete_stream.rs:68-75 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) core/cli/src/commands/binary_users/change_password.rs:65— core/cli/src/commands/binary_users/change_password.rs:65-72 | core/cli/src/commands/binary_users/change_password.rs:78-85 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) foreign/python/src/config.rs:457— foreign/python/src/config.rs:457-464 | foreign/python/src/config.rs:1499-1506 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) core/cli/src/commands/binary_streams/update_stream.rs:45— core/cli/src/commands/binary_streams/update_stream.rs:45-52 | core/cli/src/commands/binary_topics/update_topic.rs:55-62 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Awaits without ConfigureAwait(false) — Only 0/376 awaits in library code use ConfigureAwait(false). A library that captures the caller's context can stall or deadlock its host — the classic way a dependency drags an app down.
Awaits without ConfigureAwait(false) foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:148— `await _connectionStateSemaphore.WaitAsync()` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`.
Awaits without ConfigureAwait(false) foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:156— `await _offsetSemaphore.WaitAsync()` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`.
Awaits without ConfigureAwait(false) foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:175— `await WithLaneRecoveryAsync(token => _client.StoreOffsetAsync(_config.Consumer, _co...` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`.
Awaits without ConfigureAwait(false) foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:193— `await LeaveConsumerGroupAsync(_consumerGroupName)` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`.
Awaits without ConfigureAwait(false) foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:204— `await _client.LogoutUserAsync()` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`.
Awaits without ConfigureAwait(false) foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:282— `await _connectionStateSemaphore.WaitAsync(ct)` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`.
Awaits without ConfigureAwait(false) foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:297— `await _client.ConnectAsync(ct)` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`.
Awaits without ConfigureAwait(false) foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:301— `await _client.LoginUserAsync(_config.Login, _config.Password, ct)` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`.
Awaits without ConfigureAwait(false) foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:304— `await InitializeConsumerGroupAsync(ct)` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`.
Awaits without ConfigureAwait(false) foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:341— `await PollMessagesAsync(ct)` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`.
Awaits without ConfigureAwait(false) foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:353— `await CommitDeliveredAsync(message.CurrentOffset, message.PartitionId, message.Cont...` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`.
Awaits without ConfigureAwait(false) foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:380— `await StoreOffsetCoreAsync(offset, partitionId, context, ct)` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`.
Awaits without ConfigureAwait(false) foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:401— `await StoreOffsetCoreAsync(offset, partitionId, context, ct)` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`.
Awaits without ConfigureAwait(false) foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:412— `await _offsetSemaphore.WaitAsync(cancellation.Token)` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`.
Awaits without ConfigureAwait(false) foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:417— `await WithLaneRecoveryAsync(token => context is { } captured ? _client.StoreOffsetA...` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`.
Awaits without ConfigureAwait(false) foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:449— `await WithLaneRecoveryAsync(token => _client.DeleteOffsetAsync(_config.Consumer, _c...` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`.
Awaits without ConfigureAwait(false) foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:505— `await _client.GetConsumerGroupByIdAsync(_config.StreamId, _config.TopicId, Identifi...` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`.
Awaits without ConfigureAwait(false) foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:512— `await TryCreateConsumerGroupAsync(_consumerGroupName, ct)` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`.
Awaits without ConfigureAwait(false) foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:528— `await _client.JoinConsumerGroupAsync(_config.StreamId, _config.TopicId, Identifier....` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`.
Awaits without ConfigureAwait(false) foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:547— `await _client.LeaveConsumerGroupAsync(_config.StreamId, _config.TopicId, Identifier...` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`.
Awaits without ConfigureAwait(false) foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:564— `await _client.CreateConsumerGroupAsync(_config.StreamId, _config.TopicId, groupName...` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`.
Awaits without ConfigureAwait(false) foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:612— `await TryRecoverGroupMembershipAsync(ct)` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`.
Awaits without ConfigureAwait(false) foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:618— `await _pollingSemaphore.WaitAsync(ct)` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`.
Awaits without ConfigureAwait(false) foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:625— `await WaitBeforePollingAsync(ct)` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`.
+ 15 more in this group — see findings.md.
R4 · Test Coverage· No test reaches this file · ×40
No test reaches this file web/src/lib/components/PermissionsManager.svelte:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web/src/routes/dashboard/changes/+page.svelte:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file scripts/ci/render-node-licenses.mjs:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web/src/lib/actions/tooltip.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web/src/lib/components/Modals/TopicSettingsModal.svelte:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web/src/lib/domain/Stats.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web/src/lib/components/Modals/StreamSettingsModal.svelte:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web/src/lib/components/DurationInput.svelte:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web/src/lib/utils/addOnKeyDownListener.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web/src/lib/components/Modals/DeletePartitionsModal.svelte:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file foreign/node/src/debug-send.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web/src/lib/components/Modals/AddTopicModal.svelte:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web/src/lib/auth/authStore.svelte.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file foreign/node/src/debug.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web/src/lib/components/Modals/AddUserModal.svelte:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web/src/lib/components/Modals/AddStreamModal.svelte:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web/src/lib/components/Modals/InspectMessage.svelte:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web/src/lib/components/Modals/AddPartitionsModal.svelte:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web/src/lib/components/SortableList.svelte:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web/src/lib/components/Modals/EditUserModal.svelte:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web/src/lib/api/clientApi.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web/src/routes/auth/sign-in/+page.svelte:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web/src/lib/domain/Permissions.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file web/src/lib/domain/Message.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
MethodTooLong: TcpMessageStream.RunClientOperationAsync foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.PollRouting.cs:178— MethodTooLong — RunClientOperationAsync runs 266 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 166 over it, 2.66× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: IggyErrorCode.name foreign/swift/Sources/Iggy/Errors/IggyErrorCode.swift:291— MethodTooLong — name runs 262 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 162 over it, 2.62× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ClusterConfig.validate core/configs/src/server_config/cluster.rs:899— MethodTooLong — validate runs 246 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 146 over it, 2.46× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: IggyTcpClient.driveOperation foreign/go/client/tcp/tcp_driver.go:183— MethodTooLong — driveOperation runs 223 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 123 over it, 2.23× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: IggyMetadata.install_state_transfer core/metadata/src/impls/metadata.rs:2494— MethodTooLong — install_state_transfer runs 222 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 122 over it, 2.22× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CommandResponseStream.drive foreign/node/src/client/client.socket.ts:282— MethodTooLong — drive runs 222 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 122 over it, 2.22× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: IggyShard.on_partition_read core/shard/src/poll.rs:163— MethodTooLong — on_partition_read runs 216 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 116 over it, 2.16× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ServerConfig.validate core/configs/src/server_config/validators.rs:51— MethodTooLong — validate runs 213 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 113 over it, 2.13× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Projection.project core/metadata/src/change_log/current.rs:179— MethodTooLong — project runs 172 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 72 over it, 1.72× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Simulator.build_inner core/simulator/src/lib.rs:393— MethodTooLong — build_inner runs 165 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 65 over it, 1.65× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ShardMetrics.register core/shard/src/metrics.rs:1045— MethodTooLong — register runs 154 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 54 over it, 1.54× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: IggyShard.on_partition_state_transfer_target core/shard/src/lib.rs:10407— MethodTooLong — on_partition_state_transfer_target runs 149 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 49 over it, 1.49× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: InfluxDbSource.poll core/connectors/sources/influxdb_source/src/lib.rs:469— MethodTooLong — poll runs 146 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 46 over it, 1.46× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: IggyShard.on_partition_request_state_chunk core/shard/src/lib.rs:9567— MethodTooLong — on_partition_request_state_chunk runs 145 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 45 over it, 1.45× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: PartitionPrepareJournal.rewrite core/journal/src/partition_journal.rs:1337— MethodTooLong — rewrite runs 143 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 43 over it, 1.43× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: GetStatsCmd.execute_cmd core/cli/src/commands/binary_system/stats.rs:63— MethodTooLong — execute_cmd runs 140 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 40 over it, 1.40× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Workload.on_reply core/simulator/src/workload/mod.rs:662— MethodTooLong — on_reply runs 140 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 40 over it, 1.40× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: StreamsSnapshot.validate_ownership_history core/metadata/src/stm/lifecycle.rs:546— MethodTooLong — validate_ownership_history runs 139 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 39 over it, 1.39× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ShardingConfig.validate core/configs/src/server_config/sharding.rs:234— MethodTooLong — validate runs 138 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 38 over it, 1.38× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: IggyMetadata.prepare_request core/metadata/src/impls/metadata.rs:4847— MethodTooLong — prepare_request runs 136 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 36 over it, 1.36× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: InfluxDbSource.open core/connectors/sources/influxdb_source/src/lib.rs:258— MethodTooLong — open runs 135 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 35 over it, 1.35× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: VsrConsensus.try_handle_start_view core/consensus/src/impls.rs:4443— MethodTooLong — try_handle_start_view runs 131 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 31 over it, 1.31× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: RabbitMQSink.publish_batch_with_retry core/connectors/sinks/rabbitmq_sink/src/lib.rs:193— MethodTooLong — publish_batch_with_retry runs 127 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 27 over it, 1.27× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Simulator.replica_restart_losing_partitions core/simulator/src/lib.rs:1502— MethodTooLong — replica_restart_losing_partitions runs 125 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 25 over it, 1.25× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: IggyShard.on_partition_transfer_progress core/shard/src/lib.rs:10710— MethodTooLong — on_partition_transfer_progress runs 124 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 24 over it, 1.24× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: iggy_swift_golden_vectors::main REDACTED:363— FunctionTooLong — iggy_swift_golden_vectors::main runs 1061 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 961 over it, 10.61× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: server::boot::shard_main core/server/src/boot/mod.rs:512— FunctionTooLong — server::boot::shard_main runs 392 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 292 over it, 3.92× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: iggy_connector_postgres_source::extract_column_value core/connectors/sources/postgres_source/src/lib.rs:1552— FunctionTooLong — iggy_connector_postgres_source::extract_column_value runs 346 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 246 over it, 3.46× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: kafka_message_gen::build_payload gateways/kafka/tools/kafka-tool/src/main.rs:252— FunctionTooLong — kafka_message_gen::build_payload runs 329 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 229 over it, 3.29× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: simulator::replica::new_shard core/simulator/src/replica.rs:152— FunctionTooLong — simulator::replica::new_shard runs 275 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 175 over it, 2.75× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: iggy_connectors::source::source_forwarding_loop core/connectors/runtime/src/source.rs:567— FunctionTooLong — iggy_connectors::source::source_forwarding_loop runs 252 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 152 over it, 2.52× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: iggy_connector_clickhouse_sink::binary::serialize_value core/connectors/sinks/clickhouse_sink/src/binary.rs:83— FunctionTooLong — iggy_connector_clickhouse_sink::binary::serialize_value runs 251 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 151 over it, 2.51× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: server::partition_helpers::load_partition_or_fence core/server/src/partition_helpers.rs:177— FunctionTooLong — server::partition_helpers::load_partition_or_fence runs 241 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 141 over it, 2.41× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: server::boot::recovery::build_shard_for_thread core/server/src/boot/recovery.rs:98— FunctionTooLong — server::boot::recovery::build_shard_for_thread runs 225 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 125 over it, 2.25× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: kafka_message_gen::response::decode_body gateways/kafka/tools/kafka-tool/src/response.rs:208— FunctionTooLong — kafka_message_gen::response::decode_body runs 194 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 94 over it, 1.94× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: iggy_cli::get_command core/cli/src/main.rs:113— FunctionTooLong — iggy_cli::get_command runs 193 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 93 over it, 1.93× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: iggy_connectors::sink::process_messages core/connectors/runtime/src/sink.rs:650— FunctionTooLong — iggy_connectors::sink::process_messages runs 177 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 77 over it, 1.77× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: iggy_connector_influxdb_source::v3::poll core/connectors/sources/influxdb_source/src/v3.rs:439— FunctionTooLong — iggy_connector_influxdb_source::v3::poll runs 177 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 77 over it, 1.77× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: partitions::segment_recovery::load_persisted_segments_with_checkpoint core/partitions/src/segment_recovery.rs:596— FunctionTooLong — partitions::segment_recovery::load_persisted_segments_with_checkpoint runs 177 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 77 over it, 1.77× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: server::partition_reconciler::reconcile_additions core/server/src/partition_reconciler.rs:673— FunctionTooLong — server::partition_reconciler::reconcile_additions runs 169 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 69 over it, 1.69× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: server::partition_helpers::load_partition core/server/src/partition_helpers.rs:550— FunctionTooLong — server::partition_helpers::load_partition runs 166 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 66 over it, 1.66× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: partitions::segment_recovery::recover_segment_bounds core/partitions/src/segment_recovery.rs:1660— FunctionTooLong — partitions::segment_recovery::recover_segment_bounds runs 160 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 60 over it, 1.60× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: apache_iggy::metadata_changes::change_body foreign/python/src/metadata_changes.rs:1419— FunctionTooLong — apache_iggy::metadata_changes::change_body runs 153 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 53 over it, 1.53× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: metadata::stm::authz::authorize core/metadata/src/stm/authz.rs:241— FunctionTooLong — metadata::stm::authz::authorize runs 141 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 41 over it, 1.41× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: message_bus::replica::handshake::acceptor_handshake core/message_bus/src/replica/handshake.rs:150— FunctionTooLong — message_bus::replica::handshake::acceptor_handshake runs 139 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 39 over it, 1.39× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: iggy_connectors::source::init core/connectors/runtime/src/source.rs:112— FunctionTooLong — iggy_connectors::source::init runs 137 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 37 over it, 1.37× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: iggy_connectors::run core/connectors/runtime/src/main.rs:202— FunctionTooLong — iggy_connectors::run runs 136 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 36 over it, 1.36× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: server::partition_helpers::build_partition_fresh core/server/src/partition_helpers.rs:927— FunctionTooLong — server::partition_helpers::build_partition_fresh runs 131 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 31 over it, 1.31× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: message_bus::installer::replica::install_replica_conn core/message_bus/src/installer/replica.rs:393— FunctionTooLong — message_bus::installer::replica::install_replica_conn runs 129 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 29 over it, 1.29× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: server::boot::bootstrap core/server/src/boot/mod.rs:283— FunctionTooLong — server::boot::bootstrap runs 126 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 26 over it, 1.26× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
IggyPartition::on_request (cognitive 120) core/partitions/src/iggy_partition.rs:7120— IggyPartition::on_request has cognitive complexity 120 (threshold 15). Drivers by points: if/else 51 (76 pts), boolean chains 24, match/switch 11 (20 pts) (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.
IggyPartition::resume_io_inner (cognitive 110) core/partitions/src/iggy_partition.rs:5992— IggyPartition::resume_io_inner has cognitive complexity 110 (threshold 15). Drivers by points: if/else 49 (78 pts), boolean chains 22, match/switch 5 (10 pts) (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.
IggyPartition::drain_request_queue_into_prepares (cognitive 83) core/partitions/src/iggy_partition.rs:7920— IggyPartition::drain_request_queue_into_prepares has cognitive complexity 83 (threshold 15). Drivers by points: if/else 29 (72 pts), boolean chains 7, match/switch 1 (3 pts), loops 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.
IggyPartition::on_replicate (cognitive 74) core/partitions/src/iggy_partition.rs:8302— IggyPartition::on_replicate has cognitive complexity 74 (threshold 15). Drivers by points: if/else 39 (62 pts), boolean chains 10, match/switch 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.
IggyPartition::drive_install_io (cognitive 41) core/partitions/src/state_transfer.rs:3434— IggyPartition::drive_install_io has cognitive complexity 41 (threshold 15). Drivers by points: if/else 15 (29 pts), match/switch 5 (10 pts), boolean chains 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IggyPartition::prepare_state_transfer_install (cognitive 33) core/partitions/src/state_transfer.rs:4296— IggyPartition::prepare_state_transfer_install has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17 (20 pts), boolean chains 12, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
IggyPartition::resynchronize_consumer_offset_reservations_inner (cognitive 31) core/partitions/src/iggy_partition.rs:5301— IggyPartition::resynchronize_consumer_offset_reservations_inner has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 10, loops 3 (5 pts), match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
IggyPartition::open_persistence_with_recovered (cognitive 29) core/partitions/src/iggy_partition.rs:1608— IggyPartition::open_persistence_with_recovered has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (22 pts), loops 4 (5 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IggyPartition::reanchor_to_offset_frontier (cognitive 29) core/partitions/src/iggy_partition.rs:12173— IggyPartition::reanchor_to_offset_frontier has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 5, loops 3 (5 pts), match/switch 2 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IggyPartition::drive_committed_offsets (cognitive 25) core/partitions/src/iggy_partition.rs:10537— IggyPartition::drive_committed_offsets has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 1 (4 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IggyPartition::publish_pending_commit (cognitive 25) core/partitions/src/iggy_partition.rs:11051— IggyPartition::publish_pending_commit has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 6 (9 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IggyPartition::accept_install_io (cognitive 24) core/partitions/src/state_transfer.rs:3942— IggyPartition::accept_install_io has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 4 (9 pts), match/switch 4 (6 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IggyPartition::accept_commit_phase (cognitive 23) core/partitions/src/iggy_partition.rs:10765— IggyPartition::accept_commit_phase has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 1 (3 pts), match/switch 1 (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
IggyPartition::complete_repair (cognitive 23) core/partitions/src/iggy_partition.rs:12610— IggyPartition::complete_repair has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
IggyPartition::reuse_staged_segments (cognitive 23) core/partitions/src/state_transfer.rs:3267— IggyPartition::reuse_staged_segments has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 2 (3 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IggyPartition::drive_quarantine_io (cognitive 22) core/partitions/src/iggy_partition.rs:1499— IggyPartition::drive_quarantine_io has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 4 (9 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IggyPartition::apply_repaired_prepare (cognitive 22) core/partitions/src/iggy_partition.rs:12474— IggyPartition::apply_repaired_prepare has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14, boolean chains 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.
IggyPartition::drive_no_ack (cognitive 21) core/partitions/src/iggy_partition.rs:4941— IggyPartition::drive_no_ack has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (18 pts), match/switch 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IggyPartition::build_poll_plan (cognitive 21) core/partitions/src/iggy_partition.rs:5502— IggyPartition::build_poll_plan has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (10 pts), match/switch 6 (8 pts), boolean chains 3 (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.
IggyPartition::handle_committed_entries (cognitive 20) core/partitions/src/iggy_partition.rs:10363— IggyPartition::handle_committed_entries has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 3 (7 pts), 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.
IggyPartition::complete_poll (cognitive 19) core/partitions/src/iggy_partition.rs:4225— IggyPartition::complete_poll has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IggyPartition::persistence_checkpoint_files (cognitive 18) core/partitions/src/iggy_partition.rs:1957— IggyPartition::persistence_checkpoint_files has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 4 (5 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IggyPartition::ensure_wal_view (cognitive 18) core/partitions/src/iggy_partition.rs:2343— IggyPartition::ensure_wal_view has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 4 (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.
IggyPartition::persist_repaired_prefix_through (cognitive 18) core/partitions/src/iggy_partition.rs:2456— IggyPartition::persist_repaired_prefix_through has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (16 pts), 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.
IggyPartition::accept_io (cognitive 18) core/partitions/src/iggy_partition.rs:6469— IggyPartition::accept_io has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 3, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Duplicated block (11 lines × 2) core/ai/mcp/src/log.rs:127— core/ai/mcp/src/log.rs:127-137 | core/connectors/runtime/src/log.rs:83-93 — before extracting anything, compare `core/ai/mcp/src/log.rs` and `core/connectors/runtime/src/log.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 87 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) core/ai/mcp/src/stream.rs:26— core/ai/mcp/src/stream.rs:26-36 | core/connectors/runtime/src/stream.rs:37-47 — before extracting anything, compare `core/ai/mcp/src/stream.rs` and `core/connectors/runtime/src/stream.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) core/common/src/types/configuration/quic_config/quic_connection_string_options.rs:216— core/common/src/types/configuration/quic_config/quic_connection_string_options.rs:216-226 | core/common/src/types/configuration/tcp_config/tcp_connection_string_options.rs:129-139 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (11 lines × 2) core/common/src/types/permissions/permissions_global.rs:254— core/common/src/types/permissions/permissions_global.rs:254-264 | core/common/src/types/permissions/permissions_global.rs:278-288 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) core/configs/src/configs_impl/typed_env_provider.rs:399— core/configs/src/configs_impl/typed_env_provider.rs:399-409 | core/integration/src/harness/config/resolve.rs:185-195 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (11 lines × 2) core/connectors/sinks/postgres_sink/src/lib.rs:542— core/connectors/sinks/postgres_sink/src/lib.rs:542-552 | REDACTED:1055-1065 — before extracting anything, compare `core/connectors/sinks/postgres_sink/src/lib.rs` and `REDACTED` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) core/message_bus/src/transports/tcp_tls.rs:258— core/message_bus/src/transports/tcp_tls.rs:258-268 | core/message_bus/src/transports/wss.rs:258-268 — before extracting anything, compare `core/message_bus/src/transports/tcp_tls.rs` and `core/message_bus/src/transports/wss.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) core/message_bus/src/transports/ws.rs:253— core/message_bus/src/transports/ws.rs:253-263 | core/message_bus/src/transports/wss.rs:404-414 — before extracting anything, compare `core/message_bus/src/transports/ws.rs` and `core/message_bus/src/transports/wss.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 101 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) core/partitions/src/journal.rs:236— core/partitions/src/journal.rs:236-246 | core/partitions/src/journal.rs:853-863 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) core/shard/src/lib.rs:8185— core/shard/src/lib.rs:8185-8195 | core/shard/src/lib.rs:9748-9758 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) gateways/kafka/src/protocol/handlers/alter_configs.rs:103— gateways/kafka/src/protocol/handlers/alter_configs.rs:103-113 | gateways/kafka/src/protocol/handlers/incremental_alter_configs.rs:121-131 — before extracting anything, compare `gateways/kafka/src/protocol/handlers/alter_configs.rs` and `gateways/kafka/src/protocol/handlers/incremental_alter_configs.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 84 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) core/connectors/sdk/src/decoders/avro.rs:190— core/connectors/sdk/src/decoders/avro.rs:190-200 | core/connectors/sdk/src/decoders/flatbuffer.rs:133-143 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) core/connectors/runtime/src/api/sink.rs:160— core/connectors/runtime/src/api/sink.rs:160-170 | core/connectors/runtime/src/api/source.rs:163-173 — before extracting anything, compare `core/connectors/runtime/src/api/sink.rs` and `core/connectors/runtime/src/api/source.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) core/connectors/runtime/src/api/sink.rs:211— core/connectors/runtime/src/api/sink.rs:211-221 | core/connectors/runtime/src/api/source.rs:214-224 — before extracting anything, compare `core/connectors/runtime/src/api/sink.rs` and `core/connectors/runtime/src/api/source.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) core/partitions/src/iggy_partition.rs:7748— core/partitions/src/iggy_partition.rs:7748-7764 | core/partitions/src/iggy_partition.rs:7787-7797 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) gateways/kafka/src/protocol/handlers/alter_configs.rs:99— gateways/kafka/src/protocol/handlers/alter_configs.rs:99-109 | gateways/kafka/src/protocol/handlers/describe_configs.rs:95-105 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) core/connectors/sources/mqtt_source/src/driver.rs:884— core/connectors/sources/mqtt_source/src/driver.rs:884-894 | core/connectors/sources/mqtt_source/src/driver.rs:954-964 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) core/integration/src/harness/handle/client_builder.rs:189— core/integration/src/harness/handle/client_builder.rs:189-199 | core/integration/src/harness/handle/client_builder.rs:256-266 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) core/connectors/runtime/src/context.rs:95— core/connectors/runtime/src/context.rs:95-105 | core/connectors/runtime/src/context.rs:141-151 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) gateways/kafka/src/protocol/handlers/fetch.rs:112— gateways/kafka/src/protocol/handlers/fetch.rs:112-122 | gateways/kafka/src/protocol/handlers/list_offsets.rs:85-95 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) core/connectors/runtime/src/sink.rs:77— core/connectors/runtime/src/sink.rs:77-87 | core/connectors/runtime/src/source.rs:130-140 — before extracting anything, compare `core/connectors/runtime/src/sink.rs` and `core/connectors/runtime/src/source.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) core/partitions/src/segment_recovery.rs:1591— core/partitions/src/segment_recovery.rs:1591-1601 | core/partitions/src/segment_recovery.rs:2494-2504 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) gateways/kafka/src/protocol/bounds_guard.rs:287— gateways/kafka/src/protocol/bounds_guard.rs:287-297 | gateways/kafka/src/protocol/bounds_guard.rs:330-340 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) foreign/java/java-sdk/src/main/java/org/apache/iggy/client/blocking/http/MetadataChangesJson.java:150— foreign/java/java-sdk/src/main/java/org/apache/iggy/client/blocking/http/MetadataChangesJson.java:150-160 | foreign/java/java-sdk/src/main/java/org/apache/iggy/serde/MetadataChangesReader.java:192-202 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `body` to `JsonNode` in one and `ByteBuf` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (11 lines × 2) foreign/java/java-sdk/src/main/java/org/apache/iggy/serde/BytesSerializer.java:153— foreign/java/java-sdk/src/main/java/org/apache/iggy/serde/BytesSerializer.java:153-163 | foreign/java/java-sdk/src/main/java/org/apache/iggy/serde/BytesSerializer.java:266-276 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `foreign/java/java-sdk/src/main/java/org/apache/iggy/serde/BytesSerializer.java:153` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (9 lines × 2) core/ai/mcp/src/api.rs:166— core/ai/mcp/src/api.rs:166-176 | core/connectors/runtime/src/api/mod.rs:121-129 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 2) core/ai/mcp/src/log.rs:85— core/ai/mcp/src/log.rs:85-93 | core/ai/mcp/src/log.rs:96-104 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) core/binary_protocol/src/framing.rs:106— core/binary_protocol/src/framing.rs:106-114 | core/binary_protocol/src/framing.rs:182-190 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) core/binary_protocol/src/primitives/metadata_changes/body.rs:808— core/binary_protocol/src/primitives/metadata_changes/body.rs:808-816 | core/binary_protocol/src/primitives/metadata_changes/body.rs:888-896 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) core/binary_protocol/src/primitives/metadata_changes/body.rs:834— core/binary_protocol/src/primitives/metadata_changes/body.rs:834-842 | core/binary_protocol/src/primitives/metadata_changes/body.rs:914-922 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) core/binary_protocol/src/requests/users/create_user.rs:68— core/binary_protocol/src/requests/users/create_user.rs:68-76 | core/binary_protocol/src/requests/users/update_permissions.rs:47-55 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) core/cli/src/args/permissions/global.rs:113— core/cli/src/args/permissions/global.rs:113-121 | core/cli/src/args/permissions/topic.rs:106-114 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) core/connectors/runtime/src/manager/sink.rs:44— core/connectors/runtime/src/manager/sink.rs:44-52 | core/connectors/runtime/src/manager/source.rs:52-60 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) core/connectors/runtime/src/manager/sink.rs:120— core/connectors/runtime/src/manager/sink.rs:120-128 | core/connectors/runtime/src/manager/sink.rs:259-267 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) core/connectors/runtime/src/manager/source.rs:152— core/connectors/runtime/src/manager/source.rs:152-160 | core/connectors/runtime/src/manager/source.rs:335-343 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) core/connectors/sources/http_source/src/management.rs:330— core/connectors/sources/http_source/src/management.rs:330-338 | core/connectors/sources/http_source/src/management.rs:376-387 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) core/server_common/src/send_messages.rs:322— core/server_common/src/send_messages.rs:322-330 | core/server_common/src/send_messages.rs:385-393 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) core/shard/src/lib.rs:3892— core/shard/src/lib.rs:3892-3900 | core/shard/src/lib.rs:3959-3967 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) core/simulator/src/workload/state_checker.rs:147— core/simulator/src/workload/state_checker.rs:147-155 | core/simulator/src/workload/state_checker.rs:523-531 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) foreign/cpp/src/type_conversion.rs:835— foreign/cpp/src/type_conversion.rs:835-843 | foreign/cpp/src/type_conversion.rs:854-862 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) foreign/cpp/src/type_conversion.rs:886— foreign/cpp/src/type_conversion.rs:886-894 | foreign/cpp/src/type_conversion.rs:910-918 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) foreign/python/src/permissions.rs:67— foreign/python/src/permissions.rs:67-77 | foreign/python/src/permissions.rs:315-323 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) foreign/python/src/producer.rs:574— foreign/python/src/producer.rs:574-582 | foreign/python/src/producer.rs:613-621 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) core/connectors/sdk/src/decoders/avro.rs:76— core/connectors/sdk/src/decoders/avro.rs:76-84 | core/connectors/sdk/src/encoders/avro.rs:69-77 — `core/connectors/sdk/src/decoders/avro.rs` and `core/connectors/sdk/src/encoders/avro.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 59 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 2) core/partitions/src/iggy_partitions.rs:270— core/partitions/src/iggy_partitions.rs:270-278 | core/shard/src/partition_io.rs:226-234 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 2) core/integration/src/harness/handle/client.rs:131— core/integration/src/harness/handle/client.rs:131-139 | core/integration/src/harness/handle/client.rs:156-164 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) core/connectors/runtime/src/sink.rs:68— core/connectors/runtime/src/sink.rs:68-76 | core/connectors/runtime/src/source.rs:121-129 — before extracting anything, compare `core/connectors/runtime/src/sink.rs` and `core/connectors/runtime/src/source.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) core/connectors/runtime/src/configs/connectors/local_provider.rs:469— core/connectors/runtime/src/configs/connectors/local_provider.rs:469-477 | core/connectors/runtime/src/configs/connectors/local_provider.rs:504-512 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) core/metadata/src/impls/metadata.rs:3801— core/metadata/src/impls/metadata.rs:3801-3809 | core/metadata/src/impls/metadata.rs:3905-3913 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) foreign/java/java-sdk/src/main/java/org/apache/iggy/serde/BytesDeserializer.java:102— foreign/java/java-sdk/src/main/java/org/apache/iggy/serde/BytesDeserializer.java:102-110 | foreign/java/java-sdk/src/main/java/org/apache/iggy/serde/BytesDeserializer.java:165-173 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) foreign/csharp/Iggy_SDK/Contracts/Tcp/TcpContracts.cs:46— foreign/csharp/Iggy_SDK/Contracts/Tcp/TcpContracts.cs:46-52 | foreign/csharp/Iggy_SDK/Contracts/Tcp/TcpContracts.cs:55-61 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) core/ai/mcp/src/stream.rs:91— core/ai/mcp/src/stream.rs:91-97 | core/connectors/runtime/src/stream.rs:134-140 — before extracting anything, compare `core/ai/mcp/src/stream.rs` and `core/connectors/runtime/src/stream.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) core/binary_protocol/src/primitives/metadata_changes/body.rs:1071— core/binary_protocol/src/primitives/metadata_changes/body.rs:1071-1077 | core/binary_protocol/src/primitives/metadata_changes/body.rs:1101-1107 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) core/configs/src/configs_impl/parsing.rs:77— core/configs/src/configs_impl/parsing.rs:77-83 | core/connectors/sources/influxdb_source/src/common.rs:475-481 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) core/connectors/runtime/src/configs/connectors/local_provider.rs:600— core/connectors/runtime/src/configs/connectors/local_provider.rs:600-606 | core/connectors/runtime/src/configs/connectors/local_provider.rs:629-635 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) core/connectors/runtime/src/stats.rs:44— core/connectors/runtime/src/stats.rs:44-50 | core/connectors/runtime/src/stats.rs:70-76 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) core/connectors/sdk/src/lib.rs:205— core/connectors/sdk/src/lib.rs:205-211 | core/connectors/sdk/src/lib.rs:349-355 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) core/connectors/sinks/elasticsearch_sink/src/lib.rs:137— core/connectors/sinks/elasticsearch_sink/src/lib.rs:137-143 | core/connectors/sources/elasticsearch_source/src/lib.rs:327-333 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) core/connectors/sources/influxdb_source/src/common.rs:522— core/connectors/sources/influxdb_source/src/common.rs:522-528 | core/connectors/sources/influxdb_source/src/lib.rs:805-811 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7 lines × 2) core/integration/src/harness/handle/server.rs:915— core/integration/src/harness/handle/server.rs:915-921 | core/integration/src/harness/handle/server.rs:926-932 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) core/message_bus/src/installer/replica.rs:560— core/message_bus/src/installer/replica.rs:560-566 | core/message_bus/src/installer/tcp.rs:162-186 — before extracting anything, compare `core/message_bus/src/installer/replica.rs` and `core/message_bus/src/installer/tcp.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 87 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) core/metadata/src/impls/metadata.rs:5299— core/metadata/src/impls/metadata.rs:5299-5305 | core/metadata/src/impls/metadata.rs:5338-5344 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) gateways/kafka/src/group/state.rs:1244— gateways/kafka/src/group/state.rs:1244-1250 | gateways/kafka/src/group/state.rs:1252-1258 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) core/ai/mcp/src/configs.rs:201— core/ai/mcp/src/configs.rs:201-207 | core/connectors/runtime/src/configs/runtime.rs:128-134 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) core/common/src/http/partitions/create_partitions.rs:52— core/common/src/http/partitions/create_partitions.rs:52-58 | core/common/src/http/partitions/delete_partitions.rs:52-58 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7 lines × 2) core/connectors/sdk/src/encoders/proto.rs:512— core/connectors/sdk/src/encoders/proto.rs:512-518 | core/connectors/sdk/src/transforms/proto_convert.rs:455-461 — before extracting anything, compare `core/connectors/sdk/src/encoders/proto.rs` and `core/connectors/sdk/src/transforms/proto_convert.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 102 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) gateways/kafka/src/protocol/handlers/alter_configs.rs:319— gateways/kafka/src/protocol/handlers/alter_configs.rs:319-325 | gateways/kafka/src/protocol/handlers/incremental_alter_configs.rs:336-342 — before extracting anything, compare `gateways/kafka/src/protocol/handlers/alter_configs.rs` and `gateways/kafka/src/protocol/handlers/incremental_alter_configs.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 84 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) core/bench/report/src/types/server_stats.rs:121— core/bench/report/src/types/server_stats.rs:121-127 | core/common/src/types/stats/mod.rs:134-140 — before extracting anything, compare `core/bench/report/src/types/server_stats.rs` and `core/common/src/types/stats/mod.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) core/binary_protocol/src/responses/system/describe_options.rs:142— core/binary_protocol/src/responses/system/describe_options.rs:142-148 | core/binary_protocol/src/responses/topics/get_topics.rs:50-56 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) core/metadata/src/impls/metadata.rs:2186— core/metadata/src/impls/metadata.rs:2186-2192 | core/partitions/src/iggy_partitions.rs:976-982 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) foreign/php/src/client.rs:127— foreign/php/src/client.rs:127-134 | foreign/python/src/client.rs:278-284 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) gateways/kafka/src/protocol/handlers/alter_configs.rs:94— gateways/kafka/src/protocol/handlers/alter_configs.rs:94-100 | gateways/kafka/src/protocol/handlers/incremental_alter_configs.rs:110-118 — before extracting anything, compare `gateways/kafka/src/protocol/handlers/alter_configs.rs` and `gateways/kafka/src/protocol/handlers/incremental_alter_configs.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 84 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) core/common/src/types/consumer/consumer_kind.rs:187— core/common/src/types/consumer/consumer_kind.rs:187-193 | core/server/src/http/jwt.rs:484-490 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) core/binary_protocol/src/batch.rs:301— core/binary_protocol/src/batch.rs:301-307 | core/binary_protocol/src/batch.rs:338-344 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) foreign/swift/Sources/Iggy/Models/IggyMessage.swift:134— foreign/swift/Sources/Iggy/Models/IggyMessage.swift:134-140 | foreign/swift/Sources/Iggy/Models/UserHeaders.swift:310-316 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
IggyShard::tick_partitions (cognitive 197) core/shard/src/lib.rs:8501— IggyShard::tick_partitions has cognitive complexity 197 (threshold 15). Drivers by points: if/else 67 (167 pts), boolean chains 15, loops 7 (9 pts), match/switch 3 (6 pts) (nesting depth added 105). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
IggyShard::on_repair_range_reply (cognitive 71) core/shard/src/lib.rs:6268— IggyShard::on_repair_range_reply has cognitive complexity 71 (threshold 15). Drivers by points: if/else 28 (62 pts), boolean chains 6, match/switch 2 (3 pts) (nesting depth added 35). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
IggyShard::on_primary_rebalance (cognitive 52) core/shard/src/primary_rebalance.rs:408— IggyShard::on_primary_rebalance has cognitive complexity 52 (threshold 15). Drivers by points: if/else 20 (39 pts), boolean chains 10, match/switch 2 (3 pts) (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.
IggyShard::run_message_pump (cognitive 52) core/shard/src/router.rs:313— IggyShard::run_message_pump has cognitive complexity 52 (threshold 15). Drivers by points: if/else 18 (36 pts), match/switch 4 (11 pts), boolean chains 4, loops 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IggyShard::on_start_view (cognitive 49) core/shard/src/lib.rs:5270— IggyShard::on_start_view has cognitive complexity 49 (threshold 15). Drivers by points: if/else 21 (37 pts), boolean chains 11, match/switch 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.
IggyShard::on_request_prepares (cognitive 48) core/shard/src/lib.rs:5742— IggyShard::on_request_prepares has cognitive complexity 48 (threshold 15). Drivers by points: if/else 21 (40 pts), loops 3 (5 pts), boolean chains 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.
IggyShard::on_partition_read (cognitive 48) core/shard/src/poll.rs:163— IggyShard::on_partition_read has cognitive complexity 48 (threshold 15). Drivers by points: if/else 20 (32 pts), boolean chains 10, match/switch 4 (6 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IggyShard::on_repair_prepare (cognitive 47) core/shard/src/lib.rs:5979— IggyShard::on_repair_prepare has cognitive complexity 47 (threshold 15). Drivers by points: if/else 22 (41 pts), boolean chains 6 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IggyShard::on_partition_transfer_progress (cognitive 39) core/shard/src/lib.rs:10710— IggyShard::on_partition_transfer_progress has cognitive complexity 39 (threshold 15). Drivers by points: if/else 20 (27 pts), match/switch 4 (8 pts), boolean chains 3, 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.
IggyShard::flush_partitions (cognitive 39) core/shard/src/router.rs:593— IggyShard::flush_partitions has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (30 pts), loops 3 (5 pts), boolean chains 2, match/switch 1 (2 pts) (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.
IggyShard::service_deferred_polls (cognitive 38) core/shard/src/poll/deferred.rs:801— IggyShard::service_deferred_polls has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (29 pts), loops 2 (5 pts), boolean chains 4 (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.
IggyShard::drain_queued_frames_for_shutdown (cognitive 38) core/shard/src/router.rs:696— IggyShard::drain_queued_frames_for_shutdown has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (34 pts), loops 3 (4 pts) (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.
IggyShard::tick_metadata (cognitive 33) core/shard/src/lib.rs:11433— IggyShard::tick_metadata has cognitive complexity 33 (threshold 15). Drivers by points: if/else 18 (29 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IggyShard::tick_primary_rebalance (cognitive 32) core/shard/src/primary_rebalance.rs:273— IggyShard::tick_primary_rebalance has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 9, loops 2, match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IggyShard::on_transfer_progress (cognitive 28) core/shard/src/lib.rs:8281— IggyShard::on_transfer_progress has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (21 pts), match/switch 4 (6 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IggyShard::service_partition_io (cognitive 27) core/shard/src/partition_io.rs:638— IggyShard::service_partition_io has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (20 pts), match/switch 3 (5 pts), 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.
IggyShard::on_partition_request_state_chunk (cognitive 26) core/shard/src/lib.rs:9567— IggyShard::on_partition_request_state_chunk has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 5 (11 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IggyShard::dispatch_message (cognitive 25) core/shard/src/lib.rs:3693— IggyShard::dispatch_message has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (17 pts), match/switch 3 (5 pts), boolean chains 3 (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
IggyShard::process_lifecycle (cognitive 25) core/shard/src/router.rs:848— IggyShard::process_lifecycle has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (24 pts), match/switch 1 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
IggyShard::on_state_transfer_target (cognitive 23) core/shard/src/lib.rs:7697— IggyShard::on_state_transfer_target has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 2, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IggyShard::on_partition_state_transfer_target (cognitive 21) core/shard/src/lib.rs:10407— IggyShard::on_partition_state_transfer_target has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16 (17 pts), match/switch 2, boolean chains 1, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
IggyShard::wait_for_messages (cognitive 20) core/shard/src/lib.rs:2485— IggyShard::wait_for_messages has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3, boolean chains 2, match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IggyShard::maybe_request_partition_repair (cognitive 20) core/shard/src/lib.rs:10082— IggyShard::maybe_request_partition_repair has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 7 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
IggyShard::advance_pending_partition_view (cognitive 19) core/shard/src/lib.rs:6770— IggyShard::advance_pending_partition_view has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (15 pts), 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.
IggyShard::apply_reconcile_ops (cognitive 18) core/shard/src/lib.rs:2994— IggyShard::apply_reconcile_ops has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IggyShard::tick_partitions (cyclomatic 89) core/shard/src/lib.rs:8501— IggyShard::tick_partitions has cyclomatic complexity 89 (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.
IggyShard::on_partition_read (cyclomatic 43) core/shard/src/poll.rs:163— IggyShard::on_partition_read has cyclomatic complexity 43 (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.
IggyShard::dispatch_message (cyclomatic 37) core/shard/src/lib.rs:3693— IggyShard::dispatch_message has cyclomatic complexity 37 (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.
IggyShard::on_primary_rebalance (cyclomatic 36) core/shard/src/primary_rebalance.rs:408— IggyShard::on_primary_rebalance 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.
IggyShard::on_start_view (cyclomatic 35) core/shard/src/lib.rs:5270— IggyShard::on_start_view has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
IggyShard::on_repair_range_reply (cyclomatic 35) core/shard/src/lib.rs:6268— IggyShard::on_repair_range_reply has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
IggyShard::process_lifecycle (cyclomatic 35) core/shard/src/router.rs:848— IggyShard::process_lifecycle has cyclomatic complexity 35 (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.
IggyShard::run_message_pump (cyclomatic 34) core/shard/src/router.rs:313— IggyShard::run_message_pump 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.
IggyShard::on_repair_prepare (cyclomatic 29) core/shard/src/lib.rs:5979— IggyShard::on_repair_prepare 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.
IggyShard::on_request_prepares (cyclomatic 28) core/shard/src/lib.rs:5742— IggyShard::on_request_prepares 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.
IggyShard::on_partition_transfer_progress (cyclomatic 27) core/shard/src/lib.rs:10710— IggyShard::on_partition_transfer_progress 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.
IggyShard::tick_primary_rebalance (cyclomatic 26) core/shard/src/primary_rebalance.rs:273— IggyShard::tick_primary_rebalance 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.
IggyShard::service_partition_io (cyclomatic 25) core/shard/src/partition_io.rs:638— IggyShard::service_partition_io 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.
IggyShard::on_partition_state_transfer_target (cyclomatic 21) core/shard/src/lib.rs:10407— IggyShard::on_partition_state_transfer_target has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
IggyShard::tick_metadata (cyclomatic 20) core/shard/src/lib.rs:11433— IggyShard::tick_metadata 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.
IggyShard::advance_pending_partition_view (cyclomatic 19) core/shard/src/lib.rs:6770— IggyShard::advance_pending_partition_view has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
IggyShard::on_state_transfer_target (cyclomatic 19) core/shard/src/lib.rs:7697— IggyShard::on_state_transfer_target 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.
IggyShard::on_transfer_progress (cyclomatic 19) core/shard/src/lib.rs:8281— IggyShard::on_transfer_progress 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.
IggyShard::flush_partitions (cyclomatic 19) core/shard/src/router.rs:593— IggyShard::flush_partitions 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.
IggyShard::on_partition_request_state_chunk (cyclomatic 18) core/shard/src/lib.rs:9567— IggyShard::on_partition_request_state_chunk 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.
IggyShard::maybe_request_partition_repair (cyclomatic 18) core/shard/src/lib.rs:10082— IggyShard::maybe_request_partition_repair has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
IggyShard::service_deferred_polls (cyclomatic 17) core/shard/src/poll/deferred.rs:801— IggyShard::service_deferred_polls 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.
IggyShard::drain_queued_frames_for_shutdown (cyclomatic 16) core/shard/src/router.rs:696— IggyShard::drain_queued_frames_for_shutdown 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.
Duplicated block (12 lines × 2) core/binary_protocol/src/primitives/user_headers.rs:168— core/binary_protocol/src/primitives/user_headers.rs:168-179 | core/binary_protocol/src/primitives/user_headers.rs:182-193 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) core/common/src/wire_conversions.rs:622— core/common/src/wire_conversions.rs:622-633 | foreign/cpp/src/type_conversion.rs:348-359 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (12 lines × 2) core/connectors/sinks/influxdb_sink/src/protocol.rs:49— core/connectors/sinks/influxdb_sink/src/protocol.rs:49-60 | core/connectors/sinks/influxdb_sink/src/protocol.rs:86-97 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) core/connectors/sinks/postgres_sink/src/lib.rs:171— core/connectors/sinks/postgres_sink/src/lib.rs:171-182 | core/connectors/sources/postgres_source/src/lib.rs:486-497 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (12 lines × 2) core/consensus/src/impls.rs:3812— core/consensus/src/impls.rs:3812-3823 | core/consensus/src/impls.rs:4007-4018 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) core/metadata/src/impls/metadata.rs:3454— core/metadata/src/impls/metadata.rs:3454-3465 | core/metadata/src/impls/metadata.rs:3582-3595 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) core/metadata/src/impls/metadata.rs:3507— core/metadata/src/impls/metadata.rs:3507-3519 | core/metadata/src/impls/metadata.rs:3575-3586 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) core/partitions/src/io.rs:1241— core/partitions/src/io.rs:1241-1252 | core/partitions/src/partition_storage.rs:510-521 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (12 lines × 2) core/server/src/dispatch/session_ops.rs:898— core/server/src/dispatch/session_ops.rs:898-909 | core/server/src/dispatch/session_ops.rs:924-935 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) core/server/src/responses.rs:631— core/server/src/responses.rs:631-642 | core/server/src/responses.rs:934-946 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) foreign/python/src/config.rs:375— foreign/python/src/config.rs:375-386 | foreign/python/src/config.rs:1418-1429 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) foreign/php/src/identifier.rs:57— foreign/php/src/identifier.rs:57-68 | foreign/python/src/identifier.rs:61-72 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (12 lines × 2) core/partitions/src/iggy_partitions.rs:921— core/partitions/src/iggy_partitions.rs:921-932 | core/partitions/src/iggy_partitions.rs:946-957 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) gateways/kafka/src/protocol/handlers/create_topics.rs:329— gateways/kafka/src/protocol/handlers/create_topics.rs:329-340 | gateways/kafka/src/protocol/handlers/delete_topics.rs:319-330 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (12 lines × 2) core/message_bus/src/client_listener/tcp_tls.rs:113— core/message_bus/src/client_listener/tcp_tls.rs:113-124 | core/message_bus/src/client_listener/wss.rs:107-118 — before extracting anything, compare `core/message_bus/src/client_listener/tcp_tls.rs` and `core/message_bus/src/client_listener/wss.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) core/server/src/dispatch/session_ops.rs:493— core/server/src/dispatch/session_ops.rs:493-504 | core/server/src/dispatch/session_ops.rs:761-772 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) foreign/java/external-processors/iggy-connector-flink/iggy-connector-library/src/main/java/org/apache/iggy/connector/flink/sink/IggyCommittable.java:50— foreign/java/external-processors/iggy-connector-flink/iggy-connector-library/src/main/java/org/apache/iggy/connector/flink/sink/IggyCommittable.java:50-61 | foreign/java/external-processors/iggy-connector-flink/iggy-connector-library/src/main/java/org/apache/iggy/connector/flink/source/IggySourceSplit.java:52-63 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (12 lines × 2) foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/ConsumerGroupsTcpClient.java:134— foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/ConsumerGroupsTcpClient.java:134-145 | foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/ConsumerGroupsTcpClient.java:152-163 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) foreign/java/java-sdk/src/main/java/org/apache/iggy/stream/StreamDetails.java:49— foreign/java/java-sdk/src/main/java/org/apache/iggy/stream/StreamDetails.java:49-60 | foreign/java/java-sdk/src/main/java/org/apache/iggy/topic/TopicDetails.java:50-61 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (12 lines × 2) foreign/go/binary_serialization/binary_response_deserializer.go:687— foreign/go/binary_serialization/binary_response_deserializer.go:687-698 | foreign/go/binary_serialization/binary_response_deserializer.go:703-714 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `foreign/go/binary_serialization/binary_response_deserializer.go:687` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) foreign/swift/Sources/Iggy/Models/Resources.swift:512— foreign/swift/Sources/Iggy/Models/Resources.swift:512-523 | foreign/swift/Sources/Iggy/Models/TopicOptions.swift:90-101 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `foreign/swift/Sources/Iggy/Models/Resources.swift:512` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) core/bench/dashboard/frontend/src/api/mod.rs:107— core/bench/dashboard/frontend/src/api/mod.rs:107-118 | core/bench/dashboard/frontend/src/api/mod.rs:196-207 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) core/bench/dashboard/frontend/src/components/layout/main_content.rs:114— core/bench/dashboard/frontend/src/components/layout/main_content.rs:114-125 | core/bench/dashboard/frontend/src/components/layout/main_content.rs:208-219 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
server::consumer_group::liveness::retire_session (cognitive 87) core/server/src/consumer_group/liveness.rs:333— server::consumer_group::liveness::retire_session has cognitive complexity 87 (threshold 15). Drivers by points: if/else 29 (57 pts), loops 4 (14 pts), boolean chains 8, match/switch 2 (8 pts) (nesting depth added 44). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
server::boot::shard_main (cognitive 48) core/server/src/boot/mod.rs:512— server::boot::shard_main has cognitive complexity 48 (threshold 15). Drivers by points: if/else 30 (40 pts), boolean chains 3, match/switch 3, loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
server::partition_reconciler::reconcile_additions (cognitive 45) core/server/src/partition_reconciler.rs:673— server::partition_reconciler::reconcile_additions has cognitive complexity 45 (threshold 15). Drivers by points: if/else 15 (36 pts), match/switch 3 (6 pts), boolean chains 2, loops 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.
server::http::forward::serve_partition (cognitive 38) core/server/src/http/forward.rs:551— server::http::forward::serve_partition has cognitive complexity 38 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 4 (15 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
server::boot::credentials::initialize_root_user (cognitive 34) core/server/src/boot/credentials.rs:76— server::boot::credentials::initialize_root_user has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (22 pts), match/switch 2 (7 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
server::dispatch::reads::handle_non_replicated_request (cognitive 31) core/server/src/dispatch/reads.rs:371— server::dispatch::reads::handle_non_replicated_request has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (24 pts), match/switch 4 (7 pts) (nesting depth added 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
server::partition_reconciler::reconcile_group_offsets (cognitive 29) core/server/src/partition_reconciler.rs:1244— server::partition_reconciler::reconcile_group_offsets has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (21 pts), match/switch 1 (4 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
server::partition_reconciler::reconcile_retired_lifecycles (cognitive 27) core/server/src/partition_reconciler.rs:1845— server::partition_reconciler::reconcile_retired_lifecycles has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 4 (6 pts), match/switch 1 (3 pts), 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.
server::dispatch::handle_client_request (cognitive 26) core/server/src/dispatch/mod.rs:785— server::dispatch::handle_client_request has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 6 (10 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
server::http::forward::attach_partition_request (cognitive 26) core/server/src/http/forward.rs:979— server::http::forward::attach_partition_request has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (15 pts), match/switch 7 (10 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
server::partition_reconciler::reconcile_partition_lifecycles (cognitive 26) core/server/src/partition_reconciler.rs:1753— server::partition_reconciler::reconcile_partition_lifecycles has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (16 pts), match/switch 2 (6 pts), loops 3 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
server::dispatch::submit::handle_metadata_submit (cognitive 24) core/server/src/dispatch/submit.rs:75— server::dispatch::submit::handle_metadata_submit has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 3 (5 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
server::dispatch::enqueue_client_request (cognitive 22) core/server/src/dispatch/mod.rs:190— server::dispatch::enqueue_client_request has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 4, loops 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
server::http::submit::submit_gated (cognitive 21) core/server/src/http/submit.rs:191— server::http::submit::submit_gated has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (17 pts), match/switch 2 (3 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
server::snapshot::procdump::dump_file (cognitive 21) core/server/src/snapshot/procdump.rs:96— server::snapshot::procdump::dump_file has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (9 pts), match/switch 2 (6 pts), loops 1 (4 pts), boolean chains 2 (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
server::boot::listeners::start_tcp_runtime (cognitive 19) core/server/src/boot/listeners.rs:60— server::boot::listeners::start_tcp_runtime has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
server::boot::recovery::build_shard_for_thread (cognitive 18) core/server/src/boot/recovery.rs:98— server::boot::recovery::build_shard_for_thread has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (7 pts), loops 4 (7 pts), match/switch 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
server::consumer_group::liveness::run (cognitive 17) core/server/src/consumer_group/liveness.rs:62— server::consumer_group::liveness::run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 2 (4 pts), match/switch 1 (4 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
server::consumer_group::liveness::report_sessions (cognitive 17) core/server/src/consumer_group/liveness.rs:209— server::consumer_group::liveness::report_sessions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 3, loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
server::partition_helpers::load_partition_or_fence (cognitive 17) core/server/src/partition_helpers.rs:177— server::partition_helpers::load_partition_or_fence has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 6 (8 pts), if/else 4 (7 pts), boolean chains 2 (nesting depth added 5). 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.
server::dispatch::session_ops::handle_login_register_request (cognitive 16) core/server/src/dispatch/session_ops.rs:1099— server::dispatch::session_ops::handle_login_register_request has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), match/switch 2 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
server::http::forward::relay_to_primary (cognitive 16) core/server/src/http/forward.rs:658— server::http::forward::relay_to_primary has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (12 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
iggy_gateway_kafka::protocol::bounds_guard::validate_fetch_shape (cognitive 51) gateways/kafka/src/protocol/bounds_guard.rs:476— iggy_gateway_kafka::protocol::bounds_guard::validate_fetch_shape has cognitive complexity 51 (threshold 15). Drivers by points: if/else 23 (38 pts), loops 5 (13 pts) (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.
iggy_gateway_kafka::tls::identity::parse_replacement (cognitive 36) gateways/kafka/src/tls/identity.rs:623— iggy_gateway_kafka::tls::identity::parse_replacement has cognitive complexity 36 (threshold 15). Drivers by points: if/else 5 (17 pts), match/switch 3 (10 pts), loops 3 (9 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
iggy_gateway_kafka::protocol::bounds_guard::validate_create_topics_shape (cognitive 34) gateways/kafka/src/protocol/bounds_guard.rs:633— iggy_gateway_kafka::protocol::bounds_guard::validate_create_topics_shape has cognitive complexity 34 (threshold 15). Drivers by points: if/else 16 (26 pts), loops 4 (8 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
iggy_gateway_kafka::protocol::bounds_guard::validate_offset_commit_shape (cognitive 30) gateways/kafka/src/protocol/bounds_guard.rs:1150— iggy_gateway_kafka::protocol::bounds_guard::validate_offset_commit_shape has cognitive complexity 30 (threshold 15). Drivers by points: if/else 19 (27 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
iggy_gateway_kafka::protocol::handlers::list_offsets::resolve_topic_lookups (cognitive 25) gateways/kafka/src/protocol/handlers/list_offsets.rs:168— iggy_gateway_kafka::protocol::handlers::list_offsets::resolve_topic_lookups has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 2 (3 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
iggy_gateway_kafka::protocol::bounds_guard::validate_list_offsets_shape (cognitive 24) gateways/kafka/src/protocol/bounds_guard.rs:575— iggy_gateway_kafka::protocol::bounds_guard::validate_list_offsets_shape has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (21 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
iggy_gateway_kafka::protocol::bounds_guard::validate_create_partitions_shape (cognitive 24) gateways/kafka/src/protocol/bounds_guard.rs:753— iggy_gateway_kafka::protocol::bounds_guard::validate_create_partitions_shape has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 3 (6 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
iggy_gateway_kafka::protocol::bounds_guard::validate_produce_shape (cognitive 23) gateways/kafka/src/protocol/bounds_guard.rs:421— iggy_gateway_kafka::protocol::bounds_guard::validate_produce_shape has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (20 pts), loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
iggy_gateway_kafka::protocol::handlers::offset_delete::delete_unsubscribed (cognitive 22) gateways/kafka/src/protocol/handlers/offset_delete.rs:258— iggy_gateway_kafka::protocol::handlers::offset_delete::delete_unsubscribed has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 2 (5 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
iggy_gateway_kafka::protocol::bounds_guard::validate_join_group_shape (cognitive 21) gateways/kafka/src/protocol/bounds_guard.rs:944— iggy_gateway_kafka::protocol::bounds_guard::validate_join_group_shape has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17 (20 pts), loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
iggy_gateway_kafka::protocol::handlers::produce::handle (cognitive 21) gateways/kafka/src/protocol/handlers/produce.rs:88— iggy_gateway_kafka::protocol::handlers::produce::handle has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (16 pts), match/switch 3 (5 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
iggy_gateway_kafka::group::state::join_step (cognitive 20) gateways/kafka/src/group/state.rs:1082— iggy_gateway_kafka::group::state::join_step has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 2, match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
iggy_gateway_kafka::protocol::bounds_guard::validate_leave_group_shape (cognitive 20) gateways/kafka/src/protocol/bounds_guard.rs:1047— iggy_gateway_kafka::protocol::bounds_guard::validate_leave_group_shape has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
iggy_gateway_kafka::protocol::bounds_guard::validate_describe_configs_shape (cognitive 19) gateways/kafka/src/protocol/bounds_guard.rs:1413— iggy_gateway_kafka::protocol::bounds_guard::validate_describe_configs_shape has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
iggy_gateway_kafka::server::accept_loop (cognitive 19) gateways/kafka/src/server.rs:687— iggy_gateway_kafka::server::accept_loop has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (14 pts), match/switch 2 (4 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
iggy_gateway_kafka::group::state::choose_described (cognitive 18) gateways/kafka/src/group/state.rs:1645— iggy_gateway_kafka::group::state::choose_described has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (17 pts), 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.
iggy_gateway_kafka::protocol::bounds_guard::validate_sync_group_shape (cognitive 18) gateways/kafka/src/protocol/bounds_guard.rs:1092— iggy_gateway_kafka::protocol::bounds_guard::validate_sync_group_shape has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14 (17 pts), loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
iggy_gateway_kafka::protocol::bounds_guard::validate_alter_configs_shape (cognitive 18) gateways/kafka/src/protocol/bounds_guard.rs:1465— iggy_gateway_kafka::protocol::bounds_guard::validate_alter_configs_shape has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (iggy_gateway_kafka::protocol::bounds_guard::validate_incremental_alter_configs_shape) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
iggy_gateway_kafka::protocol::bounds_guard::validate_incremental_alter_configs_shape (cognitive 18) gateways/kafka/src/protocol/bounds_guard.rs:1517— iggy_gateway_kafka::protocol::bounds_guard::validate_incremental_alter_configs_shape has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (iggy_gateway_kafka::protocol::bounds_guard::validate_alter_configs_shape) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
iggy_gateway_kafka::server::serve_frames (cognitive 17) gateways/kafka/src/server.rs:1007— iggy_gateway_kafka::server::serve_frames has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
iggy_gateway_kafka::protocol::bounds_guard::validate_offset_fetch_shape (cognitive 16) gateways/kafka/src/protocol/bounds_guard.rs:1226— iggy_gateway_kafka::protocol::bounds_guard::validate_offset_fetch_shape has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Duplicated block (10 lines × 2) foreign/csharp/Iggy_SDK/Contracts/Tcp/TcpContracts.cs:104— foreign/csharp/Iggy_SDK/Contracts/Tcp/TcpContracts.cs:104-113 | foreign/csharp/Iggy_SDK/Contracts/Tcp/TcpContracts.cs:115-124 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) core/connectors/runtime/src/api/models.rs:63— core/connectors/runtime/src/api/models.rs:63-72 | core/connectors/runtime/src/api/models.rs:78-87 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) core/connectors/runtime/src/configs/connectors/http_provider.rs:400— core/connectors/runtime/src/configs/connectors/http_provider.rs:400-409 | core/connectors/runtime/src/configs/connectors/http_provider.rs:432-441 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) core/connectors/runtime/src/configs/connectors/local_provider.rs:539— core/connectors/runtime/src/configs/connectors/local_provider.rs:539-548 | core/connectors/runtime/src/configs/connectors/local_provider.rs:561-570 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) core/connectors/sinks/surrealdb_sink/src/lib.rs:433— core/connectors/sinks/surrealdb_sink/src/lib.rs:433-442 | core/connectors/sinks/surrealdb_sink/src/lib.rs:489-498 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) core/message_bus/src/lifecycle/connection_registry.rs:980— core/message_bus/src/lifecycle/connection_registry.rs:980-989 | core/message_bus/src/lifecycle/connection_registry.rs:1007-1016 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) core/partitions/src/iggy_index_writer.rs:47— core/partitions/src/iggy_index_writer.rs:47-56 | core/partitions/src/messages_writer.rs:55-64 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10 lines × 2) core/partitions/src/segment_recovery.rs:2356— core/partitions/src/segment_recovery.rs:2356-2365 | core/partitions/src/segment_recovery.rs:2491-2500 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) core/server/src/dispatch/metadata_changes.rs:96— core/server/src/dispatch/metadata_changes.rs:96-105 | core/server/src/dispatch/mod.rs:1229-1238 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10 lines × 2) core/common/src/http/personal_access_tokens/create_personal_access_token.rs:46— core/common/src/http/personal_access_tokens/create_personal_access_token.rs:46-55 | core/common/src/http/personal_access_tokens/delete_personal_access_token.rs:41-50 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10 lines × 2) core/connectors/runtime/src/api/sink.rs:60— core/connectors/runtime/src/api/sink.rs:60-69 | core/connectors/runtime/src/api/source.rs:63-72 — before extracting anything, compare `core/connectors/runtime/src/api/sink.rs` and `core/connectors/runtime/src/api/source.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) core/simulator/src/workload/ops/create_keyed_stream.rs:76— core/simulator/src/workload/ops/create_keyed_stream.rs:76-85 | core/simulator/src/workload/ops/create_stream.rs:74-83 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10 lines × 2) gateways/kafka/src/protocol/handlers/alter_configs.rs:150— gateways/kafka/src/protocol/handlers/alter_configs.rs:150-159 | gateways/kafka/src/protocol/handlers/incremental_alter_configs.rs:168-177 — before extracting anything, compare `gateways/kafka/src/protocol/handlers/alter_configs.rs` and `gateways/kafka/src/protocol/handlers/incremental_alter_configs.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 84 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) core/simulator/src/workload/ops/create_partitions.rs:109— core/simulator/src/workload/ops/create_partitions.rs:109-118 | core/simulator/src/workload/ops/delete_partitions.rs:134-143 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10 lines × 2) core/connectors/runtime/src/sink.rs:574— core/connectors/runtime/src/sink.rs:574-583 | core/connectors/runtime/src/source.rs:449-458 — before extracting anything, compare `core/connectors/runtime/src/sink.rs` and `core/connectors/runtime/src/source.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) core/connectors/sources/postgres_source/src/lib.rs:1131— core/connectors/sources/postgres_source/src/lib.rs:1131-1140 | core/connectors/sources/postgres_source/src/lib.rs:1151-1160 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) core/message_bus/src/transports/tls/mod.rs:111— core/message_bus/src/transports/tls/mod.rs:111-120 | core/message_bus/src/transports/tls/mod.rs:130-139 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) core/server/src/boot/credentials.rs:483— core/server/src/boot/credentials.rs:483-492 | core/server/src/boot/credentials.rs:499-508 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/MessagesClient.java:147— foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/MessagesClient.java:147-156 | foreign/java/java-sdk/src/main/java/org/apache/iggy/client/blocking/MessagesClient.java:45-54 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/MessagesClient.java:147` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) core/bench/dashboard/frontend/src/components/tooltips/benchmark_info_toggle.rs:28— core/bench/dashboard/frontend/src/components/tooltips/benchmark_info_toggle.rs:28-37 | core/bench/dashboard/frontend/src/components/tooltips/server_stats_toggle.rs:28-37 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10 lines × 2) foreign/java/bench/src/main/java/org/apache/iggy/bench/report/FinalReportBuilder.java:219— foreign/java/bench/src/main/java/org/apache/iggy/bench/report/FinalReportBuilder.java:219-228 | foreign/java/bench/src/main/java/org/apache/iggy/bench/report/FinalReportBuilder.java:231-240 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D30 · Dependency Vulnerabilities· Medium advisory (unsound) · ×20
Duplicated block (13 lines × 2) core/binary_protocol/src/requests/users/login_register.rs:157— core/binary_protocol/src/requests/users/login_register.rs:157-169 | core/binary_protocol/src/requests/users/login_register_with_pat.rs:66-78 — before extracting anything, compare `core/binary_protocol/src/requests/users/login_register.rs` and `core/binary_protocol/src/requests/users/login_register_with_pat.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) core/connectors/runtime/src/configs/connectors.rs:162— core/connectors/runtime/src/configs/connectors.rs:162-174 | core/connectors/runtime/src/configs/connectors.rs:218-230 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) core/connectors/runtime/src/configs/connectors/http_provider.rs:233— core/connectors/runtime/src/configs/connectors/http_provider.rs:233-245 | core/connectors/runtime/src/configs/connectors/http_provider.rs:254-266 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) core/connectors/runtime/src/main.rs:354— core/connectors/runtime/src/main.rs:354-366 | core/connectors/runtime/src/main.rs:371-383 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) core/connectors/sdk/src/decoders/proto.rs:175— core/connectors/sdk/src/decoders/proto.rs:175-187 | core/connectors/sdk/src/transforms/proto_convert.rs:201-213 — before extracting anything, compare `core/connectors/sdk/src/decoders/proto.rs` and `core/connectors/sdk/src/transforms/proto_convert.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) core/connectors/sinks/postgres_sink/src/lib.rs:527— core/connectors/sinks/postgres_sink/src/lib.rs:527-539 | REDACTED:1040-1052 — before extracting anything, compare `core/connectors/sinks/postgres_sink/src/lib.rs` and `REDACTED` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) core/integration/src/harness/handle/connectors_runtime.rs:167— core/integration/src/harness/handle/connectors_runtime.rs:167-179 | core/integration/src/harness/handle/mcp.rs:167-179 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (13 lines × 2) core/partitions/src/iggy_partition.rs:1775— core/partitions/src/iggy_partition.rs:1775-1787 | core/partitions/src/iggy_partition.rs:3107-3119 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) core/partitions/src/iggy_partitions.rs:162— core/partitions/src/iggy_partitions.rs:162-174 | core/partitions/src/iggy_partitions.rs:184-196 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) foreign/cpp/src/client.rs:1639— foreign/cpp/src/client.rs:1639-1651 | foreign/python/src/client.rs:182-194 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (13 lines × 2) foreign/php/src/receive_message.rs:52— foreign/php/src/receive_message.rs:52-64 | foreign/php/src/send_message.rs:39-51 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (13 lines × 2) core/ai/mcp/src/configs.rs:375— core/ai/mcp/src/configs.rs:375-387 | core/connectors/runtime/src/api/config.rs:250-262 — before extracting anything, compare `core/ai/mcp/src/configs.rs` and `core/connectors/runtime/src/api/config.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) core/simulator/src/workload/ops/create_keyed_stream.rs:47— core/simulator/src/workload/ops/create_keyed_stream.rs:47-59 | core/simulator/src/workload/ops/create_stream.rs:44-57 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (13 lines × 2) core/message_bus/src/transports/ws.rs:270— core/message_bus/src/transports/ws.rs:270-282 | core/message_bus/src/transports/wss.rs:421-434 — before extracting anything, compare `core/message_bus/src/transports/ws.rs` and `core/message_bus/src/transports/wss.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 101 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) core/connectors/sources/influxdb_source/src/v2.rs:584— core/connectors/sources/influxdb_source/src/v2.rs:584-596 | core/connectors/sources/influxdb_source/src/v3.rs:93-105 — before extracting anything, compare `core/connectors/sources/influxdb_source/src/v2.rs` and `core/connectors/sources/influxdb_source/src/v3.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) core/journal/src/prepare_journal.rs:671— core/journal/src/prepare_journal.rs:671-683 | core/journal/src/prepare_journal.rs:739-751 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) core/connectors/sinks/http_sink/src/lib.rs:801— core/connectors/sinks/http_sink/src/lib.rs:801-813 | core/connectors/sinks/http_sink/src/lib.rs:894-906 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) core/connectors/runtime/src/state/http.rs:310— core/connectors/runtime/src/state/http.rs:310-322 | core/connectors/runtime/src/state/http.rs:354-366 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) foreign/java/external-processors/iggy-connector-pinot/src/main/java/org/apache/iggy/connector/pinot/consumer/IggyPartitionGroupConsumer.java:125— foreign/java/external-processors/iggy-connector-pinot/src/main/java/org/apache/iggy/connector/pinot/consumer/IggyPartitionGroupConsumer.java:125-137 | foreign/java/external-processors/iggy-connector-pinot/src/main/java/org/apache/iggy/connector/pinot/metadata/IggyStreamMetadataProvider.java:155-167 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `foreign/java/external-processors/iggy-connector-pinot/src/main/java/org/apache/iggy/connector/pinot/consumer/IggyPartitionGroupConsumer.java:125` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `foreign/java/external-processors/iggy-connector-pinot/src/main/java/org/apache/iggy/connector/pinot/consumer/IggyPartitionGroupConsumer.java:139` calls `of`, `valueOf` and `foreign/java/external-processors/iggy-connector-pinot/src/main/java/org/apache/iggy/connector/pinot/metadata/IggyStreamMetadataProvider.java:169` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 2) core/bench/dashboard/frontend/src/components/layout/sidebar.rs:238— core/bench/dashboard/frontend/src/components/layout/sidebar.rs:238-250 | core/bench/dashboard/frontend/src/components/layout/sidebar.rs:259-271 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) foreign/csharp/Iggy_SDK/Contracts/Tcp/TcpContracts.cs:756— foreign/csharp/Iggy_SDK/Contracts/Tcp/TcpContracts.cs:756-761 | foreign/csharp/Iggy_SDK/Contracts/Tcp/TcpContracts.cs:765-770 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (6 lines × 2) core/bench/src/utils/mod.rs:113— core/bench/src/utils/mod.rs:113-118 | core/connectors/sinks/influxdb_sink/src/lib.rs:421-426 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) core/configs_derive/src/config_env.rs:218— core/configs_derive/src/config_env.rs:218-223 | core/configs_derive/src/config_env.rs:329-334 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) core/connectors/runtime/src/configs/connectors/local_provider.rs:460— core/connectors/runtime/src/configs/connectors/local_provider.rs:460-465 | core/connectors/runtime/src/configs/connectors/local_provider.rs:495-500 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) core/connectors/runtime/src/manager/sink.rs:70— core/connectors/runtime/src/manager/sink.rs:70-75 | core/connectors/runtime/src/manager/source.rs:78-83 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) core/connectors/sdk/src/decoders/proto.rs:429— core/connectors/sdk/src/decoders/proto.rs:429-434 | core/connectors/sdk/src/decoders/proto.rs:482-487 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) core/connectors/sdk/src/sink.rs:68— core/connectors/sdk/src/sink.rs:68-73 | core/connectors/sdk/src/source.rs:258-263 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) core/connectors/sinks/clickhouse_sink/src/binary.rs:486— core/connectors/sinks/clickhouse_sink/src/binary.rs:486-491 | core/connectors/sinks/clickhouse_sink/src/binary.rs:679-684 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) core/sdk/src/stream_builder/build/build_iggy_consumer.rs:45— core/sdk/src/stream_builder/build/build_iggy_consumer.rs:45-50 | core/sdk/src/stream_builder/build/build_iggy_producer.rs:46-51 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) core/simulator/src/workload/mod.rs:1677— core/simulator/src/workload/mod.rs:1677-1682 | core/simulator/src/workload/oracle.rs:169-176 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) core/common/src/traits/binary_impls/mod.rs:190— core/common/src/traits/binary_impls/mod.rs:190-195 | core/common/src/types/options/catalog.rs:1019-1024 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) core/common/src/utils/serde_secret.rs:66— core/common/src/utils/serde_secret.rs:66-71 | core/connectors/sources/http_source/src/state.rs:587-592 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) core/connectors/sinks/clickhouse_sink/src/binary.rs:689— core/connectors/sinks/clickhouse_sink/src/binary.rs:689-694 | core/connectors/sinks/clickhouse_sink/src/binary.rs:746-751 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) core/binary_protocol/src/consensus/header.rs:1035— core/binary_protocol/src/consensus/header.rs:1035-1040 | core/binary_protocol/src/consensus/header.rs:1196-1201 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) core/connectors/runtime/src/configs/connectors/local_provider.rs:761— core/connectors/runtime/src/configs/connectors/local_provider.rs:761-766 | core/connectors/runtime/src/configs/connectors/local_provider.rs:812-817 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) foreign/java/java-sdk/src/main/java/org/apache/iggy/client/blocking/http/StreamsHttpClient.java:47— foreign/java/java-sdk/src/main/java/org/apache/iggy/client/blocking/http/StreamsHttpClient.java:47-52 | foreign/java/java-sdk/src/main/java/org/apache/iggy/client/blocking/http/UsersHttpClient.java:50-55 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) foreign/go/contracts/user_headers.go:179— foreign/go/contracts/user_headers.go:179-184 | foreign/go/contracts/user_headers.go:208-213 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) foreign/go/errors/generator/main.go:189— foreign/go/errors/generator/main.go:189-194 | foreign/go/errors/generator/main.go:204-209 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `foreign/go/errors/generator/main.go:189` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) foreign/go/internal/command/topic.go:111— foreign/go/internal/command/topic.go:111-116 | foreign/go/internal/command/topic.go:203-208 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) core/bench/src/actors/producer/typed_benchmark_producer.rs:94— core/bench/src/actors/producer/typed_benchmark_producer.rs:94-99 | core/bench/src/actors/producing_consumer/typed_benchmark_producing_consumer.rs:126-131 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) core/journal/src/prepare_journal.rs:930— core/journal/src/prepare_journal.rs:930-934 | core/journal/src/prepare_journal.rs:1181-1185 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) core/journal/src/prepare_journal.rs:1046— core/journal/src/prepare_journal.rs:1046-1050 | core/journal/src/prepare_journal.rs:1159-1163 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) core/message_bus/src/lifecycle/connection_registry.rs:364— core/message_bus/src/lifecycle/connection_registry.rs:364-368 | core/message_bus/src/lifecycle/connection_registry.rs:401-405 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) core/metadata/src/stm/consumer_group.rs:433— core/metadata/src/stm/consumer_group.rs:433-437 | core/metadata/src/stm/consumer_group.rs:488-492 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) foreign/csharp/Iggy_SDK/Consumers/IggyConsumerBuilder.cs:311— foreign/csharp/Iggy_SDK/Consumers/IggyConsumerBuilder.cs:311-315 | foreign/csharp/Iggy_SDK/Publishers/IggyPublisherBuilder.cs:375-379 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) foreign/csharp/Iggy_SDK/Identifier.cs:53— foreign/csharp/Iggy_SDK/Identifier.cs:53-57 | foreign/csharp/Iggy_SDK/Kinds/Partitioning.cs:52-56 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) core/binary_protocol/src/requests/users/login_register.rs:217— core/binary_protocol/src/requests/users/login_register.rs:217-221 | core/binary_protocol/src/requests/users/login_register_with_pat.rs:122-126 — before extracting anything, compare `core/binary_protocol/src/requests/users/login_register.rs` and `core/binary_protocol/src/requests/users/login_register_with_pat.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) foreign/python/src/config.rs:1530— foreign/python/src/config.rs:1530-1534 | foreign/python/src/producer.rs:873-877 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) core/partitions/src/segment_recovery.rs:3051— core/partitions/src/segment_recovery.rs:3051-3055 | core/sdk/src/vsr.rs:324-328 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) core/connectors/sinks/postgres_sink/src/lib.rs:168— core/connectors/sinks/postgres_sink/src/lib.rs:168-175 | REDACTED:142-146 — before extracting anything, compare `core/connectors/sinks/postgres_sink/src/lib.rs` and `REDACTED` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) core/common/src/types/message/iggy_message.rs:618— core/common/src/types/message/iggy_message.rs:618-622 | core/common/src/types/message/iggy_message.rs:628-634 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) core/connectors/sinks/postgres_sink/src/lib.rs:193— core/connectors/sinks/postgres_sink/src/lib.rs:193-197 | REDACTED:601-605 — before extracting anything, compare `core/connectors/sinks/postgres_sink/src/lib.rs` and `REDACTED` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) gateways/kafka/tools/kafka-tool/src/response.rs:363— gateways/kafka/tools/kafka-tool/src/response.rs:363-367 | gateways/kafka/tools/kafka-tool/src/response.rs:394-398 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/PartitionsTcpClient.java:61— foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/PartitionsTcpClient.java:61-65 | foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/PartitionsTcpClient.java:76-80 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) foreign/java/java-sdk/src/main/java/org/apache/iggy/client/blocking/http/MessagesHttpClient.java:92— foreign/java/java-sdk/src/main/java/org/apache/iggy/client/blocking/http/MessagesHttpClient.java:92-96 | foreign/java/java-sdk/src/main/java/org/apache/iggy/client/blocking/http/MessagesHttpClient.java:160-164 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `foreign/java/java-sdk/src/main/java/org/apache/iggy/client/blocking/http/MessagesHttpClient.java:92` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/StreamsTcpClient.java:111— foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/StreamsTcpClient.java:111-115 | foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/UsersTcpClient.java:103-107 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `update` to `StreamUpdate` in one and `UserUpdate` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (5 lines × 2) foreign/java/java-sdk/src/main/java/org/apache/iggy/client/blocking/http/StreamsHttpClient.java:69— foreign/java/java-sdk/src/main/java/org/apache/iggy/client/blocking/http/StreamsHttpClient.java:69-73 | foreign/java/java-sdk/src/main/java/org/apache/iggy/client/blocking/http/UsersHttpClient.java:85-89 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Note first that the copies are not typed on the same thing: the declarations holding them bind `update` to `StreamUpdate` in one and `UserUpdate` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (5 lines × 2) foreign/go/binary_serialization/binary_response_deserializer.go:112— foreign/go/binary_serialization/binary_response_deserializer.go:112-116 | foreign/go/binary_serialization/binary_response_deserializer.go:532-536 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) foreign/go/client/connection_string.go:338— foreign/go/client/connection_string.go:338-342 | foreign/go/client/connection_string.go:350-354 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) foreign/java/bench/src/main/java/org/apache/iggy/bench/models/report/FinalReport.java:43— foreign/java/bench/src/main/java/org/apache/iggy/bench/models/report/FinalReport.java:43-47 | foreign/java/bench/src/main/java/org/apache/iggy/bench/models/report/metrics/IndividualMetrics.java:35-39 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `foreign/java/bench/src/main/java/org/apache/iggy/bench/models/report/FinalReport.java:48` calls `copyOf`, `requireNonNull` and `foreign/java/bench/src/main/java/org/apache/iggy/bench/models/report/metrics/IndividualMetrics.java:40` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
IggyPartition::resume_io_inner (cyclomatic 82) core/partitions/src/iggy_partition.rs:5992— IggyPartition::resume_io_inner has cyclomatic complexity 82 (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.
IggyPartition::on_request (cyclomatic 81) core/partitions/src/iggy_partition.rs:7120— IggyPartition::on_request has cyclomatic complexity 81 (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.
IggyPartition::on_replicate (cyclomatic 45) core/partitions/src/iggy_partition.rs:8302— IggyPartition::on_replicate 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.
IggyPartition::drive_install_io (cyclomatic 41) core/partitions/src/state_transfer.rs:3434— IggyPartition::drive_install_io has cyclomatic complexity 41 (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.
IggyPartition::drain_request_queue_into_prepares (cyclomatic 38) core/partitions/src/iggy_partition.rs:7920— IggyPartition::drain_request_queue_into_prepares 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.
IggyPartition::accept_install_io (cyclomatic 34) core/partitions/src/state_transfer.rs:3942— IggyPartition::accept_install_io has cyclomatic complexity 34 (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.
IggyPartition::prepare_state_transfer_install (cyclomatic 28) core/partitions/src/state_transfer.rs:4296— IggyPartition::prepare_state_transfer_install has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
IggyPartition::capture_install_io (cyclomatic 26) core/partitions/src/state_transfer.rs:3691— IggyPartition::capture_install_io 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.
IggyPartition::resynchronize_consumer_offset_reservations_inner (cyclomatic 25) core/partitions/src/iggy_partition.rs:5301— IggyPartition::resynchronize_consumer_offset_reservations_inner has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
IggyPartition::reanchor_to_offset_frontier (cyclomatic 22) core/partitions/src/iggy_partition.rs:12173— IggyPartition::reanchor_to_offset_frontier 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.
IggyPartition::apply_repaired_prepare (cyclomatic 22) core/partitions/src/iggy_partition.rs:12474— IggyPartition::apply_repaired_prepare has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
IggyPartition::open_persistence_with_recovered (cyclomatic 20) core/partitions/src/iggy_partition.rs:1608— IggyPartition::open_persistence_with_recovered 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.
IggyPartition::accept_io (cyclomatic 20) core/partitions/src/iggy_partition.rs:6469— IggyPartition::accept_io 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.
IggyPartition::build_poll_plan (cyclomatic 19) core/partitions/src/iggy_partition.rs:5502— IggyPartition::build_poll_plan has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
IggyPartition::drive_validated_commit (cyclomatic 19) core/partitions/src/iggy_partition.rs:10423— IggyPartition::drive_validated_commit has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
IggyPartition::complete_repair (cyclomatic 19) core/partitions/src/iggy_partition.rs:12610— IggyPartition::complete_repair has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
IggyPartition::publish_pending_commit (cyclomatic 17) core/partitions/src/iggy_partition.rs:11051— IggyPartition::publish_pending_commit 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.
IggyPartition::capture_io (cyclomatic 16) core/partitions/src/iggy_partition.rs:6374— IggyPartition::capture_io 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.
IggyPartition::build_state_transfer_offer (cyclomatic 16) core/partitions/src/state_transfer.rs:2700— IggyPartition::build_state_transfer_offer has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
X2 · Cancellation propagation· Async method without CancellationToken · ×18
Async method without CancellationToken: LeaveConsumerGroupAsync foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:543— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: OnClientConnectionStateChangedAsync foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:951— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: RejoinConsumerGroupOnReconnectionAsync foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:1011— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: HandleResponseAsync foreign/csharp/Iggy_SDK/IggyClient/Implementations/HttpMessageStream.cs:1139— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: DropConnectionAsync foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.cs:1112— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: ResetConsensusSessionAsync foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.Vsr.cs:703— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: TryEnterSendingSemaphoreAsync foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.Vsr.cs:743— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: Create foreign/csharp/Benchmarks/SendMessage.cs:29— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: ConsumeMessages examples/csharp/src/GettingStarted/Iggy_SDK.Examples.GettingStarted.Consumer/Utils.cs:35— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: InitSystem examples/csharp/src/GettingStarted/Iggy_SDK.Examples.GettingStarted.Producer/Utils.cs:37— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: ProduceMessages examples/csharp/src/GettingStarted/Iggy_SDK.Examples.GettingStarted.Producer/Utils.cs:46— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: InitSystem examples/csharp/src/MessageEnvelope/Iggy_SDK.Examples.MessageEnvelope.Producer/Utils.cs:38— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: ProduceMessages examples/csharp/src/MessageEnvelope/Iggy_SDK.Examples.MessageEnvelope.Producer/Utils.cs:47— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: ConsumeMessages examples/csharp/src/MessageEnvelope/Iggy_SDK.Examples.MessageEnvelope.Consumer/Utils.cs:37— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: ConsumeMessages examples/csharp/src/MessageHeaders/Iggy_SDK.Examples.MessageHeaders.Consumer/Utils.cs:38— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: InitSystem examples/csharp/src/MessageHeaders/Iggy_SDK.Examples.MessageHeaders.Producer/Utils.cs:39— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: ProduceMessages examples/csharp/src/MessageHeaders/Iggy_SDK.Examples.MessageHeaders.Producer/Utils.cs:48— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: ProduceMessages examples/csharp/src/NewSdk/Iggy_SDK.Examples.NewSdk.Producer/Utils.cs:31— No CancellationToken parameter — this work can't be stopped early once started.
Duplicated block (14 lines × 2) foreign/csharp/Iggy_SDK/Contracts/MetadataChangeBodies.cs:45— foreign/csharp/Iggy_SDK/Contracts/MetadataChangeBodies.cs:45-58 | foreign/csharp/Iggy_SDK/Contracts/MetadataChangeBodies.cs:137-150 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) foreign/csharp/Iggy_SDK/Publishers/IggyPublisherOfT.cs:103— foreign/csharp/Iggy_SDK/Publishers/IggyPublisherOfT.cs:103-116 | foreign/csharp/Iggy_SDK/Publishers/IggyPublisherOfT.cs:138-151 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.Rented.cs:153— foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.Rented.cs:153-166 | foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:629-642 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.Rented.cs:153` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (14 lines × 2) core/bench/report/src/types/server_stats.rs:174— core/bench/report/src/types/server_stats.rs:174-187 | core/common/src/types/stats/mod.rs:186-199 — before extracting anything, compare `core/bench/report/src/types/server_stats.rs` and `core/common/src/types/stats/mod.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) core/binary_protocol/src/requests/partitions/create_partitions.rs:47— core/binary_protocol/src/requests/partitions/create_partitions.rs:47-60 | core/binary_protocol/src/requests/partitions/delete_partitions.rs:47-60 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (14 lines × 2) core/connectors/runtime/src/api/sink.rs:92— core/connectors/runtime/src/api/sink.rs:92-105 | core/connectors/runtime/src/api/source.rs:95-108 — before extracting anything, compare `core/connectors/runtime/src/api/sink.rs` and `core/connectors/runtime/src/api/source.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) core/connectors/sdk/src/source.rs:465— core/connectors/sdk/src/source.rs:465-478 | core/connectors/sdk/src/source.rs:502-515 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) core/connectors/sources/postgres_source/src/lib.rs:1720— core/connectors/sources/postgres_source/src/lib.rs:1720-1733 | core/connectors/sources/postgres_source/src/lib.rs:1737-1750 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) core/message_bus/src/installer/replica.rs:479— core/message_bus/src/installer/replica.rs:479-492 | core/message_bus/src/installer/tcp.rs:114-127 — before extracting anything, compare `core/message_bus/src/installer/replica.rs` and `core/message_bus/src/installer/tcp.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 87 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) gateways/kafka/src/protocol/handlers/alter_configs.rs:189— gateways/kafka/src/protocol/handlers/alter_configs.rs:189-202 | gateways/kafka/src/protocol/handlers/incremental_alter_configs.rs:211-224 — before extracting anything, compare `gateways/kafka/src/protocol/handlers/alter_configs.rs` and `gateways/kafka/src/protocol/handlers/incremental_alter_configs.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 84 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) core/binary_protocol/src/requests/personal_access_tokens/login_with_personal_access_token.rs:30— core/binary_protocol/src/requests/personal_access_tokens/login_with_personal_access_token.rs:30-43 | core/binary_protocol/src/responses/personal_access_tokens/create_personal_access_token.rs:35-48 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (14 lines × 2) core/binary_protocol/src/requests/users/delete_user.rs:30— core/binary_protocol/src/requests/users/delete_user.rs:30-43 | core/binary_protocol/src/requests/users/get_user.rs:30-43 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (14 lines × 2) examples/csharp/src/MessageEnvelope/Iggy_SDK.Examples.MessageEnvelope.Producer/Utils.cs:88— examples/csharp/src/MessageEnvelope/Iggy_SDK.Examples.MessageEnvelope.Producer/Utils.cs:88-101 | examples/csharp/src/MessageHeaders/Iggy_SDK.Examples.MessageHeaders.Producer/Utils.cs:93-106 — before extracting anything, compare `examples/csharp/src/MessageEnvelope/Iggy_SDK.Examples.MessageEnvelope.Producer/Utils.cs` and `examples/csharp/src/MessageHeaders/Iggy_SDK.Examples.MessageHeaders.Producer/Utils.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 81 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `examples/csharp/src/MessageEnvelope/Iggy_SDK.Examples.MessageEnvelope.Producer/Utils.cs:88` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) core/bench/dashboard/frontend/src/components/layout/sidebar.rs:198— core/bench/dashboard/frontend/src/components/layout/sidebar.rs:198-211 | core/bench/dashboard/frontend/src/components/layout/sidebar.rs:215-228 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) examples/python/basic/producer.py:110— examples/python/basic/producer.py:110-123 | examples/python/getting-started/producer.py:216-229 — `examples/python/basic/producer.py` and `examples/python/getting-started/producer.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 53 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `examples/python/basic/producer.py:110` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `examples/python/basic/producer.py:109` calls `partition_id` and `examples/python/getting-started/producer.py:215` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D30 · Dependency Vulnerabilities· Medium advisory (unmaintained) · ×12
server::consumer_group::liveness::retire_session (cyclomatic 43) core/server/src/consumer_group/liveness.rs:333— server::consumer_group::liveness::retire_session has cyclomatic complexity 43 (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.
server::boot::shard_main (cyclomatic 31) core/server/src/boot/mod.rs:512— server::boot::shard_main 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.
server::dispatch::reads::handle_non_replicated_request (cyclomatic 27) core/server/src/dispatch/reads.rs:371— server::dispatch::reads::handle_non_replicated_request 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.
server::partition_helpers::load_partition_or_fence (cyclomatic 27) core/server/src/partition_helpers.rs:177— server::partition_helpers::load_partition_or_fence has cyclomatic complexity 27 (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.
server::dispatch::submit::handle_metadata_submit (cyclomatic 24) core/server/src/dispatch/submit.rs:75— server::dispatch::submit::handle_metadata_submit has cyclomatic complexity 24 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
server::dispatch::handle_client_request (cyclomatic 23) core/server/src/dispatch/mod.rs:785— server::dispatch::handle_client_request has cyclomatic complexity 23 (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.
server::partition_reconciler::reconcile_additions (cyclomatic 22) core/server/src/partition_reconciler.rs:673— server::partition_reconciler::reconcile_additions 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.
server::http::forward::serve_partition (cyclomatic 19) core/server/src/http/forward.rs:551— server::http::forward::serve_partition 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.
server::http::forward::attach_partition_request (cyclomatic 17) core/server/src/http/forward.rs:979— server::http::forward::attach_partition_request has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
server::boot::credentials::initialize_root_user (cyclomatic 16) core/server/src/boot/credentials.rs:76— server::boot::credentials::initialize_root_user 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.
server::boot::threads::validate_sharding_runtime_knobs (cyclomatic 16) core/server/src/boot/threads.rs:579— server::boot::threads::validate_sharding_runtime_knobs has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TooManyFields: IggyPartition core/partitions/src/iggy_partition.rs:124— TooManyFields — 96 stored fields beside 409 methods. The bar is 30 stored fields; this is 66 over it, 3.20× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: VsrConsensus core/consensus/src/impls.rs:1281— TooManyFields — 61 stored fields beside 186 methods. The bar is 30 stored fields; this is 31 over it, 2.03× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: IggyShard core/shard/src/lib.rs:1596— TooManyFields — 57 stored fields beside 203 methods. The bar is 30 stored fields; this is 27 over it, 1.90× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: ShardMetrics core/shard/src/metrics.rs:320— TooManyFields — 51 stored fields beside 34 methods. The bar is 30 stored fields; this is 21 over it, 1.70× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: IggyConsumer core/sdk/src/clients/consumer.rs:544— TooManyFields — 50 stored fields beside 24 methods. The bar is 30 stored fields; this is 20 over it, 1.67× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: PartitionPersistence core/partitions/src/persistence.rs:130— TooManyFields — 45 stored fields beside 68 methods. The bar is 30 stored fields; this is 15 over it, 1.50× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: Args core/common/src/types/args/mod.rs:227— TooManyFields — 43 stored fields beside 1 method. The bar is 30 stored fields; this is 13 over it, 1.43× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: Worker core/sdk/src/clients/consumer/deferred.rs:253— TooManyFields — 39 stored fields beside 25 methods. The bar is 30 stored fields; this is 9 over it, 1.30× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: Args core/simulator/src/bin/workload-fuzz.rs:91— TooManyFields — 38 stored fields. The bar is 30 stored fields; this is 8 over it, 1.27× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: Stats foreign/cpp/src/lib.rs:340— TooManyFields — 31 stored fields. The bar is 30 stored fields; this is 1 over it, 1.03× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: MetadataChangeBody foreign/cpp/src/lib.rs:642— TooManyFields — 31 stored fields. The bar is 30 stored fields; this is 1 over it, 1.03× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
D30 · Dependency Vulnerabilities· Medium CVE · ×11
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
D30 · Dependency Vulnerabilities· Medium vulnerability · ×11
Duplicated block (18 lines × 2) core/ai/mcp/src/configs.rs:286— core/ai/mcp/src/configs.rs:286-303 | core/connectors/runtime/src/api/config.rs:178-195 — before extracting anything, compare `core/ai/mcp/src/configs.rs` and `core/connectors/runtime/src/api/config.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (18 lines × 2) core/connectors/runtime/src/configs/connectors/http_provider.rs:308— core/connectors/runtime/src/configs/connectors/http_provider.rs:308-325 | core/connectors/runtime/src/configs/connectors/http_provider.rs:372-389 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) core/integration/src/harness/handle/connectors_runtime.rs:216— core/integration/src/harness/handle/connectors_runtime.rs:216-233 | core/integration/src/harness/handle/server.rs:1202-1219 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (18 lines × 2) core/integration/src/harness/seeds.rs:77— core/integration/src/harness/seeds.rs:77-94 | core/integration/src/harness/seeds.rs:103-120 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) core/metadata/src/impls/metadata.rs:4964— core/metadata/src/impls/metadata.rs:4964-4981 | core/metadata/src/impls/metadata.rs:5003-5020 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) core/connectors/sources/mqtt_source/src/driver.rs:505— core/connectors/sources/mqtt_source/src/driver.rs:505-522 | core/connectors/sources/mqtt_source/src/driver.rs:533-550 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) core/connectors/sinks/elasticsearch_sink/src/lib.rs:373— core/connectors/sinks/elasticsearch_sink/src/lib.rs:373-390 | core/connectors/sinks/meilisearch_sink/src/lib.rs:787-804 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (18 lines × 2) foreign/go/internal/command/partition.go:37— foreign/go/internal/command/partition.go:37-54 | foreign/go/internal/command/partition.go:67-84 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (18 lines × 2) core/bench/dashboard/server/src/handlers.rs:464— core/bench/dashboard/server/src/handlers.rs:464-481 | core/bench/dashboard/server/src/handlers.rs:659-676 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) core/bench/dashboard/server/src/handlers.rs:496— core/bench/dashboard/server/src/handlers.rs:496-513 | core/bench/dashboard/server/src/handlers.rs:678-695 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) core/bench/report/src/types/group_metrics.rs:93— core/bench/report/src/types/group_metrics.rs:93-110 | core/bench/report/src/types/individual_metrics.rs:90-107 — before extracting anything, compare `core/bench/report/src/types/group_metrics.rs` and `core/bench/report/src/types/individual_metrics.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 2) core/common/src/types/configuration/quic_config/quic_connection_string_options.rs:114— core/common/src/types/configuration/quic_config/quic_connection_string_options.rs:114-129 | core/common/src/types/configuration/tcp_config/tcp_connection_string_options.rs:82-97 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (16 lines × 2) core/connectors/sinks/http_sink/src/lib.rs:751— core/connectors/sinks/http_sink/src/lib.rs:751-766 | core/connectors/sinks/http_sink/src/lib.rs:833-848 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) core/connectors/sources/influxdb_source/src/v2.rs:854— core/connectors/sources/influxdb_source/src/v2.rs:854-869 | core/connectors/sources/influxdb_source/src/v3.rs:419-434 — before extracting anything, compare `core/connectors/sources/influxdb_source/src/v2.rs` and `core/connectors/sources/influxdb_source/src/v3.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 2) core/journal/src/prepare_journal.rs:1069— core/journal/src/prepare_journal.rs:1069-1084 | core/journal/src/prepare_journal.rs:1203-1218 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) core/metadata/src/stm/consumer_group.rs:693— core/metadata/src/stm/consumer_group.rs:693-708 | core/metadata/src/stm/consumer_group.rs:812-827 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) core/server/src/dispatch/partition.rs:579— core/server/src/dispatch/partition.rs:579-594 | core/server/src/dispatch/partition.rs:1071-1086 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) core/shard/src/lib.rs:7610— core/shard/src/lib.rs:7610-7625 | core/shard/src/lib.rs:7639-7654 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) gateways/kafka/src/protocol/bounds_guard.rs:975— gateways/kafka/src/protocol/bounds_guard.rs:975-990 | gateways/kafka/src/protocol/bounds_guard.rs:1119-1134 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) gateways/kafka/src/protocol/handlers/metadata.rs:476— gateways/kafka/src/protocol/handlers/metadata.rs:476-491 | gateways/kafka/src/protocol/handlers/metadata.rs:523-538 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) core/partitions/src/poll_plan.rs:1206— core/partitions/src/poll_plan.rs:1206-1221 | core/partitions/src/poll_plan.rs:1252-1267 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) core/bench/dashboard/frontend/src/components/layout/hero.rs:297— core/bench/dashboard/frontend/src/components/layout/hero.rs:297-312 | core/bench/dashboard/frontend/src/components/layout/main_content.rs:261-276 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (17 lines × 2) core/binary_protocol/src/requests/users/create_user.rs:93— core/binary_protocol/src/requests/users/create_user.rs:93-109 | core/binary_protocol/src/requests/users/update_permissions.rs:63-79 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (17 lines × 2) core/common/src/http/users/create_user.rs:63— core/common/src/http/users/create_user.rs:63-79 | core/common/src/http/users/login_user.rs:37-53 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (17 lines × 2) core/connectors/runtime/src/api/sink.rs:118— core/connectors/runtime/src/api/sink.rs:118-134 | core/connectors/runtime/src/api/source.rs:121-137 — before extracting anything, compare `core/connectors/runtime/src/api/sink.rs` and `core/connectors/runtime/src/api/source.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17 lines × 2) core/connectors/runtime/src/configs/connectors.rs:396— core/connectors/runtime/src/configs/connectors.rs:396-412 | core/connectors/runtime/src/configs/connectors.rs:417-433 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) core/connectors/sinks/influxdb_sink/src/lib.rs:127— core/connectors/sinks/influxdb_sink/src/lib.rs:127-143 | core/connectors/sources/influxdb_source/src/common.rs:60-76 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (17 lines × 2) core/integration/src/harness/handle/server.rs:813— core/integration/src/harness/handle/server.rs:813-829 | core/integration/src/harness/handle/server.rs:995-1011 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) core/partitions/src/partition_storage.rs:826— core/partitions/src/partition_storage.rs:826-842 | core/partitions/src/partition_storage.rs:866-882 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) gateways/kafka/src/protocol/bounds_guard.rs:1475— gateways/kafka/src/protocol/bounds_guard.rs:1475-1491 | gateways/kafka/src/protocol/bounds_guard.rs:1527-1543 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) core/tools/src/data-seeder/seeder.rs:64— core/tools/src/data-seeder/seeder.rs:64-80 | core/tools/src/data-seeder/seeder.rs:88-104 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) core/server/src/dispatch/reads.rs:550— core/server/src/dispatch/reads.rs:550-566 | core/server/src/dispatch/reads.rs:573-589 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
partitions::segment_recovery::load_persisted_segments_with_checkpoint (cognitive 39) core/partitions/src/segment_recovery.rs:596— partitions::segment_recovery::load_persisted_segments_with_checkpoint has cognitive complexity 39 (threshold 15). Drivers by points: if/else 17 (29 pts), boolean chains 4, match/switch 2 (4 pts), loops 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.
partitions::segment_recovery::recover_segment_bounds (cognitive 26) core/partitions/src/segment_recovery.rs:1660— partitions::segment_recovery::recover_segment_bounds has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (24 pts), boolean chains 1, match/switch 1 (nesting depth added 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
partitions::install_backup::link_tree (cognitive 23) core/partitions/src/install_backup.rs:132— partitions::install_backup::link_tree has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
partitions::segment_recovery::find_provable_index_anchor (cognitive 23) core/partitions/src/segment_recovery.rs:2339— partitions::segment_recovery::find_provable_index_anchor has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (20 pts), 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.
partitions::segment_recovery::index_is_consistent (cognitive 20) core/partitions/src/segment_recovery.rs:2482— partitions::segment_recovery::index_is_consistent has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (12 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
partitions::io::remove_offset_files (cognitive 18) core/partitions/src/io.rs:820— partitions::io::remove_offset_files has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2, match/switch 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
partitions::segment_recovery::sweep_scratch_files_and_collect_offsets (cognitive 18) core/partitions/src/segment_recovery.rs:1149— partitions::segment_recovery::sweep_scratch_files_and_collect_offsets has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 2 (3 pts), 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.
partitions::segment_recovery::recover_by_walking_log (cognitive 18) core/partitions/src/segment_recovery.rs:1950— partitions::segment_recovery::recover_by_walking_log has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
partitions::segment_recovery::walk_chain_from_anchor (cognitive 16) core/partitions/src/segment_recovery.rs:2096— partitions::segment_recovery::walk_chain_from_anchor has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (15 pts), 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.
simulator::replica::new_shard (cognitive 35) core/simulator/src/replica.rs:152— simulator::replica::new_shard has cognitive complexity 35 (threshold 15). Drivers by points: if/else 21 (27 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
simulator::workload::state_checker::assert_applied_data_agrees (cognitive 26) core/simulator/src/workload/state_checker.rs:673— simulator::workload::state_checker::assert_applied_data_agrees has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 3 (6 pts), match/switch 1 (4 pts) (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.
simulator::workload::oracle::assert_partition_offsets_agree (cognitive 20) core/simulator/src/workload/oracle.rs:1008— simulator::workload::oracle::assert_partition_offsets_agree has cognitive complexity 20 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 3 (9 pts), boolean chains 1 (nesting depth added 12). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
simulator::workload::state_checker::assert_partition_prefixes_agree (cognitive 20) core/simulator/src/workload/state_checker.rs:589— simulator::workload::state_checker::assert_partition_prefixes_agree has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 3 (6 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
simulator::workload::oracle::assert_retired_owners_removed (cognitive 19) core/simulator/src/workload/oracle.rs:930— simulator::workload::oracle::assert_retired_owners_removed has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (6 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
simulator::workload::oracle::quiesce_failure_report (cognitive 18) core/simulator/src/workload/oracle.rs:205— simulator::workload::oracle::quiesce_failure_report has cognitive complexity 18 (threshold 15). Drivers by points: loops 6 (11 pts), if/else 2 (4 pts), match/switch 1 (3 pts) (nesting depth added 9). 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.
simulator::workload::oracle::assert_converged (cognitive 18) core/simulator/src/workload/oracle.rs:526— simulator::workload::oracle::assert_converged has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
simulator::bin::workload-fuzz::network_options (cognitive 16) core/simulator/src/bin/workload-fuzz.rs:487— simulator::bin::workload-fuzz::network_options has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, 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.
simulator::bin::workload-fuzz::run_quiesce_phase (cognitive 16) core/simulator/src/bin/workload-fuzz.rs:589— simulator::bin::workload-fuzz::run_quiesce_phase has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 5, loops 1 (2 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Duplicated block (15 lines × 2) core/binary_protocol/src/primitives/permissions.rs:120— core/binary_protocol/src/primitives/permissions.rs:120-134 | core/binary_protocol/src/primitives/permissions.rs:162-176 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) core/connectors/runtime/src/configs/connectors/http_provider.rs:411— core/connectors/runtime/src/configs/connectors/http_provider.rs:411-425 | core/connectors/runtime/src/configs/connectors/http_provider.rs:443-457 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) core/connectors/sources/postgres_source/src/lib.rs:1770— core/connectors/sources/postgres_source/src/lib.rs:1770-1784 | core/connectors/sources/postgres_source/src/lib.rs:1804-1818 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) gateways/kafka/src/protocol/handlers/alter_configs.rs:211— gateways/kafka/src/protocol/handlers/alter_configs.rs:211-225 | gateways/kafka/src/protocol/handlers/incremental_alter_configs.rs:233-247 — before extracting anything, compare `gateways/kafka/src/protocol/handlers/alter_configs.rs` and `gateways/kafka/src/protocol/handlers/incremental_alter_configs.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 84 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 2) core/server/src/dispatch/session_ops.rs:1177— core/server/src/dispatch/session_ops.rs:1177-1191 | core/server/src/dispatch/session_ops.rs:1216-1233 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) core/message_bus/src/transports/tcp_tls.rs:226— core/message_bus/src/transports/tcp_tls.rs:226-240 | core/message_bus/src/transports/wss.rs:185-199 — before extracting anything, compare `core/message_bus/src/transports/tcp_tls.rs` and `core/message_bus/src/transports/wss.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 2) foreign/java/java-sdk/src/main/java/org/apache/iggy/serde/BytesSerializer.java:382— foreign/java/java-sdk/src/main/java/org/apache/iggy/serde/BytesSerializer.java:382-396 | foreign/java/java-sdk/src/main/java/org/apache/iggy/serde/BytesSerializer.java:399-413 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (15 lines × 2) examples/java/src/main/java/org/apache/iggy/examples/multitenant/consumer/MultiTenantConsumer.java:93— examples/java/src/main/java/org/apache/iggy/examples/multitenant/consumer/MultiTenantConsumer.java:93-107 | examples/java/src/main/java/org/apache/iggy/examples/multitenant/producer/MultiTenantProducer.java:91-105 — before extracting anything, compare `examples/java/src/main/java/org/apache/iggy/examples/multitenant/consumer/MultiTenantConsumer.java` and `examples/java/src/main/java/org/apache/iggy/examples/multitenant/producer/MultiTenantProducer.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `examples/java/src/main/java/org/apache/iggy/examples/multitenant/consumer/MultiTenantConsumer.java:93` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) foreign/java/bench/src/main/java/org/apache/iggy/bench/report/IndividualMetricsCalculator.java:172— foreign/java/bench/src/main/java/org/apache/iggy/bench/report/IndividualMetricsCalculator.java:172-186 | foreign/java/bench/src/main/java/org/apache/iggy/bench/report/IndividualMetricsCalculator.java:238-252 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `foreign/java/bench/src/main/java/org/apache/iggy/bench/report/IndividualMetricsCalculator.java:172` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
No assertions: CreateClient_TcpClientDisposesTwice foreign/csharp/Iggy_SDK_Tests/ClientTests/IggyClientFactoryTests.cs:114— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: given_queries_the_rules_allow_when_validating_should_accept_them foreign/csharp/Iggy_SDK_Tests/MapperTests/MetadataChangesTests.cs:228— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: Dispose_IsIdempotent foreign/csharp/Iggy_SDK_Tests/UtilityTests/PooledBufferWriterTests.cs:116— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: BatchDispose_IsIdempotent foreign/csharp/Iggy_SDK_Tests/UtilityTests/RentedMessageBatchTests.cs:192— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: ValidateUsername_AcceptsTheServerBounds foreign/csharp/Iggy_SDK_Tests/VsrTests/CredentialBoundsTests.cs:29— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: ValidatePassword_AcceptsTheServerBounds foreign/csharp/Iggy_SDK_Tests/VsrTests/CredentialBoundsTests.cs:45— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: given_a_writer_reference_when_abandoning_should_release_the_logical_count_before_its_bytes foreign/csharp/Iggy_SDK_Tests/VsrTests/MutationLaneTests.cs:111— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: given_a_lifecycle_busy_retry_when_pausing_should_let_other_requests_through foreign/csharp/Iggy_SDK_Tests/VsrTests/PartitionContextTests.cs:479— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
Repeated repair: core/shard/src/metrics.rs core/shard/src/metrics.rs:1249— core/shard/src/metrics.rs changed 25 times in last 90 days and 13 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 2 (its worst body is FrameDropMetrics::record at line 1249), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(consensus): retry the primary's own write on prepare timeout (#4457)”; “fix(consensus): keep committed ops when restarted replicas elect (#4500)”; “fix(cluster): preserve group membership and reduce produce/poll overhead (#4169)”; “fix(partitions): complete polls on the owning shard (#4119)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 06:16:38 +01:00' --until='2026-10-28 06:16:38 +01:00' --full-history --no-merges -- core/shard/src/metrics.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: core/server/src/shell.rs core/server/src/shell.rs:93— core/server/src/shell.rs changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 1 (its worst body is server::shell::duration_to_ticks at line 93), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(server): recover stalled consumer groups after restarts (#4283)”; “fix(partitions): complete polls on the owning shard (#4119)”; “fix(shard): drive metadata repair and the commit walk from the tick (#4008)”; “fix(shard): drive partition repair and the commit walk from the tick (#4006)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 06:16:38 +01:00' --until='2026-10-28 06:16:38 +01:00' --full-history --no-merges -- core/server/src/shell.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: core/common/src/traits/client.rs core/common/src/traits/client.rs:107— core/common/src/traits/client.rs changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 1 (its worst body is Client::resolve_operation at line 107), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(sdk): drop the oldest diagnostic event instead of blocking (#4501)”; “fix(sdk): keep an explicit disconnect until the next connect (#4388)”; “fix(sdk): keep a shut down client shut down (#4374)”; “fix(server): preserve write responses and validate CLI input (#4150)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 06:16:38 +01:00' --until='2026-10-28 06:16:38 +01:00' --full-history --no-merges -- core/common/src/traits/client.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: core/connectors/sinks/quickwit_sink/src/lib.rs core/connectors/sinks/quickwit_sink/src/lib.rs:212— core/connectors/sinks/quickwit_sink/src/lib.rs changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is QuickwitSink::ingest at line 212), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(connectors): tag sink batches with the payload's schema (#4204)”; “fix(connectors): defer source checkpoints and surface sink failures (#4153)”; “fix(connectors): validate sink writes and startup readiness (#4154)”; “fix(connectors): bring quickwit_sink up to convention (#3523)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 06:16:38 +01:00' --until='2026-10-28 06:16:38 +01:00' --full-history --no-merges -- core/connectors/sinks/quickwit_sink/src/lib.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: core/connectors/sinks/elasticsearch_sink/src/lib.rs core/connectors/sinks/elasticsearch_sink/src/lib.rs:205— core/connectors/sinks/elasticsearch_sink/src/lib.rs changed 4 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is ElasticsearchSink::bulk_index_documents at line 205), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(connectors): tag sink batches with the payload's schema (#4204)”; “fix(connectors): defer source checkpoints and surface sink failures (#4153)”; “fix(connectors): validate sink writes and startup readiness (#4154)”; “fix(connectors): Harden Elasticsearch sink test readiness (#3729)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 06:16:38 +01:00' --until='2026-10-28 06:16:38 +01:00' --full-history --no-merges -- core/connectors/sinks/elasticsearch_sink/src/lib.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: core/server/src/shard_allocator.rs core/server/src/shard_allocator.rs:368— core/server/src/shard_allocator.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is ShardAllocator::to_shard_assignments at line 368), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(server): skip NUMA memory binding on a single-node host (#4243)”; “fix(server): preserve write responses and validate CLI input (#4150)”; “fix(server): resolve non-Linux clippy errors in shard binding (#4144)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 06:16:38 +01:00' --until='2026-10-28 06:16:38 +01:00' --full-history --no-merges -- core/server/src/shard_allocator.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: core/connectors/runtime/src/configs/connectors/local_provider.rs core/connectors/runtime/src/configs/connectors/local_provider.rs:148— core/connectors/runtime/src/configs/connectors/local_provider.rs changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is LocalConnectorsConfigProvider::init at line 148), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(connectors): exclude key and version from connector env mappings (#4486)”; “fix(connectors): bring quickwit_sink up to convention (#3523)”; “fix(connectors): validate connector key before it becomes a path (#4083)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 06:16:38 +01:00' --until='2026-10-28 06:16:38 +01:00' --full-history --no-merges -- core/connectors/runtime/src/configs/connectors/local_provider.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: core/connectors/runtime/src/metrics.rs core/connectors/runtime/src/metrics.rs:74— core/connectors/runtime/src/metrics.rs changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is Stage::as_label at line 74), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(connectors): tag sink batches with the payload's schema (#4204)”; “fix(connectors): close the source instance a failed start leaves behind (#4064)”; “fix(connectors): stop rendering counter metrics with a doubled _total (#3921)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 06:16:38 +01:00' --until='2026-10-28 06:16:38 +01:00' --full-history --no-merges -- core/connectors/runtime/src/metrics.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
iggy_connectors::source::source_forwarding_loop (cognitive 67) core/connectors/runtime/src/source.rs:567— iggy_connectors::source::source_forwarding_loop has cognitive complexity 67 (threshold 15). Drivers by points: if/else 30 (53 pts), match/switch 3 (8 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
iggy_connectors::sink::process_messages (cognitive 45) core/connectors/runtime/src/sink.rs:650— iggy_connectors::sink::process_messages has cognitive complexity 45 (threshold 15). Drivers by points: if/else 16 (30 pts), match/switch 4 (10 pts), loops 4 (5 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
iggy_connectors::sink::consume_messages (cognitive 39) core/connectors/runtime/src/sink.rs:364— iggy_connectors::sink::consume_messages has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (27 pts), match/switch 4 (10 pts), boolean chains 1, loops 1 (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.
iggy_connectors::run (cognitive 29) core/connectors/runtime/src/main.rs:202— iggy_connectors::run has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 10 (12 pts), 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.
iggy_connectors::sink::init (cognitive 23) core/connectors/runtime/src/sink.rs:60— iggy_connectors::sink::init has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 4 (9 pts), loops 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
iggy_connectors::source::send_with_failed_tail_retries (cognitive 23) core/connectors/runtime/src/source.rs:1102— iggy_connectors::source::send_with_failed_tail_retries has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (15 pts), match/switch 2 (5 pts), boolean chains 2, 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.
iggy_connectors::source::init (cognitive 20) core/connectors/runtime/src/source.rs:112— iggy_connectors::source::init has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 4 (9 pts), 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.
iggy_connectors::source::process_messages (cognitive 18) core/connectors/runtime/src/source.rs:1017— iggy_connectors::source::process_messages has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TodoComment foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:569— // 5004 - Consumer group already exists TODO: refactor errors — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment foreign/csharp/Iggy_SDK/Errors/ErrorFactory.cs:20— //TODO - refactor whole error system, once the contract is set and stone. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment foreign/csharp/Iggy_SDK/IggyClient/Implementations/HttpMessageStream.cs:58— //TODO - create mechanism for refreshing REDACTED token — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment foreign/csharp/Iggy_SDK/IggyClient/Implementations/HttpMessageStream.cs:59— //TODO - replace the HttpClient with IHttpClientFactory, when implementing support for ASP.NET Core DI — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment foreign/csharp/Iggy_SDK/IggyClient/Implementations/HttpMessageStream.cs:60— //TODO - the error handling pattern is pretty ugly, look into moving it into an extension method — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment foreign/csharp/Iggy_SDK/IggyClient/Implementations/HttpMessageStream.cs:755— //TODO - this doesn't work prob needs a custom json serializer — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment foreign/csharp/Iggy_SDK/IggyClient/Implementations/HttpMessageStream.cs:845— // TODO: Add binary protocol version — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×7
Members sharing a duplicated core (4 members, 50+ identical tokens) core/binary_protocol/src/requests/consumer_offsets/delete_consumer_offset.rs:56— core/binary_protocol/src/requests/consumer_offsets/delete_consumer_offset.rs:56-68 | core/binary_protocol/src/requests/consumer_offsets/get_consumer_offset.rs:50-61 | core/binary_protocol/src/requests/consumer_offsets/store_consumer_offset.rs:58-71 | core/binary_protocol/src/requests/messages/poll_messages.rs:112-126 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) core/integration/src/harness/disk.rs:197— core/integration/src/harness/disk.rs:197-224 | core/integration/src/harness/disk.rs:378-403 | core/integration/src/harness/disk.rs:408-431 | core/integration/src/harness/disk.rs:494-522 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) core/message_bus/src/lifecycle/connection_registry.rs:640— core/message_bus/src/lifecycle/connection_registry.rs:640-651 | core/message_bus/src/lifecycle/connection_registry.rs:664-683 | core/message_bus/src/lifecycle/connection_registry.rs:975-991 | core/message_bus/src/lifecycle/connection_registry.rs:1001-1019 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) core/shard/src/lib.rs:5135— core/shard/src/lib.rs:5135-5178 | core/shard/src/lib.rs:5188-5267 | core/shard/src/lib.rs:5278-5502 | core/shard/src/lib.rs:5684-5735 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) gateways/kafka/src/protocol/bounds_guard.rs:421— gateways/kafka/src/protocol/bounds_guard.rs:421-468 | gateways/kafka/src/protocol/bounds_guard.rs:476-567 | gateways/kafka/src/protocol/bounds_guard.rs:579-625 | gateways/kafka/src/protocol/bounds_guard.rs:1154-1217 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) gateways/kafka/src/protocol/bounds_guard.rs:944— gateways/kafka/src/protocol/bounds_guard.rs:944-999 | gateways/kafka/src/protocol/bounds_guard.rs:1010-1036 | gateways/kafka/src/protocol/bounds_guard.rs:1092-1140 | gateways/kafka/src/protocol/bounds_guard.rs:1154-1217 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) examples/java/src/main/java/org/apache/iggy/examples/gettingstarted/consumer/GettingStartedConsumer.java:62— examples/java/src/main/java/org/apache/iggy/examples/gettingstarted/consumer/GettingStartedConsumer.java:62-115 | examples/java/src/main/java/org/apache/iggy/examples/messageenvelope/consumer/MessageEnvelopeConsumer.java:71-124 | examples/java/src/main/java/org/apache/iggy/examples/messageheaders/consumer/MessageHeadersConsumer.java:74-119 | examples/java/src/main/java/org/apache/iggy/examples/tcptls/consumer/TcpTlsConsumer.java:83-136 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Duplicated block (7 lines × 3) core/ai/mcp/src/log.rs:161— core/ai/mcp/src/log.rs:161-167 | core/connectors/runtime/src/log.rs:114-120 | core/server_common/src/log/logger.rs:374-380 — before extracting anything, compare `core/ai/mcp/src/log.rs` and `core/connectors/runtime/src/log.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 87 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) core/ai/mcp/src/log.rs:197— core/ai/mcp/src/log.rs:197-203 | core/connectors/runtime/src/log.rs:150-156 | core/server_common/src/log/logger.rs:405-411 — before extracting anything, compare `core/ai/mcp/src/log.rs` and `core/connectors/runtime/src/log.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 87 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) core/cli/src/commands/binary_consumer_groups/get_consumer_group.rs:64— core/cli/src/commands/binary_consumer_groups/get_consumer_group.rs:64-72 | core/cli/src/commands/binary_streams/get_stream.rs:51-57 | core/cli/src/commands/binary_users/get_user.rs:54-61 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (7 lines × 3) core/connectors/sources/postgres_source/src/lib.rs:1627— core/connectors/sources/postgres_source/src/lib.rs:1627-1633 | core/connectors/sources/postgres_source/src/lib.rs:1635-1641 | core/connectors/sources/postgres_source/src/lib.rs:1651-1657 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) core/bench/dashboard/frontend/src/api/mod.rs:82— core/bench/dashboard/frontend/src/api/mod.rs:82-88 | core/bench/dashboard/frontend/src/api/mod.rs:170-176 | core/bench/dashboard/frontend/src/api/mod.rs:234-240 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) examples/java/src/main/java/org/apache/iggy/examples/messageenvelope/producer/MessageEnvelopeProducer.java:69— examples/java/src/main/java/org/apache/iggy/examples/messageenvelope/producer/MessageEnvelopeProducer.java:69-75 | examples/java/src/main/java/org/apache/iggy/examples/messageheaders/producer/MessageHeadersProducer.java:69-75 | examples/java/src/main/java/org/apache/iggy/examples/streambuilder/StreamBasic.java:119-125 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `examples/java/src/main/java/org/apache/iggy/examples/messageenvelope/producer/MessageEnvelopeProducer.java:69` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) foreign/java/bench/src/main/java/org/apache/iggy/bench/report/IndividualMetricsCalculator.java:171— foreign/java/bench/src/main/java/org/apache/iggy/bench/report/IndividualMetricsCalculator.java:171-177 | foreign/java/bench/src/main/java/org/apache/iggy/bench/report/IndividualMetricsCalculator.java:237-243 | foreign/java/bench/src/main/java/org/apache/iggy/bench/report/IndividualMetricsCalculator.java:303-309 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
IggyMetadata::install_state_transfer (cognitive 85) core/metadata/src/impls/metadata.rs:2494— IggyMetadata::install_state_transfer has cognitive complexity 85 (threshold 15). Drivers by points: if/else 40 (73 pts), boolean chains 12 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IggyMetadata::on_replicate (cognitive 20) core/metadata/src/impls/metadata.rs:1855— IggyMetadata::on_replicate has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (16 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
IggyMetadata::submit_logout_in_process (cognitive 20) core/metadata/src/impls/metadata.rs:3073— IggyMetadata::submit_logout_in_process has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (14 pts), match/switch 3 (4 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IggyMetadata::drain_request_queue_into_prepares (cognitive 18) core/metadata/src/impls/metadata.rs:4131— IggyMetadata::drain_request_queue_into_prepares has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 2 (4 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IggyMetadata::submit_register_in_process (cognitive 16) core/metadata/src/impls/metadata.rs:2895— IggyMetadata::submit_register_in_process has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 2, match/switch 1 (2 pts) (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.
IggyMetadata::repair_primary_self_acks (cognitive 16) core/metadata/src/impls/metadata.rs:3836— IggyMetadata::repair_primary_self_acks has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PartitionPrepareJournal::rewrite (cognitive 31) core/journal/src/partition_journal.rs:1337— PartitionPrepareJournal::rewrite has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (27 pts), boolean chains 3, 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.
PartitionPrepareJournal::append_batch_inner (cognitive 26) core/journal/src/partition_journal.rs:755— PartitionPrepareJournal::append_batch_inner has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 4, loops 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.
PartitionPrepareJournal::reset_with_segment_checkpoint (cognitive 25) core/journal/src/partition_journal/segments.rs:218— PartitionPrepareJournal::reset_with_segment_checkpoint has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 4, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PartitionPrepareJournal::recover_entries (cognitive 18) core/journal/src/partition_journal.rs:914— PartitionPrepareJournal::recover_entries has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), 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.
PartitionPrepareJournal::recover_segment_files (cognitive 17) core/journal/src/partition_journal/segments.rs:544— PartitionPrepareJournal::recover_segment_files has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), 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.
PartitionPrepareJournal::recover_unpublished_tail (cognitive 17) core/journal/src/partition_journal.rs:987— PartitionPrepareJournal::recover_unpublished_tail has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), 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.
Duplicated block (11 lines × 3) core/connectors/sdk/src/decoders/proto.rs:163— core/connectors/sdk/src/decoders/proto.rs:163-173 | core/connectors/sdk/src/encoders/proto.rs:195-205 | core/connectors/sdk/src/transforms/proto_convert.rs:189-199 — `core/connectors/sdk/src/decoders/proto.rs` and `core/connectors/sdk/src/encoders/proto.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 116 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (11 lines × 3) core/message_bus/src/transports/tcp_tls.rs:595— core/message_bus/src/transports/tcp_tls.rs:595-612 | core/message_bus/src/transports/ws.rs:248-258 | core/message_bus/src/transports/wss.rs:399-409 — before extracting anything, compare `core/message_bus/src/transports/tcp_tls.rs` and `core/message_bus/src/transports/wss.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 3) core/common/src/types/configuration/quic_config/quic_connection_string_options.rs:131— core/common/src/types/configuration/quic_config/quic_connection_string_options.rs:131-141 | core/common/src/types/configuration/quic_config/quic_connection_string_options.rs:155-165 | core/common/src/types/configuration/quic_config/quic_connection_string_options.rs:171-181 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 3) core/message_bus/src/client_listener/tcp.rs:65— core/message_bus/src/client_listener/tcp.rs:65-75 | core/message_bus/src/client_listener/tcp_tls.rs:107-117 | core/message_bus/src/client_listener/wss.rs:101-111 — before extracting anything, compare `core/message_bus/src/client_listener/tcp.rs` and `core/message_bus/src/client_listener/tcp_tls.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 3) core/integration/src/harness/handle/client_builder.rs:189— core/integration/src/harness/handle/client_builder.rs:189-199 | core/integration/src/harness/handle/client_builder.rs:256-266 | core/integration/src/harness/handle/client_builder.rs:311-321 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 3) examples/python/high-level/background_producer.py:43— examples/python/high-level/background_producer.py:43-53 | examples/python/high-level/consumer.py:42-52 | examples/python/high-level/producer.py:43-53 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (8 lines × 3) core/connectors/sinks/mongodb_sink/src/lib.rs:587— core/connectors/sinks/mongodb_sink/src/lib.rs:587-594 | core/connectors/sinks/postgres_sink/src/lib.rs:556-563 | core/connectors/sources/postgres_source/src/lib.rs:2492-2499 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (8 lines × 3) core/server/src/partition_reconciler.rs:837— core/server/src/partition_reconciler.rs:837-844 | core/server/src/partition_reconciler.rs:857-864 | core/server/src/partition_reconciler.rs:965-972 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 3) gateways/kafka/tools/kafka-tool/src/response.rs:309— gateways/kafka/tools/kafka-tool/src/response.rs:309-316 | gateways/kafka/tools/kafka-tool/src/response.rs:333-340 | gateways/kafka/tools/kafka-tool/src/response.rs:420-427 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 3) core/connectors/sources/mqtt_source/src/driver.rs:888— core/connectors/sources/mqtt_source/src/driver.rs:888-895 | core/connectors/sources/mqtt_source/src/driver.rs:933-940 | core/connectors/sources/mqtt_source/src/driver.rs:958-965 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 3) foreign/java/java-sdk/src/main/java/org/apache/iggy/serde/BytesDeserializer.java:711— foreign/java/java-sdk/src/main/java/org/apache/iggy/serde/BytesDeserializer.java:711-718 | foreign/java/java-sdk/src/main/java/org/apache/iggy/serde/BytesDeserializer.java:764-771 | foreign/java/java-sdk/src/main/java/org/apache/iggy/serde/BytesDeserializer.java:778-785 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 3) core/bench/src/actors/consumer/benchmark_consumer.rs:312— core/bench/src/actors/consumer/benchmark_consumer.rs:312-319 | core/bench/src/actors/producer/benchmark_producer.rs:307-314 | core/bench/src/actors/producing_consumer/benchmark_producing_consumer.rs:391-398 — `core/bench/src/actors/consumer/benchmark_consumer.rs` and `core/bench/src/actors/producer/benchmark_producer.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 205 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
iggy_connector_clickhouse_sink::binary::serialize_value (cognitive 55) core/connectors/sinks/clickhouse_sink/src/binary.rs:83— iggy_connector_clickhouse_sink::binary::serialize_value has cognitive complexity 55 (threshold 15). Drivers by points: if/else 13 (30 pts), loops 5 (12 pts), match/switch 5 (10 pts), boolean chains 3 (nesting depth added 29). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
iggy_connector_clickhouse_sink::binary::strip_timezone (cognitive 42) core/connectors/sinks/clickhouse_sink/src/binary.rs:801— iggy_connector_clickhouse_sink::binary::strip_timezone has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (29 pts), match/switch 2 (12 pts), loops 1 (nesting depth added 28). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
iggy_connector_clickhouse_sink::schema::parse_type_inner (cognitive 22) core/connectors/sinks/clickhouse_sink/src/schema.rs:155— iggy_connector_clickhouse_sink::schema::parse_type_inner has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17 (20 pts), boolean chains 1, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
iggy_connector_clickhouse_sink::schema::strip_named_tuple_field (cognitive 18) core/connectors/sinks/clickhouse_sink/src/schema.rs:402— iggy_connector_clickhouse_sink::schema::strip_named_tuple_field has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
iggy_connector_clickhouse_sink::binary::parse_decimal_str (cognitive 16) core/connectors/sinks/clickhouse_sink/src/binary.rs:605— iggy_connector_clickhouse_sink::binary::parse_decimal_str has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 2, match/switch 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
IggyConsumer::poll_next (cognitive 50) core/sdk/src/clients/consumer.rs:1416— IggyConsumer::poll_next has cognitive complexity 50 (threshold 15). Drivers by points: if/else 12 (31 pts), boolean chains 11, match/switch 2 (5 pts), loops 2 (3 pts) (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.
IggyConsumer::init (cognitive 27) core/sdk/src/clients/consumer.rs:926— IggyConsumer::init has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (19 pts), match/switch 3 (5 pts), 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.
IggyConsumer::consume_messages (cognitive 26) core/sdk/src/consumer_ext/consumer_message_ext.rs:54— IggyConsumer::consume_messages has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (16 pts), match/switch 3 (6 pts), boolean chains 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.
IggyConsumer::shutdown (cognitive 21) core/sdk/src/clients/consumer.rs:1574— IggyConsumer::shutdown has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 4, loops 1 (2 pts), match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IggyConsumer::initialize_consumer_group (cognitive 17) core/sdk/src/clients/consumer.rs:1233— IggyConsumer::initialize_consumer_group has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 2 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
message_bus::transports::ws::run_pump (cognitive 37) core/message_bus/src/transports/ws.rs:186— message_bus::transports::ws::run_pump has cognitive complexity 37 (threshold 15). Drivers by points: match/switch 5 (15 pts), if/else 3 (12 pts), loops 4 (10 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
message_bus::transports::wss::run_pump (cognitive 37) core/message_bus/src/transports/wss.rs:334— message_bus::transports::wss::run_pump has cognitive complexity 37 (threshold 15). Drivers by points: match/switch 5 (15 pts), if/else 3 (12 pts), loops 4 (10 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
message_bus::transports::tcp_tls::run_pump (cognitive 28) core/message_bus/src/transports/tcp_tls.rs:521— message_bus::transports::tcp_tls::run_pump has cognitive complexity 28 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 4 (10 pts), match/switch 3 (8 pts) (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.
message_bus::installer::replica::install_replica_conn (cognitive 23) core/message_bus/src/installer/replica.rs:393— message_bus::installer::replica::install_replica_conn has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 4, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
message_bus::transports::tcp::writer_loop (cognitive 18) core/message_bus/src/transports/tcp.rs:397— message_bus::transports::tcp::writer_loop has cognitive complexity 18 (threshold 15). Drivers by points: loops 4 (7 pts), if/else 3 (6 pts), match/switch 2 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Change coupling: quic_client.rs ↔ tcp_client.rs core/sdk/src/quic/quic_client.rs:1— `core/sdk/src/quic/quic_client.rs` and `core/sdk/src/tcp/tcp_client.rs` change together 73% of the time (8 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `b1166a59` fix(sdk): stop a reconnect sweep when the client shuts down (#4507); `69ab058c` fix(sdk): drop the oldest diagnostic event instead of blocking (#4501); `8ded5478` fix(sdk): keep an explicit disconnect until the next connect (#4388) — run `git show` on any of them.
Change coupling: partition_helpers.rs ↔ REDACTED core/server/src/partition_helpers.rs:1— `core/server/src/partition_helpers.rs` and `core/shard/src/lib.rs` change together 69% of the time (9 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `39c1bd0a` fix(partitions): reserve offsets before confirming them (#3975); `bad22c03` feat(server): dedup partition writes with per-group client table slic…; `e9b1c9a1` fix(cluster): stop a late partition materialiser from wedging its gro… — run `git show` on any of them.
Change coupling: benchmark_producer.rs ↔ common.rs core/bench/src/actors/producer/benchmark_producer.rs:1— `core/bench/src/actors/producer/benchmark_producer.rs` and `core/bench/src/args/common.rs` change together 62% of the time (8 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `c0340966` fix(bench): pace warmup and rewind consumers (#4314); `fcc5a447` feat(bench): prettier table output (#3090); `8294ccef` feat(bench): add high-level consumer API for benchmarking (#1855) — run `git show` on any of them.
Change coupling: iggy_partition.rs ↔ metrics.rs core/partitions/src/iggy_partition.rs:1— `core/partitions/src/iggy_partition.rs` and `core/shard/src/metrics.rs` change together 58% of the time (7 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `44c7dc83` fix(consensus): retry the primary's own write on prepare timeout (#4457); `22778643` fix(shard): drive metadata repair and the commit walk from the tick (…; `9914f5a8` fix(shard): drive partition repair and the commit walk from the tick … — run `git show` on any of them.
Change coupling: metrics.rs ↔ REDACTED core/shard/src/metrics.rs:1— `core/shard/src/metrics.rs` and `core/simulator/src/lib.rs` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `44c7dc83` fix(consensus): retry the primary's own write on prepare timeout (#4457); `22778643` fix(shard): drive metadata repair and the commit walk from the tick (…; `9914f5a8` fix(shard): drive partition repair and the commit walk from the tick … — run `git show` on any of them.
Duplicated block (19 lines × 2) foreign/csharp/Iggy_SDK/Contracts/Tcp/TcpContracts.cs:731— foreign/csharp/Iggy_SDK/Contracts/Tcp/TcpContracts.cs:731-749 | foreign/csharp/Iggy_SDK/Contracts/Tcp/TcpContracts.cs:868-886 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) core/binary_protocol/src/requests/users/login_register_with_pat.rs:100— core/binary_protocol/src/requests/users/login_register_with_pat.rs:100-118 | core/binary_protocol/src/requests/users/login_user.rs:102-120 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (19 lines × 2) core/partitions/src/iggy_index_writer.rs:58— core/partitions/src/iggy_index_writer.rs:58-76 | core/partitions/src/messages_writer.rs:70-88 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (19 lines × 2) core/server/src/http/handlers.rs:1771— core/server/src/http/handlers.rs:1771-1789 | core/server/src/http/handlers.rs:1839-1857 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) examples/go/getting-started/consumer/main.go:41— examples/go/getting-started/consumer/main.go:41-59 | examples/go/getting-started/producer/main.go:43-61 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (9 lines × 3) core/binary_protocol/src/primitives/permissions.rs:107— core/binary_protocol/src/primitives/permissions.rs:107-115 | core/binary_protocol/src/primitives/permissions.rs:160-168 | core/binary_protocol/src/primitives/permissions.rs:219-227 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 3) gateways/kafka/src/protocol/bounds_guard.rs:945— gateways/kafka/src/protocol/bounds_guard.rs:945-953 | gateways/kafka/src/protocol/bounds_guard.rs:1093-1101 | gateways/kafka/src/protocol/bounds_guard.rs:1155-1163 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 3) core/sdk/src/http/http_client.rs:345— core/sdk/src/http/http_client.rs:345-353 | core/sdk/src/quic/quic_client.rs:71-79 | core/sdk/src/tcp/tcp_client.rs:77-85 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (9 lines × 3) core/partitions/src/segment_recovery.rs:2357— core/partitions/src/segment_recovery.rs:2357-2365 | core/partitions/src/segment_recovery.rs:2492-2500 | core/partitions/src/segment_recovery.rs:2506-2514 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 3) examples/java/src/main/java/org/apache/iggy/examples/gettingstarted/consumer/GettingStartedConsumer.java:52— examples/java/src/main/java/org/apache/iggy/examples/gettingstarted/consumer/GettingStartedConsumer.java:52-60 | examples/java/src/main/java/org/apache/iggy/examples/messageenvelope/consumer/MessageEnvelopeConsumer.java:61-69 | examples/java/src/main/java/org/apache/iggy/examples/messageheaders/consumer/MessageHeadersConsumer.java:64-72 — before extracting anything, compare `examples/java/src/main/java/org/apache/iggy/examples/gettingstarted/consumer/GettingStartedConsumer.java` and `examples/java/src/main/java/org/apache/iggy/examples/messageenvelope/consumer/MessageEnvelopeConsumer.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 86 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) core/shard/src/lib.rs:5136— core/shard/src/lib.rs:5136-5142 | core/shard/src/lib.rs:5189-5195 | core/shard/src/lib.rs:5685-5690 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 3) core/common/src/types/configuration/quic_config/quic_client_config_builder.rs:165— core/common/src/types/configuration/quic_config/quic_client_config_builder.rs:165-170 | core/common/src/types/configuration/tcp_config/tcp_client_config_builder.rs:114-119 | core/common/src/types/configuration/websocket_config/websocket_client_config_builder.rs:149-154 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (6 lines × 3) core/binary_protocol/src/primitives/metadata_changes/body.rs:706— core/binary_protocol/src/primitives/metadata_changes/body.rs:706-711 | core/binary_protocol/src/primitives/metadata_changes/mod.rs:270-275 | core/binary_protocol/src/primitives/metadata_changes/mod.rs:292-297 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (6 lines × 3) foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/ConsumerGroupsTcpClient.java:134— foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/ConsumerGroupsTcpClient.java:134-145 | foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/ConsumerGroupsTcpClient.java:152-163 | foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/ConsumerGroupsTcpClient.java:185-190 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 3) examples/csharp/src/GettingStarted/Iggy_SDK.Examples.GettingStarted.Producer/Utils.cs:39— examples/csharp/src/GettingStarted/Iggy_SDK.Examples.GettingStarted.Producer/Utils.cs:39-44 | examples/csharp/src/MessageEnvelope/Iggy_SDK.Examples.MessageEnvelope.Producer/Utils.cs:40-45 | examples/csharp/src/MessageHeaders/Iggy_SDK.Examples.MessageHeaders.Producer/Utils.cs:41-46 — before extracting anything, compare `examples/csharp/src/MessageEnvelope/Iggy_SDK.Examples.MessageEnvelope.Producer/Utils.cs` and `examples/csharp/src/MessageHeaders/Iggy_SDK.Examples.MessageHeaders.Producer/Utils.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 81 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Off the main sequence: cpu_allocation — cpu_allocation: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
Off the main sequence: github.com/apache/iggy/foreign/go — github.com/apache/iggy/foreign/go: abstractness 0.01, instability 0.00, distance 0.99 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
Off the main sequence: iggy_binary_protocol — iggy_binary_protocol: abstractness 0.02, instability 0.00, distance 0.98 — zone of pain — concrete and depended on by 16 project(s), so it's rigid to change.
Off the main sequence: iggy_connector_sdk — iggy_connector_sdk: abstractness 0.07, instability 0.07, distance 0.86 — zone of pain — concrete and depended on by 25 project(s), so it's rigid to change.
Off the main sequence: iggy (Cargo) — iggy (Cargo): abstractness 0.06, instability 0.15, distance 0.78 — zone of pain — concrete and depended on by 11 project(s), so it's rigid to change.
Unfinished stub — throws NotImplementedException foreign/csharp/Iggy_SDK/JsonConverters/ConsumerConverter.cs:27— A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException foreign/csharp/Iggy_SDK/JsonConverters/ExpiryConverter.cs:37— A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException foreign/csharp/Iggy_SDK/JsonConverters/MessageConverter.cs:27— A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException foreign/csharp/Iggy_SDK/JsonConverters/MessagesConverter.cs:36— A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException foreign/csharp/Iggy_SDK/JsonConverters/SizeConverter.cs:50— A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
Duplicated block (9 lines × 2 locations) foreign/node/src/debug-send.ts:68— foreign/node/src/debug-send.ts:68 · foreign/node/src/debug.ts:67 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (9 lines × 2 locations) foreign/node/src/wire/client/client.utils.ts:31— foreign/node/src/wire/client/client.utils.ts:31 · foreign/node/src/wire/user/user.utils.ts:69 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (9 lines × 2 locations) foreign/node/src/wire/consumer-group/get-group.command.ts:37— foreign/node/src/wire/consumer-group/get-group.command.ts:37 · foreign/node/src/wire/topic/get-topic.command.ts:45 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (9 lines × 2 locations) foreign/node/src/wire/topic/create-topic.command.ts:132— foreign/node/src/wire/topic/create-topic.command.ts:132 · foreign/node/src/wire/topic/update-topic.command.ts:84 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (9 lines × 2 locations) web/src/lib/api/clientApi.ts:47— web/src/lib/api/clientApi.ts:47 · web/src/lib/api/fetchApi.ts:37 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Duplicated block (8 lines × 2 locations) REDACTED:255— REDACTED:255 · REDACTED:263 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (8 lines × 2 locations) foreign/node/src/wire/cluster/cluster.utils.ts:56— foreign/node/src/wire/cluster/cluster.utils.ts:56 · foreign/node/src/wire/cluster/cluster.utils.ts:131 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (8 lines × 2 locations) foreign/node/src/wire/session/login.utils.ts:54— foreign/node/src/wire/session/login.utils.ts:54 · foreign/node/src/wire/user/create-user.command.ts:60 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (8 lines × 2 locations) foreign/node/src/wire/stream/stream.utils.ts:70— foreign/node/src/wire/stream/stream.utils.ts:70 · foreign/node/src/wire/topic/topic.utils.ts:142 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (8 lines × 2 locations) foreign/node/src/wire/user/permissions.utils.ts:251— foreign/node/src/wire/user/permissions.utils.ts:251 · foreign/node/src/wire/user/permissions.utils.ts:318 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2 locations) foreign/node/src/bdd/metadata-changes.ts:169— foreign/node/src/bdd/metadata-changes.ts:169 · foreign/node/src/bdd/resource-options.ts:148 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Duplicated block (7 lines × 2 locations) foreign/node/src/wire/cluster/cluster.utils.ts:72— foreign/node/src/wire/cluster/cluster.utils.ts:72 · foreign/node/src/wire/cluster/cluster.utils.ts:137 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (7 lines × 2 locations) foreign/node/src/wire/message/iggy-header.utils.ts:87— foreign/node/src/wire/message/iggy-header.utils.ts:87 · foreign/node/src/wire/message/iggy-header.utils.ts:157 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2 locations) foreign/node/src/wire/system/metadata-changes.utils.ts:895— foreign/node/src/wire/system/metadata-changes.utils.ts:895 · foreign/node/src/wire/system/metadata-changes.utils.ts:903 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (7 lines × 2 locations) foreign/node/src/wire/user/permissions.utils.ts:159— foreign/node/src/wire/user/permissions.utils.ts:159 · foreign/node/src/wire/user/permissions.utils.ts:243 — all 2 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases.
Swallowed exception (empty catch) foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:433— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:770— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.Vsr.cs:221— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) examples/csharp/src/Iggy_SDK.Examples.Shared/ExampleHelpers.cs:43— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) examples/csharp/src/Iggy_SDK.Examples.Shared/ExampleHelpers.cs:70— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
iggy_connectors::source::source_forwarding_loop (cyclomatic 31) core/connectors/runtime/src/source.rs:567— iggy_connectors::source::source_forwarding_loop 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.
iggy_connectors::sink::process_messages (cyclomatic 23) core/connectors/runtime/src/sink.rs:650— iggy_connectors::sink::process_messages 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.
iggy_connectors::run (cyclomatic 21) core/connectors/runtime/src/main.rs:202— iggy_connectors::run 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.
iggy_connectors::sink::consume_messages (cyclomatic 18) core/connectors/runtime/src/sink.rs:364— iggy_connectors::sink::consume_messages 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.
message_bus::installer::replica::install_replica_conn (cyclomatic 20) core/message_bus/src/installer/replica.rs:393— message_bus::installer::replica::install_replica_conn has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
message_bus::transports::ws::run_pump (cyclomatic 19) core/message_bus/src/transports/ws.rs:186— message_bus::transports::ws::run_pump has cyclomatic complexity 19 (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.
message_bus::transports::wss::run_pump (cyclomatic 19) core/message_bus/src/transports/wss.rs:334— message_bus::transports::wss::run_pump has cyclomatic complexity 19 (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.
message_bus::transports::tcp_tls::run_pump (cyclomatic 16) core/message_bus/src/transports/tcp_tls.rs:521— message_bus::transports::tcp_tls::run_pump 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.
shard::dispatch_vsr_actions (cognitive 54) core/shard/src/lib.rs:13287— shard::dispatch_vsr_actions has cognitive complexity 54 (threshold 15). Drivers by points: if/else 11 (34 pts), loops 6 (13 pts), match/switch 3 (6 pts), boolean chains 1 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
shard::dispatch_partition_journal_actions (cognitive 26) core/shard/src/lib.rs:13621— shard::dispatch_partition_journal_actions has cognitive complexity 26 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 5 (12 pts), match/switch 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
shard::reconcile_partition_view_divergence (cognitive 20) core/shard/src/lib.rs:12923— shard::reconcile_partition_view_divergence has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
shard::reconcile_metadata_view_log (cognitive 19) core/shard/src/lib.rs:12796— shard::reconcile_metadata_view_log has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
kafka_message_gen::response::decode_body (cognitive 53) gateways/kafka/tools/kafka-tool/src/response.rs:208— kafka_message_gen::response::decode_body has cognitive complexity 53 (threshold 15). Drivers by points: loops 14 (32 pts), if/else 10 (20 pts), match/switch 1 (nesting depth added 28). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
kafka_message_gen::run_send (cognitive 44) gateways/kafka/tools/kafka-tool/src/main.rs:808— kafka_message_gen::run_send has cognitive complexity 44 (threshold 15). Drivers by points: if/else 9 (33 pts), match/switch 2 (6 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
kafka_message_gen::build_payload (cognitive 29) gateways/kafka/tools/kafka-tool/src/main.rs:252— kafka_message_gen::build_payload has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (28 pts), match/switch 1 (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
kafka_message_gen::cmd_generate (cognitive 18) gateways/kafka/tools/kafka-tool/src/main.rs:694— kafka_message_gen::cmd_generate has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Simulator::step_with_senders (cognitive 33) core/simulator/src/lib.rs:963— Simulator::step_with_senders has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (19 pts), match/switch 3 (9 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Simulator::reconcile_transitions (cognitive 24) core/simulator/src/lib.rs:1250— Simulator::reconcile_transitions has cognitive complexity 24 (threshold 15). Drivers by points: loops 6 (12 pts), if/else 3 (9 pts), match/switch 1 (3 pts) (nesting depth added 14). 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.
Simulator::try_await_setup_reply (cognitive 20) core/simulator/src/lib.rs:869— Simulator::try_await_setup_reply has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Simulator::build_inner (cognitive 18) core/simulator/src/lib.rs:393— Simulator::build_inner has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 6 (9 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
consensus::view_change_quorum::dvc_suffix_decode (cognitive 27) core/consensus/src/view_change_quorum.rs:366— consensus::view_change_quorum::dvc_suffix_decode has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (23 pts), boolean chains 3, 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.
consensus::dvc_merge::tally_op (cognitive 25) core/consensus/src/dvc_merge.rs:216— consensus::dvc_merge::tally_op has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 4, match/switch 1 (4 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
consensus::dvc_merge::merge_dvc_quorum (cognitive 24) core/consensus/src/dvc_merge.rs:522— consensus::dvc_merge::merge_dvc_quorum has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
consensus::dvc_merge::committed_elsewhere (cognitive 21) core/consensus/src/dvc_merge.rs:371— consensus::dvc_merge::committed_elsewhere has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ServerHandle::start (cognitive 25) core/integration/src/harness/handle/server.rs:1013— ServerHandle::start has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 6, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ServerHandle::set_protocol_addresses (cognitive 17) core/integration/src/harness/handle/server.rs:516— ServerHandle::set_protocol_addresses has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
ServerHandle::build_envs (cognitive 16) core/integration/src/harness/handle/server.rs:395— ServerHandle::build_envs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (12 pts), loops 2, boolean chains 1, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ServerHandle::start_dependents (cognitive 16) core/integration/src/harness/handle/server.rs:903— ServerHandle::start_dependents has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
integration::harness::disk::collect_comparable_files (cognitive 17) core/integration/src/harness/disk.rs:197— integration::harness::disk::collect_comparable_files has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (integration::harness::disk::total_log_bytes) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
integration::harness::disk::total_log_bytes (cognitive 17) core/integration/src/harness/disk.rs:378— integration::harness::disk::total_log_bytes has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (integration::harness::disk::collect_comparable_files) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
integration::bench_utils::run_bench_and_wait_for_finish (cognitive 16) core/integration/src/bench_utils.rs:42— integration::bench_utils::run_bench_and_wait_for_finish has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 2 (3 pts), boolean chains 2, match/switch 1 (2 pts) (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.
integration::harness::config::resolve::resolve_config_paths (cognitive 16) core/integration/src/harness/config/resolve.rs:47— integration::harness::config::resolve::resolve_config_paths has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 2, match/switch 1 (2 pts), 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.
Duplicated block (20 lines × 2) foreign/csharp/Iggy_SDK/JsonConverters/MessageConverter.cs:92— foreign/csharp/Iggy_SDK/JsonConverters/MessageConverter.cs:92-111 | foreign/csharp/Iggy_SDK/JsonConverters/UserHeadersConverter.cs:237-256 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (20 lines × 2) core/partitions/src/iggy_partition.rs:9175— core/partitions/src/iggy_partition.rs:9175-9194 | core/partitions/src/iggy_partition.rs:12987-13006 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 2) core/partitions/src/segment_recovery.rs:1781— core/partitions/src/segment_recovery.rs:1781-1800 | core/partitions/src/segment_recovery.rs:1803-1822 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 2) foreign/java/java-sdk/src/main/java/org/apache/iggy/client/blocking/http/MetadataChangesJson.java:128— foreign/java/java-sdk/src/main/java/org/apache/iggy/client/blocking/http/MetadataChangesJson.java:128-147 | foreign/java/java-sdk/src/main/java/org/apache/iggy/serde/MetadataChangesReader.java:170-189 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `body` to `JsonNode` in one and `ByteBuf` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (14 lines × 3) core/binary_protocol/src/primitives/options.rs:155— core/binary_protocol/src/primitives/options.rs:155-168 | core/binary_protocol/src/responses/system/describe_options.rs:77-90 | core/binary_protocol/src/responses/system/describe_options.rs:95-108 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (14 lines × 3) core/binary_protocol/src/responses/streams/get_stream.rs:85— core/binary_protocol/src/responses/streams/get_stream.rs:85-98 | core/binary_protocol/src/responses/streams/stream_response.rs:81-94 | core/binary_protocol/src/responses/users/user_response.rs:75-88 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (14 lines × 3) core/binary_protocol/src/requests/streams/delete_stream.rs:30— core/binary_protocol/src/requests/streams/delete_stream.rs:30-43 | core/binary_protocol/src/requests/streams/get_stream.rs:30-43 | core/binary_protocol/src/requests/topics/get_topics.rs:30-43 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (14 lines × 3) foreign/go/client/tcp/tcp_driver.go:288— foreign/go/client/tcp/tcp_driver.go:288-301 | foreign/go/client/tcp/tcp_driver.go:318-331 | foreign/go/client/tcp/tcp_driver.go:475-488 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `foreign/go/client/tcp/tcp_driver.go:288` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 3) core/integration/src/harness/disk.rs:199— core/integration/src/harness/disk.rs:199-211 | core/integration/src/harness/disk.rs:380-392 | core/integration/src/harness/disk.rs:496-508 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (13 lines × 3) core/connectors/sdk/src/decoders/proto.rs:175— core/connectors/sdk/src/decoders/proto.rs:175-187 | core/connectors/sdk/src/encoders/proto.rs:207-222 | core/connectors/sdk/src/transforms/proto_convert.rs:201-213 — `core/connectors/sdk/src/decoders/proto.rs` and `core/connectors/sdk/src/encoders/proto.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 116 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (13 lines × 3) core/connectors/sdk/src/decoders/proto.rs:67— core/connectors/sdk/src/decoders/proto.rs:67-79 | core/connectors/sdk/src/encoders/proto.rs:89-101 | core/connectors/sdk/src/transforms/proto_convert.rs:92-104 — `core/connectors/sdk/src/decoders/proto.rs` and `core/connectors/sdk/src/encoders/proto.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 116 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (13 lines × 3) foreign/java/external-processors/iggy-connector-flink/iggy-flink-examples/src/main/java/org/apache/iggy/flink/example/MultiStreamJoinJob.java:148— foreign/java/external-processors/iggy-connector-flink/iggy-flink-examples/src/main/java/org/apache/iggy/flink/example/MultiStreamJoinJob.java:148-160 | foreign/java/external-processors/iggy-connector-flink/iggy-flink-examples/src/main/java/org/apache/iggy/flink/example/StreamTransformJob.java:128-140 | foreign/java/external-processors/iggy-connector-flink/iggy-flink-examples/src/main/java/org/apache/iggy/flink/example/WordCountJob.java:123-135 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `foreign/java/external-processors/iggy-connector-flink/iggy-flink-examples/src/main/java/org/apache/iggy/flink/example/MultiStreamJoinJob.java:148` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12–13 lines × 2) core/connectors/sdk/src/decoders/proto.rs:196— core/connectors/sdk/src/decoders/proto.rs:196-207 | core/connectors/sdk/src/encoders/proto.rs:231-243 — `core/connectors/sdk/src/decoders/proto.rs` and `core/connectors/sdk/src/encoders/proto.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 116 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (12–13 lines × 2) core/server/src/partition_helpers.rs:709— core/server/src/partition_helpers.rs:709-720 | core/server/src/partition_helpers.rs:1061-1073 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12–13 lines × 2) core/server_common/src/bootstrap.rs:127— core/server_common/src/bootstrap.rs:127-138 | core/server_common/src/fs_utils.rs:119-131 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (12–13 lines × 2) foreign/php/src/metadata_changes.rs:1638— foreign/php/src/metadata_changes.rs:1638-1649 | foreign/python/src/metadata_changes.rs:1292-1304 — before extracting anything, compare `foreign/php/src/metadata_changes.rs` and `foreign/python/src/metadata_changes.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (11–12 lines × 2) core/connectors/runtime/src/sink.rs:714— core/connectors/runtime/src/sink.rs:714-725 | core/connectors/runtime/src/source.rs:1032-1042 — before extracting anything, compare `core/connectors/runtime/src/sink.rs` and `core/connectors/runtime/src/source.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11–12 lines × 2) core/server_common/src/iobuf.rs:489— core/server_common/src/iobuf.rs:489-500 | core/server_common/src/iobuf.rs:525-535 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–12 lines × 2) foreign/swift/Sources/Iggy/Models/Resources.swift:112— foreign/swift/Sources/Iggy/Models/Resources.swift:112-122 | foreign/swift/Sources/Iggy/Models/Resources.swift:163-174 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–12 lines × 2) core/bench/src/actors/consumer/benchmark_consumer.rs:107— core/bench/src/actors/consumer/benchmark_consumer.rs:107-117 | core/bench/src/actors/producer/benchmark_producer.rs:108-119 — `core/bench/src/actors/consumer/benchmark_consumer.rs` and `core/bench/src/actors/producer/benchmark_producer.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 205 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (12 lines × 2 locations) foreign/node/src/wire/stream/get-stream.command.ts:27— foreign/node/src/wire/stream/get-stream.command.ts:27 · foreign/node/src/wire/user/get-user.command.ts:28 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (12 lines × 2 locations) foreign/node/src/wire/user/permissions.utils.ts:291— foreign/node/src/wire/user/permissions.utils.ts:291 · foreign/node/src/wire/user/permissions.utils.ts:349 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (12 lines × 2 locations) foreign/node/src/wire/vsr/register.ts:61— foreign/node/src/wire/vsr/register.ts:61 · foreign/node/src/wire/vsr/register.ts:81 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (12 lines × 2 locations) web/src/lib/components/Modals/InspectMessage.svelte:52— web/src/lib/components/Modals/InspectMessage.svelte:52 · web/src/lib/components/Modals/InspectMessage.svelte:65 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
X18 · Disposal-pattern correctness· Owned disposable field is never released · ×4
Owned disposable field is never released foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:88— `IggyConsumer` implements `IDisposable` — so it has told every caller it holds something worth releasing — and it constructs `_pollingSemaphore` itself (line 88), which makes that instance its own. But `_pollingSemaphore` is named in none of the methods the disposal search covered: `DisposeAsync` (line 136), `CompleteReceiveChannels` (line 226), `SamePartition` (line 258), `LeaveConsumerGroupAsync` (line 543), `WithLaneRecoveryAsync` (line 736) — that is `Dispose` plus every method `Dispose` calls BY NAME, so a release reached through an interface, a delegate or a base class is not followed and is worth checking before acting. On what was read, the type's disposal releases everything except the one thing it owns. A disposable the owner never disposes is held until finalization if its type has a finalizer, and forever if it does not — which for a synchronisation primitive, a timer, a stream or a handle means the resource accumulates once per instance for the life of the process. Release it in `Dispose` (`_pollingSemaphore?.Dispose();`), or, if it truly does not need releasing, drop `IDisposable` from the type so the claim and the behaviour agree.
Owned disposable field is never released foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.cs:64— `TcpMessageStream` implements `IDisposable` — so it has told every caller it holds something worth releasing — and it constructs `_connectGate` itself (line 64), which makes that instance its own. But `_connectGate` is named in none of the methods the disposal search covered: `Dispose` (line 115), `StopHeartbeat` (line 889), `SetConnectionState` (line 1316) — that is `Dispose` plus every method `Dispose` calls BY NAME, so a release reached through an interface, a delegate or a base class is not followed and is worth checking before acting. On what was read, the type's disposal releases everything except the one thing it owns. A disposable the owner never disposes is held until finalization if its type has a finalizer, and forever if it does not — which for a synchronisation primitive, a timer, a stream or a handle means the resource accumulates once per instance for the life of the process. Release it in `Dispose` (`_connectGate?.Dispose();`), or, if it truly does not need releasing, drop `IDisposable` from the type so the claim and the behaviour agree.
Owned disposable field is never released foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.cs:71— `TcpMessageStream` implements `IDisposable` — so it has told every caller it holds something worth releasing — and it constructs `_sendingSemaphore` itself (line 71), which makes that instance its own. But `_sendingSemaphore` is named in none of the methods the disposal search covered: `Dispose` (line 115), `StopHeartbeat` (line 889), `SetConnectionState` (line 1316) — that is `Dispose` plus every method `Dispose` calls BY NAME, so a release reached through an interface, a delegate or a base class is not followed and is worth checking before acting. On what was read, the type's disposal releases everything except the one thing it owns. A disposable the owner never disposes is held until finalization if its type has a finalizer, and forever if it does not — which for a synchronisation primitive, a timer, a stream or a handle means the resource accumulates once per instance for the life of the process. Release it in `Dispose` (`_sendingSemaphore?.Dispose();`), or, if it truly does not need releasing, drop `IDisposable` from the type so the claim and the behaviour agree.
Owned disposable field is never released foreign/csharp/Iggy_SDK/Vsr/VsrConnection.cs:56— `VsrConnection` implements `IDisposable` — so it has told every caller it holds something worth releasing — and it constructs `_pendingCapacity` itself (line 56), which makes that instance its own. But `_pendingCapacity` is named in none of the methods the disposal search covered: `Dispose` (line 89), `Fail` (line 483) — that is `Dispose` plus every method `Dispose` calls BY NAME, so a release reached through an interface, a delegate or a base class is not followed and is worth checking before acting. On what was read, the type's disposal releases everything except the one thing it owns. A disposable the owner never disposes is held until finalization if its type has a finalizer, and forever if it does not — which for a synchronisation primitive, a timer, a stream or a handle means the resource accumulates once per instance for the life of the process. Release it in `Dispose` (`_pendingCapacity?.Dispose();`), or, if it truly does not need releasing, drop `IDisposable` from the type so the claim and the behaviour agree.
kafka_message_gen::build_payload (cyclomatic 44) gateways/kafka/tools/kafka-tool/src/main.rs:252— kafka_message_gen::build_payload has cyclomatic complexity 44 (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.
kafka_message_gen::response::decode_body (cyclomatic 36) gateways/kafka/tools/kafka-tool/src/response.rs:208— kafka_message_gen::response::decode_body has cyclomatic complexity 36 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
kafka_message_gen::run_send (cyclomatic 17) gateways/kafka/tools/kafka-tool/src/main.rs:808— kafka_message_gen::run_send 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.
IggyMetadata::install_state_transfer (cyclomatic 43) core/metadata/src/impls/metadata.rs:2494— IggyMetadata::install_state_transfer has cyclomatic complexity 43 (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.
IggyMetadata::on_replicate (cyclomatic 17) core/metadata/src/impls/metadata.rs:1855— IggyMetadata::on_replicate has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
IggyMetadata::submit_logout_in_process (cyclomatic 17) core/metadata/src/impls/metadata.rs:3073— IggyMetadata::submit_logout_in_process 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.
metadata::stm::authz::authorize (cyclomatic 35) core/metadata/src/stm/authz.rs:241— metadata::stm::authz::authorize has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
metadata::impls::recovery::recover (cyclomatic 28) core/metadata/src/impls/recovery.rs:433— metadata::impls::recovery::recover 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.
metadata::impls::metadata::apply_committed_prepare (cyclomatic 16) core/metadata/src/impls/metadata.rs:921— metadata::impls::metadata::apply_committed_prepare 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.
IggyConsumer::poll_next (cyclomatic 29) core/sdk/src/clients/consumer.rs:1416— IggyConsumer::poll_next 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.
IggyConsumer::init (cyclomatic 20) core/sdk/src/clients/consumer.rs:926— IggyConsumer::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.
IggyConsumer::shutdown (cyclomatic 17) core/sdk/src/clients/consumer.rs:1574— IggyConsumer::shutdown 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.
iggy_gateway_kafka::protocol::bounds_guard::validate_fetch_shape (cyclomatic 23) gateways/kafka/src/protocol/bounds_guard.rs:476— iggy_gateway_kafka::protocol::bounds_guard::validate_fetch_shape 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.
iggy_gateway_kafka::group::state::join_step (cyclomatic 17) gateways/kafka/src/group/state.rs:1082— iggy_gateway_kafka::group::state::join_step has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
iggy_gateway_kafka::protocol::handlers::produce::handle (cyclomatic 16) gateways/kafka/src/protocol/handlers/produce.rs:88— iggy_gateway_kafka::protocol::handlers::produce::handle has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PartitionPrepareJournal::reset_with_segment_checkpoint (cyclomatic 18) core/journal/src/partition_journal/segments.rs:218— PartitionPrepareJournal::reset_with_segment_checkpoint 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.
PartitionPrepareJournal::append_batch_inner (cyclomatic 17) core/journal/src/partition_journal.rs:755— PartitionPrepareJournal::append_batch_inner 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.
PartitionPrepareJournal::rewrite (cyclomatic 16) core/journal/src/partition_journal.rs:1337— PartitionPrepareJournal::rewrite 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.
metadata::impls::recovery::recover (cognitive 42) core/metadata/src/impls/recovery.rs:433— metadata::impls::recovery::recover has cognitive complexity 42 (threshold 15). Drivers by points: if/else 21 (36 pts), boolean chains 3, match/switch 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.
metadata::stm::authz::authorize (cognitive 30) core/metadata/src/stm/authz.rs:241— metadata::stm::authz::authorize has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (27 pts), match/switch 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
metadata::impls::metadata::apply_committed_prepare (cognitive 21) core/metadata/src/impls/metadata.rs:921— metadata::impls::metadata::apply_committed_prepare has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 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.
Worker::run (cognitive 41) core/sdk/src/clients/consumer/deferred.rs:354— Worker::run has cognitive complexity 41 (threshold 15). Drivers by points: if/else 10 (27 pts), match/switch 4 (11 pts), boolean chains 2, loops 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.
Worker::complete (cognitive 23) core/sdk/src/clients/consumer/deferred.rs:918— Worker::complete has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (18 pts), match/switch 1 (3 pts), 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.
Worker::complete_on_demand (cognitive 19) core/sdk/src/clients/consumer/deferred.rs:1007— Worker::complete_on_demand has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PrepareJournal::scan (cognitive 37) core/journal/src/prepare_journal.rs:602— PrepareJournal::scan has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (32 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PrepareJournal::remove_range (cognitive 16) core/journal/src/prepare_journal.rs:1025— PrepareJournal::remove_range has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 3, boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PrepareJournal::drain (cognitive 16) core/journal/src/prepare_journal.rs:1142— PrepareJournal::drain has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 4, boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
iggy_connector_influxdb_source::v3::poll (cognitive 21) core/connectors/sources/influxdb_source/src/v3.rs:439— iggy_connector_influxdb_source::v3::poll has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 4, match/switch 2 (3 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
iggy_connector_influxdb_source::row::parse_csv_rows (cognitive 20) core/connectors/sources/influxdb_source/src/row.rs:58— iggy_connector_influxdb_source::row::parse_csv_rows has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
iggy_connector_influxdb_source::v2::process_rows (cognitive 19) core/connectors/sources/influxdb_source/src/v2.rs:786— iggy_connector_influxdb_source::v2::process_rows has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 pts), match/switch 2 (6 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClientTable::decode (cognitive 18) core/consensus/src/client_table.rs:1706— ClientTable::decode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 2 (3 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClientTable::check_request (cognitive 16) core/consensus/src/client_table.rs:940— ClientTable::check_request has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 1, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClientTable::commit_request (cognitive 16) core/consensus/src/client_table.rs:1263— ClientTable::commit_request has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×3
Members sharing a duplicated core (5 members, 50+ identical tokens) core/binary_protocol/src/codec.rs:84— core/binary_protocol/src/codec.rs:84-102 | core/binary_protocol/src/codec.rs:110-128 | core/binary_protocol/src/codec.rs:136-154 | core/binary_protocol/src/codec.rs:187-205 | core/binary_protocol/src/codec.rs:213-231 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) gateways/kafka/src/protocol/bounds_guard.rs:637— gateways/kafka/src/protocol/bounds_guard.rs:637-704 | gateways/kafka/src/protocol/bounds_guard.rs:720-742 | gateways/kafka/src/protocol/bounds_guard.rs:757-804 | gateways/kafka/src/protocol/bounds_guard.rs:1282-1304 | gateways/kafka/src/protocol/bounds_guard.rs:1346-1365 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) foreign/go/internal/command/offset.go:42— foreign/go/internal/command/offset.go:42-75 | foreign/go/internal/command/offset.go:88-119 | foreign/go/internal/command/offset.go:132-164 | foreign/go/internal/command/partition.go:36-54 | foreign/go/internal/command/partition.go:66-84 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Duplicated block (31 lines × 2) foreign/csharp/Iggy_SDK/JsonConverters/UserHeadersConverter.cs:94— foreign/csharp/Iggy_SDK/JsonConverters/UserHeadersConverter.cs:94-124 | foreign/csharp/Iggy_SDK/JsonConverters/UserHeadersConverter.cs:139-169 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `foreign/csharp/Iggy_SDK/JsonConverters/UserHeadersConverter.cs:94` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (31 lines × 2) core/ai/mcp/src/log.rs:149— core/ai/mcp/src/log.rs:149-179 | core/connectors/runtime/src/log.rs:102-132 — before extracting anything, compare `core/ai/mcp/src/log.rs` and `core/connectors/runtime/src/log.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 87 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (31 lines × 2) core/ai/mcp/src/log.rs:185— core/ai/mcp/src/log.rs:185-215 | core/connectors/runtime/src/log.rs:138-168 — before extracting anything, compare `core/ai/mcp/src/log.rs` and `core/connectors/runtime/src/log.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 87 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (23 lines × 2) foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.Rented.cs:221— foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.Rented.cs:221-243 | foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:685-707 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.Rented.cs:221` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (23 lines × 2) core/binary_protocol/src/consensus/header.rs:434— core/binary_protocol/src/consensus/header.rs:434-456 | core/binary_protocol/src/consensus/header.rs:465-487 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23 lines × 2) core/binary_protocol/src/requests/topics/delete_topic.rs:31— core/binary_protocol/src/requests/topics/delete_topic.rs:31-53 | core/binary_protocol/src/requests/topics/get_topic.rs:31-53 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (26 lines × 2) core/binary_protocol/src/responses/streams/get_stream.rs:79— core/binary_protocol/src/responses/streams/get_stream.rs:79-104 | core/binary_protocol/src/responses/streams/stream_response.rs:75-100 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (26 lines × 2) core/ai/mcp/src/stream.rs:38— core/ai/mcp/src/stream.rs:38-63 | core/connectors/runtime/src/stream.rs:49-74 — before extracting anything, compare `core/ai/mcp/src/stream.rs` and `core/connectors/runtime/src/stream.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (26 lines × 2) core/common/src/types/consumer/consumer_group_offsets.rs:25— core/common/src/types/consumer/consumer_group_offsets.rs:25-50 | core/common/src/types/consumer/consumer_offsets.rs:24-49 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (24 lines × 2) core/common/src/traits/binary_impls/messages.rs:590— core/common/src/traits/binary_impls/messages.rs:590-613 | core/server/src/http/wire.rs:72-95 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (24 lines × 2) examples/java/src/main/java/org/apache/iggy/examples/messageenvelope/producer/MessageEnvelopeProducer.java:61— examples/java/src/main/java/org/apache/iggy/examples/messageenvelope/producer/MessageEnvelopeProducer.java:61-84 | examples/java/src/main/java/org/apache/iggy/examples/messageheaders/producer/MessageHeadersProducer.java:61-84 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (24 lines × 2) examples/python/basic/producer.py:81— examples/python/basic/producer.py:81-104 | examples/python/getting-started/producer.py:191-214 — `examples/python/basic/producer.py` and `examples/python/getting-started/producer.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 53 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `examples/python/basic/producer.py:81` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 3) foreign/csharp/Iggy_SDK/Contracts/MetadataChangeBodies.cs:91— foreign/csharp/Iggy_SDK/Contracts/MetadataChangeBodies.cs:91-107 | foreign/csharp/Iggy_SDK/Contracts/MetadataChangeBodies.cs:125-141 | foreign/csharp/Iggy_SDK/Contracts/MetadataChangeBodies.cs:156-172 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (17 lines × 3) foreign/csharp/Iggy_SDK/Contracts/MetadataChangeBodies.cs:228— foreign/csharp/Iggy_SDK/Contracts/MetadataChangeBodies.cs:228-244 | foreign/csharp/Iggy_SDK/Contracts/MetadataChangeBodies.cs:253-269 | foreign/csharp/Iggy_SDK/Contracts/MetadataChangeBodies.cs:281-297 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (17 lines × 3) examples/csharp/src/MessageEnvelope/Iggy_SDK.Examples.MessageEnvelope.Consumer/Utils.cs:106— examples/csharp/src/MessageEnvelope/Iggy_SDK.Examples.MessageEnvelope.Consumer/Utils.cs:106-122 | examples/csharp/src/MessageHeaders/Iggy_SDK.Examples.MessageHeaders.Consumer/Utils.cs:107-123 | examples/csharp/src/NewSdk/Iggy_SDK.Examples.NewSdk.Consumer/Utils.cs:48-64 — before extracting anything, compare `examples/csharp/src/MessageEnvelope/Iggy_SDK.Examples.MessageEnvelope.Consumer/Utils.cs` and `examples/csharp/src/MessageHeaders/Iggy_SDK.Examples.MessageHeaders.Consumer/Utils.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 94 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `examples/csharp/src/MessageEnvelope/Iggy_SDK.Examples.MessageEnvelope.Consumer/Utils.cs:106` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16 lines × 3) core/binary_protocol/src/requests/users/login_register.rs:193— core/binary_protocol/src/requests/users/login_register.rs:193-208 | core/binary_protocol/src/requests/users/login_register_with_pat.rs:99-114 | core/binary_protocol/src/requests/users/login_user.rs:101-116 — before extracting anything, compare `core/binary_protocol/src/requests/users/login_register.rs` and `core/binary_protocol/src/requests/users/login_register_with_pat.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 3) foreign/python/src/config.rs:360— foreign/python/src/config.rs:360-375 | foreign/python/src/config.rs:725-740 | foreign/python/src/config.rs:1400-1415 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (16 lines × 3) gateways/kafka/src/protocol/bounds_guard.rs:1418— gateways/kafka/src/protocol/bounds_guard.rs:1418-1433 | gateways/kafka/src/protocol/bounds_guard.rs:1470-1485 | gateways/kafka/src/protocol/bounds_guard.rs:1522-1537 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12 lines × 3) core/bench/src/analytics/report_builder.rs:214— core/bench/src/analytics/report_builder.rs:214-225 | core/common/src/wire_conversions.rs:452-463 | foreign/cpp/src/type_conversion.rs:280-291 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (12 lines × 3) foreign/python/src/config.rs:209— foreign/python/src/config.rs:209-220 | foreign/python/src/config.rs:519-530 | foreign/python/src/config.rs:1088-1099 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12 lines × 3) examples/java/src/main/java/org/apache/iggy/examples/multitenant/consumer/MultiTenantConsumer.java:342— examples/java/src/main/java/org/apache/iggy/examples/multitenant/consumer/MultiTenantConsumer.java:342-353 | examples/java/src/main/java/org/apache/iggy/examples/multitenant/producer/MultiTenantProducer.java:346-357 | examples/java/src/main/java/org/apache/iggy/examples/sinkdataproducer/SinkDataProducer.java:153-164 — before extracting anything, compare `examples/java/src/main/java/org/apache/iggy/examples/multitenant/consumer/MultiTenantConsumer.java` and `examples/java/src/main/java/org/apache/iggy/examples/multitenant/producer/MultiTenantProducer.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `examples/java/src/main/java/org/apache/iggy/examples/sinkdataproducer/SinkDataProducer.java:153` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `examples/java/src/main/java/org/apache/iggy/examples/sinkdataproducer/SinkDataProducer.java:152` calls `toLowerCase`, `replace` and `examples/java/src/main/java/org/apache/iggy/examples/multitenant/consumer/MultiTenantConsumer.java:341` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 3) foreign/cpp/src/type_conversion.rs:1617— foreign/cpp/src/type_conversion.rs:1617-1626 | foreign/cpp/src/type_conversion.rs:1636-1645 | foreign/cpp/src/type_conversion.rs:1671-1680 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 3) core/connectors/sdk/src/transforms/add_fields.rs:56— core/connectors/sdk/src/transforms/add_fields.rs:56-65 | core/connectors/sdk/src/transforms/delete_fields.rs:57-66 | core/connectors/sdk/src/transforms/update_fields.rs:67-76 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (10 lines × 3) foreign/python/src/config.rs:259— foreign/python/src/config.rs:259-268 | foreign/python/src/config.rs:569-578 | foreign/python/src/config.rs:1138-1147 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8–9 lines × 2) core/metadata/src/impls/metadata.rs:3156— core/metadata/src/impls/metadata.rs:3156-3163 | core/metadata/src/impls/metadata.rs:3171-3179 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–9 lines × 2) foreign/python/src/client.rs:582— foreign/python/src/client.rs:582-590 | foreign/python/src/client.rs:943-950 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–9 lines × 2) foreign/java/external-processors/iggy-connector-flink/iggy-connector-library/src/main/java/org/apache/iggy/connector/flink/sink/IggySink.java:127— foreign/java/external-processors/iggy-connector-flink/iggy-connector-library/src/main/java/org/apache/iggy/connector/flink/sink/IggySink.java:127-134 | foreign/java/external-processors/iggy-connector-flink/iggy-connector-library/src/main/java/org/apache/iggy/connector/flink/source/IggySource.java:163-171 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `foreign/java/external-processors/iggy-connector-flink/iggy-connector-library/src/main/java/org/apache/iggy/connector/flink/sink/IggySink.java:127` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8 lines × 4) core/message_bus/src/lifecycle/connection_registry.rs:643— core/message_bus/src/lifecycle/connection_registry.rs:643-650 | core/message_bus/src/lifecycle/connection_registry.rs:674-681 | core/message_bus/src/lifecycle/connection_registry.rs:983-990 | core/message_bus/src/lifecycle/connection_registry.rs:1010-1017 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 4) core/message_bus/src/client_listener/tcp.rs:68— core/message_bus/src/client_listener/tcp.rs:68-75 | core/message_bus/src/client_listener/tcp_tls.rs:110-119 | core/message_bus/src/client_listener/ws.rs:82-89 | core/message_bus/src/client_listener/wss.rs:104-113 — before extracting anything, compare `core/message_bus/src/client_listener/tcp.rs` and `core/message_bus/src/client_listener/tcp_tls.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 4) foreign/go/client/tcp/tcp_access_token_management.go:47— foreign/go/client/tcp/tcp_access_token_management.go:47-54 | foreign/go/client/tcp/tcp_clients_management.go:28-35 | foreign/go/client/tcp/tcp_stream_management.go:29-36 | foreign/go/client/tcp/tcp_user_management.go:41-48 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once.
Duplicated block (5 lines × 3) core/connectors/sinks/postgres_sink/src/lib.rs:526— core/connectors/sinks/postgres_sink/src/lib.rs:526-530 | REDACTED:1039-1043 | core/connectors/sources/postgres_source/src/lib.rs:2471-2477 — before extracting anything, compare `core/connectors/sinks/postgres_sink/src/lib.rs` and `REDACTED` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 3) core/cli/src/commands/binary_users/change_password.rs:64— core/cli/src/commands/binary_users/change_password.rs:64-70 | core/cli/src/commands/binary_users/change_password.rs:77-83 | core/cli/src/credentials.rs:123-127 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (5 lines × 3) foreign/java/java-sdk/src/main/java/org/apache/iggy/stream/StreamUpdate.java:94— foreign/java/java-sdk/src/main/java/org/apache/iggy/stream/StreamUpdate.java:94-98 | foreign/java/java-sdk/src/main/java/org/apache/iggy/topic/TopicUpdate.java:118-122 | foreign/java/java-sdk/src/main/java/org/apache/iggy/user/UserUpdate.java:113-117 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `keys` to `Set<StreamOptionKey>` in one and `Set<TopicOptionKey>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (36 lines × 2) examples/csharp/src/MessageEnvelope/Iggy_SDK.Examples.MessageEnvelope.Producer/Utils.cs:49— examples/csharp/src/MessageEnvelope/Iggy_SDK.Examples.MessageEnvelope.Producer/Utils.cs:49-84 | examples/csharp/src/MessageHeaders/Iggy_SDK.Examples.MessageHeaders.Producer/Utils.cs:50-85 — before extracting anything, compare `examples/csharp/src/MessageEnvelope/Iggy_SDK.Examples.MessageEnvelope.Producer/Utils.cs` and `examples/csharp/src/MessageHeaders/Iggy_SDK.Examples.MessageHeaders.Producer/Utils.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 81 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `examples/csharp/src/MessageEnvelope/Iggy_SDK.Examples.MessageEnvelope.Producer/Utils.cs:49` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (36 lines × 2) foreign/java/bench/src/main/java/org/apache/iggy/bench/report/IndividualMetricsCalculator.java:189— foreign/java/bench/src/main/java/org/apache/iggy/bench/report/IndividualMetricsCalculator.java:189-224 | foreign/java/bench/src/main/java/org/apache/iggy/bench/report/IndividualMetricsCalculator.java:255-290 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `foreign/java/bench/src/main/java/org/apache/iggy/bench/report/IndividualMetricsCalculator.java:189` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (36 lines × 2) examples/python/basic/consumer.py:62— examples/python/basic/consumer.py:62-97 | examples/python/getting-started/consumer.py:176-211 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `examples/python/getting-started/consumer.py:172` calls `exception` and `examples/python/basic/consumer.py:58` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
X18 · Disposal-pattern correctness· Disposes a dependency it does not own · ×3
Disposes a dependency it does not own foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:209— `_client` is never created by `IggyConsumer` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 209). Its declared type `IIggyClient` is an interface, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed.
Disposes a dependency it does not own foreign/csharp/Iggy_SDK/Contracts/PolledMessagesRental.cs:74— `_owner` is never created by `PolledMessagesRental` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 74). Its declared type `IMemoryOwner` is an interface, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed.
Disposes a dependency it does not own foreign/csharp/Iggy_SDK/Publishers/IggyPublisher.cs:118— `Client` is never created by `IggyPublisher` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 118). Its declared type `IIggyClient` is an interface, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed.
X2 · Cancellation propagation· Async local function without CancellationToken · ×3
Async local function without CancellationToken: InitSystem examples/csharp/src/TcpTls/Iggy_SDK.Examples.TcpTls.Producer/Program.cs:71— Neither takes a CancellationToken nor reads the one of the function it sits in, while it calls something that takes one — this work can't be stopped early once started. Take the token, or pass on the enclosing one.
Async local function without CancellationToken: ProduceMessages examples/csharp/src/TcpTls/Iggy_SDK.Examples.TcpTls.Producer/Program.cs:99— Neither takes a CancellationToken nor reads the one of the function it sits in, while it calls something that takes one — this work can't be stopped early once started. Take the token, or pass on the enclosing one.
Async local function without CancellationToken: ConsumeMessages examples/csharp/src/TcpTls/Iggy_SDK.Examples.TcpTls.Consumer/Program.cs:68— Neither takes a CancellationToken nor reads the one of the function it sits in, while it calls something that takes one — this work can't be stopped early once started. Take the token, or pass on the enclosing one.
X24 · Document value interpolated into markup unescaped· Untrusted text written into markup unescaped · ×3
Untrusted text written into markup unescaped about.hbs:16— `name` is text this program did not author, and it is written into the text of an element through Handlebars' raw `{{{ }}}` output with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
Untrusted text written into markup unescaped about.hbs:18— `crate.name` is text this program did not author, and it is written into the text of an element through Handlebars' raw `{{{ }}}` output with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
Untrusted text written into markup unescaped about.hbs:21— `text` is text this program did not author, and it is written into the text of an element through Handlebars' raw `{{{ }}}` output with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
iggy_connector_clickhouse_sink::binary::serialize_value (cyclomatic 54) core/connectors/sinks/clickhouse_sink/src/binary.rs:83— iggy_connector_clickhouse_sink::binary::serialize_value has cyclomatic complexity 54 (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.
iggy_connector_clickhouse_sink::schema::parse_type_inner (cyclomatic 41) core/connectors/sinks/clickhouse_sink/src/schema.rs:155— iggy_connector_clickhouse_sink::schema::parse_type_inner has cyclomatic complexity 41 (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.
OperationDriver::attempt (cyclomatic 26) core/sdk/src/driver.rs:666— OperationDriver::attempt has cyclomatic complexity 26 (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.
OperationDriver::settle (cyclomatic 21) core/sdk/src/driver.rs:964— OperationDriver::settle has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
simulator::replica::new_shard (cyclomatic 26) core/simulator/src/replica.rs:152— simulator::replica::new_shard has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
simulator::bin::workload-fuzz::network_options (cyclomatic 17) core/simulator/src/bin/workload-fuzz.rs:487— simulator::bin::workload-fuzz::network_options has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
InfluxDbSource::open (cyclomatic 24) core/connectors/sources/influxdb_source/src/lib.rs:258— InfluxDbSource::open has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
InfluxDbSource::poll (cyclomatic 17) core/connectors/sources/influxdb_source/src/lib.rs:469— InfluxDbSource::poll 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.
VsrConsensus::tick_with_history_fence (cyclomatic 19) core/consensus/src/impls.rs:3154— VsrConsensus::tick_with_history_fence 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.
VsrConsensus::try_handle_start_view (cyclomatic 18) core/consensus/src/impls.rs:4443— VsrConsensus::try_handle_start_view has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ServerHandle::start (cyclomatic 19) core/integration/src/harness/handle/server.rs:1013— ServerHandle::start has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ServerHandle::set_protocol_addresses (cyclomatic 16) core/integration/src/harness/handle/server.rs:516— ServerHandle::set_protocol_addresses has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DiskReadPlan::read_disk_with_limit (cyclomatic 17) core/partitions/src/poll_plan.rs:795— DiskReadPlan::read_disk_with_limit 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.
DiskReadPlan::walk_segment (cyclomatic 16) core/partitions/src/poll_plan.rs:947— DiskReadPlan::walk_segment 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.
InfluxDbSource::poll (cognitive 40) core/connectors/sources/influxdb_source/src/lib.rs:469— InfluxDbSource::poll has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (29 pts), match/switch 5 (11 pts) (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.
InfluxDbSource::open (cognitive 23) core/connectors/sources/influxdb_source/src/lib.rs:258— InfluxDbSource::open has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 7, match/switch 3 (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.
PacketSimulator::step (cognitive 39) core/simulator/src/packet.rs:692— PacketSimulator::step has cognitive complexity 39 (threshold 15). Drivers by points: if/else 8 (32 pts), loops 3 (6 pts), boolean chains 1 (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.
PacketSimulator::auto_partition_network (cognitive 23) core/simulator/src/packet.rs:845— PacketSimulator::auto_partition_network has cognitive complexity 23 (threshold 15). Drivers by points: loops 6 (11 pts), if/else 4 (9 pts), boolean chains 2, match/switch 1 (nesting depth added 10). 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.
DiskReadPlan::walk_segment (cognitive 30) core/partitions/src/poll_plan.rs:947— DiskReadPlan::walk_segment has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (25 pts), boolean chains 4, 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.
DiskReadPlan::read_disk_with_limit (cognitive 21) core/partitions/src/poll_plan.rs:795— DiskReadPlan::read_disk_with_limit has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (13 pts), match/switch 4 (5 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Logging::cleanup_log_files (cognitive 28) core/server_common/src/log/logger.rs:625— Logging::cleanup_log_files has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 4 (6 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Logging::read_log_files (cognitive 19) core/server_common/src/log/logger.rs:557— Logging::read_log_files has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 4 (7 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VsrConsensus::tick_with_history_fence (cognitive 27) core/consensus/src/impls.rs:3154— VsrConsensus::tick_with_history_fence has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 5, match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VsrConsensus::try_handle_start_view (cognitive 18) core/consensus/src/impls.rs:4443— VsrConsensus::try_handle_start_view has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 4, match/switch 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.
iggy_common::types::options::catalog::admit (cognitive 26) core/common/src/types/options/catalog.rs:637— iggy_common::types::options::catalog::admit has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 4, match/switch 3 (4 pts), loops 3 (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.
iggy_common::traits::binary_impls::messages::poll_group_messages (cognitive 17) core/common/src/traits/binary_impls/messages.rs:269— iggy_common::traits::binary_impls::messages::poll_group_messages has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 1 (2 pts), 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.
PostgresSource::poll_tables (cognitive 25) core/connectors/sources/postgres_source/src/lib.rs:806— PostgresSource::poll_tables has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (21 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PostgresSource::process_row (cognitive 25) core/connectors/sources/postgres_source/src/lib.rs:1419— PostgresSource::process_row has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 4, 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.
DorisSink::send_stream_load (cognitive 22) core/connectors/sinks/doris_sink/src/lib.rs:255— DorisSink::send_stream_load has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 3 (7 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DorisSink::open (cognitive 17) core/connectors/sinks/doris_sink/src/lib.rs:941— DorisSink::open has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), match/switch 4, boolean chains 2 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ElasticsearchSource::search_documents (cognitive 22) core/connectors/sources/elasticsearch_source/src/lib.rs:339— ElasticsearchSource::search_documents has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ElasticsearchSource::source_state_to_internal_state (cognitive 16) core/connectors/sources/elasticsearch_source/src/lib.rs:261— ElasticsearchSource::source_state_to_internal_state has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 5 (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.
iggy_connector_postgres_source::parse_record_columns (cognitive 19) core/connectors/sources/postgres_source/src/lib.rs:2344— iggy_connector_postgres_source::parse_record_columns has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (5 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
iggy_connector_postgres_source::substitute_query_tokens (cognitive 16) core/connectors/sources/postgres_source/src/lib.rs:2137— iggy_connector_postgres_source::substitute_query_tokens has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 2 (3 pts), match/switch 1 (3 pts), 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.
LinksShared::apply_roster (cognitive 18) core/sdk/src/links/replicas.rs:972— LinksShared::apply_roster has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 2, loops 2, match/switch 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LinksShared::sweep (cognitive 16) core/sdk/src/links/replicas.rs:555— LinksShared::sweep has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 3 (6 pts), if/else 3 (5 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication· Members sharing a duplicated core (6 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (6 members, 50+ identical tokens) core/connectors/runtime/src/configs/connectors/http_provider.rs:136— core/connectors/runtime/src/configs/connectors/http_provider.rs:136-156 | core/connectors/runtime/src/configs/connectors/http_provider.rs:162-182 | core/connectors/runtime/src/configs/connectors/http_provider.rs:184-204 | core/connectors/runtime/src/configs/connectors/http_provider.rs:206-226 | core/connectors/runtime/src/configs/connectors/http_provider.rs:268-289 | core/connectors/runtime/src/configs/connectors/http_provider.rs:331-352 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) core/bench/dashboard/frontend/src/api/mod.rs:55— core/bench/dashboard/frontend/src/api/mod.rs:55-75 | core/bench/dashboard/frontend/src/api/mod.rs:77-97 | core/bench/dashboard/frontend/src/api/mod.rs:102-127 | core/bench/dashboard/frontend/src/api/mod.rs:165-185 | core/bench/dashboard/frontend/src/api/mod.rs:191-216 | core/bench/dashboard/frontend/src/api/mod.rs:228-249 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Duplicated block (43 lines × 2) core/connectors/sdk/src/decoders/avro.rs:87— core/connectors/sdk/src/decoders/avro.rs:87-129 | core/connectors/sdk/src/encoders/avro.rs:80-122 — `core/connectors/sdk/src/decoders/avro.rs` and `core/connectors/sdk/src/encoders/avro.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 59 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (43 lines × 2) examples/python/getting-started/consumer.py:110— examples/python/getting-started/consumer.py:110-152 | examples/python/getting-started/producer.py:109-151 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (29 lines × 2) core/message_bus/src/transports/ws.rs:187— core/message_bus/src/transports/ws.rs:187-215 | core/message_bus/src/transports/wss.rs:335-363 — before extracting anything, compare `core/message_bus/src/transports/ws.rs` and `core/message_bus/src/transports/wss.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 101 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (29 lines × 2) core/bench/src/actors/consumer/benchmark_consumer.rs:120— core/bench/src/actors/consumer/benchmark_consumer.rs:120-148 | core/bench/src/actors/producer/benchmark_producer.rs:122-150 — `core/bench/src/actors/consumer/benchmark_consumer.rs` and `core/bench/src/actors/producer/benchmark_producer.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 205 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (25–27 lines × 2) core/connectors/runtime/src/configs/connectors/local_provider.rs:778— core/connectors/runtime/src/configs/connectors/local_provider.rs:778-802 | core/connectors/runtime/src/configs/connectors/local_provider.rs:831-857 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (25–27 lines × 2) core/simulator/src/lib.rs:495— core/simulator/src/lib.rs:495-521 | core/simulator/src/lib.rs:1564-1588 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 3) foreign/csharp/Iggy_SDK/Contracts/MetadataChangeBodies.cs:303— foreign/csharp/Iggy_SDK/Contracts/MetadataChangeBodies.cs:303-322 | foreign/csharp/Iggy_SDK/Contracts/MetadataChangeBodies.cs:334-353 | foreign/csharp/Iggy_SDK/Contracts/MetadataChangeBodies.cs:390-409 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (20 lines × 3) gateways/kafka/src/protocol/bounds_guard.rs:1012— gateways/kafka/src/protocol/bounds_guard.rs:1012-1031 | gateways/kafka/src/protocol/bounds_guard.rs:1094-1113 | gateways/kafka/src/protocol/bounds_guard.rs:1156-1175 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (22 lines × 2) core/binary_protocol/src/requests/partitions/create_partitions_with_assignments.rs:98— core/binary_protocol/src/requests/partitions/create_partitions_with_assignments.rs:98-119 | core/binary_protocol/src/requests/topics/create_topic_with_assignments.rs:121-142 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (22 lines × 2) core/server_common/src/consensus_message.rs:322— core/server_common/src/consensus_message.rs:322-343 | core/server_common/src/consensus_message.rs:361-382 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 2) core/connectors/sources/http_source/src/server.rs:830— core/connectors/sources/http_source/src/server.rs:830-850 | core/connectors/sources/http_source/src/server.rs:926-946 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 2) foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/TopicsClient.java:90— foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/TopicsClient.java:90-110 | foreign/java/java-sdk/src/main/java/org/apache/iggy/client/blocking/TopicsClient.java:36-87 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/TopicsClient.java:90` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `streamId` to `StreamId` in one and `Long` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (14 lines × 5) core/binary_protocol/src/codec.rs:85— core/binary_protocol/src/codec.rs:85-98 | core/binary_protocol/src/codec.rs:111-124 | core/binary_protocol/src/codec.rs:137-150 | core/binary_protocol/src/codec.rs:188-201 | core/binary_protocol/src/codec.rs:214-227 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (14 lines × 5) core/binary_protocol/src/requests/consumer_groups/delete_consumer_group.rs:49— core/binary_protocol/src/requests/consumer_groups/delete_consumer_group.rs:49-62 | core/binary_protocol/src/requests/consumer_groups/get_consumer_group.rs:49-62 | core/binary_protocol/src/requests/consumer_groups/join_consumer_group.rs:49-62 | core/binary_protocol/src/requests/consumer_groups/leave_consumer_group.rs:49-62 | core/binary_protocol/src/requests/consumer_groups/sync_consumer_group.rs:52-65 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once.
Duplicated block (12–14 lines × 2) core/binary_protocol/src/consensus/primary_rebalance.rs:102— core/binary_protocol/src/consensus/primary_rebalance.rs:102-113 | core/binary_protocol/src/consensus/segment_delete.rs:84-97 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (12–14 lines × 2) core/partitions/src/iggy_partition.rs:8455— core/partitions/src/iggy_partition.rs:8455-8468 | core/partitions/src/iggy_partition.rs:8667-8678 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13–14 lines × 2) core/common/src/types/permissions/permissions_global.rs:248— core/common/src/types/permissions/permissions_global.rs:248-261 | core/common/src/types/permissions/permissions_global.rs:302-314 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13–14 lines × 2) examples/csharp/src/GettingStarted/Iggy_SDK.Examples.GettingStarted.Producer/Utils.cs:69— examples/csharp/src/GettingStarted/Iggy_SDK.Examples.GettingStarted.Producer/Utils.cs:69-81 | examples/csharp/src/TcpTls/Iggy_SDK.Examples.TcpTls.Producer/Program.cs:115-128 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `examples/csharp/src/GettingStarted/Iggy_SDK.Examples.GettingStarted.Producer/Utils.cs:69` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (12 lines × 6) core/connectors/runtime/src/configs/connectors/http_provider.rs:145— core/connectors/runtime/src/configs/connectors/http_provider.rs:145-156 | core/connectors/runtime/src/configs/connectors/http_provider.rs:171-182 | core/connectors/runtime/src/configs/connectors/http_provider.rs:193-204 | core/connectors/runtime/src/configs/connectors/http_provider.rs:215-226 | core/connectors/runtime/src/configs/connectors/http_provider.rs:278-289 | core/connectors/runtime/src/configs/connectors/http_provider.rs:341-352 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12 lines × 6) core/bench/dashboard/frontend/src/api/mod.rs:62— core/bench/dashboard/frontend/src/api/mod.rs:62-73 | core/bench/dashboard/frontend/src/api/mod.rs:84-95 | core/bench/dashboard/frontend/src/api/mod.rs:114-125 | core/bench/dashboard/frontend/src/api/mod.rs:172-183 | core/bench/dashboard/frontend/src/api/mod.rs:203-214 | core/bench/dashboard/frontend/src/api/mod.rs:236-247 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 4) foreign/csharp/Iggy_SDK/Contracts/Tcp/TcpContracts.cs:271— foreign/csharp/Iggy_SDK/Contracts/Tcp/TcpContracts.cs:271-281 | foreign/csharp/Iggy_SDK/Contracts/Tcp/TcpContracts.cs:706-716 | foreign/csharp/Iggy_SDK/Contracts/Tcp/TcpContracts.cs:733-743 | foreign/csharp/Iggy_SDK/Contracts/Tcp/TcpContracts.cs:870-880 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `foreign/csharp/Iggy_SDK/Contracts/Tcp/TcpContracts.cs:271` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 4) core/integration/src/harness/disk.rs:200— core/integration/src/harness/disk.rs:200-210 | core/integration/src/harness/disk.rs:381-391 | core/integration/src/harness/disk.rs:410-420 | core/integration/src/harness/disk.rs:497-507 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 4) core/binary_protocol/src/requests/consumer_offsets/delete_consumer_offset.rs:57— core/binary_protocol/src/requests/consumer_offsets/delete_consumer_offset.rs:57-66 | core/binary_protocol/src/requests/consumer_offsets/get_consumer_offset.rs:51-60 | core/binary_protocol/src/requests/consumer_offsets/store_consumer_offset.rs:59-68 | core/binary_protocol/src/requests/messages/poll_messages.rs:113-122 — before extracting anything, compare `core/binary_protocol/src/requests/consumer_offsets/delete_consumer_offset.rs` and `core/binary_protocol/src/requests/consumer_offsets/get_consumer_offset.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 4) core/message_bus/src/client_listener/tcp.rs:64— core/message_bus/src/client_listener/tcp.rs:64-74 | core/message_bus/src/client_listener/tcp_tls.rs:106-116 | core/message_bus/src/client_listener/wss.rs:100-110 | core/message_bus/src/replica/listener.rs:148-157 — before extracting anything, compare `core/message_bus/src/client_listener/tcp.rs` and `core/message_bus/src/client_listener/tcp_tls.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 3) core/connectors/sinks/elasticsearch_sink/src/lib.rs:372— core/connectors/sinks/elasticsearch_sink/src/lib.rs:372-386 | core/connectors/sinks/meilisearch_sink/src/lib.rs:786-800 | core/connectors/sinks/stdout_sink/src/lib.rs:74-88 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (15 lines × 3) examples/python/basic/producer.py:63— examples/python/basic/producer.py:63-77 | examples/python/getting-started/producer.py:173-187 | examples/python/message-headers/common.py:121-135 — `examples/python/basic/producer.py` and `examples/python/getting-started/producer.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 53 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (7 lines × 5) foreign/java/external-processors/iggy-connector-flink/iggy-connector-library/src/main/java/org/apache/iggy/connector/flink/sink/IggySinkWriter.java:248— foreign/java/external-processors/iggy-connector-flink/iggy-connector-library/src/main/java/org/apache/iggy/connector/flink/sink/IggySinkWriter.java:248-254 | foreign/java/external-processors/iggy-connector-flink/iggy-connector-library/src/main/java/org/apache/iggy/connector/flink/source/IggyPartitionSplitReader.java:250-256 | foreign/java/external-processors/iggy-connector-flink/iggy-connector-library/src/main/java/org/apache/iggy/connector/flink/source/IggySourceSplitEnumerator.java:259-265 | foreign/java/external-processors/iggy-connector-pinot/src/main/java/org/apache/iggy/connector/pinot/consumer/IggyPartitionGroupConsumer.java:229-235 | foreign/java/external-processors/iggy-connector-pinot/src/main/java/org/apache/iggy/connector/pinot/metadata/IggyStreamMetadataProvider.java:207-213 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times.
Duplicated block (7 lines × 5) foreign/java/external-processors/iggy-connector-flink/iggy-connector-library/src/main/java/org/apache/iggy/connector/flink/sink/IggySinkWriter.java:259— foreign/java/external-processors/iggy-connector-flink/iggy-connector-library/src/main/java/org/apache/iggy/connector/flink/sink/IggySinkWriter.java:259-265 | foreign/java/external-processors/iggy-connector-flink/iggy-connector-library/src/main/java/org/apache/iggy/connector/flink/source/IggyPartitionSplitReader.java:261-267 | foreign/java/external-processors/iggy-connector-flink/iggy-connector-library/src/main/java/org/apache/iggy/connector/flink/source/IggySourceSplitEnumerator.java:270-276 | foreign/java/external-processors/iggy-connector-pinot/src/main/java/org/apache/iggy/connector/pinot/consumer/IggyPartitionGroupConsumer.java:240-246 | foreign/java/external-processors/iggy-connector-pinot/src/main/java/org/apache/iggy/connector/pinot/metadata/IggyStreamMetadataProvider.java:218-224 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times.
Duplicated block (29 lines × 3) foreign/go/internal/command/offset.go:43— foreign/go/internal/command/offset.go:43-71 | foreign/go/internal/command/offset.go:89-117 | foreign/go/internal/command/offset.go:133-161 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `foreign/go/internal/command/offset.go:72` calls `PutUint64` and `foreign/go/internal/command/offset.go:118` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (29 lines × 3) core/bench/src/actors/consumer/benchmark_consumer.rs:279— core/bench/src/actors/consumer/benchmark_consumer.rs:279-307 | core/bench/src/actors/producer/benchmark_producer.rs:274-302 | core/bench/src/actors/producing_consumer/benchmark_producing_consumer.rs:358-386 — `core/bench/src/actors/consumer/benchmark_consumer.rs` and `core/bench/src/actors/producer/benchmark_producer.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 205 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Unfinished stub — throws NotImplementedException foreign/csharp/Iggy_SDK/JsonConverters/ExpiryConverter.cs:37— `Write` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException foreign/csharp/Iggy_SDK/JsonConverters/SizeConverter.cs:50— `Write` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
R10 · Code Duplication· Duplicated block with local edits (11 matched lines × 2 locations) · ×2
Duplicated block with local edits (11 matched lines × 2 locations) foreign/node/src/client/client.frame.ts:140— foreign/node/src/client/client.frame.ts:140 · foreign/node/src/client/client.frame.ts:158 — the two spans are one implementation copied and then locally edited — 78 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block with local edits (11 matched lines × 2 locations) web/src/lib/auth/authStore.svelte.ts:58— web/src/lib/auth/authStore.svelte.ts:58 · web/src/lib/auth/authStore.svelte.ts:75 — the two spans are one implementation copied and then locally edited — 65 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (11 lines × 2 locations) foreign/node/src/wire/session/login-with-token.command.ts:37— foreign/node/src/wire/session/login-with-token.command.ts:37 · foreign/node/src/wire/session/login.command.ts:34 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Duplicated block (11 lines × 2 locations) web/src/lib/api/clientApi.ts:35— web/src/lib/api/clientApi.ts:35 · web/src/lib/api/fetchRouteApi.ts:28 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Duplicated block (10 lines × 2 locations) foreign/node/src/wire/session/login.utils.ts:90— foreign/node/src/wire/session/login.utils.ts:90 · foreign/node/src/wire/token/delete-token.command.ts:38 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (10 lines × 2 locations) foreign/node/src/wire/token/token.utils.ts:100— foreign/node/src/wire/token/token.utils.ts:100 · foreign/node/src/wire/user/user.utils.ts:142 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Dead file (~28 LoC) web/src/lib/components/PreventEventsPropagation.svelte— no import path from any entry point (40 application, 10 tooling, 82 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~28 LoC) web/src/lib/utils/addWindowEventListener.ts— no import path from any entry point (40 application, 10 tooling, 82 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~22 LoC) web/src/env.ts— no import path from any entry point (40 application, 10 tooling, 82 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~22 LoC) web/src/lib/utils/arrayMax.ts— no import path from any entry point (40 application, 10 tooling, 82 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~18 LoC) foreign/node/src/wire/segment/index.ts— no import path from any entry point (40 application, 10 tooling, 82 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~18 LoC) web/src/lib/utils/NonNullable.ts— no import path from any entry point (40 application, 10 tooling, 82 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Rethrow loses stack trace (`throw ex;`) foreign/csharp/Iggy_SDK/Publishers/BackgroundMessageProcessor.cs:615— `throw blocked;` resets the exception's stack trace to this line, hiding where it really came from. Use a bare `throw;` to preserve the original stack.
Rethrow loses stack trace (`throw ex;`) foreign/csharp/Iggy_SDK/Publishers/BackgroundMessageProcessor.cs:619— `throw blocked;` resets the exception's stack trace to this line, hiding where it really came from. Use a bare `throw;` to preserve the original stack.
CommandResponseStream.drive (cyclomatic 149) foreign/node/src/client/client.socket.ts:282— CommandResponseStream.drive has cyclomatic complexity 149 (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.
TcpMessageStream.RunClientOperationAsync (cyclomatic 140) foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.PollRouting.cs:178— TcpMessageStream.RunClientOperationAsync has cyclomatic complexity 140 (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.
IggyTcpClient.driveOperation (cyclomatic 133) foreign/go/client/tcp/tcp_driver.go:183— IggyTcpClient.driveOperation has cyclomatic complexity 133 (threshold 15). Of this number, 121 points are the body's own statements and 12 belong to 2 function literals inside it that branch. 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.
iggy_cli::get_command (cyclomatic 49) core/cli/src/main.rs:113— iggy_cli::get_command has cyclomatic complexity 49 (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.
ClusterConfig::validate (cyclomatic 49) core/configs/src/server_config/cluster.rs:899— ClusterConfig::validate has cyclomatic complexity 49 (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.
StreamsSnapshot::validate_ownership_history (cyclomatic 43) core/metadata/src/stm/lifecycle.rs:546— StreamsSnapshot::validate_ownership_history has cyclomatic complexity 43 (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.
Projection::project (cyclomatic 42) core/metadata/src/change_log/current.rs:179— Projection::project 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.
IggyTcpClient.drive (cyclomatic 41) foreign/go/client/tcp/tcp_driver.go:37— IggyTcpClient.drive has cyclomatic complexity 41 (threshold 15). Of this number, 40 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
IggyTcpClient.consumerRoute (cyclomatic 41) foreign/go/client/tcp/tcp_poll_routing.go:232— IggyTcpClient.consumerRoute has cyclomatic complexity 41 (threshold 15). Of this number, 39 points are the body's own statements and 2 belong to one function literal inside it that branches. 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.
TransferFileJob::execute (cyclomatic 38) core/partitions/src/io.rs:914— TransferFileJob::execute 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.
ClientCore.exchange (cyclomatic 37) foreign/swift/Sources/Iggy/Client/ClientCore.swift:184— ClientCore.exchange 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.
ServerConfig::validate (cyclomatic 36) core/configs/src/server_config/validators.rs:51— ServerConfig::validate has cyclomatic complexity 36 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
IggyTcpClient.register (cyclomatic 36) foreign/go/client/tcp/tcp_session_management.go:75— IggyTcpClient.register has cyclomatic complexity 36 (threshold 15). Of this number, 24 points are the body's own statements and 12 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ClientCore.exchangeLocked (cyclomatic 35) foreign/swift/Sources/Iggy/Client/ClientCore.swift:692— ClientCore.exchangeLocked has cyclomatic complexity 35 (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.
TcpMessageStream.GetPartitionRouteAsync (cyclomatic 34) foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.PollRouting.cs:696— TcpMessageStream.GetPartitionRouteAsync has cyclomatic complexity 34 (threshold 15). Of this number, 32 points are the body's own statements and 2 belong to 2 function literals inside it that branch. 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.
VsrConnection.ReadRepliesAsync (cyclomatic 33) foreign/csharp/Iggy_SDK/Vsr/VsrConnection.cs:304— VsrConnection.ReadRepliesAsync 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.
TcpMessageStream.RunReplicaLinkAsync (cyclomatic 31) foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.ReplicaLinks.cs:100— TcpMessageStream.RunReplicaLinkAsync 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.
Args::from (cyclomatic 30) core/common/src/types/args/mod.rs:424— Args::from has cyclomatic complexity 30 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ShardingConfig::validate (cyclomatic 30) core/configs/src/server_config/sharding.rs:234— ShardingConfig::validate has cyclomatic complexity 30 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AsyncTcpConnection.completeAttempt (cyclomatic 30) foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/AsyncTcpConnection.java:1322— AsyncTcpConnection.completeAttempt has cyclomatic complexity 30 (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.
TcpMessageStream.LoginRegisterCoreAsync (cyclomatic 29) foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.Vsr.cs:178— TcpMessageStream.LoginRegisterCoreAsync has cyclomatic complexity 29 (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.
shard::dispatch_vsr_actions (cyclomatic 29) core/shard/src/lib.rs:13287— shard::dispatch_vsr_actions 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.
iggy_cpp::type_conversion::decode_field (cyclomatic 29) foreign/cpp/src/type_conversion.rs:1026— iggy_cpp::type_conversion::decode_field has cyclomatic complexity 29 (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.
PollRouter.exchange (cyclomatic 29) foreign/swift/Sources/Iggy/Client/PollRouter.swift:577— PollRouter.exchange 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.
replicaLinks.connect (cyclomatic 28) REDACTED:89— replicaLinks.connect 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.
QuicConnectionStringOptions::parse_options (cyclomatic 27) core/common/src/types/configuration/quic_config/quic_connection_string_options.rs:95— QuicConnectionStringOptions::parse_options has cyclomatic complexity 27 (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.
HttpSourceConfig::validate (cyclomatic 27) core/connectors/sources/http_source/src/lib.rs:631— HttpSourceConfig::validate 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.
vsr.DecodeReplyFor (cyclomatic 27) foreign/go/internal/vsr/reply.go:37— vsr.DecodeReplyFor has cyclomatic complexity 27 (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.
update-resource.command.checkPatch (cyclomatic 27) foreign/node/src/wire/system/update-resource.command.ts:123— update-resource.command.checkPatch has cyclomatic complexity 27 (threshold 15). Of this number, 25 points are the body's own statements and 2 belong to 2 function literals inside it that branch. 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.
Workload::on_reply (cyclomatic 26) core/simulator/src/workload/mod.rs:662— Workload::on_reply has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
get-metadata-changes.command.checkQuery (cyclomatic 26) foreign/node/src/wire/system/get-metadata-changes.command.ts:209— get-metadata-changes.command.checkQuery 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.
IggyPublisherBuilder.Validate (cyclomatic 25) foreign/csharp/Iggy_SDK/Publishers/IggyPublisherBuilder.cs:385— IggyPublisherBuilder.Validate 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.
Mirror::apply (cyclomatic 25) core/simulator/src/workload/change_log_oracle.rs:214— Mirror::apply has cyclomatic complexity 25 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
Worker::run (cyclomatic 24) core/sdk/src/clients/consumer/deferred.rs:354— Worker::run 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.
ConsensusSession.acquireWhenAvailable (cyclomatic 24) foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/vsr/ConsensusSession.java:532— ConsensusSession.acquireWhenAvailable 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.
ClientCore.sendRaw (cyclomatic 24) foreign/swift/Sources/Iggy/Client/ClientCore.swift:517— ClientCore.sendRaw 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.
IggyConsumer.poll (cyclomatic 24) foreign/swift/Sources/Iggy/Consumer/IggyConsumer.swift:490— IggyConsumer.poll 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.
CommandResponseStream.routeFor (cyclomatic 24) foreign/node/src/client/client.socket.ts:613— CommandResponseStream.routeFor 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.
iggy_common::types::options::catalog::admit (cyclomatic 23) core/common/src/types/options/catalog.rs:637— iggy_common::types::options::catalog::admit 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.
Shadow::apply (cyclomatic 23) core/simulator/src/workload/shadow.rs:743— Shadow::apply has cyclomatic complexity 23 (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.
ClientCore.sweep (cyclomatic 23) foreign/swift/Sources/Iggy/Client/ClientCore.swift:868— ClientCore.sweep 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.
client.connection-string.parseConnectionString (cyclomatic 23) REDACTED:59— client.connection-string.parseConnectionString has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MutationLanes.enter (cyclomatic 23) foreign/node/src/client/client.operation.ts:228— MutationLanes.enter 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.
poll-messages.command.syncAssignment (cyclomatic 23) foreign/node/src/wire/message/poll-messages.command.ts:150— poll-messages.command.syncAssignment 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.
partitions::segment_recovery::load_persisted_segments_with_checkpoint (cyclomatic 22) core/partitions/src/segment_recovery.rs:596— partitions::segment_recovery::load_persisted_segments_with_checkpoint 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.
CommandResponseStream.connectBootstrap (cyclomatic 22) foreign/node/src/client/client.socket.ts:956— CommandResponseStream.connectBootstrap has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 7 of the 22 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 962, 1000). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
PrimaryRebalanceHeader::validate (cyclomatic 21) core/binary_protocol/src/consensus/primary_rebalance.rs:101— PrimaryRebalanceHeader::validate has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
WebSocketConnectionStringOptions::parse_options (cyclomatic 21) core/common/src/types/configuration/websocket_config/websocket_connection_string_options.rs:107— WebSocketConnectionStringOptions::parse_options has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
PartitionIoJob::execute (cyclomatic 21) core/partitions/src/io.rs:649— PartitionIoJob::execute has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
client.parseConnectionOptions (cyclomatic 21) foreign/go/client/connection_string.go:215— client.parseConnectionOptions 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.
IggyTcpClient.signIn (cyclomatic 21) foreign/go/client/tcp/tcp_session_management.go:222— IggyTcpClient.signIn 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.
IggyConsumerBuilder.Validate (cyclomatic 20) foreign/csharp/Iggy_SDK/Consumers/IggyConsumerBuilder.cs:321— IggyConsumerBuilder.Validate 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.
iggy_connector_delta_sink::coercions::apply_coercion (cyclomatic 20) core/connectors/sinks/delta_sink/src/coercions.rs:104— iggy_connector_delta_sink::coercions::apply_coercion has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
RabbitMQSink::publish_batch_with_retry (cyclomatic 20) core/connectors/sinks/rabbitmq_sink/src/lib.rs:193— RabbitMQSink::publish_batch_with_retry has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
JournalState::decode (cyclomatic 20) core/journal/src/partition_journal.rs:1564— JournalState::decode 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.
CommandResponseStream.runReplica (cyclomatic 20) foreign/node/src/client/client.socket.ts:864— CommandResponseStream.runReplica 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.
ConnectionString.ParseOptions (cyclomatic 19) foreign/csharp/Iggy_SDK/Configuration/ConnectionString.cs:133— ConnectionString.ParseOptions has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
IggyConsumer.PollRentedMessagesCoreAsync (cyclomatic 19) foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.Rented.cs:124— IggyConsumer.PollRentedMessagesCoreAsync 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.
AdvertisedAddress::from_str (cyclomatic 19) core/configs/src/server_config/cluster.rs:734— AdvertisedAddress::from_str has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PartitionConfig::validate (cyclomatic 19) core/configs/src/server_config/partition.rs:284— PartitionConfig::validate has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AvroStreamEncoder::serde_json_to_avro_value (cyclomatic 19) core/connectors/sdk/src/encoders/avro.rs:150— AvroStreamEncoder::serde_json_to_avro_value has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
iggy_connector_sdk::source::handle_messages_with_serializer (cyclomatic 19) core/connectors/sdk/src/source.rs:430— iggy_connector_sdk::source::handle_messages_with_serializer 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.
InfluxDbSink::append_line (cyclomatic 19) core/connectors/sinks/influxdb_sink/src/lib.rs:489— InfluxDbSink::append_line has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PrepareJournal::scan (cyclomatic 19) core/journal/src/prepare_journal.rs:602— PrepareJournal::scan 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.
AsyncIggyTcpClient.loginOnLeader (cyclomatic 19) foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/AsyncIggyTcpClient.java:1298— AsyncIggyTcpClient.loginOnLeader has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
client.ParseConnectionString (cyclomatic 19) foreign/go/client/connection_string.go:86— client.ParseConnectionString has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
IggyTcpClient.establishSession (cyclomatic 19) foreign/go/client/tcp/tcp_session_management.go:303— IggyTcpClient.establishSession 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.
replicaLinks.install (cyclomatic 19) REDACTED:211— replicaLinks.install 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.
replicaLinks.runSlot (cyclomatic 19) REDACTED:290— replicaLinks.runSlot has cyclomatic complexity 19 (threshold 15). Of this number, 17 points are the body's own statements and 2 belong to one function literal inside it that branches. 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.
PollRouter.exchange (cyclomatic 19) foreign/swift/Sources/Iggy/Client/PollRouter.swift:450— PollRouter.exchange 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.
client.connection-string.parseConnectionOptions (cyclomatic 19) REDACTED:156— client.connection-string.parseConnectionOptions 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.
CommandResponseStream.sendCommand (cyclomatic 19) foreign/node/src/client/client.socket.ts:200— CommandResponseStream.sendCommand has cyclomatic complexity 19 (threshold 15). Of this number, 15 points are the body's own statements and 4 belong to 2 function literals inside it that branch. 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.
BackgroundMessageProcessor.SendWithRetry (cyclomatic 18) foreign/csharp/Iggy_SDK/Publishers/BackgroundMessageProcessor.cs:485— BackgroundMessageProcessor.SendWithRetry 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.
VsrConnection.SendAttemptAsync (cyclomatic 18) foreign/csharp/Iggy_SDK/Vsr/VsrConnection.cs:105— VsrConnection.SendAttemptAsync has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
MqttSource::validate_config (cyclomatic 18) core/connectors/sources/mqtt_source/src/lib.rs:231— MqttSource::validate_config has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
server_common::diagnostics::report_io_uring_environment (cyclomatic 18) core/server_common/src/diagnostics.rs:280— server_common::diagnostics::report_io_uring_environment 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.
QuicConfig::new (cyclomatic 18) foreign/python/src/config.rs:668— QuicConfig::new has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PollRouter.failedAttempt (cyclomatic 18) foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/PollRouter.java:846— PollRouter.failedAttempt 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.
IggyTcpClient.waitForRecovery (cyclomatic 18) foreign/go/client/tcp/tcp_driver.go:657— IggyTcpClient.waitForRecovery 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.
MetadataChangesQuery.Validate (cyclomatic 18) foreign/go/contracts/metadata_changes.go:598— MetadataChangesQuery.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.
MetadataChangesQuery.validate (cyclomatic 18) foreign/swift/Sources/Iggy/Models/MetadataChanges.swift:474— MetadataChangesQuery.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. This is NOT this file's highest cyclomatic complexity: MetadataChange.decode (cyclomatic 25) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
CommandResponseStream.readyLink (cyclomatic 18) foreign/node/src/client/client.socket.ts:785— CommandResponseStream.readyLink has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
VsrConnection.ExchangeAsync (cyclomatic 17) foreign/csharp/Iggy_SDK/Vsr/VsrConnection.cs:159— VsrConnection.ExchangeAsync 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.
CreatePartitionsWithAssignmentsRequest::apply (cyclomatic 17) core/metadata/src/stm/stream.rs:2905— CreatePartitionsWithAssignmentsRequest::apply has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
UpdateUserResolvedRequest::apply (cyclomatic 17) core/metadata/src/stm/user.rs:637— UpdateUserResolvedRequest::apply has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SendMessages::deserialize (cyclomatic 17) core/common/src/http/messages/send_messages.rs:141— SendMessages::deserialize 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.
EndpointRegistry::restore (cyclomatic 17) core/connectors/sources/http_source/src/state.rs:103— EndpointRegistry::restore 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.
harness_derive::codegen::generate_harness_setup (cyclomatic 17) core/harness_derive/src/codegen.rs:389— harness_derive::codegen::generate_harness_setup has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
tcp.partitionQuery (cyclomatic 17) foreign/go/client/tcp/tcp_messaging.go:301— tcp.partitionQuery 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.
IggyTcpClient.bindLink (cyclomatic 17) foreign/go/client/tcp/tcp_session_management.go:383— IggyTcpClient.bindLink 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.
vsr.StampRequestHeader (cyclomatic 17) foreign/go/internal/vsr/envelope.go:43— vsr.StampRequestHeader 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.
ClientCore.signIn (cyclomatic 17) foreign/swift/Sources/Iggy/Client/ClientCore.swift:1255— ClientCore.signIn 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.
CommandResponseStream.exchange (cyclomatic 17) foreign/node/src/client/client.socket.ts:561— CommandResponseStream.exchange 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.
CommandResponseStream.installRoster (cyclomatic 17) foreign/node/src/client/client.socket.ts:820— CommandResponseStream.installRoster 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.
client.socket.partitionRoute (cyclomatic 17) foreign/node/src/client/client.socket.ts:1349— client.socket.partitionRoute 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.
IggyConsumer.StoreOffsetCoreAsync (cyclomatic 16) foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:404— IggyConsumer.StoreOffsetCoreAsync has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
TcpContracts.CreateMessage (cyclomatic 16) foreign/csharp/Iggy_SDK/Contracts/Tcp/TcpContracts.cs:301— TcpContracts.CreateMessage has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: TcpContracts.HeaderKindToByte (cyclomatic 17) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
TopicOptions.ToDictionary (cyclomatic 16) foreign/csharp/Iggy_SDK/Contracts/TopicOptions.cs:103— TopicOptions.ToDictionary has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TcpMessageStream.TryEstablishConnectionAsync (cyclomatic 16) foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.cs:1030— TcpMessageStream.TryEstablishConnectionAsync 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.
TcpMessageStream.RecoverSessionAsync (cyclomatic 16) foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.ReplicaLinks.cs:519— TcpMessageStream.RecoverSessionAsync has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
CreateTopicWithAssignmentsRequest::apply (cyclomatic 16) core/metadata/src/stm/stream.rs:2412— CreateTopicWithAssignmentsRequest::apply has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ElasticsearchSource::source_state_to_internal_state (cyclomatic 16) core/connectors/sources/elasticsearch_source/src/lib.rs:261— ElasticsearchSource::source_state_to_internal_state has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
iggy_connector_influxdb_source::v3::poll (cyclomatic 16) core/connectors/sources/influxdb_source/src/v3.rs:439— iggy_connector_influxdb_source::v3::poll has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CompleteLifecycleRequest::apply (cyclomatic 16) core/metadata/src/stm/lifecycle.rs:452— CompleteLifecycleRequest::apply 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.
LinksShared::sweep (cyclomatic 16) core/sdk/src/links/replicas.rs:555— LinksShared::sweep has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
ConsumerGroupLiveness::receive (cyclomatic 16) core/server/src/consumer_group/lease.rs:208— ConsumerGroupLiveness::receive 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.
Logging::cleanup_log_files (cyclomatic 16) core/server_common/src/log/logger.rs:625— Logging::cleanup_log_files 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.
Slot.attach (cyclomatic 16) foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/PollRouter.java:1365— Slot.attach has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
IggyTcpClient.SendMessages (cyclomatic 16) foreign/go/client/tcp/tcp_messaging.go:43— IggyTcpClient.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.
tcpLink.exchange (cyclomatic 16) foreign/go/client/tcp/tcp_link.go:68— tcpLink.exchange has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
iggcon.DeserializeHeaders (cyclomatic 16) foreign/go/contracts/user_headers.go:154— iggcon.DeserializeHeaders 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.
command.encodeOptions (cyclomatic 16) foreign/go/internal/command/update_resource.go:253— command.encodeOptions has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ClientCore.requireAuthenticated (cyclomatic 16) foreign/swift/Sources/Iggy/Client/ClientCore.swift:434— ClientCore.requireAuthenticated 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.
poll-messages.command.pollConsumerGroup (cyclomatic 16) foreign/node/src/wire/message/poll-messages.command.ts:230— poll-messages.command.pollConsumerGroup 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.
IggyTcpClient.driveOperation (cognitive 269) foreign/go/client/tcp/tcp_driver.go:183— IggyTcpClient.driveOperation has cognitive complexity 269 (threshold 15). Drivers by points: if/else 80 (227 pts), boolean chains 38, match/switch 2 (3 pts), loops 1 (nesting depth added 148). Of this number, 258 points are the body's own statements and 11 belong to 2 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
CommandResponseStream.drive (cognitive 242) foreign/node/src/client/client.socket.ts:282— CommandResponseStream.drive has cognitive complexity 242 (threshold 15). Drivers by points: if/else 64 (152 pts), boolean chains 48, ternaries 10 (25 pts), error handling 5 (12 pts), loops 2 (5 pts) (nesting depth added 113). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TcpMessageStream.RunClientOperationAsync (cognitive 238) foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.PollRouting.cs:178— TcpMessageStream.RunClientOperationAsync has cognitive complexity 238 (threshold 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.
Projection::project (cognitive 115) core/metadata/src/change_log/current.rs:179— Projection::project has cognitive complexity 115 (threshold 15). Drivers by points: if/else 23 (81 pts), loops 10 (27 pts), boolean chains 4, match/switch 2 (3 pts) (nesting depth added 76). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
StreamsSnapshot::validate_ownership_history (cognitive 95) core/metadata/src/stm/lifecycle.rs:546— StreamsSnapshot::validate_ownership_history has cognitive complexity 95 (threshold 15). Drivers by points: if/else 18 (55 pts), loops 10 (24 pts), boolean chains 13, match/switch 1 (3 pts) (nesting depth added 53). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClientCore.exchange (cognitive 90) foreign/swift/Sources/Iggy/Client/ClientCore.swift:184— ClientCore.exchange has cognitive complexity 90 (threshold 15). Drivers by points: if/else 20 (53 pts), ternaries 7 (24 pts), boolean chains 7, error handling 2 (5 pts), loops 1 (nesting depth added 53). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IggyTcpClient.drive (cognitive 87) foreign/go/client/tcp/tcp_driver.go:37— IggyTcpClient.drive has cognitive complexity 87 (threshold 15). Drivers by points: if/else 33 (79 pts), boolean chains 5, match/switch 1 (2 pts), loops 1 (nesting depth added 47). Of this number, 86 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ClusterConfig::validate (cognitive 83) core/configs/src/server_config/cluster.rs:899— ClusterConfig::validate has cognitive complexity 83 (threshold 15). Drivers by points: if/else 38 (65 pts), loops 7 (15 pts), boolean chains 3 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TransferFileJob::execute (cognitive 68) core/partitions/src/io.rs:914— TransferFileJob::execute has cognitive complexity 68 (threshold 15). Drivers by points: if/else 19 (45 pts), match/switch 5 (14 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 39). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
IggyTcpClient.consumerRoute (cognitive 60) foreign/go/client/tcp/tcp_poll_routing.go:232— IggyTcpClient.consumerRoute has cognitive complexity 60 (threshold 15). Drivers by points: if/else 27 (53 pts), boolean chains 6, loops 1 (nesting depth added 26). Of this number, 58 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClientCore.exchangeLocked (cognitive 58) foreign/swift/Sources/Iggy/Client/ClientCore.swift:692— ClientCore.exchangeLocked has cognitive complexity 58 (threshold 15). Drivers by points: if/else 13 (25 pts), boolean chains 14, error handling 6 (12 pts), match/switch 2 (6 pts), loops 1 (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.
iggy_connector_sdk::source::handle_messages_with_serializer (cognitive 54) core/connectors/sdk/src/source.rs:430— iggy_connector_sdk::source::handle_messages_with_serializer has cognitive complexity 54 (threshold 15). Drivers by points: if/else 9 (32 pts), match/switch 5 (17 pts), loops 2 (4 pts), boolean chains 1 (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.
CommandResponseStream.connectBootstrap (cognitive 54) foreign/node/src/client/client.socket.ts:956— CommandResponseStream.connectBootstrap has cognitive complexity 54 (threshold 15). Drivers by points: if/else 12 (39 pts), boolean chains 5, error handling 2 (5 pts), loops 2 (5 pts) (nesting depth added 33). Most of this is not in the body itself: 7 of the 54 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 962, 1000). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
VsrConnection.ReadRepliesAsync (cognitive 49) foreign/csharp/Iggy_SDK/Vsr/VsrConnection.cs:304— VsrConnection.ReadRepliesAsync has cognitive complexity 49 (threshold 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.
ClientCore.sweep (cognitive 48) foreign/swift/Sources/Iggy/Client/ClientCore.swift:868— ClientCore.sweep has cognitive complexity 48 (threshold 15). Drivers by points: if/else 10 (29 pts), error handling 3 (10 pts), boolean chains 4, loops 2 (3 pts), match/switch 1 (2 pts) (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.
ClientCore.sendRaw (cognitive 46) foreign/swift/Sources/Iggy/Client/ClientCore.swift:517— ClientCore.sendRaw has cognitive complexity 46 (threshold 15). Drivers by points: if/else 10 (26 pts), boolean chains 7, ternaries 2 (6 pts), error handling 1 (3 pts), match/switch 2 (3 pts), loops 1 (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.
IggyTcpClient.establishSession (cognitive 44) foreign/go/client/tcp/tcp_session_management.go:303— IggyTcpClient.establishSession has cognitive complexity 44 (threshold 15). Drivers by points: if/else 18 (41 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 24). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
PollRouter.exchange (cognitive 44) foreign/swift/Sources/Iggy/Client/PollRouter.swift:577— PollRouter.exchange has cognitive complexity 44 (threshold 15). Drivers by points: if/else 13 (25 pts), boolean chains 12, error handling 3 (6 pts), 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.
TcpMessageStream.GetPartitionRouteAsync (cognitive 43) foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.PollRouting.cs:696— TcpMessageStream.GetPartitionRouteAsync has cognitive complexity 43 (threshold 15). Of this number, 41 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IggyPublisherBuilder.Validate (cognitive 43) foreign/csharp/Iggy_SDK/Publishers/IggyPublisherBuilder.cs:385— IggyPublisherBuilder.Validate has cognitive complexity 43 (threshold 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.
SendMessages::deserialize (cognitive 43) core/common/src/http/messages/send_messages.rs:141— SendMessages::deserialize has cognitive complexity 43 (threshold 15). Drivers by points: if/else 11 (30 pts), loops 3 (10 pts), match/switch 2 (3 pts) (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.
ServerConfig::validate (cognitive 43) core/configs/src/server_config/validators.rs:51— ServerConfig::validate has cognitive complexity 43 (threshold 15). Drivers by points: if/else 21 (26 pts), boolean chains 11, loops 3 (6 pts) (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
TcpContracts.CreateMessage (cognitive 41) foreign/csharp/Iggy_SDK/Contracts/Tcp/TcpContracts.cs:301— TcpContracts.CreateMessage has cognitive complexity 41 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
TcpMessageStream.RunReplicaLinkAsync (cognitive 41) foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.ReplicaLinks.cs:100— TcpMessageStream.RunReplicaLinkAsync has cognitive complexity 41 (threshold 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.
IggyTcpClient.register (cognitive 41) foreign/go/client/tcp/tcp_session_management.go:75— IggyTcpClient.register has cognitive complexity 41 (threshold 15). Drivers by points: if/else 28 (35 pts), boolean chains 4, match/switch 2 (nesting depth added 7). Of this number, 31 points are the body's own statements and 10 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
CommandResponseStream.routeFor (cognitive 41) foreign/node/src/client/client.socket.ts:613— CommandResponseStream.routeFor has cognitive complexity 41 (threshold 15). Drivers by points: if/else 10 (25 pts), boolean chains 6, error handling 2 (5 pts), ternaries 1 (4 pts), loops 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
replicaLinks.connect (cognitive 40) REDACTED:89— replicaLinks.connect has cognitive complexity 40 (threshold 15). Drivers by points: if/else 16 (28 pts), boolean chains 5, loops 3 (4 pts), match/switch 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommandResponseStream.runReplica (cognitive 40) foreign/node/src/client/client.socket.ts:864— CommandResponseStream.runReplica has cognitive complexity 40 (threshold 15). Drivers by points: if/else 10 (28 pts), boolean chains 4, error handling 2 (4 pts), loops 2 (4 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TcpMessageStream.TryEstablishConnectionAsync (cognitive 37) foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.cs:1030— TcpMessageStream.TryEstablishConnectionAsync has cognitive complexity 37 (threshold 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.
Workload::on_reply (cognitive 36) core/simulator/src/workload/mod.rs:662— Workload::on_reply has cognitive complexity 36 (threshold 15). Drivers by points: if/else 24 (30 pts), boolean chains 5, match/switch 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
AsyncTcpConnection.completeAttempt (cognitive 36) foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/AsyncTcpConnection.java:1322— AsyncTcpConnection.completeAttempt has cognitive complexity 36 (threshold 15). Drivers by points: boolean chains 18, if/else 11 (14 pts), error handling 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 5). 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.
IggyTcpClient.signIn (cognitive 35) foreign/go/client/tcp/tcp_session_management.go:222— IggyTcpClient.signIn has cognitive complexity 35 (threshold 15). Drivers by points: if/else 16 (32 pts), boolean chains 2, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MutationLanes.enter (cognitive 35) foreign/node/src/client/client.operation.ts:228— MutationLanes.enter has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 5, error handling 2 (4 pts), loops 1, ternaries 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.
BackgroundMessageProcessor.SendWithRetry (cognitive 34) foreign/csharp/Iggy_SDK/Publishers/BackgroundMessageProcessor.cs:485— BackgroundMessageProcessor.SendWithRetry has cognitive complexity 34 (threshold 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.
iggy_connector_delta_sink::coercions::apply_coercion (cognitive 34) core/connectors/sinks/delta_sink/src/coercions.rs:104— iggy_connector_delta_sink::coercions::apply_coercion has cognitive complexity 34 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 4 (12 pts), boolean chains 4, match/switch 1 (nesting depth added 18). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
OperationDriver::attempt (cognitive 34) core/sdk/src/driver.rs:666— OperationDriver::attempt has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 9, match/switch 5 (9 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HttpSourceConfig::validate (cognitive 33) core/connectors/sources/http_source/src/lib.rs:631— HttpSourceConfig::validate has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (23 pts), boolean chains 7, 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.
QuicTransportConn::run (cognitive 33) core/message_bus/src/transports/quic.rs:621— QuicTransportConn::run has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (18 pts), match/switch 4 (12 pts), loops 2 (3 pts) (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.
ConsensusSession.acquireWhenAvailable (cognitive 33) foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/vsr/ConsensusSession.java:532— ConsensusSession.acquireWhenAvailable has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (23 pts), boolean chains 9, 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.
RabbitMQSink::publish_batch_with_retry (cognitive 32) core/connectors/sinks/rabbitmq_sink/src/lib.rs:193— RabbitMQSink::publish_batch_with_retry has cognitive complexity 32 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 5 (13 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FileScanner::probe_for_survivor (cognitive 32) core/partitions/src/segment_recovery.rs:2933— FileScanner::probe_for_survivor has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (27 pts), loops 2 (3 pts), boolean chains 2 (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.
poll-messages.command.syncAssignment (cognitive 32) foreign/node/src/wire/message/poll-messages.command.ts:150— poll-messages.command.syncAssignment has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 8, error handling 3 (5 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
client.parseConnectionOptions (cognitive 31) foreign/go/client/connection_string.go:215— client.parseConnectionOptions has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (25 pts), boolean chains 3, match/switch 1 (2 pts), loops 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.
replicaLinks.runSlot (cognitive 31) REDACTED:290— replicaLinks.runSlot has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 5, match/switch 1 (3 pts), loops 1 (nesting depth added 14). Of this number, 29 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
update-resource.command.checkPatch (cognitive 31) foreign/node/src/wire/system/update-resource.command.ts:123— update-resource.command.checkPatch has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 9, ternaries 3 (7 pts), loops 1 (nesting depth added 7). Of this number, 29 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Args::from (cognitive 30) core/common/src/types/args/mod.rs:424— Args::from has cognitive complexity 30 (threshold 15). Drivers by points: if/else 28 (29 pts), loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ClientCore.signIn (cognitive 30) foreign/swift/Sources/Iggy/Client/ClientCore.swift:1255— ClientCore.signIn has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (21 pts), error handling 2 (4 pts), boolean chains 3, match/switch 1 (2 pts) (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.
IggyConsumer.poll (cognitive 30) foreign/swift/Sources/Iggy/Consumer/IggyConsumer.swift:490— IggyConsumer.poll has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 11, error handling 2 (3 pts), 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.
iggy_cli::get_command (cognitive 29) core/cli/src/main.rs:113— iggy_cli::get_command has cognitive complexity 29 (threshold 15). Drivers by points: match/switch 15 (29 pts) (nesting depth added 14). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ShardingConfig::validate (cognitive 29) core/configs/src/server_config/sharding.rs:234— ShardingConfig::validate has cognitive complexity 29 (threshold 15). Drivers by points: if/else 22, boolean chains 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.
client.parseIggyDuration (cognitive 29) foreign/go/client/connection_string.go:294— client.parseIggyDuration has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (23 pts), match/switch 2 (4 pts), boolean chains 1, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PollRouter.exchange (cognitive 29) foreign/swift/Sources/Iggy/Client/PollRouter.swift:450— PollRouter.exchange has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (18 pts), error handling 5 (8 pts), boolean chains 3 (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.
Batch.decodeMessages (cognitive 29) foreign/swift/Sources/Iggy/Protocol/Batch.swift:193— Batch.decodeMessages has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 2 (3 pts), ternaries 1 (3 pts) (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.
DurationParser.parse (cognitive 29) foreign/node/src/duration.utils.ts:159— DurationParser.parse has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 3 (5 pts) (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.
IggyConsumerBuilder.Validate (cognitive 28) foreign/csharp/Iggy_SDK/Consumers/IggyConsumerBuilder.cs:321— IggyConsumerBuilder.Validate has cognitive complexity 28 (threshold 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.
PlacementState::scan (cognitive 28) core/metadata/src/impls/placement.rs:250— PlacementState::scan has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 4 (7 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
binaryserialization.DeserializeFetchMessagesResponse (cognitive 28) foreign/go/binary_serialization/binary_response_deserializer.go:184— binaryserialization.DeserializeFetchMessagesResponse has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
replicaLinks.install (cognitive 28) REDACTED:211— replicaLinks.install has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 4, 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.
PollReadResult::limit_bytes (cognitive 27) core/partitions/src/poll_plan.rs:219— PollReadResult::limit_bytes has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClientCore.requireAuthenticated (cognitive 27) foreign/swift/Sources/Iggy/Client/ClientCore.swift:434— ClientCore.requireAuthenticated has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (17 pts), boolean chains 3, error handling 1 (3 pts), match/switch 2, ternaries 1 (2 pts) (nesting depth added 14). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
IggyConsumer.PollRentedMessagesCoreAsync (cognitive 26) foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.Rented.cs:124— IggyConsumer.PollRentedMessagesCoreAsync has cognitive complexity 26 (threshold 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.
TcpMessageStream.LoginRegisterCoreAsync (cognitive 26) foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.Vsr.cs:178— TcpMessageStream.LoginRegisterCoreAsync has cognitive complexity 26 (threshold 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.
ElasticsearchSink::bulk_index_documents (cognitive 26) core/connectors/sinks/elasticsearch_sink/src/lib.rs:205— ElasticsearchSink::bulk_index_documents has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
harness_derive::codegen::generate_harness_setup (cognitive 26) core/harness_derive/src/codegen.rs:389— harness_derive::codegen::generate_harness_setup has cognitive complexity 26 (threshold 15). Drivers by points: if/else 21 (23 pts), match/switch 2 (3 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
PartitionJournal::evict_prefix (cognitive 26) core/partitions/src/journal.rs:656— PartitionJournal::evict_prefix has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 4 (8 pts), boolean chains 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.
tools::data-seeder::seeder::send_messages (cognitive 26) core/tools/src/data-seeder/seeder.rs:119— tools::data-seeder::seeder::send_messages has cognitive complexity 26 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 4 (10 pts), match/switch 1 (5 pts), 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.
get-metadata-changes.command.checkQuery (cognitive 26) foreign/node/src/wire/system/get-metadata-changes.command.ts:209— get-metadata-changes.command.checkQuery has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 7, loops 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommandResponseStream.readyLink (cognitive 26) foreign/node/src/client/client.socket.ts:785— CommandResponseStream.readyLink has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 5, loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 11). Of this number, 25 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BinaryMapper.MapRentedMessages (cognitive 25) foreign/csharp/Iggy_SDK/Mappers/BinaryMapper.cs:279— BinaryMapper.MapRentedMessages has cognitive complexity 25 (threshold 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.
Parser.Parse (cognitive 25) foreign/csharp/Iggy_SDK/Utils/IggyDurationParser.cs:170— Parser.Parse has cognitive complexity 25 (threshold 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.
EndpointRegistry::restore (cognitive 25) core/connectors/sources/http_source/src/state.rs:103— EndpointRegistry::restore has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 3, loops 2, match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChangeLogSnapshot::validate (cognitive 25) core/metadata/src/change_log/snapshot.rs:65— ChangeLogSnapshot::validate has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
server_common::diagnostics::report_io_uring_environment (cognitive 25) core/server_common/src/diagnostics.rs:280— server_common::diagnostics::report_io_uring_environment has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 5, match/switch 3 (4 pts), loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Invariants::check (cognitive 25) core/simulator/src/workload/invariants.rs:128— Invariants::check has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (22 pts), loops 2 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
iggcon.DeserializeHeaders (cognitive 25) foreign/go/contracts/user_headers.go:154— iggcon.DeserializeHeaders has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 4, 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.
UserHeadersConverter.Read (cognitive 24) foreign/csharp/Iggy_SDK/JsonConverters/UserHeadersConverter.cs:26— UserHeadersConverter.Read has cognitive complexity 24 (threshold 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.
VsrConnection.ExchangeAsync (cognitive 24) foreign/csharp/Iggy_SDK/Vsr/VsrConnection.cs:159— VsrConnection.ExchangeAsync has cognitive complexity 24 (threshold 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.
TestHarness::start_internal (cognitive 24) core/integration/src/harness/orchestrator/harness.rs:108— TestHarness::start_internal has cognitive complexity 24 (threshold 15). Drivers by points: loops 5 (11 pts), if/else 6 (10 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 11). 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.
JwksClient::refresh_keys (cognitive 24) core/server/src/http/jwks.rs:180— JwksClient::refresh_keys has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (18 pts), match/switch 1 (3 pts), 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.
VsrConnection.ReadFirstReplyByteAsync (cognitive 23) foreign/csharp/Iggy_SDK/Vsr/VsrConnection.cs:433— VsrConnection.ReadFirstReplyByteAsync has cognitive complexity 23 (threshold 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.
LocalConnectorsConfigProvider::init (cognitive 23) core/connectors/runtime/src/configs/connectors/local_provider.rs:148— LocalConnectorsConfigProvider::init has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (18 pts), match/switch 2 (4 pts), 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.
OffsetDirectoriesIoJob::execute (cognitive 23) core/partitions/src/io.rs:1385— OffsetDirectoriesIoJob::execute has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 3 (4 pts), match/switch 2 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Shard::new (cognitive 23) core/sdk/src/clients/producer_sharding.rs:207— Shard::new has cognitive complexity 23 (threshold 15). Drivers by points: if/else 3 (11 pts), match/switch 2 (5 pts), loops 2 (4 pts), 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.
LaneTicket::drop (cognitive 23) core/sdk/src/session_owner/lanes.rs:527— LaneTicket::drop has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 4 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ConsumerGroupLiveness::receive (cognitive 23) core/server/src/consumer_group/lease.rs:208— ConsumerGroupLiveness::receive has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PollReadback::assert_served_committed (cognitive 23) core/simulator/src/workload/readback.rs:292— PollReadback::assert_served_committed has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PollRouter.invalidateRoute (cognitive 23) foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/PollRouter.java:891— PollRouter.invalidateRoute has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 4 (15 pts), boolean chains 4, if/else 3 (4 pts) (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
client.ParseConnectionString (cognitive 23) foreign/go/client/connection_string.go:86— client.ParseConnectionString has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17 (22 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
replicaLinks.startHeartbeat (cognitive 23) REDACTED:498— replicaLinks.startHeartbeat has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3 (5 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 11). Most of this is not in the body itself: 2 of the 23 points are its own statements and the rest belongs to one function literal inside it that branches (line 508). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
client.connection-string.parseConnectionString (cognitive 23) REDACTED:59— client.connection-string.parseConnectionString has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13, ternaries 5 (6 pts), 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.
IggyConsumer.DisposeAsync (cognitive 22) foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:136— IggyConsumer.DisposeAsync has cognitive complexity 22 (threshold 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.
PrimaryRebalanceHeader::validate (cognitive 22) core/binary_protocol/src/consensus/primary_rebalance.rs:101— PrimaryRebalanceHeader::validate has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 8, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
TypedEnvProvider::warn_unknown_env_vars_inner (cognitive 22) core/configs/src/configs_impl/typed_env_provider.rs:266— TypedEnvProvider::warn_unknown_env_vars_inner has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 3 (5 pts), 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.
HttpRetryMiddleware::handle (cognitive 22) core/connectors/sdk/src/retry.rs:434— HttpRetryMiddleware::handle has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 4 (11 pts), if/else 3 (9 pts), boolean chains 1, loops 1 (nesting depth added 13). 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.
Rewrapper::sweep (cognitive 22) core/server/src/stream_key_rewrapper.rs:103— Rewrapper::sweep has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (12 pts), match/switch 2 (6 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AsyncIggyTcpClient.loginOnLeader (cognitive 22) foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/AsyncIggyTcpClient.java:1298— AsyncIggyTcpClient.loginOnLeader has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 5 (8 pts), boolean chains 7, if/else 7 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
PollRouter.failedAttempt (cognitive 22) foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/PollRouter.java:846— PollRouter.failedAttempt has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 10, if/else 8 (9 pts), ternaries 1 (3 pts) (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.
Permissions.MarshalBinary (cognitive 22) foreign/go/contracts/users.go:50— Permissions.MarshalBinary has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 2 (6 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vsr.StampRequestHeader (cognitive 22) foreign/go/internal/vsr/envelope.go:43— vsr.StampRequestHeader has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 5, loops 1 (2 pts), match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IggyConsumer.consumeMessages (cognitive 22) foreign/swift/Sources/Iggy/Consumer/IggyConsumer.swift:316— IggyConsumer.consumeMessages has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (12 pts), error handling 2 (4 pts), ternaries 1 (3 pts), match/switch 1 (2 pts), 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.
ShardWorker.run (cognitive 22) foreign/swift/Sources/Iggy/Producer/ProducerDispatcher.swift:324— ShardWorker.run has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (7 pts), boolean chains 5 (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.
poll-messages.command.pollConsumerGroup (cognitive 22) foreign/node/src/wire/message/poll-messages.command.ts:230— poll-messages.command.pollConsumerGroup has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 5, ternaries 2 (4 pts), error handling 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MutationLanes.RestartAsync (cognitive 21) foreign/csharp/Iggy_SDK/Vsr/MutationLanes.cs:192— MutationLanes.RestartAsync has cognitive complexity 21 (threshold 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.
CreatePartitionsWithAssignmentsRequest::apply (cognitive 21) core/metadata/src/stm/stream.rs:2905— CreatePartitionsWithAssignmentsRequest::apply has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (19 pts), loops 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
IggyMessagesBatch::validate (cognitive 21) core/common/src/types/message/messages_batch.rs:170— IggyMessagesBatch::validate has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MongoDbSink::insert_batch (cognitive 21) core/connectors/sinks/mongodb_sink/src/lib.rs:282— MongoDbSink::insert_batch has cognitive complexity 21 (threshold 15). Drivers by points: match/switch 5 (13 pts), if/else 4 (7 pts), loops 1 (nesting depth added 11). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
HttpClient::get_deferred_poll (cognitive 21) core/sdk/src/http/http_client.rs:228— HttpClient::get_deferred_poll has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tcp.sendTarget (cognitive 21) foreign/go/client/tcp/tcp_messaging.go:239— tcp.sendTarget has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (15 pts), match/switch 2 (3 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
CommandResponseStream.sendCommand (cognitive 21) foreign/node/src/client/client.socket.ts:200— CommandResponseStream.sendCommand has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 5, ternaries 2 (3 pts) (nesting depth added 4). Of this number, 13 points are the body's own statements and 8 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AdvertisedAddress::from_str (cognitive 20) core/configs/src/server_config/cluster.rs:734— AdvertisedAddress::from_str has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 6, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
MqttDriver::acknowledge_batch (cognitive 20) core/connectors/sources/mqtt_source/src/driver.rs:379— MqttDriver::acknowledge_batch has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (14 pts), loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OffsetIoJob::execute (cognitive 20) core/partitions/src/io.rs:1304— OffsetIoJob::execute has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 4 (11 pts), if/else 5 (8 pts), boolean chains 1 (nesting depth added 10). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
IggyTcpClient.waitForRecovery (cognitive 20) foreign/go/client/tcp/tcp_driver.go:657— IggyTcpClient.waitForRecovery has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IggyTcpClient.SendMessages (cognitive 20) foreign/go/client/tcp/tcp_messaging.go:43— IggyTcpClient.SendMessages has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 3, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IggyTcpClient.bindLink (cognitive 20) foreign/go/client/tcp/tcp_session_management.go:383— IggyTcpClient.bindLink has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 2, loops 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PollRouter.send (cognitive 20) foreign/swift/Sources/Iggy/Client/PollRouter.swift:148— PollRouter.send has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 5, error handling 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommandResponseStream.signIn (cognitive 20) foreign/node/src/client/client.socket.ts:1228— CommandResponseStream.signIn has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 2 (4 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 8). Most of this is not in the body itself: 2 of the 20 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1233, 1248). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
BackgroundMessageProcessor.RunBackgroundProcessor (cognitive 19) foreign/csharp/Iggy_SDK/Publishers/BackgroundMessageProcessor.cs:255— BackgroundMessageProcessor.RunBackgroundProcessor has cognitive complexity 19 (threshold 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.
MutationLanes.EnterAsync (cognitive 19) foreign/csharp/Iggy_SDK/Vsr/MutationLanes.cs:121— MutationLanes.EnterAsync has cognitive complexity 19 (threshold 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.
InfluxDbSink::append_line (cognitive 19) core/connectors/sinks/influxdb_sink/src/lib.rs:489— InfluxDbSink::append_line has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10, boolean chains 6, match/switch 2 (3 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MqttSource::validate_config (cognitive 19) core/connectors/sources/mqtt_source/src/lib.rs:231— MqttSource::validate_config has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 3, loops 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
WriterLease::acquire (cognitive 19) core/partitions/src/persistence.rs:207— WriterLease::acquire has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 1 (2 pts), 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.
GroupState::tick (cognitive 19) gateways/kafka/src/group/state.rs:391— GroupState::tick has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 3 (5 pts), boolean chains 3 (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.
AsyncTcpConnection.sendAdmittedFrame (cognitive 19) foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/AsyncTcpConnection.java:1147— AsyncTcpConnection.sendAdmittedFrame has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (8 pts), error handling 3 (6 pts), boolean chains 3, ternaries 2 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
PollRouter.applyTopology (cognitive 19) foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/PollRouter.java:478— PollRouter.applyTopology has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), 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.
main.types (cognitive 19) foreign/go/errors/generator/main.go:101— main.types has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
util.CheckAndRedirectToLeader (cognitive 19) foreign/go/internal/util/leader_aware.go:62— util.CheckAndRedirectToLeader has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 pts), match/switch 2 (5 pts), 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.
MetadataChangesQuery.validate (cognitive 19) foreign/swift/Sources/Iggy/Models/MetadataChanges.swift:474— MetadataChangesQuery.validate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 5, match/switch 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.
TopicCreateOptions.toResourceOptions (cognitive 19) foreign/swift/Sources/Iggy/Models/TopicOptions.swift:108— TopicCreateOptions.toResourceOptions has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProducerCore.initialize (cognitive 19) foreign/swift/Sources/Iggy/Producer/IggyProducer.swift:207— ProducerCore.initialize has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), error handling 2 (4 pts), ternaries 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
consumer-stream.genEagerUntilPoll (cognitive 19) foreign/node/src/stream/consumer-stream.ts:70— consumer-stream.genEagerUntilPoll has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 3, loops 1 (nesting depth added 8). Of this number, 11 points are the body's own statements and 8 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TcpMessageStream.PollGroupMessagesRentedAsync (cognitive 18) foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.Vsr.cs:454— TcpMessageStream.PollGroupMessagesRentedAsync has cognitive complexity 18 (threshold 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.
IggyCredentials::new (cognitive 18) core/cli/src/credentials.rs:60— IggyCredentials::new has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 3, match/switch 1 (2 pts) (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.
QuicConnectionStringOptions::parse_options (cognitive 18) core/common/src/types/configuration/quic_config/quic_connection_string_options.rs:95— QuicConnectionStringOptions::parse_options has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 10 (15 pts), if/else 1 (2 pts), loops 1 (nesting depth added 6). 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.
PartitionConfig::validate (cognitive 18) core/configs/src/server_config/partition.rs:284— PartitionConfig::validate has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, boolean chains 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.
ClickHouseClient::insert (cognitive 18) core/connectors/sinks/clickhouse_sink/src/client.rs:175— ClickHouseClient::insert has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (15 pts), match/switch 1 (2 pts), 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.
HttpSink::open (cognitive 18) core/connectors/sinks/http_sink/src/lib.rs:1036— HttpSink::open has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 3, boolean chains 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.
MeilisearchSink::retry_sdk_operation_with_retries (cognitive 18) core/connectors/sinks/meilisearch_sink/src/lib.rs:671— MeilisearchSink::retry_sdk_operation_with_retries has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (14 pts), match/switch 1 (2 pts), 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.
S3Sink::close (cognitive 18) core/connectors/sinks/s3_sink/src/sink.rs:135— S3Sink::close has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SurrealDbSink::insert_records_with_retry (cognitive 18) core/connectors/sinks/surrealdb_sink/src/lib.rs:718— SurrealDbSink::insert_records_with_retry has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 4 (9 pts), if/else 2 (6 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
RouteTable::build_with (cognitive 18) core/connectors/sources/http_source/src/routes.rs:282— RouteTable::build_with has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 3 (8 pts), if/else 3 (7 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CompleteLifecycleRequest::apply (cognitive 18) core/metadata/src/stm/lifecycle.rs:452— CompleteLifecycleRequest::apply has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 3 (4 pts), match/switch 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PartitionPersistence::run_inner (cognitive 18) core/partitions/src/persistence.rs:1262— PartitionPersistence::run_inner has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 2, match/switch 1 (2 pts), 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.
Mirror::apply (cognitive 18) core/simulator/src/workload/change_log_oracle.rs:214— Mirror::apply has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (4 pts), match/switch 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
QuicConfig::new (cognitive 18) foreign/python/src/config.rs:668— QuicConfig::new has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17 (18 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AsyncTcpConnection.completeFailedRequest (cognitive 18) foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/AsyncTcpConnection.java:776— AsyncTcpConnection.completeFailedRequest has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 8, if/else 7 (8 pts), ternaries 1 (2 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Slot.attach (cognitive 18) foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/PollRouter.java:1365— Slot.attach has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
binaryserialization.deserializePermissions (cognitive 18) foreign/go/binary_serialization/binary_response_deserializer.go:670— binaryserialization.deserializePermissions has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (6 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
binaryserialization.DeserializeMetadataChanges (cognitive 18) foreign/go/binary_serialization/metadata_changes_deserializer.go:54— binaryserialization.DeserializeMetadataChanges has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 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.
IggyTcpClient.pollGroup (cognitive 18) foreign/go/client/tcp/tcp_group_polling.go:177— IggyTcpClient.pollGroup has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IggyTcpClient.ensureAssignment (cognitive 18) foreign/go/client/tcp/tcp_group_polling.go:249— IggyTcpClient.ensureAssignment has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), 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.
command.validatePatch (cognitive 18) foreign/go/internal/command/update_resource.go:125— command.validatePatch has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IggyConsumer.start (cognitive 18) foreign/swift/Sources/Iggy/Consumer/IggyConsumer.swift:180— IggyConsumer.start has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
client.connection-string.parseConnectionOptions (cognitive 18) REDACTED:156— client.connection-string.parseConnectionOptions has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (11 pts), ternaries 1 (3 pts), match/switch 1 (2 pts), 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.
CommandResponseStream.replicaLink (cognitive 18) foreign/node/src/client/client.socket.ts:762— CommandResponseStream.replicaLink has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommandResponseStream.installRoster (cognitive 18) foreign/node/src/client/client.socket.ts:820— CommandResponseStream.installRoster has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 6, loops 2, ternaries 1 (2 pts) (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.
metadataChanges.scanRecentMetadataChanges (cognitive 18) web/src/lib/api/metadataChanges.ts:177— metadataChanges.scanRecentMetadataChanges has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 5, ternaries 1 (3 pts), 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.
IggyConsumer.PollMessagesAsync (cognitive 17) foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:602— IggyConsumer.PollMessagesAsync has cognitive complexity 17 (threshold 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.
TcpMessageStream.RecoverSessionAsync (cognitive 17) foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.ReplicaLinks.cs:519— TcpMessageStream.RecoverSessionAsync has cognitive complexity 17 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
VsrConnection.SendAttemptAsync (cognitive 17) foreign/csharp/Iggy_SDK/Vsr/VsrConnection.cs:105— VsrConnection.SendAttemptAsync has cognitive complexity 17 (threshold 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.
CreateTopicWithAssignmentsRequest::apply (cognitive 17) core/metadata/src/stm/stream.rs:2412— CreateTopicWithAssignmentsRequest::apply has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (14 pts), loops 2 (3 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
UpdateUserResolvedRequest::apply (cognitive 17) core/metadata/src/stm/user.rs:637— UpdateUserResolvedRequest::apply has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 4, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
ConnectionString::new (cognitive 17) core/common/src/types/configuration/auth_config/connection_string.rs:50— ConnectionString::new has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ProtoConvert::transform (cognitive 17) core/connectors/sdk/src/transforms/proto_convert.rs:709— ProtoConvert::transform has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (16 pts), match/switch 1 (nesting depth added 6). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
RedshiftSink::process_messages (cognitive 17) REDACTED:375— RedshiftSink::process_messages has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StreamContext::serve (cognitive 17) core/message_bus/src/transports/quic.rs:476— StreamContext::serve has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), match/switch 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.
RemoveConsumerGroupMembersRequest::apply (cognitive 17) core/metadata/src/stm/consumer_group.rs:930— RemoveConsumerGroupMembersRequest::apply has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 2 (7 pts) (nesting depth added 11). 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.
Fetch::wait (cognitive 17) gateways/kafka/src/protocol/handlers/fetch.rs:465— Fetch::wait has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VsrRequestEncoder.encode (cognitive 17) foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/vsr/VsrRequestEncoder.java:82— VsrRequestEncoder.encode has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 3 (7 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PollRouter.lookupConnection (cognitive 17) foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/PollRouter.java:1105— PollRouter.lookupConnection has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 4, loops 1 (2 pts) (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.
tcp.partitionQuery (cognitive 17) foreign/go/client/tcp/tcp_messaging.go:301— tcp.partitionQuery has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, loops 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.
tcpLink.readLoop (cognitive 17) foreign/go/client/tcp/tcp_link.go:178— tcpLink.readLoop has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (15 pts), 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.
laneTicket.finish (cognitive 17) foreign/go/client/tcp/tcp_pending.go:360— laneTicket.finish has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 5 (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.
MetadataChangesQuery.Validate (cognitive 17) foreign/go/contracts/metadata_changes.go:598— MetadataChangesQuery.Validate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 5, 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.
vsr.DecodeReplyFor (cognitive 17) foreign/go/internal/vsr/reply.go:37— vsr.DecodeReplyFor has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, if/else 7 (8 pts) (nesting depth added 1). 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.
PollRouter.lookUpInCluster (cognitive 17) foreign/swift/Sources/Iggy/Client/PollRouter.swift:739— PollRouter.lookUpInCluster has cognitive complexity 17 (threshold 15). Drivers by points: error handling 5 (9 pts), if/else 5 (8 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IggyConnection.onData (cognitive 17) foreign/node/src/client/client.connection.ts:255— IggyConnection.onData has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 1 (3 pts), boolean chains 1, error handling 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
poll.utils.deserializeBatchMessages (cognitive 17) foreign/node/src/wire/message/poll.utils.ts:276— poll.utils.deserializeBatchMessages has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommandResponseStream.exchange (cognitive 17) foreign/node/src/client/client.socket.ts:561— CommandResponseStream.exchange has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 5, ternaries 1 (2 pts), 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.
CommandResponseStream.rememberRoute (cognitive 17) foreign/node/src/client/client.socket.ts:701— CommandResponseStream.rememberRoute has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, loops 2, 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.
client.socket.partitionRoute (cognitive 17) foreign/node/src/client/client.socket.ts:1349— client.socket.partitionRoute has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (7 pts), if/else 5 (6 pts), boolean chains 4 (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.
ConnectionString.ParseOptions (cognitive 16) foreign/csharp/Iggy_SDK/Configuration/ConnectionString.cs:133— ConnectionString.ParseOptions has cognitive complexity 16 (threshold 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.
IggyConsumer.WithLaneRecoveryAsync (cognitive 16) foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:736— IggyConsumer.WithLaneRecoveryAsync has cognitive complexity 16 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
BackgroundMessageProcessor.SendWithRecovery (cognitive 16) foreign/csharp/Iggy_SDK/Publishers/BackgroundMessageProcessor.cs:583— BackgroundMessageProcessor.SendWithRecovery has cognitive complexity 16 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
ClickHouseSink::open (cognitive 16) core/connectors/sinks/clickhouse_sink/src/sink.rs:31— ClickHouseSink::open has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), match/switch 2 (5 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DynamicRouter::route_data (cognitive 16) core/connectors/sinks/iceberg_sink/src/router/dynamic_router.rs:107— DynamicRouter::route_data has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), match/switch 3 (6 pts), 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.
VsrState::try_from (cognitive 16) core/consensus/src/vsr_state.rs:440— VsrState::try_from has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 1 (3 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConsumerGroup::balanced_member_indices (cognitive 16) core/metadata/src/stm/consumer_group.rs:323— ConsumerGroup::balanced_member_indices has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
iggy_cpp::type_conversion::decode_field (cognitive 16) foreign/cpp/src/type_conversion.rs:1026— iggy_cpp::type_conversion::decode_field has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 14 (16 pts) (nesting depth added 2). 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.
CreateTopic.typedOptions (cognitive 16) foreign/go/internal/command/topic.go:99— CreateTopic.typedOptions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
fakevsr.Listen (cognitive 16) foreign/go/internal/fakevsr/fakevsr.go:198— fakevsr.Listen has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 9). None of this is in the body itself: all 16 points belong to one function literal inside it that branches (line 206). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
ClientCore.establishSession (cognitive 16) foreign/swift/Sources/Iggy/Client/ClientCore.swift:983— ClientCore.establishSession has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), error handling 3 (5 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IggyClient.pollGroup (cognitive 16) foreign/swift/Sources/Iggy/Client/IggyClient+Messages.swift:236— IggyClient.pollGroup has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), error handling 1 (2 pts), 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.
ShardWorker.flush (cognitive 16) foreign/swift/Sources/Iggy/Producer/ProducerDispatcher.swift:379— ShardWorker.flush has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), error handling 2 (4 pts), ternaries 1 (3 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommandResponseStream.primaryLink (cognitive 16) foreign/node/src/client/client.socket.ts:739— CommandResponseStream.primaryLink has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 2, error handling 1 (2 pts), 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.
CommandResponseStream._rememberCredentials (cognitive 16) foreign/node/src/client/client.socket.ts:1139— CommandResponseStream._rememberCredentials has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 3, loops 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D22 · Internal API Consistency· `IIggyClient.AbandonOperationAsync` has no CancellationToken; its 3 sibling async members take one · ×1
`IIggyClient.AbandonOperationAsync` has no CancellationToken; its 3 sibling async members take one foreign/csharp/Iggy_SDK/IggyClient/IIggyClient.cs:119— 3 of 4 awaitable members of `IIggyClient` take a CancellationToken (3 of 4). Siblings: IIggyClient.SendBinaryRequestAsync (foreign/csharp/Iggy_SDK/IggyClient/IIggyClient.cs:74); IIggyClient.SendBinaryRequestToReplicaAsync (foreign/csharp/Iggy_SDK/IggyClient/IIggyClient.cs:93); IIggyClient.ResolveOperationAsync (foreign/csharp/Iggy_SDK/IggyClient/IIggyClient.cs:109). Add a trailing `CancellationToken cancellationToken = default` and pass it on. [rule A1]
D4 · Code Duplication· Near-duplicate member family (3 members, 11 shared lines) · ×1
Near-duplicate member family (3 members, 11 shared lines) foreign/csharp/Iggy_SDK/Contracts/Tcp/TcpContracts.cs:703— foreign/csharp/Iggy_SDK/Contracts/Tcp/TcpContracts.cs:703-727 | foreign/csharp/Iggy_SDK/Contracts/Tcp/TcpContracts.cs:730-752 | foreign/csharp/Iggy_SDK/Contracts/Tcp/TcpContracts.cs:867-890 — These 3 members are variants of one another: a block of 11 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
Near-duplicate member pair (84 shared lines) core/message_bus/src/transports/ws.rs:186— core/message_bus/src/transports/ws.rs:186-293 | core/message_bus/src/transports/wss.rs:334-445 — These two members are variants of one another: 84 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (66 shared lines) core/message_bus/src/installer/replica.rs:398— core/message_bus/src/installer/replica.rs:398-655 | core/message_bus/src/installer/tcp.rs:84-252 — These two members are variants of one another: 66 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (37 shared lines) core/connectors/sinks/http_sink/src/lib.rs:737— core/connectors/sinks/http_sink/src/lib.rs:737-813 | core/connectors/sinks/http_sink/src/lib.rs:822-906 — These two members are variants of one another: 37 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Edited copy of a member (20 corresponding lines) · ×1
Edited copy of a member (20 corresponding lines) core/integration/src/harness/handle/connectors_runtime.rs:210— core/integration/src/harness/handle/connectors_runtime.rs:210-233 | core/integration/src/harness/handle/server.rs:1181-1219 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Members sharing a duplicated core (13 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (13 members, 50+ identical tokens) core/consensus/src/observability.rs:530— core/consensus/src/observability.rs:530-567 | core/consensus/src/observability.rs:569-606 | core/consensus/src/observability.rs:608-645 | core/consensus/src/observability.rs:647-684 | core/consensus/src/observability.rs:686-723 | core/consensus/src/observability.rs:799-818 | core/consensus/src/observability.rs:825-846 | core/consensus/src/observability.rs:849-872 | core/consensus/src/observability.rs:876-903 | core/consensus/src/observability.rs:907-933 | core/consensus/src/observability.rs:937-962 | core/consensus/src/observability.rs:966-991 | core/consensus/src/observability.rs:995-1020 — These 13 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 13 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 13 times.
D4 · Code Duplication· Members sharing a duplicated core (10 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (10 members, 50+ identical tokens) core/binary_protocol/src/requests/consumer_groups/create_consumer_group.rs:47— core/binary_protocol/src/requests/consumer_groups/create_consumer_group.rs:47-63 | core/binary_protocol/src/requests/consumer_groups/delete_consumer_group.rs:46-62 | core/binary_protocol/src/requests/consumer_groups/get_consumer_group.rs:46-62 | core/binary_protocol/src/requests/consumer_groups/join_consumer_group.rs:46-62 | core/binary_protocol/src/requests/consumer_groups/leave_consumer_group.rs:46-62 | core/binary_protocol/src/requests/consumer_groups/sync_consumer_group.rs:49-65 | core/binary_protocol/src/requests/consumer_offsets/delete_consumer_offset.rs:72-102 | core/binary_protocol/src/requests/consumer_offsets/get_consumer_offset.rs:65-91 | core/binary_protocol/src/requests/consumer_offsets/store_consumer_offset.rs:75-108 | core/binary_protocol/src/requests/messages/poll_messages.rs:130-168 — These 10 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 10 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 10 times.
Duplicated block (42–46 lines × 2) core/connectors/sources/influxdb_source/src/lib.rs:547— core/connectors/sources/influxdb_source/src/lib.rs:547-592 | core/connectors/sources/influxdb_source/src/lib.rs:633-674 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (38–44 lines × 2) foreign/csharp/Iggy_SDK/Consumers/IggyConsumerConfig.cs:46— foreign/csharp/Iggy_SDK/Consumers/IggyConsumerConfig.cs:46-83 | foreign/csharp/Iggy_SDK/Publishers/IggyPublisherConfig.cs:44-87 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `foreign/csharp/Iggy_SDK/Consumers/IggyConsumerConfig.cs:46` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (13–31 lines × 2) core/message_bus/src/installer/replica.rs:445— core/message_bus/src/installer/replica.rs:445-475 | core/message_bus/src/installer/tcp.rs:98-110 — before extracting anything, compare `core/message_bus/src/installer/replica.rs` and `core/message_bus/src/installer/tcp.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 87 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (28–29 lines × 3) core/connectors/sdk/src/decoders/proto.rs:118— core/connectors/sdk/src/decoders/proto.rs:118-145 | core/connectors/sdk/src/encoders/proto.rs:147-175 | core/connectors/sdk/src/transforms/proto_convert.rs:141-169 — `core/connectors/sdk/src/decoders/proto.rs` and `core/connectors/sdk/src/encoders/proto.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 116 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (26–29 lines × 2) core/message_bus/src/transports/ws.rs:221— core/message_bus/src/transports/ws.rs:221-246 | core/message_bus/src/transports/wss.rs:369-397 — before extracting anything, compare `core/message_bus/src/transports/ws.rs` and `core/message_bus/src/transports/wss.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 101 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (27 lines × 3) core/connectors/sdk/src/encoders/avro.rs:295— core/connectors/sdk/src/encoders/avro.rs:295-321 | core/connectors/sdk/src/encoders/flatbuffer.rs:169-195 | core/connectors/sdk/src/encoders/proto.rs:665-691 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (27 lines × 2) core/simulator/src/workload/ops/create_partitions.rs:58— core/simulator/src/workload/ops/create_partitions.rs:58-84 | core/simulator/src/workload/ops/delete_partitions.rs:72-98 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11–27 lines × 2) foreign/php/src/metadata_changes.rs:1623— foreign/php/src/metadata_changes.rs:1623-1633 | foreign/python/src/metadata_changes.rs:1262-1288 — before extracting anything, compare `foreign/php/src/metadata_changes.rs` and `foreign/python/src/metadata_changes.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (25 lines × 2) core/ai/mcp/src/configs.rs:261— core/ai/mcp/src/configs.rs:261-285 | core/connectors/runtime/src/api/config.rs:153-177 — before extracting anything, compare `core/ai/mcp/src/configs.rs` and `core/connectors/runtime/src/api/config.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (21–22 lines × 2) foreign/csharp/Iggy_SDK/IggyClient/Implementations/HttpMessageStream.cs:851— foreign/csharp/Iggy_SDK/IggyClient/Implementations/HttpMessageStream.cs:851-871 | foreign/csharp/Iggy_SDK/IggyClient/Implementations/HttpMessageStream.cs:934-955 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `foreign/csharp/Iggy_SDK/IggyClient/Implementations/HttpMessageStream.cs:851` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11–22 lines × 2) foreign/php/src/metadata_changes.rs:1653— foreign/php/src/metadata_changes.rs:1653-1663 | foreign/python/src/metadata_changes.rs:1292-1313 — before extracting anything, compare `foreign/php/src/metadata_changes.rs` and `foreign/python/src/metadata_changes.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (19–21 lines × 2) core/binary_protocol/src/requests/partitions/create_partitions_with_assignments.rs:73— core/binary_protocol/src/requests/partitions/create_partitions_with_assignments.rs:73-91 | core/binary_protocol/src/requests/topics/create_topic_with_assignments.rs:89-109 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (17–21 lines × 2) core/consensus/src/impls.rs:3326— core/consensus/src/impls.rs:3326-3346 | core/consensus/src/impls.rs:3640-3656 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17–20 lines × 2) core/server/src/boot/handoff.rs:148— core/server/src/boot/handoff.rs:148-167 | core/server/src/boot/handoff.rs:188-204 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 3) core/integration/src/harness/handle/connectors_runtime.rs:183— core/integration/src/harness/handle/connectors_runtime.rs:183-201 | core/integration/src/harness/handle/mcp.rs:183-201 | core/integration/src/harness/handle/server.rs:1148-1166 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (16–19 lines × 2) core/connectors/sources/mqtt_source/src/driver.rs:313— core/connectors/sources/mqtt_source/src/driver.rs:313-331 | core/connectors/sources/mqtt_source/src/driver.rs:495-510 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 5) core/consensus/src/observability.rs:550— core/consensus/src/observability.rs:550-567 | core/consensus/src/observability.rs:589-606 | core/consensus/src/observability.rs:628-645 | core/consensus/src/observability.rs:667-684 | core/consensus/src/observability.rs:706-723 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (18 lines × 4) gateways/kafka/src/protocol/bounds_guard.rs:433— gateways/kafka/src/protocol/bounds_guard.rs:433-450 | gateways/kafka/src/protocol/bounds_guard.rs:494-511 | gateways/kafka/src/protocol/bounds_guard.rs:588-605 | gateways/kafka/src/protocol/bounds_guard.rs:1180-1197 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (18 lines × 3) core/connectors/sdk/src/decoders/proto.rs:95— core/connectors/sdk/src/decoders/proto.rs:95-112 | core/connectors/sdk/src/encoders/proto.rs:117-134 | core/connectors/sdk/src/transforms/proto_convert.rs:111-128 — `core/connectors/sdk/src/decoders/proto.rs` and `core/connectors/sdk/src/encoders/proto.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 116 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (16–18 lines × 2) core/simulator/src/lib.rs:558— core/simulator/src/lib.rs:558-573 | core/simulator/src/lib.rs:1617-1634 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–17 lines × 4) core/binary_protocol/src/requests/consumer_offsets/delete_consumer_offset.rs:73— core/binary_protocol/src/requests/consumer_offsets/delete_consumer_offset.rs:73-88 | core/binary_protocol/src/requests/consumer_offsets/get_consumer_offset.rs:66-81 | core/binary_protocol/src/requests/consumer_offsets/store_consumer_offset.rs:76-91 | core/binary_protocol/src/requests/messages/poll_messages.rs:131-147 — before extracting anything, compare `core/binary_protocol/src/requests/consumer_offsets/delete_consumer_offset.rs` and `core/binary_protocol/src/requests/consumer_offsets/get_consumer_offset.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15–17 lines × 2) core/message_bus/src/installer/replica.rs:522— core/message_bus/src/installer/replica.rs:522-538 | core/message_bus/src/installer/tcp.rs:148-162 — before extracting anything, compare `core/message_bus/src/installer/replica.rs` and `core/message_bus/src/installer/tcp.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 87 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11–16 lines × 3) core/common/src/types/args/mod.rs:438— core/common/src/types/args/mod.rs:438-448 | core/common/src/types/args/mod.rs:452-463 | core/common/src/types/args/mod.rs:473-488 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (14–16 lines × 3) core/sdk/src/http/consumer_groups.rs:42— core/sdk/src/http/consumer_groups.rs:42-56 | core/sdk/src/http/consumer_offsets.rs:87-102 | core/sdk/src/http/streams.rs:35-48 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (10–16 lines × 2) core/server/src/dispatch/session_ops.rs:585— core/server/src/dispatch/session_ops.rs:585-600 | core/server/src/dispatch/session_ops.rs:806-815 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12–15 lines × 2) core/integration/src/harness/disk.rs:102— core/integration/src/harness/disk.rs:102-113 | core/integration/src/harness/disk.rs:596-610 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13–14 lines × 5) gateways/kafka/src/protocol/bounds_guard.rs:638— gateways/kafka/src/protocol/bounds_guard.rs:638-651 | gateways/kafka/src/protocol/bounds_guard.rs:721-734 | gateways/kafka/src/protocol/bounds_guard.rs:758-771 | gateways/kafka/src/protocol/bounds_guard.rs:1283-1295 | gateways/kafka/src/protocol/bounds_guard.rs:1347-1359 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (14 lines × 4) core/connectors/sources/postgres_source/src/lib.rs:1839— core/connectors/sources/postgres_source/src/lib.rs:1839-1852 | core/connectors/sources/postgres_source/src/lib.rs:1870-1883 | core/connectors/sources/postgres_source/src/lib.rs:1887-1900 | core/connectors/sources/postgres_source/src/lib.rs:1904-1917 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (13–14 lines × 3) gateways/kafka/src/protocol/bounds_guard.rs:969— gateways/kafka/src/protocol/bounds_guard.rs:969-982 | gateways/kafka/src/protocol/bounds_guard.rs:1480-1492 | gateways/kafka/src/protocol/bounds_guard.rs:1532-1544 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (13 lines × 13) core/consensus/src/observability.rs:544— core/consensus/src/observability.rs:544-556 | core/consensus/src/observability.rs:583-595 | core/consensus/src/observability.rs:622-634 | core/consensus/src/observability.rs:661-673 | core/consensus/src/observability.rs:700-712 | core/consensus/src/observability.rs:804-816 | core/consensus/src/observability.rs:830-842 | core/consensus/src/observability.rs:855-867 | core/consensus/src/observability.rs:882-894 | core/consensus/src/observability.rs:913-925 | core/consensus/src/observability.rs:943-955 | core/consensus/src/observability.rs:974-986 | core/consensus/src/observability.rs:1001-1013 — all 13 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12 lines × 5) core/consensus/src/observability.rs:531— core/consensus/src/observability.rs:531-542 | core/consensus/src/observability.rs:570-581 | core/consensus/src/observability.rs:609-620 | core/consensus/src/observability.rs:648-659 | core/consensus/src/observability.rs:687-698 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10–12 lines × 2) core/partitions/src/state_transfer.rs:3184— core/partitions/src/state_transfer.rs:3184-3195 | core/partitions/src/state_transfer.rs:3237-3246 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7–10 lines × 3) gateways/kafka/src/protocol/handlers/alter_configs.rs:173— gateways/kafka/src/protocol/handlers/alter_configs.rs:173-179 | gateways/kafka/src/protocol/handlers/describe_configs.rs:149-158 | gateways/kafka/src/protocol/handlers/incremental_alter_configs.rs:191-200 — before extracting anything, compare `gateways/kafka/src/protocol/handlers/alter_configs.rs` and `gateways/kafka/src/protocol/handlers/incremental_alter_configs.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 84 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9–10 lines × 2) core/bench/report/src/types/server_stats.rs:136— core/bench/report/src/types/server_stats.rs:136-145 | core/common/src/types/stats/mod.rs:149-157 — before extracting anything, compare `core/bench/report/src/types/server_stats.rs` and `core/common/src/types/stats/mod.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (6–10 lines × 2) core/journal/src/partition_journal.rs:1744— core/journal/src/partition_journal.rs:1744-1749 | core/journal/src/partition_journal/segments.rs:844-853 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7–9 lines × 2) core/consensus/src/vsr_timeout.rs:285— core/consensus/src/vsr_timeout.rs:285-293 | core/consensus/src/vsr_timeout.rs:310-316 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5–9 lines × 3) core/server_common/src/send_messages.rs:146— core/server_common/src/send_messages.rs:146-150 | core/server_common/src/send_messages.rs:333-341 | core/server_common/src/send_messages.rs:396-404 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7–8 lines × 3) core/connectors/sdk/src/decoders/proto.rs:223— core/connectors/sdk/src/decoders/proto.rs:223-229 | core/connectors/sdk/src/encoders/proto.rs:263-270 | core/connectors/sdk/src/transforms/proto_convert.rs:260-267 — `core/connectors/sdk/src/decoders/proto.rs` and `core/connectors/sdk/src/encoders/proto.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 116 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (7 lines × 10) core/connectors/sources/postgres_source/src/lib.rs:1719— core/connectors/sources/postgres_source/src/lib.rs:1719-1725 | core/connectors/sources/postgres_source/src/lib.rs:1736-1742 | core/connectors/sources/postgres_source/src/lib.rs:1753-1759 | core/connectors/sources/postgres_source/src/lib.rs:1787-1793 | core/connectors/sources/postgres_source/src/lib.rs:1838-1844 | core/connectors/sources/postgres_source/src/lib.rs:1869-1875 | core/connectors/sources/postgres_source/src/lib.rs:1886-1892 | core/connectors/sources/postgres_source/src/lib.rs:1903-1909 | core/connectors/sources/postgres_source/src/lib.rs:1920-1926 | core/connectors/sources/postgres_source/src/lib.rs:1937-1943 — all 10 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 4) foreign/csharp/Iggy_SDK/Contracts/Tcp/TcpContracts.cs:561— foreign/csharp/Iggy_SDK/Contracts/Tcp/TcpContracts.cs:561-566 | foreign/csharp/Iggy_SDK/Contracts/Tcp/TcpContracts.cs:570-575 | foreign/csharp/Iggy_SDK/Contracts/Tcp/TcpContracts.cs:579-584 | foreign/csharp/Iggy_SDK/Contracts/Tcp/TcpContracts.cs:595-600 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (3–6 lines × 4) core/shard/src/lib.rs:5145— core/shard/src/lib.rs:5145-5150 | core/shard/src/lib.rs:5207-5209 | core/shard/src/lib.rs:5315-5317 | core/shard/src/lib.rs:5693-5698 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 9) core/binary_protocol/src/requests/consumer_groups/delete_consumer_group.rs:49— core/binary_protocol/src/requests/consumer_groups/delete_consumer_group.rs:49-53 | core/binary_protocol/src/requests/consumer_groups/get_consumer_group.rs:49-53 | core/binary_protocol/src/requests/consumer_groups/join_consumer_group.rs:49-53 | core/binary_protocol/src/requests/consumer_groups/leave_consumer_group.rs:49-53 | core/binary_protocol/src/requests/consumer_groups/sync_consumer_group.rs:52-56 | core/binary_protocol/src/requests/consumer_offsets/delete_consumer_offset.rs:75-79 | core/binary_protocol/src/requests/consumer_offsets/get_consumer_offset.rs:68-72 | core/binary_protocol/src/requests/consumer_offsets/store_consumer_offset.rs:78-82 | core/binary_protocol/src/requests/messages/poll_messages.rs:133-137 — before extracting anything, compare `core/binary_protocol/src/requests/consumer_offsets/delete_consumer_offset.rs` and `core/binary_protocol/src/requests/consumer_offsets/get_consumer_offset.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 6) core/binary_protocol/src/requests/consumer_groups/create_consumer_group.rs:48— core/binary_protocol/src/requests/consumer_groups/create_consumer_group.rs:48-52 | core/binary_protocol/src/requests/consumer_groups/delete_consumer_group.rs:47-51 | core/binary_protocol/src/requests/consumer_groups/get_consumer_group.rs:47-51 | core/binary_protocol/src/requests/consumer_groups/join_consumer_group.rs:47-51 | core/binary_protocol/src/requests/consumer_groups/leave_consumer_group.rs:47-51 | core/binary_protocol/src/requests/consumer_groups/sync_consumer_group.rs:50-54 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 6 call sites, so a change lands once.
Duplicated block (7 lines × 6) core/connectors/sdk/src/decoders/avro.rs:176— core/connectors/sdk/src/decoders/avro.rs:176-182 | core/connectors/sdk/src/decoders/flatbuffer.rs:119-125 | core/connectors/sdk/src/decoders/proto.rs:524-530 | core/connectors/sdk/src/encoders/avro.rs:124-130 | core/connectors/sdk/src/encoders/flatbuffer.rs:66-72 | core/connectors/sdk/src/transforms/proto_convert.rs:487-493 — `core/connectors/sdk/src/decoders/avro.rs` and `core/connectors/sdk/src/encoders/avro.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 59 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (43 lines × 3) foreign/java/java-sdk/src/main/java/org/apache/iggy/stream/StreamBase.java:1— foreign/java/java-sdk/src/main/java/org/apache/iggy/stream/StreamBase.java:1-63 | foreign/java/java-sdk/src/main/java/org/apache/iggy/topic/Topic.java:1-64 | foreign/java/java-sdk/src/main/java/org/apache/iggy/user/UserInfo.java:1-43 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `foreign/java/java-sdk/src/main/java/org/apache/iggy/stream/StreamBase.java:1` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 5) foreign/go/internal/command/offset.go:53— foreign/go/internal/command/offset.go:53-60 | foreign/go/internal/command/offset.go:99-106 | foreign/go/internal/command/offset.go:143-150 | foreign/go/internal/command/partition.go:37-44 | foreign/go/internal/command/partition.go:67-74 — there are 5 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Near-duplicate member pair (34 shared lines) core/bench/report/src/types/group_metrics.rs:42— core/bench/report/src/types/group_metrics.rs:42-123 | core/bench/report/src/types/individual_metrics.rs:43-121 — These two members are variants of one another: 34 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Duplicated block (73 lines × 3) core/bench/src/actors/consumer/benchmark_consumer.rs:339— core/bench/src/actors/consumer/benchmark_consumer.rs:339-411 | core/bench/src/actors/producer/benchmark_producer.rs:334-406 | core/bench/src/actors/producing_consumer/benchmark_producing_consumer.rs:421-493 — `core/bench/src/actors/consumer/benchmark_consumer.rs` and `core/bench/src/actors/producer/benchmark_producer.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 205 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (52 lines × 3) examples/csharp/src/GettingStarted/Iggy_SDK.Examples.GettingStarted.Consumer/Utils.cs:37— examples/csharp/src/GettingStarted/Iggy_SDK.Examples.GettingStarted.Consumer/Utils.cs:37-88 | examples/csharp/src/MessageEnvelope/Iggy_SDK.Examples.MessageEnvelope.Consumer/Utils.cs:39-90 | examples/csharp/src/MessageHeaders/Iggy_SDK.Examples.MessageHeaders.Consumer/Utils.cs:40-91 — before extracting anything, compare `examples/csharp/src/GettingStarted/Iggy_SDK.Examples.GettingStarted.Consumer/Utils.cs` and `examples/csharp/src/MessageEnvelope/Iggy_SDK.Examples.MessageEnvelope.Consumer/Utils.cs` as WHOLE FILES: 89% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (25 lines × 8) examples/csharp/src/GettingStarted/Iggy_SDK.Examples.GettingStarted.Consumer/Utils.cs:102— examples/csharp/src/GettingStarted/Iggy_SDK.Examples.GettingStarted.Consumer/Utils.cs:102-126 | examples/csharp/src/GettingStarted/Iggy_SDK.Examples.GettingStarted.Producer/Utils.cs:97-121 | examples/csharp/src/MessageEnvelope/Iggy_SDK.Examples.MessageEnvelope.Consumer/Utils.cs:130-154 | examples/csharp/src/MessageEnvelope/Iggy_SDK.Examples.MessageEnvelope.Producer/Utils.cs:105-129 | examples/csharp/src/MessageHeaders/Iggy_SDK.Examples.MessageHeaders.Consumer/Utils.cs:131-155 | examples/csharp/src/MessageHeaders/Iggy_SDK.Examples.MessageHeaders.Producer/Utils.cs:110-134 | examples/csharp/src/NewSdk/Iggy_SDK.Examples.NewSdk.Consumer/Utils.cs:72-96 | examples/csharp/src/NewSdk/Iggy_SDK.Examples.NewSdk.Producer/Utils.cs:85-109 — before extracting anything, compare `examples/csharp/src/GettingStarted/Iggy_SDK.Examples.GettingStarted.Consumer/Utils.cs` and `examples/csharp/src/MessageEnvelope/Iggy_SDK.Examples.MessageEnvelope.Consumer/Utils.cs` as WHOLE FILES: 89% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (21 lines × 3) core/bench/src/actors/consumer/benchmark_consumer.rs:242— core/bench/src/actors/consumer/benchmark_consumer.rs:242-262 | core/bench/src/actors/producer/benchmark_producer.rs:237-257 | core/bench/src/actors/producing_consumer/benchmark_producing_consumer.rs:321-341 — `core/bench/src/actors/consumer/benchmark_consumer.rs` and `core/bench/src/actors/producer/benchmark_producer.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 205 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (15–16 lines × 2) core/bench/dashboard/frontend/src/components/embed_modal.rs:86— core/bench/dashboard/frontend/src/components/embed_modal.rs:86-100 | core/bench/dashboard/frontend/src/components/tooltips/benchmark_info_tooltip.rs:42-57 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (25 lines × 3) core/bench/src/actors/consumer/benchmark_consumer.rs:217— core/bench/src/actors/consumer/benchmark_consumer.rs:217-241 | core/bench/src/actors/producer/benchmark_producer.rs:212-236 | core/bench/src/actors/producing_consumer/benchmark_producing_consumer.rs:296-320 — `core/bench/src/actors/consumer/benchmark_consumer.rs` and `core/bench/src/actors/producer/benchmark_producer.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 205 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (53 lines × 3) examples/java/src/main/java/org/apache/iggy/examples/gettingstarted/consumer/GettingStartedConsumer.java:63— examples/java/src/main/java/org/apache/iggy/examples/gettingstarted/consumer/GettingStartedConsumer.java:63-115 | examples/java/src/main/java/org/apache/iggy/examples/messageenvelope/consumer/MessageEnvelopeConsumer.java:72-124 | examples/java/src/main/java/org/apache/iggy/examples/tcptls/consumer/TcpTlsConsumer.java:84-136 — before extracting anything, compare `examples/java/src/main/java/org/apache/iggy/examples/gettingstarted/consumer/GettingStartedConsumer.java` and `examples/java/src/main/java/org/apache/iggy/examples/messageenvelope/consumer/MessageEnvelopeConsumer.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 86 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (34 lines × 2) examples/java/src/main/java/org/apache/iggy/examples/gettingstarted/producer/GettingStartedProducer.java:68— examples/java/src/main/java/org/apache/iggy/examples/gettingstarted/producer/GettingStartedProducer.java:68-101 | examples/java/src/main/java/org/apache/iggy/examples/tcptls/producer/TcpTlsProducer.java:89-122 — before extracting anything, compare `examples/java/src/main/java/org/apache/iggy/examples/gettingstarted/producer/GettingStartedProducer.java` and `examples/java/src/main/java/org/apache/iggy/examples/tcptls/producer/TcpTlsProducer.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (24 lines × 4) examples/java/src/main/java/org/apache/iggy/examples/gettingstarted/consumer/GettingStartedConsumer.java:70— examples/java/src/main/java/org/apache/iggy/examples/gettingstarted/consumer/GettingStartedConsumer.java:70-93 | examples/java/src/main/java/org/apache/iggy/examples/messageenvelope/consumer/MessageEnvelopeConsumer.java:79-102 | examples/java/src/main/java/org/apache/iggy/examples/messageheaders/consumer/MessageHeadersConsumer.java:81-104 | examples/java/src/main/java/org/apache/iggy/examples/tcptls/consumer/TcpTlsConsumer.java:91-114 — before extracting anything, compare `examples/java/src/main/java/org/apache/iggy/examples/gettingstarted/consumer/GettingStartedConsumer.java` and `examples/java/src/main/java/org/apache/iggy/examples/messageenvelope/consumer/MessageEnvelopeConsumer.java` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 86 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `examples/java/src/main/java/org/apache/iggy/examples/gettingstarted/consumer/GettingStartedConsumer.java:70` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `examples/java/src/main/java/org/apache/iggy/examples/gettingstarted/consumer/GettingStartedConsumer.java:94` calls `sleep` and `examples/java/src/main/java/org/apache/iggy/examples/messageheaders/consumer/MessageHeadersConsumer.java:105` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14–15 lines × 2) examples/java/src/main/java/org/apache/iggy/examples/async/AsyncConsumer.java:153— examples/java/src/main/java/org/apache/iggy/examples/async/AsyncConsumer.java:153-167 | examples/java/src/main/java/org/apache/iggy/examples/async/AsyncProducer.java:93-106 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `examples/java/src/main/java/org/apache/iggy/examples/async/AsyncConsumer.java:153` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (35 lines × 2) examples/python/getting-started/consumer.py:70— examples/python/getting-started/consumer.py:70-104 | examples/python/getting-started/producer.py:69-103 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (28 lines × 2) examples/go/getting-started/consumer/main.go:141— examples/go/getting-started/consumer/main.go:141-168 | examples/go/getting-started/producer/main.go:136-163 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
No DR/backup evidence — A persistence guard (data volume / purge-protection) was found, but no backup, geo-recovery or RTO/RPO controls were evidenced — a volume that survives a container recreate is not a tested restore from catastrophic loss.
Duplication concentrated across 10 sibling directories (18 clone groups) foreign/node/src/wire/client/get-clients.command.ts:23— 18 duplicated blocks under foreign/node/src/wire/ have copies in at least two of the sibling directories client, consumer-group, message, partition, session, stream (+4 more sibling(s) not listed) — 11 of them are reported below, and 7 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 18 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 18 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 18 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplicated block (65 lines × 2 locations) web/src/lib/components/Modals/AddPartitionsModal.svelte:49— web/src/lib/components/Modals/AddPartitionsModal.svelte:49 · web/src/lib/components/Modals/DeletePartitionsModal.svelte:65 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Duplicated block (45 lines × 3 locations) web/src/lib/components/Modals/AddTopicModal.svelte:72— web/src/lib/components/Modals/AddTopicModal.svelte:72 · web/src/lib/components/Modals/AddUserModal.svelte:67 · web/src/lib/components/Modals/StreamSettingsModal.svelte:73 — the 3 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (38 lines × 2 locations) web/src/lib/components/Modals/EditUserModal.svelte:50— web/src/lib/components/Modals/EditUserModal.svelte:50 · web/src/lib/components/Modals/StreamSettingsModal.svelte:58 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (37 lines × 2 locations) web/src/lib/components/Modals/AddStreamModal.svelte:74— web/src/lib/components/Modals/AddStreamModal.svelte:74 · web/src/lib/components/Modals/EditUserModal.svelte:65 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (35 lines × 3 locations) web/src/lib/components/Modals/AddTopicModal.svelte:72— web/src/lib/components/Modals/AddTopicModal.svelte:72 · web/src/lib/components/Modals/StreamSettingsModal.svelte:73 · web/src/lib/components/Modals/TopicSettingsModal.svelte:98 — the 3 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (29 lines × 2 locations) web/src/lib/components/RouteComponents/Settings/UsersTab.svelte:46— web/src/lib/components/RouteComponents/Settings/UsersTab.svelte:46 · web/src/routes/dashboard/settings/users/+page.svelte:49 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication· Duplicated block with local edits (27 matched lines × 2 locations) · ×1
Duplicated block with local edits (27 matched lines × 2 locations) web/src/lib/components/SlimSortableList.svelte:24— web/src/lib/components/SlimSortableList.svelte:24 · web/src/lib/components/SortableList.svelte:28 — the two spans are one implementation copied and then locally edited — 213 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (20 lines × 2 locations) foreign/node/src/debug-send.ts:94— foreign/node/src/debug-send.ts:94 · foreign/node/src/debug.ts:92 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (17 lines × 2 locations) foreign/node/src/wire/message/header.utils.ts:314— foreign/node/src/wire/message/header.utils.ts:314 · foreign/node/src/wire/message/header.utils.ts:333 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2 locations) foreign/node/src/wire/client/get-clients.command.ts:23— foreign/node/src/wire/client/get-clients.command.ts:23 · foreign/node/src/wire/stream/get-streams.command.ts:27 — the 2 copies are spread across 2 files, and the CITED SPAN is a run of MODULE-LEVEL DECLARATIONS — bindings the module declares and exports — rather than statements with a call site. Do not read this as an extract-a-helper row: a call expression cannot stand where a declaration was, and putting one there would delete the names themselves, which are what the rest of the codebase imports. What actually repeats here is the INITIALISER — the same expression shape written once per binding. So give that expression one name (a small helper the initialisers call, or a shared base value they are each derived from) and keep every binding under the name it already has. Where the run is an enumeration — one binding per distinct thing, differing precisely in the thing each one names — the repetition IS the enumeration and collapsing it would delete entries; consider instead whether the set belongs in one exported table the individual names are read out of. Reported because the copies drift apart the first time only one of them is edited.
R10 · Code Duplication· Duplicated block with local edits (15 matched lines × 2 locations) · ×1
Duplicated block with local edits (15 matched lines × 2 locations) foreign/node/src/duration.utils.ts:175— foreign/node/src/duration.utils.ts:175 · foreign/node/src/duration.utils.ts:258 — the two spans are one implementation copied and then locally edited — 81 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (13 lines × 2 locations) foreign/node/src/debug-send.ts:52— foreign/node/src/debug-send.ts:52 · foreign/node/src/debug.ts:49 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (11 lines × 3 locations) foreign/node/src/wire/stream/get-stream.command.ts:21— foreign/node/src/wire/stream/get-stream.command.ts:21 · foreign/node/src/wire/topic/get-topics.command.ts:21 · foreign/node/src/wire/user/get-user.command.ts:21 — the 3 copies are spread across 3 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (10 lines × 5 locations) foreign/node/src/wire/number.utils.ts:26— foreign/node/src/wire/number.utils.ts:26 · foreign/node/src/wire/number.utils.ts:50 · foreign/node/src/wire/number.utils.ts:74 · foreign/node/src/wire/number.utils.ts:98 · +1 more site(s) not listed — all 5 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Complex function drive (cyclomatic 151, cognitive 254) foreign/node/src/client/client.socket.ts:282— drive has cyclomatic complexity 151 and cognitive complexity 254; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 36, cognitive 60) foreign/node/src/client/client.socket.test.ts:2844— (anonymous) has cyclomatic complexity 36 and cognitive complexity 60; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 27, cognitive 25) foreign/node/src/client/client.config.ts:38— (anonymous) has cyclomatic complexity 27 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 26, cognitive 26) foreign/node/src/wire/system/get-metadata-changes.command.ts:212— (anonymous) has cyclomatic complexity 26 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 25, cognitive 30) foreign/node/src/wire/system/update-resource.command.ts:123— (anonymous) has cyclomatic complexity 25 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 25, cognitive 24) REDACTED:59— (anonymous) has cyclomatic complexity 25 and cognitive complexity 24; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function routeFor (cyclomatic 24, cognitive 41) foreign/node/src/client/client.socket.ts:613— routeFor has cyclomatic complexity 24 and cognitive complexity 41; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity· Complex function enter (cyclomatic 23, cognitive 36) · ×1
Complex function enter (cyclomatic 23, cognitive 36) foreign/node/src/client/client.operation.ts:228— enter has cyclomatic complexity 23 and cognitive complexity 36; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 23, cognitive 32) foreign/node/src/wire/message/poll-messages.command.ts:155— (anonymous) has cyclomatic complexity 23 and cognitive complexity 32; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function runReplica (cyclomatic 21, cognitive 41) foreign/node/src/client/client.socket.ts:864— runReplica has cyclomatic complexity 21 and cognitive complexity 41; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function serialize (cyclomatic 20, cognitive 24) foreign/node/src/wire/topic/create-topic.command.ts:95— serialize has cyclomatic complexity 20 and cognitive complexity 24; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 19, cognitive 21) REDACTED:158— (anonymous) has cyclomatic complexity 19 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function readyLink (cyclomatic 18, cognitive 26) foreign/node/src/client/client.socket.ts:785— readyLink has cyclomatic complexity 18 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function sendCommand (cyclomatic 18, cognitive 16) foreign/node/src/client/client.socket.ts:200— sendCommand has cyclomatic complexity 18 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 17, cognitive 23) foreign/node/src/client/client.socket.test.ts:4320— (anonymous) has cyclomatic complexity 17 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function exchange (cyclomatic 17, cognitive 18) foreign/node/src/client/client.socket.ts:561— exchange has cyclomatic complexity 17 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R3 · Large Files· foreign/node/src/client/client.socket.ts · ×1
foreign/node/src/client/client.socket.ts: 1361 lines of code foreign/node/src/client/client.socket.ts:1— foreign/node/src/client/client.socket.ts has 1361 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· foreign/node/src/wire/system/metadata-changes.utils.ts · ×1
foreign/node/src/wire/system/metadata-changes.utils.ts: 1041 lines of code foreign/node/src/wire/system/metadata-changes.utils.ts:1— foreign/node/src/wire/system/metadata-changes.utils.ts has 1041 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web/src/routes/dashboard/changes/+page.svelte · ×1
web/src/routes/dashboard/changes/+page.svelte: 537 lines of code web/src/routes/dashboard/changes/+page.svelte:1— web/src/routes/dashboard/changes/+page.svelte has 537 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· foreign/node/src/wire/message/header.utils.ts · ×1
foreign/node/src/wire/message/header.utils.ts: 514 lines of code foreign/node/src/wire/message/header.utils.ts:1— foreign/node/src/wire/message/header.utils.ts has 514 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· web/src/lib/components/PermissionsManager.svelte · ×1
web/src/lib/components/PermissionsManager.svelte: 428 lines of code web/src/lib/components/PermissionsManager.svelte:1— web/src/lib/components/PermissionsManager.svelte has 428 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· foreign/node/src/client/client.operation.ts · ×1
foreign/node/src/client/client.operation.ts: 404 lines of code foreign/node/src/client/client.operation.ts:1— foreign/node/src/client/client.operation.ts has 404 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
Dead file (~145 LoC) web/src/lib/utils/addOnKeyDownListener.ts— no import path from any entry point (40 application, 10 tooling, 82 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~126 LoC) foreign/node/src/debug-send.ts— no import path from any entry point (40 application, 10 tooling, 82 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~121 LoC) foreign/node/src/debug.ts— no import path from any entry point (40 application, 10 tooling, 82 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~85 LoC) web/src/lib/components/RouteComponents/Settings/UsersTab.svelte— no import path from any entry point (40 application, 10 tooling, 82 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/src/lib/components/RouteComponents/Settings/UsersTabActions.svelte) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
Dead file (~80 LoC) web/src/lib/api/handleFetchErrors.ts— no import path from any entry point (40 application, 10 tooling, 82 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~54 LoC) web/src/lib/api/fetchApi.ts— no import path from any entry point (40 application, 10 tooling, 82 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~49 LoC) web/src/lib/components/DeleteButtonWithConfirmation.svelte— no import path from any entry point (40 application, 10 tooling, 82 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~46 LoC) web/src/lib/utils/queryParsers.ts— no import path from any entry point (40 application, 10 tooling, 82 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~43 LoC) web/src/lib/components/FixedSvelteComponent.svelte— no import path from any entry point (40 application, 10 tooling, 82 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~32 LoC) web/src/lib/hooks/useGoPrev.ts— no import path from any entry point (40 application, 10 tooling, 82 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~24 LoC) web/src/lib/utils/dataHas.ts— no import path from any entry point (40 application, 10 tooling, 82 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~23 LoC) web/src/lib/components/RouteComponents/Settings/UsersTabActions.svelte— no import path from any entry point (40 application, 10 tooling, 82 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~20 LoC) web/src/lib/queries.ts— no import path from any entry point (40 application, 10 tooling, 82 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~19 LoC) foreign/node/src/wire/cluster/index.ts— no import path from any entry point (40 application, 10 tooling, 82 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Unused dependency 'ccusage' — Declared in the root package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency '@swc-node/register' — Declared in foreign/node/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency 'd3-interpolate' — Declared in web/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Duplicated predicate foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.cs:1102— `!_configuration.ReconnectionSettings.Enabled || _configuration.ReconnectionSettings.MaxRetries > 0 && attempts >= _configuration.Reconnectio…` appears character-identically in 2 files — foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.ReplicaLinks.cs, foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:609— `!_joinedConsumerGroup || !IsGroupMembershipCurrent()` appears character-identically in 2 files — foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.Rented.cs, foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:355— `!ct.IsCancellationRequested && !IsDisposed` appears character-identically in 3 files — foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.Rented.cs, foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs, foreign/csharp/Iggy_SDK/Consumers/IggyConsumerOfT.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.cs:1047— `!token.IsCancellationRequested && !_disposed` appears character-identically in 2 files — foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.ReplicaLinks.cs, foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate foreign/csharp/Iggy_SDK/Contracts/TopicOptions.cs:118— `MessageExpiry is { } messageExpiry && DurationHelpers.ToDuration(messageExpiry) is not 0 and var micros` appears character-identically in 2 files — foreign/csharp/Iggy_SDK/Contracts/TopicOptions.cs, foreign/csharp/Iggy_SDK/Contracts/TopicUpdate.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate examples/csharp/src/GettingStarted/Iggy_SDK.Examples.GettingStarted.Consumer/Utils.cs:106— `argumentName is null && tcpServerAddr is null` appears character-identically in 8 files — examples/csharp/src/GettingStarted/Iggy_SDK.Examples.GettingStarted.Consumer/Utils.cs, examples/csharp/src/GettingStarted/Iggy_SDK.Examples.GettingStarted.Producer/Utils.cs, examples/csharp/src/MessageEnvelope/Iggy_SDK.Examples.MessageEnvelope.Consumer/Utils.cs, examples/csharp/src/MessageEnvelope/Iggy_SDK.Examples.MessageEnvelope.Producer/Utils.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:766— `cancellation.IsCancellationRequested && !ct.IsCancellationRequested` appears character-identically in 2 files — foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs, foreign/csharp/Iggy_SDK/Publishers/BackgroundMessageProcessor.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate foreign/csharp/Iggy_SDK/IggyClient/IIggyConsumer.cs:151— `consumer.Type == ConsumerType.ConsumerGroup && partitionId is null` appears character-identically in 2 files — foreign/csharp/Iggy_SDK/IggyClient/IIggyConsumer.cs, foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs:656— `hasLastOffset && message.Header.Offset <= lastPolledPartitionOffset` appears character-identically in 2 files — foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.Rented.cs, foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate foreign/java/java-sdk/src/main/java/org/apache/iggy/client/blocking/http/HttpOptionValue.java:125— `!"true".equals(value) && !"false".equals(value)` appears character-identically in 2 files — foreign/java/java-sdk/src/main/java/org/apache/iggy/client/blocking/http/HttpOptionValue.java, foreign/java/java-sdk/src/main/java/org/apache/iggy/config/TcpConnectionString.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/AsyncIggyTcpClient.java:1252— `error instanceof CompletionException && error.getCause() != null` appears character-identically in 5 files — foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/AsyncIggyTcpClient.java, foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/AsyncTcpConnection.java, foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/MessagesTcpClient.java, foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/PollRouter.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate foreign/java/external-processors/iggy-connector-flink/iggy-connector-library/src/main/java/org/apache/iggy/connector/flink/sink/IggySinkBuilder.java:132— `flushInterval == null || flushInterval.isNegative()` appears character-identically in 2 files — foreign/java/external-processors/iggy-connector-flink/iggy-connector-library/src/main/java/org/apache/iggy/connector/flink/sink/IggySinkBuilder.java, foreign/java/external-processors/iggy-connector-flink/iggy-connector-library/src/main/java/org/apache/iggy/connector/flink/sink/IggySinkWriter.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/AsyncIggyTcpClient.java:400— `username.isEmpty() || password.isEmpty()` appears character-identically in 2 files — foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/AsyncIggyTcpClient.java, foreign/java/java-sdk/src/main/java/org/apache/iggy/client/blocking/http/IggyHttpClient.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate foreign/node/src/bdd/metadata-changes.ts:173— `Buffer.isBuffer(value) && this.streamKey?.equals(value)` appears character-identically in 2 files — foreign/node/src/bdd/metadata-changes.ts, foreign/node/src/bdd/resource-options.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate foreign/node/src/wire/session/login.utils.ts:60— `bPassword.length < 1 || bPassword.length > 255` appears character-identically in 2 files — foreign/node/src/wire/session/login.utils.ts, foreign/node/src/wire/user/create-user.command.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate foreign/node/src/wire/session/login.utils.ts:58— `bUsername.length < 1 || bUsername.length > 255` appears character-identically in 2 files — foreign/node/src/wire/session/login.utils.ts, foreign/node/src/wire/user/create-user.command.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate foreign/node/src/client/client.socket.ts:454— `error instanceof ResponseError && error.fromServer` appears character-identically in 2 files — foreign/node/src/client/client.socket.ts, foreign/node/src/wire/vsr/reply.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate core/metadata/src/impls/metadata.rs:3202— `!consensus.is_primary() || !consensus.is_normal() || consensus.is_transferring()` appears character-identically in 3 files — core/metadata/src/impls/metadata.rs, core/server/src/partition_reconciler.rs, core/shard/src/poll.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate core/message_bus/src/installer/replica.rs:561— `aborted_dispatch_guard.get() || bus_token_dispatch_guard.is_triggered()` appears character-identically in 2 files — core/message_bus/src/installer/replica.rs, core/message_bus/src/installer/tcp.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate core/message_bus/src/installer/replica.rs:507— `aborted_transport.get() || bus_for_transport.is_shutting_down()` appears character-identically in 2 files — core/message_bus/src/installer/replica.rs, core/message_bus/src/installer/tcp.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate core/server/src/http/forward.rs:1427— `code == IggyError::TransientNotAccepted.as_code() || code == IggyError::NotPrimary.as_code()` appears character-identically in 2 files — core/server/src/http/forward.rs, core/simulator/src/workload/mod.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate core/metadata/src/impls/metadata.rs:2909— `consensus.is_primary() && consensus.is_normal() && !consensus.is_transferring()` appears character-identically in 2 files — core/metadata/src/impls/metadata.rs, core/server/src/dispatch/submit.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate core/common/src/traits/binary_impls/messages.rs:490— `consumer.kind == ConsumerKind::ConsumerGroup && partition_id.is_none()` appears character-identically in 2 files — core/common/src/traits/binary_impls/messages.rs, core/common/src/traits/message_client.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate gateways/kafka/src/protocol/handlers/alter_configs.rs:183— `deadline_exceeded || Instant::now() >= deadline` appears character-identically in 7 files — gateways/kafka/src/protocol/handlers/alter_configs.rs, gateways/kafka/src/protocol/handlers/create_partitions.rs, gateways/kafka/src/protocol/handlers/create_topics.rs, gateways/kafka/src/protocol/handlers/delete_topics.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate core/partitions/src/iggy_partition.rs:12531— `evidence == RepairEvidence::Contradicted || (evidence == RepairEvidence::Unproven && !consensus.view_log_proof_covers(header.op))` appears character-identically in 2 files — core/partitions/src/iggy_partition.rs, core/shard/src/lib.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Silent fallback default on Err core/bench/dashboard/frontend/src/components/selectors/dense_benchmark_row.rs:151— `relative_time` turns every `Err` into `"-".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err core/common/src/types/message/user_headers.rs:542— `to_string_value` turns every `Err` into `"<malformed int8>".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err core/connectors/runtime/src/configs/runtime.rs:451— `state_url_label` turns every `Err` into `"<invalid URL>".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err core/connectors/sinks/meilisearch_sink/src/lib.rs:942— `sanitize_url_for_log` turns every `Err` into `"<invalid-url>".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err core/integration/src/harness/handle/server.rs:337— `stdout_plain` turns every `Err` into `String::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err core/metadata/src/stm/stream.rs:2587— `encode_create_topic_reply` turns every `Err` into `Bytes::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err core/simulator/src/workload/oracle.rs:937— `assert_retired_owners_removed` turns every `Err` into `0` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default in catch foreign/csharp/Iggy_SDK/Contracts/MetadataCurrentPageToken.cs:181— `IsUtf8` swallows `DecoderFallbackException` into `return false;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
Silent fallback default in catch foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.PollRouting.cs:67— `RetainsOperation` swallows `VsrOperationNotRetainedException` into `return false;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 7 significant file(s) lose their only recent owner: foreign/csharp/Iggy_SDK/Publishers/IggyPublisherOfT.cs, foreign/csharp/Iggy_SDK/Kinds/Partitioning.cs, foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.Logging.cs, foreign/csharp/Iggy_SDK/Consumers/IggyConsumerBuilderOfT.cs, foreign/csharp/Iggy_SDK/Publishers/IggyPublisherBuilderOfT.cs, foreign/csharp/Iggy_SDK/Identifier.cs, foreign/csharp/Iggy_SDK/Configuration/AutoLoginSettings.cs. Pair on, review, or document these before any departure.
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 1 of 19 project(s) overshoot their size bounds, lowering Project Cohesion to 8.9/10. The most over is `Iggy_SDK(net8.0)` (27775 LoC, 180 public types across 20 namespaces). Review these for cohesion — draw the boundary inside the assembly first (group each responsibility into its own namespace/folder and keep the cross-boundary members internal), since splitting a published assembly moves types between packages and breaks consumers.
D28 · Secrets (history)· Rotate the exposed credentials · ×1
D40 · Network Egress Confinement· No network policy · ×1
No network policy — No Kubernetes NetworkPolicy (or Cilium policy) found. Without one, every pod can talk to every other pod and reach out to the internet by default. Add a default-deny policy and open only the flows you need.
P12 · CI test-gate honesty· Sleep-based test synchronization · ×1
Sleep-based test synchronization — 33 Task.Delay/Thread.Sleep call(s) in test code synchronize with background work by sleeping — a known flakiness precursor on slow runners. Prefer polling with a deadline or completion signals.
No changelog — No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
PF1 · Benchmark discipline· No performance benchmarks · ×1
No performance benchmarks — No benchmark suite was found by the two searches this check runs. FIRST, a BenchmarkDotNet package reference in any project file — every project the workspace loaded, plus a walk of project files on disk that never loaded, because a benchmark suite is exactly the project a partial load drops. SECOND, a script harness: a file whose name contains `benchmark` and ends `.py`, `.sh`, `.ps1`, `.bash`, `.rb`, `.js` or `.mjs`, credited ONLY when this repository's CI text also mentions benchmarks — a harness no pipeline runs is read as a fixture, deliberately. Neither search can see a benchmark suite in another ecosystem's idiom (a Go `testing.B` file, a JMH or criterion project, a pytest-benchmark run), so this is 'no benchmark found by those two searches', not a verdict that the repository has none. Where code is performance-sensitive, a benchmark guards against silent regressions — but it's a bonus here, not a deduction.
Unused export 'getClient' foreign/node/src/client/client.ts:72— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'formatPolledMessages' · ×1
Unused export 'formatPolledMessages' foreign/node/src/tcp.sm.utils.ts:80— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'mapTransportProtocol' · ×1
Unused export 'mapTransportProtocol' foreign/node/src/wire/cluster/cluster.type.ts:84— Nothing ultimately consumes this binding: its only referrer is the re-export in foreign/node/src/wire/cluster/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in foreign/node/src/wire/cluster/index.ts in the same commit, or the barrel will import a name that no longer exists.
Unused export 'syncGroup' foreign/node/src/wire/consumer-group/sync-group.command.ts:65— Nothing ultimately consumes this binding: its only referrer is the re-export in foreign/node/src/wire/consumer-group/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in foreign/node/src/wire/consumer-group/index.ts in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code· Unused export 'deserialiseMessageId' · ×1
Unused export 'deserialiseMessageId' foreign/node/src/wire/message/iggy-header.utils.ts:198— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'PartitionKindId' · ×1
Unused export 'PartitionKindId' foreign/node/src/wire/message/partitioning.utils.ts:37— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'PartitionKindValue' · ×1
Unused export 'PartitionKindValue' foreign/node/src/wire/message/partitioning.utils.ts:39— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'PollingStrategyKindId' · ×1
Unused export 'PollingStrategyKindId' foreign/node/src/wire/message/poll.utils.ts:52— Nothing ultimately consumes this binding: its only referrer is the re-export in foreign/node/src/wire/message/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in foreign/node/src/wire/message/index.ts in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code· Unused export 'PollingStrategyKindValue' · ×1
Unused export 'PollingStrategyKindValue' foreign/node/src/wire/message/poll.utils.ts:54— Nothing ultimately consumes this binding: its only referrer is the re-export in foreign/node/src/wire/message/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in foreign/node/src/wire/message/index.ts in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code· Unused export 'mapMessageState' · ×1
Unused export 'mapMessageState' foreign/node/src/wire/message/poll.utils.ts:210— Nothing ultimately consumes this binding: its only referrer is the re-export in foreign/node/src/wire/message/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in foreign/node/src/wire/message/index.ts in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code· Unused export 'deserializePollMessagesTransform' · ×1
Unused export 'deserializePollMessagesTransform' foreign/node/src/wire/message/poll.utils.ts:375— Nothing ultimately consumes this binding: its only referrer is the re-export in foreign/node/src/wire/message/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in foreign/node/src/wire/message/index.ts in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code· Unused export 'ConsumerKindId' · ×1
Unused export 'ConsumerKindId' foreign/node/src/wire/offset/offset.utils.ts:38— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'serializeUUID' · ×1
Unused export 'serializeUUID' foreign/node/src/wire/serialize.utils.ts:33— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'deserializeUUID' · ×1
Unused export 'deserializeUUID' foreign/node/src/wire/serialize.utils.ts:42— Nothing imports this binding — it is safe to review for removal.
Unused export 'Snapshot' foreign/node/src/wire/system/snapshot.command.ts:55— Nothing ultimately consumes this binding: its only referrer is the re-export in foreign/node/src/wire/system/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in foreign/node/src/wire/system/index.ts in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code· Unused export 'CompressionAlgorithmKindId' · ×1
Unused export 'CompressionAlgorithmKindId' foreign/node/src/wire/topic/topic.utils.ts:102— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'CompressionAlgorithmKindValue' · ×1
Unused export 'CompressionAlgorithmKindValue' foreign/node/src/wire/topic/topic.utils.ts:104— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'clientApiSafe' · ×1
Unused export 'clientApiSafe' web/src/lib/api/clientApi.ts:89— Nothing imports this binding — it is safe to review for removal.
Unused export 'UserDetails' web/src/lib/domain/UserDetails.ts:21— Nothing imports this binding — it is safe to review for removal.
X2 · Cancellation propagation· Not all async methods take a CancellationToken · ×1
Not all async methods take a CancellationToken — Only 168/193 async methods accept a CancellationToken, so in-flight work can't be stopped early when the caller gives up — whatever ends it in your host (shutdown signal, timeout, abandoned request, user cancel). Thread a token through the call chain and honour it at each await and loop; where a method genuinely cannot be interrupted, omitting it is a deliberate choice — judge against your hosting model.
Null-forgiving operator (`!`) suppressions reduce the NRT score — ~0.4 `!` suppressions per 1k syntax nodes — 40 suppression(s) across the 108142 syntax node(s) in code where nullable warnings are ENABLED, which is the only code a `!` can suppress anything in (a `!` under `#nullable disable` is inert and is not counted, and its file's nodes are not in the denominator). Each one tells the compiler to trust you about null, suppressing the very safety NRTs provide.
Silent fallback default on error foreign/go/client/tcp/tcp_user_management.go:209— `encodedUser` turns a non-nil `err` into `return ""` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the `if` or in the doc comment, and the row stops firing.
doc comments repeat the names foreign/csharp/Iggy_SDK/Configuration/IggyClientConfigurator.cs:92— 7 of 439 documented parameters and 99 of 1388 summaries in `Iggy_SDK(net8.0)` only repeat the member or parameter name (e.g. "TLS settings" for `TlsSettings`). 2 documentation tag(s) are empty. This build requires documentation, so say what the name does not: units, ranges, null handling, side effects.
Off the main sequence: iggy_common — iggy_common: abstractness 0.11, instability 0.03, distance 0.86 — the shape a shared-kernel / building-block library has BY DESIGN — concrete and widely depended-on is what makes it useful, and this dimension does not penalise it (the distance is reported for completeness, not as a defect). Worth a look only if it has grown past one coherent kernel into an everything-bucket.
Appendix B — Reproduction & audit trail
Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 22 file(s) — `foreign/csharp/Iggy_SDK/Exceptions/VsrLaneBlockedException.cs`, `foreign/csharp/Iggy_SDK/Exceptions/VsrOperationNotRetainedException.cs`, `foreign/csharp/Iggy_SDK/Exceptions/VsrRequestOutcomeUnknownException.cs`, `foreign/csharp/Iggy_SDK/Exceptions/VsrSessionEvictedException.cs`, `foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.ReplicaLinks.cs`, … (+17 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
runtime-hardening: not applicable — The repository ships application workloads but no cluster-governance resources (CRDs, admission webhooks, or a committed policy engine). Runtime threat-detection (Falco/Tetragon) and admission control (Kyverno/OPA-Gatekeeper/PodSecurity) are cluster-OPERATOR controls owned by the platform, not shipped by an application repo/chart — nothing for this repo to assess.
Run 01a18174-0b25-7a5b-a365-5731f134baeb · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 321 · Warnings: 1932 · Recommendations: 86 · Info: 60 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 28-10-2026 @ 07:40 UTC.
Downloadable artifacts
Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.