Public report of risingwavelabs/risingwave, published 27 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 report Measured 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, 27 October 2026, 06:22 UTC · Survey ID cd_efb6269b4ae94323baac07a924b8b63c

risingwavelabs/risingwave

Measured 27 October 2026, 06:17 UTC, at code version f0fada2

No regression since the last survey Code coverage: not measured

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.

Code coverage is not measured: .NET and JavaScript/TypeScript suite (CouldNotMeasureEnvironment, CouldNotMeasureTestRunFailed).

CAI score 56out of 100 At risk Down 1 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: 791,969 lines of product code in 81 projects, tests not counted · Estimated rebuild effort: about 6.9 person-years · Weakest lens: Security and Compliance, 50

Findings by how serious they are

335 critical 3002 serious 787 minor

31 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
27 October 2026, 06:17 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.

A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.

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 ▸

74of 74 dimensions measured by tools.
4065of 4124 findings point to an exact file and line, so you can open each one in the code. The other 59 concern the repository as a whole, such as missing documentation.
74dimensions across 9 lenses, read from 791,969 lines of product code in 81 projects.
Chapters

Executive summary

risingwavelabs/risingwave is rated At risk because critical security findings are open. Its score is held back because two of the dependencies have a known vulnerability and it has pipeline tools referenced by a changeable name. It scores 56 out of 100, which the At risk rating leaves unchanged.

Security and Compliance, at 50, is the weakest lens and counts most in the score. The best first step is restoring certificate checks, worth about 5 points. Fixing the 59 unsafe settings in infrastructure or container files comes next, worth about 3 points. Raising Security and Compliance to 70 would lift the score to about 62.

Sixty-seven pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Fifty-nine settings leave the servers or containers unsafe, and seventy-seven sets of files in separate parts keep changing together, which points to hidden dependencies. Pinning each tool to an exact version, correcting the unsafe settings and making the hidden dependencies explicit would close these risks. Limiting each secret to its own step would fix the 19 secrets exposed to more of the pipeline than needed, and the 21 passwords or keys in the code and the password or key in the code's history need replacing, with the old ones switched off. The 43 parts of the code nobody has worked on for a long time need someone to learn and document them before anyone changes them.

The product code is 791,969 lines, about €1,000,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 for The 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.
Security and Compliance 50 · counts for 45%Production Readiness 59 · counts for 25%Accessibility 59 · counts for 14%Architecture 63 · counts for 8%Domain Modelling 68 · counts for 4%Maturity 69 · counts for 2%Code Health 80 · counts for 1%Performance 86 · counts for 1%Event Sourcing 100 · counts for 0%

If Security and Compliance rose from 50 to 70, the lowest score rated Strong, the score would rise from 56 to about 62.

Code composition: what the lines of code are
Product code 92%Tests 8%
New since the last survey: 165 findings

These 165 critical or serious findings weren't in the previous survey, on 13 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: 70 findings

These 70 critical or serious findings were in the previous survey, on 13 October 2026, and are gone from this one.

  • Cognitive Complexity · TableWatermarksIndex::rewrite_range_with_table_watermark (cognitive 33) src/storage/hummock_sdk/src/table_watermark.rs
  • Cognitive Complexity · LogicalAgg::to_stream (cognitive 24) src/frontend/src/optimizer/plan_node/logical_agg.rs
  • Cognitive Complexity · StateTableRowStore::seal_current_epoch (cognitive 22) src/stream/src/common/table/state_table.rs
  • Cognitive Complexity · Binder::correlation_scopes (cognitive 16) src/frontend/src/binder/expr/column.rs
  • God Classes · FileTooLong: relation/mod.rs src/frontend/src/binder/relation/mod.rs
  • God Classes · ClassTooLong: PartialGraphState src/stream/src/task/barrier_worker/managed_state.rs
  • Code Duplication · Near-duplicate member pair (26 shared lines) src/meta/src/controller/streaming_job.rs
  • Code Duplication · Edited copy of a member (29 corresponding lines) src/batch/executors/src/executor/join/hash_join.rs
  • Code Duplication · Edited copy of a member (13 corresponding lines) src/connector/src/connector_common/iceberg/mod.rs
  • Code Duplication · Members sharing a duplicated core (13 members, 50+ identical tokens) REDACTED
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) src/frontend/src/optimizer/plan_node/generic/file_scan.rs
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) src/meta/src/controller/catalog/mod.rs
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) src/meta/src/hummock/mod.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) java/connector-node/risingwave-sink-jdbc/src/main/java/com/risingwave/connector/jdbc/MySqlDialect.java
  • Code Duplication · Duplicated block (25–26 lines × 2) src/batch/executors/src/executor/join/hash_join.rs
  • Code Duplication · Duplicated block (19–21 lines × 2) src/stream/src/executor/backfill/cdc/cdc_backfill.rs
  • Code Duplication · Duplicated block (18 lines × 2) src/frontend/src/handler/create_function.rs
  • Code Duplication · Duplicated block (17 lines × 2) src/batch/executors/src/executor/join/hash_join.rs
  • Code Duplication · Duplicated block (14–16 lines × 2) src/stream/src/executor/backfill/cdc/cdc_backfill.rs
  • Code Duplication · Duplicated block (15–16 lines × 2) src/stream/src/task/barrier_worker/managed_state.rs
  • Code Duplication · Duplicated block (14 lines × 2) src/batch/executors/src/executor/join/hash_join.rs
  • Code Duplication · Duplicated block (14 lines × 2) src/meta/src/manager/diagnose.rs
  • Code Duplication · Duplicated block (13 lines × 2) src/stream/src/from_proto/mview.rs
  • Code Duplication · Duplicated block (12 lines × 3) src/frontend/src/optimizer/rule/table_function_to_file_scan_rule.rs
  • Code Duplication · Duplicated block (11 lines × 2) src/frontend/src/expr/mod.rs
  • Code Duplication · Duplicated block (11 lines × 2) src/meta/node/src/server.rs
  • Code Duplication · Duplicated block (11 lines × 2) src/stream/src/executor/asof_join.rs
  • Code Duplication · Duplicated block (10–11 lines × 2) src/stream/src/executor/backfill/cdc/cdc_backfill.rs
  • Code Duplication · Duplicated block (11 lines × 2) src/stream/src/executor/backfill/cdc/cdc_backfill.rs
  • Code Duplication · Duplicated block (10 lines × 4) src/batch/executors/src/executor/join/hash_join.rs
  • Code Duplication · Duplicated block (9–10 lines × 3) src/batch/executors/src/executor/join/hash_join.rs
  • Code Duplication · Duplicated block (9 lines × 2) src/risedevtool/src/bin/risedev-dev.rs
  • Code Duplication · Duplicated block (5–7 lines × 2) src/connector/src/source/cdc/external/mysql.rs
  • Code Duplication · Duplicated block (7 lines × 2) src/meta/src/controller/streaming_job.rs
  • Code Duplication · Duplicated block (7 lines × 2) src/frontend/src/optimizer/plan_node/batch_mysql_query.rs
  • Code Duplication · Duplicated block (9 lines × 3) java/connector-node/risingwave-connector-service/src/main/java/com/risingwave/connector/source/common/MySqlValidator.java
  • Code Duplication · Edited copy of a member (32 corresponding lines) REDACTED
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) e2e_test/s3/file_sink.py
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) e2e_test/webhook/websocket_sender.py
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) integration_tests/iceberg-cdc/python/script/init.py
  • Churn × Complexity Hotspots · Hotspot: src/connector/src/parser/unified/json.rs src/connector/src/parser/unified/json.rs
  • Churn × Complexity Hotspots · Hotspot: src/frontend/src/binder/expr/function/builtin_scalar.rs src/frontend/src/binder/expr/function/builtin_scalar.rs
  • Churn × Complexity Hotspots · Hotspot: src/frontend/src/optimizer/plan_node/stream_sink.rs src/frontend/src/optimizer/plan_node/stream_sink.rs
  • Churn × Complexity Hotspots · Hotspot: src/risedevtool/config/src/main.rs src/risedevtool/config/src/main.rs
  • Churn × Complexity Hotspots · Hotspot: src/connector/src/parser/mysql.rs src/connector/src/parser/mysql.rs
  • Churn × Complexity Hotspots · Hotspot: src/storage/src/hummock/sstable/builder.rs src/storage/src/hummock/sstable/builder.rs
  • Churn × Complexity Hotspots · Hotspot: src/storage/src/hummock/compactor/fast_compactor_runner.rs src/storage/src/hummock/compactor/fast_compactor_runner.rs
  • Churn × Complexity Hotspots · Hotspot: src/meta/src/serving/mod.rs src/meta/src/serving/mod.rs
  • Churn × Complexity Hotspots · Hotspot: src/common/src/util/value_encoding/mod.rs src/common/src/util/value_encoding/mod.rs
  • Churn × Complexity Hotspots · Hotspot: src/connector/src/sink/http.rs src/connector/src/sink/http.rs
  • Churn × Complexity Hotspots · Repeated repair: src/meta/node/src/lib.rs src/meta/node/src/lib.rs
  • Churn × Complexity Hotspots · Repeated repair: src/common/src/config/streaming.rs src/common/src/config/streaming.rs
  • Churn × Complexity Hotspots · Repeated repair: src/meta/src/barrier/manager.rs src/meta/src/barrier/manager.rs
  • Dependency Vulnerabilities · High CVE: REDACTED REDACTED
  • Dependency Vulnerabilities · High CVE: REDACTED REDACTED
  • Dependency Vulnerabilities · High CVE: REDACTED REDACTED
  • Dependency Vulnerabilities · High CVE: [GHSA redacted] REDACTED
  • Dependency Vulnerabilities · Medium advisory (unsound): REDACTED REDACTED
  • Dependency Vulnerabilities · Medium advisory (unsound): REDACTED REDACTED
  • Dependency Vulnerabilities · Medium vulnerability: RUSTSEC-2026-0222 REDACTED
  • Dependency Vulnerabilities · Medium CVE: [GHSA redacted] REDACTED
  • Knowledge Freshness · Orphaned knowledge e2e_test/check_slt_coverage.py
  • Change Coupling · Change-coupling hub: traced_store.rs → replay_impl.rs, local_hummock_storage.rs, monitored_store.rs src/storage/src/monitor/traced_store.rs
  • Change Coupling · Change coupling: stream_hash_agg.rs ↔ stream_simple_agg.rs src/frontend/src/optimizer/plan_node/stream_hash_agg.rs
  • Change Coupling · Change coupling: stream_hash_agg.rs ↔ stream_stateless_simple_agg.rs src/frontend/src/optimizer/plan_node/stream_hash_agg.rs
  • Change Coupling · Change-coupling hub: store_impl.rs → main.rs, replay_impl.rs, test_utils.rs, test_utils.rs src/storage/src/store_impl.rs
  • Change Coupling · Change-coupling hub: stream_hop_window.rs → stream_dynamic_filter.rs, stream_hash_agg.rs, stream_hash_join.rs, stream_project.rs, stream_project_set.rs, stream_union.rs src/frontend/src/optimizer/plan_node/stream_hop_window.rs
  • Change Coupling · Change-coupling hub: stream_union.rs → stream_dynamic_filter.rs, stream_hash_agg.rs, stream_project.rs, stream_stateless_simple_agg.rs src/frontend/src/optimizer/plan_node/stream_union.rs
  • Change Coupling · Change coupling: replay_impl.rs ↔ monitored_store.rs src/storage/hummock_test/src/bin/replay/replay_impl.rs
  • Supply-chain Provenance & Signing · REDACTED
Rebuild cost: about €1,000,000 · Estimate
Cost to rebuild€340,000 to €1,700,000, for 5,584 to 17,713 hours of work, about 6.9 person-years for 4 to 14 engineers
Difficulty of the problemStandard, 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.
SizeVery large: 791,969 lines of product code
What it is notNot 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. For this code, every line is priced as straight logic, which keeps the estimate on the low side.

Top priorities

The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.

1
Stop accepting every TLS certificate: delete `danger_accept_invalid_certs(true)` / `SslVerifyMode::NONE` / the rustls verifier that returns `ServerCertVerified::assertion()` unconditionally, and trust a self-signed or private server by adding its CA as a root (`add_root_certificate`, a rustls `RootCertStore`) — never by switching verification off.
This repository constructs a TLS client that accepts any certificate at 3 sites, not one: `src/connector/src/connector_common/postgres.rs:614` (`set_verify(SslVerifyMode::NONE`), `src/connector/src/connector_common/postgres.rs:627` (`set_verify(SslVerifyMode::NONE`), `src/connector/src/connector_common/postgres.rs:642` (`set_verify_hostname(false)`). Each is a separate decision — fixing only the line this row cites leaves the others in place.
Raises the score by about 5 points · Medium effort · Web-Security Posture
2
Resolve the 59 High IaC finding(s) in IaC & Container Security — start with REDACTED (21), REDACTED (13), REDACTED (10).
Raises the score by about 3 points · Medium effort · IaC & Container Security
3
Resolve the 52 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (30), REDACTED (8), REDACTED (5).
Raises the score by about 3 points · Medium effort · IaC & Container Security

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,000,000 to build again, about 6.9 person-years of work. Its weakest lens is Security and Compliance, at 50 (Weak). Security and Compliance is about how well the product is protected, and how it handles personal data. Because the weakest lens counts most in the score, work on Security and Compliance also moves the score most.
Based on: the rebuild estimate · the Security and Compliance grade · how much each lens counts
What to do: Start with the Security and Compliance actions in Top priorities.
If you do one thing first · First action
Stop accepting every TLS certificate: delete `danger_accept_invalid_certs(true)` / `SslVerifyMode::NONE` / the rustls verifier that returns `ServerCertVerified::assertion()` unconditionally, and trust a self-signed or private server by adding its CA as a root (`add_root_certificate`, a rustls `RootCertStore`) — never by switching verification off. Of all the actions in this report, it raises the score most for the work it takes: about 5 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 7.2 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 2% to 5% on every change. The history of the code shows how much it changes: about 147,061 lines over the last 90 days, which is about 596,414 lines a year. At that pace, the extra work comes to an estimated 29.8 to 198.8 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of Watchdog's own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

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.

arch proto proto risingwave_batch risingwave_batch risingwave_common risingwave_common risingwave_batch->risingwave_common risingwave_connector risingwave_connector risingwave_batch->risingwave_connector risingwave_expr risingwave_expr risingwave_batch->risingwave_expr risingwave_pb risingwave_pb risingwave_batch->risingwave_pb risingwave_rpc_client risingwave_rpc_client risingwave_batch->risingwave_rpc_client risingwave_storage risingwave_storage risingwave_batch->risingwave_storage workspace-hack workspace-hack risingwave_batch->workspace-hack risingwave_batch_executors risingwave_batch_executors risingwave_batch_executors->risingwave_batch risingwave_batch_executors->risingwave_common risingwave_common_estimate_size risingwave_common_estimate_size risingwave_batch_executors->risingwave_common_estimate_size risingwave_batch_executors->risingwave_connector risingwave_batch_executors->risingwave_expr risingwave_hummock_sdk risingwave_hummock_sdk risingwave_batch_executors->risingwave_hummock_sdk risingwave_batch_executors->risingwave_pb risingwave_batch_executors->risingwave_rpc_client risingwave_batch_executors->risingwave_storage risingwave_batch_executors->workspace-hack risingwave_cmd risingwave_cmd risingwave_cmd->risingwave_batch_executors risingwave_cmd->risingwave_common risingwave_compute risingwave_compute risingwave_cmd->risingwave_compute risingwave_ctl risingwave_ctl risingwave_cmd->risingwave_ctl risingwave_frontend risingwave_frontend risingwave_cmd->risingwave_frontend risingwave_meta_node risingwave_meta_node risingwave_cmd->risingwave_meta_node risingwave_cmd->workspace-hack risingwave_cmd_all risingwave_cmd_all risingwave_cmd_all->risingwave_batch_executors risingwave_cmd_all->risingwave_cmd risingwave_cmd_all->risingwave_common risingwave_cmd_all->risingwave_compute risingwave_cmd_all->risingwave_connector risingwave_cmd_all->risingwave_ctl risingwave_cmd_all->risingwave_frontend risingwave_cmd_all->risingwave_meta_node risingwave_cmd_all->workspace-hack risingwave_common->risingwave_common_estimate_size risingwave_common->risingwave_pb risingwave_common->workspace-hack risingwave_compute->risingwave_batch risingwave_compute->risingwave_batch_executors risingwave_compute->risingwave_common risingwave_compute->risingwave_connector risingwave_compute->risingwave_hummock_sdk risingwave_compute->risingwave_pb risingwave_compute->risingwave_rpc_client risingwave_compute->risingwave_storage risingwave_stream risingwave_stream risingwave_compute->risingwave_stream risingwave_compute->workspace-hack risingwave_connector->risingwave_common risingwave_connector->risingwave_common_estimate_size risingwave_connector->risingwave_pb risingwave_connector->risingwave_rpc_client risingwave_connector->workspace-hack risingwave_ctl->risingwave_common risingwave_ctl->risingwave_connector risingwave_ctl->risingwave_frontend risingwave_ctl->risingwave_hummock_sdk risingwave_meta risingwave_meta risingwave_ctl->risingwave_meta risingwave_ctl->risingwave_pb risingwave_ctl->risingwave_rpc_client risingwave_ctl->risingwave_storage risingwave_ctl->risingwave_stream risingwave_ctl->workspace-hack risingwave_expr->risingwave_common risingwave_expr->risingwave_common_estimate_size risingwave_expr->risingwave_pb risingwave_expr->workspace-hack risingwave_frontend->risingwave_batch risingwave_frontend->risingwave_common risingwave_frontend->risingwave_common_estimate_size risingwave_frontend->risingwave_connector risingwave_frontend->risingwave_expr risingwave_frontend->risingwave_hummock_sdk risingwave_frontend->risingwave_pb risingwave_frontend->risingwave_rpc_client risingwave_frontend->risingwave_storage risingwave_frontend->workspace-hack risingwave_hummock_sdk->risingwave_common risingwave_hummock_sdk->risingwave_common_estimate_size risingwave_hummock_sdk->risingwave_pb risingwave_hummock_sdk->workspace-hack risingwave_meta->risingwave_common risingwave_meta->risingwave_connector risingwave_meta->risingwave_hummock_sdk risingwave_meta->risingwave_pb risingwave_meta->risingwave_rpc_client risingwave_meta->workspace-hack risingwave_meta_node->risingwave_common risingwave_meta_node->risingwave_meta risingwave_meta_node->risingwave_pb risingwave_meta_node->risingwave_rpc_client risingwave_meta_node->workspace-hack risingwave_pb->workspace-hack risingwave_rpc_client->risingwave_common risingwave_rpc_client->risingwave_hummock_sdk risingwave_rpc_client->risingwave_pb risingwave_rpc_client->workspace-hack risingwave_storage->risingwave_common risingwave_storage->risingwave_common_estimate_size risingwave_storage->risingwave_connector risingwave_storage->risingwave_expr risingwave_storage->risingwave_hummock_sdk risingwave_storage->risingwave_pb risingwave_storage->risingwave_rpc_client risingwave_storage->workspace-hack risingwave_stream->risingwave_common risingwave_stream->risingwave_common_estimate_size risingwave_stream->risingwave_connector risingwave_stream->risingwave_expr risingwave_stream->risingwave_hummock_sdk risingwave_stream->risingwave_pb risingwave_stream->risingwave_rpc_client risingwave_stream->risingwave_storage risingwave_stream->workspace-hack __more__ +61 more projects

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.

2399 modules, with 8628 dependencies between them. 15 loops run through 465 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 2359 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.
uses →1 risingwave_common_estimate_size2 risingwave_dml.txn_channel3 risingwave_expr_impl.scalar.format4 risingwave_frontend.optimizer.plan_node.expr_visitable5 risingwave_meta.manager.notification6 risingwave_stream.executor.monitor.streaming_stats7 risingwave_common.bitmap8 risingwave_common.row.owned_row9 risingwave_common.util.epoch10 risingwave_frontend.handler.explain_analyze_stream_job.graph11 risingwave_frontend.optimizer.plan_node.expr_rewritable12 risingwave_storage.hummock.iterator.merge_inner13 risingwave_frontend.catalog.table_catalog14 risingwave_frontend.utils.condition15 risingwave_frontend.expr16 risingwave_common.util.column_index_mapping17 risingwave_sqlparser.ast18 risingwave_frontend.optimizer.plan_node.convert19 risingwave_frontend.optimizer.plan_node.plan_tree_node20 risingwave_sqlparser.ast.value21 risingwave_common.types.jsonb22 risingwave_common.types23 risingwave_common.array.data_chunk24 risingwave_common.catalog.column25 risingwave_frontend.session26 risingwave_common.catalog.schema27 risingwave_expr.expr28 risingwave_frontend.catalog.system_catalog29 risingwave_batch.executor30 risingwave_common.array.stream_chunk31 risingwave_connector.sink32 risingwave_frontend.optimizer.plan_node.plan_base33 risingwave_frontend.optimizer.plan_node.utils34 risingwave_frontend.optimizer.plan_node35 risingwave_stream.task.actor_manager36 risingwave_connector.source.base37 risingwave_frontend.handler38 risingwave_frontend.stream_fragmenter39 risingwave_stream.executor40 risingwave_meta.barrier.command
1 risingwave_common_estimate_size
2 risingwave_dml.txn_channel
3 risingwave_expr_impl.scalar.format
4 risingwave_frontend.optimizer.plan_node.expr_visitable
5 risingwave_meta.manager.notification
6 risingwave_stream.executor.monitor.streaming_stats
7 risingwave_common.bitmap11
8 risingwave_common.row.owned_row1
9 risingwave_common.util.epoch1
10 risingwave_frontend.handler.explain_analyze_stream_job.graph1
11 risingwave_frontend.optimizer.plan_node.expr_rewritable1
12 risingwave_storage.hummock.iterator.merge_inner1
13 risingwave_frontend.catalog.table_catalog1131
14 risingwave_frontend.utils.condition21111
15 risingwave_frontend.expr211121
16 risingwave_common.util.column_index_mapping11
17 risingwave_sqlparser.ast60522
18 risingwave_frontend.optimizer.plan_node.convert1
19 risingwave_frontend.optimizer.plan_node.plan_tree_node23
20 risingwave_sqlparser.ast.value192
21 risingwave_common.types.jsonb1316
22 risingwave_common.types113
23 risingwave_common.array.data_chunk1111
24 risingwave_common.catalog.column2123
25 risingwave_frontend.session11231
26 risingwave_common.catalog.schema231
27 risingwave_expr.expr545
28 risingwave_frontend.catalog.system_catalog11
29 risingwave_batch.executor2
30 risingwave_common.array.stream_chunk111211
31 risingwave_connector.sink111
32 risingwave_frontend.optimizer.plan_node.plan_base11
33 risingwave_frontend.optimizer.plan_node.utils121123
34 risingwave_frontend.optimizer.plan_node1114213
35 risingwave_stream.task.actor_manager12314
36 risingwave_connector.source.base111111
37 risingwave_frontend.handler3211
38 risingwave_frontend.stream_fragmenter21
39 risingwave_stream.executor131222111
40 risingwave_meta.barrier.command22
Uses a module listed above itPart of a loopThe module itself
1 risingwave_common_estimate_size2 risingwave_dml.txn_channel3 risingwave_expr_impl.scalar.format4 risingwave_frontend.optimizer.plan_node.expr_visitable5 risingwave_meta.manager.notification6 risingwave_stream.executor.monitor.streaming_stats7 risingwave_common.bitmap8 risingwave_common.row.owned_row9 risingwave_common.util.epoch10 risingwave_frontend.handler.explain_analyze_stream_job.graph11 risingwave_frontend.optimizer.plan_node.expr_rewritable12 risingwave_storage.hummock.iterator.merge_inner13 risingwave_frontend.catalog.table_catalog14 risingwave_frontend.utils.condition15 risingwave_frontend.expr16 risingwave_common.util.column_index_mapping17 risingwave_sqlparser.ast18 risingwave_frontend.optimizer.plan_node.convert19 risingwave_frontend.optimizer.plan_node.plan_tree_node20 risingwave_sqlparser.ast.value21 risingwave_common.types.jsonb22 risingwave_common.types23 risingwave_common.array.data_chunk24 risingwave_common.catalog.column25 risingwave_frontend.session26 risingwave_common.catalog.schema27 risingwave_expr.expr28 risingwave_frontend.catalog.system_catalog29 risingwave_batch.executor30 risingwave_common.array.stream_chunk31 risingwave_connector.sink32 risingwave_frontend.optimizer.plan_node.plan_base33 risingwave_frontend.optimizer.plan_node.utils34 risingwave_frontend.optimizer.plan_node35 risingwave_stream.task.actor_manager36 risingwave_connector.source.base37 risingwave_frontend.handler38 risingwave_frontend.stream_fragmenter39 risingwave_stream.executor40 risingwave_meta.barrier.commandrisingwave_common_estimate_size1risingwave_dml.txn_channel2risingwave_expr_impl.scalar.format3risingwave_frontend.optimizer.plan_node.expr_visitable4risingwave_meta.manager.notification5risingwave_stream.executor.monitor.streaming_stats6risingwave_common.bitmap7risingwave_common.row.owned_row8risingwave_common.util.epoch9risingwave_frontend.handler.explain_analyze_stream_job.graph10risingwave_frontend.optimizer.plan_node.expr_rewritable11risingwave_storage.hummock.iterator.merge_inner12risingwave_frontend.catalog.table_catalog13risingwave_frontend.utils.condition14risingwave_frontend.expr15risingwave_common.util.column_index_mapping16risingwave_sqlparser.ast17risingwave_frontend.optimizer.plan_node.convert18risingwave_frontend.optimizer.plan_node.plan_tree_node19risingwave_sqlparser.ast.value20risingwave_common.types.jsonb21risingwave_common.types22risingwave_common.array.data_chunk23risingwave_common.catalog.column24risingwave_frontend.session25risingwave_common.catalog.schema26risingwave_expr.expr27risingwave_frontend.catalog.system_catalog28risingwave_batch.executor29risingwave_common.array.stream_chunk30risingwave_connector.sink31risingwave_frontend.optimizer.plan_node.plan_base32risingwave_frontend.optimizer.plan_node.utils33risingwave_frontend.optimizer.plan_node34risingwave_stream.task.actor_manager35risingwave_connector.source.base36risingwave_frontend.handler37risingwave_frontend.stream_fragmenter38risingwave_stream.executor39risingwave_meta.barrier.command4011111111131211112111211160522123192131611311112123112312315451121112111111112112311142131231411111132112113122211122+2359 more modules (most-connected shown)

At a glance — Code Health · 80% · Strong ·

At a glance — Architecture · 63% · Adequate · gated by AX10 ·

At a glance — Maturity · 69% · Adequate ·

At a glance — Readiness · 59% · Adequate · gated by D13, P7 ·

At a glance — Security · 50% · Weak · gated by D29, D30, D31, D36, S1 ·

At a glance — Domain Modelling · 68% · Adequate · gated by DM7 ·

At a glance — Event Sourcing · 100% · Exemplary ·

At a glance — Accessibility · 59% · Adequate ·

At a glance — Performance · 86% · Strong ·

Security & Compliance — OWASP Top-10 mapping

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

OWASP categoryFindingsSeverity
A05:2025 — Injection131High / Critical
A02:2025 — Security Misconfiguration112High / Critical
A03:2025 — Software Supply Chain Failures85High / Critical
A07:2025 — Authentication Failures23High / Critical

Roadmap

Immediately eliminate the insecure TLS configuration that accepts any certificate by properly trusting the specific server CA instead of disabling verification across all database connections. Concurrently, remediate the 59 high-severity and 52 medium-severity issues in the infrastructure-as-code and container definitions, prioritizing the REDACTED and docker-compose files. Finally, address the 19 static analysis findings related to unpinned actions and resolve the 21 leaked secrets found in the workflow and configuration files.

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

Do thisHelpsEffortDimension
Stop accepting every TLS certificate: delete `danger_accept_invalid_certs(true)` / `SslVerifyMode::NONE` / the rustls verifier that returns `ServerCertVerified::assertion()` unconditionally, and trust a self-signed or private server by adding its CA as a root (`add_root_certificate`, a rustls `RootCertStore`) — never by switching verification off. This repository constructs a TLS client that accepts any certificate at 3 sites, not one: `src/connector/src/connector_common/postgres.rs:614` (`set_verify(SslVerifyMode::NONE`), `src/connector/src/connector_common/postgres.rs:627` (`set_verify(SslVerifyMode::NONE`), `src/connector/src/connector_common/postgres.rs:642` (`set_verify_hostname(false)`). Each is a separate decision — fixing only the line this row cites leaves the others in place.+5.4 ptsMediumWeb-Security Posture
Resolve the 59 High IaC finding(s) in IaC & Container Security — start with REDACTED (21), REDACTED (13), REDACTED (10).+3.0 ptsMediumIaC & Container Security
Resolve the 52 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (30), REDACTED (8), REDACTED (5).+2.6 ptsMediumIaC & Container Security
Resolve the 1 REDACTED finding(s) in Secrets (history) — start with REDACTED.+1.1 ptsLowSecrets (history)
Resolve the 6 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED, REDACTED.+1.1 ptsLowStatic Analysis (SAST)
Resolve the 2 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED, REDACTED.+1.1 ptsLowDependency Vulnerabilities
Resolve the 2 Critical vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED (2).+1.1 ptsLowDependency Vulnerabilities
Resolve the 1 Deprecated module finding(s) in Dependency Hygiene.+1.0 ptsLowDependency Hygiene

File quality

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

FileScoreBandWorst signal
REDACTED0.0SlopREDACTED Scanning: Leaked secret: REDACTED
REDACTED0.0SlopREDACTED Scanning: Leaked secret: REDACTED
REDACTED0.0SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED0.0SlopIaC & Container Security: High IaC: REDACTED
REDACTED0.8SlopIaC & Container Security: High IaC: REDACTED
REDACTED0.8SlopStatic Analysis (SAST): High: REDACTED
REDACTED0.8SlopIaC & Container Security: High IaC: REDACTED
REDACTED1.0SlopIaC & Container Security: High IaC: REDACTED
REDACTED2.3SlopDependency Vulnerabilities: Critical vulnerability: REDACTED
REDACTED2.7SlopIaC & Container Security: High IaC: REDACTED
REDACTED2.7SlopIaC & Container Security: High IaC: REDACTED
REDACTED2.7SlopIaC & Container Security: High IaC: REDACTED
src/frontend/src/optimizer/plan_node/logical_join.rs3.5SlopChange Coupling: Boundary-crossing change coupling: logical_join.rs ↔ temporal_join.rs
REDACTED3.6SlopStatic Analysis (SAST): High: REDACTED
REDACTED3.7SlopIaC & Container Security: High IaC: REDACTED
src/common/src/vnode_mapping/vnode_placement.rs3.9SlopChange Coupling: Boundary-crossing change coupling: vnode_placement.rs ↔ scale.rs
src/meta/service/src/hummock_service.rs3.9SlopChange Coupling: Boundary-crossing change coupling: hummock_service.rs ↔ hummock_meta_client.rs
src/frontend/src/handler/alter_owner.rs4.0MixedChange Coupling: Boundary-crossing change coupling: alter_owner.rs ↔ parser.rs
src/frontend/src/binder/expr/function/builtin_scalar.rs4.2MixedChange Coupling: Boundary-crossing change coupling: builtin_scalar.rs ↔ strong.rs
REDACTED4.3MixedStatic Analysis (SAST): High: REDACTED

How the grades work

Every finding carries one of four grades. Three say how serious it is. The fourth says this survey could not settle it — and it is a grade, not a gap.

Critical — 335

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 — 3002

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 — 787

Recorded, with no effect on how the codebase functions. Present so the survey is complete, not because it needs doing.

Could not be resolved — 31

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. 74 of 74 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); none rely on LLM judgement. Overall confidence is 0.8 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.

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

What we checked — 74 dimensions across the health lenses
D1D2D3D4D5D6D9D10D12D13D14D15D16D17D19D26D28D29D30D31D34D35D36D37D43D44AC2AC3AC5AC6AC7AX10AX3AX4AX6AX8AX9C2DM1DM2DM4DM5DM6DM7ES1ES2M1M2M3M4P1P10P2P3P4P5P6P7PF1PF2PF3R1R10R2R3R6R7R8R9S1X20X23X27X28

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

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

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

Tools & methods

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

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

Every finding is locatable in findings.md. Run 01a17c01-fcf7-700a-9dd1-f4e7d859064b.

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

Run transparency — what happened this run

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

  • 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 2 test(s) behind this row are the ones the C# collector could read, and this repository also carries at least 251 test source file(s) (.rs, .java, .ts) 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 .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 2 measured tier(s) (other: measured (0 flaky); JavaScript/TypeScript (mocha via `npm install --ignore-scripts` (no lockfile) in integration_tests/client-library/nodejs/ (1 tests); jest via `npm install --ignore-scripts` (no lockfile) in src/utils/pgwire/tests/js/ (0 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 a Python pyproject.toml/requirements.txt (pip/uv/Poetry), but the licence verdict published here was taken over its NuGet package dependencies. Nothing was read about its Python 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 a Maven POM, but the licence verdict published here was taken over its NuGet package dependencies. Nothing was read about its Maven 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 src/common/src/system_param/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 2 deducted marker(s) and the 0.2/KLoC density on this row were taken over this repository's .NET projects ALONE: .rs (738,403 lines, 94% 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 1,008 task marker(s) (TODO/FIXME/HACK/XXX) across 551 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.
  • D22 Internal API Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape 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. This says nothing about whether that surface is consistent.
  • D24 Comment Value — 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. 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.
  • 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.
  • AX1 Captive dependencies — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads Microsoft.Extensions.DependencyInjection registrations in C# and annotated Spring beans in Java/Kotlin only, and this repository uses Spring but declares no bean through a stereotype annotation (@Component, @Service, …) this check reads — its beans are defined elsewhere, such as XML, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • 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 (integration_tests/vector/docker-compose.yml). compose up failed (exit 18 — an image could not be pulled) — risingwave-standalone Pulling grafana-0 Pulling postgres-0 Error Get "https://registry-1.docker.io/v2/": Forbidden prometheus-0 Error context canceled minio-0 Error context canceled vector Error context canceled grafana-0 Error context canceled risingwave-standalone Error Get "https://registry-1.docker.io/v2/": Forbidden Error response from daemon: Get "https://registry-1.docker.io/v2/": Forbidden; the earlier `compose pull` step reported: grafana-0 Pulling minio-0 Pulling postgres-0 Error Get "https://registry-1.docker.io/v2/": Forbidden prometheus-0 Error context canceled minio-0 Error context canceled vector Error context canceled grafana-0 Error context canceled risingwave-standalone Error Get "https://registry-1.docker.io/v2/": Forbidden Error response from daemon: Get "https://registry-1.docker.io/v2/": Forbidden; the runtime sandbox reaches registries only through the in-fence pull-through mirror, so an image the mirror does not carry cannot be fetched — this is a limit of our sandbox, not of your stack; runtime evidence skipped.
  • GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and this repository's Java, Python, Rust is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • 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). 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.
  • X1 Async correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X12 Unreachable branch — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X13 Undrained process stream — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X14 Bypassable address classification — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X15 Unvalidated length from an untrusted reader — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X16 Unfloored truncation loop — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X17 Uncapped recursion over a caller-supplied document — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X18 Disposal-pattern correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X19 Unrestored process-global state — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X2 Cancellation propagation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X21 Side-effecting pattern guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X22 Contradicted release guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X24 Document value interpolated into markup unescaped — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X25 Inert configuration knob — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X26 Unsynchronised callback handoff — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X29 Per-element action decided by a fixed element — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X3 Exception handling — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X30 Support guard that admits what it rejects — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X32 Type resolved by simple name across every loaded assembly — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X4 Structured logging — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X5 Nullable reference types — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.

Repo exclusion declarations: 19 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.
  • 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.
  • 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 (go.mod, 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.
  • AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
  • AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
  • AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
  • AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
  • AC7 A11y enforcement: Enforcement is scored from in-repo config/CI evidence only — an a11y gate enforced in external tooling with no in-repo trace can't be credited, and a configured linter is presence, not proof the rules actually run or block a merge.
  • 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.
  • DM4 Rich vs anemic domain model: Behaviour is detected as state mutation inside a method body — a method that enforces an invariant by validating-and-throwing without mutating reads as a query, and mutation delegated through an interface the scan can't resolve isn't credited; entities with zero public properties still drop out of the population. It detects that state changes, not whether the rule is correct.
  • DM6 Domain ↔ infrastructure boundary: Infrastructure reached through a hand-rolled wrapper, a domain-named facade, reflection, or a string-keyed service locator resolves to a non-infra type and isn't seen; the body scan is symbol resolution over syntax, not full dataflow. A clean result means "no resolved infra reference in a domain body", not a proof of purity.
  • 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.

Dimensions

D1 · Cyclomatic Complexity5.4 / 10Adequate✓ Tool-verified

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

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

Maturity: Documented → Verified → Prevented · effective 5.4 / 10 · rule-coverage 100% · ceiling Prevented

334 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was risingwave_frontend::handler::handle at 181. A further 97 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 PostgresErrorCode::sqlstate at 258 — they are counted neither in the figure above nor in this dimension's score. 45 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: src/error/src/code.rs (PostgresErrorCode::sqlstate at 258), src/frontend/src/datafusion/scalar_function/convert.rs (risingwave_frontend::datafusion::scalar_function::convert::convert_trivial_datafusion_func at 71), src/connector/src/source/cdc/external/postgres.rs (risingwave_connector::source::cdc::external::postgres::type_name_to_pg_type at 52), src/connector/src/connector_common/postgres.rs (risingwave_connector::connector_common::postgres::sea_type_to_pg_type at 50), src/common/src/array/arrow/arrow_impl.rs (FromArrow::from_array at 39), and 40 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.

risingwave_frontend::handler::handle (cyclomatic 181) · ×29src/frontend/src/handler/mod.rs:306
risingwave_connector::sink::encoder::avro::on_field (cyclomatic 52) · ×16src/connector/src/sink/encoder/avro.rs:411
Parser::parse_infix (cyclomatic 47) · ×16src/sqlparser/src/parser.rs:1306
Binder::bind_builtin_scalar_function (cyclomatic 62) · ×14src/frontend/src/binder/expr/function/builtin_scalar.rs:31
risingwave_storage::hummock::compactor::start_iceberg_compactor (cyclomatic 43) · ×9src/storage/src/hummock/compactor/mod.rs:401

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

What to do

  1. Bring the 2 bodies over 120 down to 120 or less in Cyclomatic Complexity — start with risingwave_frontend::handler::handle (cyclomatic 181), Statement::fmt_unchecked (cyclomatic 149). — 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 2 together lifts Cyclomatic Complexity from 5.4 to about 5.8/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
  2. Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D2 · Cognitive Complexity4.1 / 10Weak✓ Tool-verified

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

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

Maturity: Documented → Verified → Prevented · effective 4.1 / 10 · rule-coverage 100% · ceiling Prevented

674 method(s) exceeded the cognitive complexity threshold of 15; the worst was ParallelizedCdcBackfillExecutor::execute_inner at 389.

risingwave_frontend::handler::handle (cognitive 100) · ×48src/frontend/src/handler/mod.rs:306
Parser::parse_table_and_joins (cognitive 59) · ×23src/sqlparser/src/parser.rs:5501
risingwave_meta::controller::system_param::merge_params (cognitive 54) · ×22src/meta/src/controller/system_param.rs:112
Binder::bind_builtin_scalar_function (cognitive 77) · ×20src/frontend/src/binder/expr/function/builtin_scalar.rs:31
risingwave_connector::parser::unified::debezium::parse_schema_change (cognitive 115) · ×16src/connector/src/parser/unified/debezium.rs:294

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

What to do

  1. Bring the 1 body over 240 down to 240 or less in Cognitive Complexity — start with ParallelizedCdcBackfillExecutor::execute_inner (cognitive 389). — Refactoring it lifts Cognitive Complexity from 4.1 to about 4.7/10.
  2. Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D3 · God Classes7.8 / 10Strong✓ Tool-verified

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

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

Maturity: Documented → Verified → Prevented · effective 7.8 / 10 · rule-coverage 100% · ceiling Prevented

667 god class(es) detected.

MethodTooLong: DatabaseCheckpointControl.apply_command · ×235src/meta/src/barrier/checkpoint/state.rs:460
FileTooLong: src/parser.rs · ×200src/sqlparser/src/parser.rs
FunctionTooLong: risingwave_frontend::handler::handle · ×92src/frontend/src/handler/mod.rs:306
ClassTooLong: Parser · ×91src/sqlparser/src/parser.rs:196
TooManyMethods: Parser · ×30src/sqlparser/src/parser.rs:196

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

What to do

  1. Resolve the 235 MethodTooLong finding(s) in God Classes — start with REDACTED (18), streaming_job.rs (7), ddl_controller.rs (5). — One of this dimension's main actionable groups (235 warning-level).
  2. Resolve the 200 FileTooLong finding(s) in God Classes — start with REDACTED (23), lib.rs (4), utils.rs (3). — One of this dimension's main actionable groups (200 warning-level).
  3. Resolve the 92 FunctionTooLong finding(s) in God Classes — start with REDACTED (8), create_table.rs (5), create_source.rs (4). — One of this dimension's main actionable groups (92 warning-level).
  4. Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D4 · Code Duplication9.4 / 10Stronggated by 974 serious findings✓ Tool-verified

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

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

Maturity: Documented → Verified → Prevented · effective 9.4 / 10 · rule-coverage 100% · ceiling Verified

929 duplicated block group(s) detected. A further 45 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 66 of the 974 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.

Duplicated block (8 lines × 2) · ×68src/batch/executors/src/executor/hash_agg.rs:498
Duplicated block (14 lines × 2) · ×55src/batch/executors/src/executor/hash_agg.rs:655
Duplicated block (9 lines × 2) · ×51src/batch/executors/src/executor/join/hash_join.rs:2090
Duplicated block (7 lines × 2) · ×50src/batch/executors/src/executor/aggregation/orderby.rs:105
Duplicated block (6 lines × 2) · ×47src/batch/executors/src/executor/iceberg_scan.rs:186

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

What to do

  1. Resolve the 68 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with REDACTED (4), lib.rs (2), ddl_service.rs (2). — One of this dimension's main actionable groups (68 warning-level).
  2. Resolve the 55 Duplicated block (14 lines × 2) finding(s) in Code Duplication — start with server_pb.rs (5), REDACTED (3), streaming_job.rs (2). — One of this dimension's main actionable groups (55 warning-level).
  3. Resolve the 51 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with REDACTED (5), observer_manager.rs (3), watermark.rs (2). — One of this dimension's main actionable groups (51 warning-level).
  4. 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.

D5 · Coupling8.3 / 10Strong✓ 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.

Maturity: Documented → Verified → Prevented · effective 8.3 / 10 · rule-coverage 100% · ceiling Prevented

81 production modules (Maven+Cargo), 0 dependency cycle(s), 8 unstable depended-on module(s). Read from the build's own module declarations; 9 module(s) off the main sequence, with abstractness counted on 64 of the 81 (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: delta_btree_map · ×7
Unstable project risingwave_cmd
Unstable project risingwave_compute
Unstable project risingwave_ctl
Unstable project risingwave_frontend

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

What to do

  1. Resolve the 7 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (7 warning-level).
  2. Resolve the 1 Unstable project risingwave_cmd finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 Unstable project risingwave_compute finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
  4. 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.

D6 · Cohesion (LCOM4)9.9 / 10Stronggated by 9 serious findings✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 9.9 / 10 · rule-coverage 100% · ceiling Verified

9 of 1409 classes have LCOM4 above 3.

Low cohesion: StreamingMetrics (LCOM4 16) · ×9src/stream/src/executor/monitor/streaming_stats.rs:46

What to do

  1. Resolve the 9 Low cohesion finding(s) in Cohesion (LCOM4) — start with streaming_stats.rs, connection.rs, session.rs. — One of this dimension's main actionable groups (9 warning-level).
  2. Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

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

D9 · Test Distribution10.0 / 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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

3664 test methods: 3282 unit, 382 integration, 0 BDD, 0 e2e. The JavaScript/TypeScript suite contributes 2 `it`/`test` case(s) across 1 test file(s) declaring at least one beside 2 .NET test method(s); its tier split is read from package names and paths only. The Rust suite contributes 3587 `#[test]` function(s) across 790 file(s) declaring at least one; its unit/integration split is Cargo's own — 67 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 12 test function(s) across 2 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 2 test case(s) across 2 `_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: 2 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 java suite(s) contribute 59 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.

D10 · Test Quality8.1 / 10Strong✓ 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.

Maturity: Documented → Verified → Prevented · effective 8.1 / 10 · rule-coverage 100% · ceiling Prevented

0 skipped, 1 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 2 tests. Measured on the C# suite only — at least 251 test source file(s) (.rs, .java, .ts) went unread, so its test quality is unmeasured and is not in these counts.

No assertions: CreateAndReadFromTableintegration_tests/client-library/csharp/NpgsqlTest.cs:12

What to do

  1. Resolve the 1 No assertions finding(s) in Test Quality — start with NpgsqlTest.cs. — One of this dimension's main actionable groups (1 warning-level).
  2. 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.

D12 · Dependency Hygiene8.8 / 10Strong✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 8.8 / 10 · rule-coverage 100% · ceiling Verified

13 outdated, 1 author-deprecated direct Go module(s), 0 pinning or checksum defect(s). Whether any of these modules is UNMAINTAINED is not graded — proxy.golang.org publishes no maintenance status, and release age does not stand in for one. Whether any is UNUSED is not graded either: that is a source question, not a registry one. Known CVEs in this module graph are D30's question, read from go.mod and go.sum there.

Deprecated module: github.com/aws/aws-sdk-go
Outdated: github.com/Shopify/sarama · ×13

What to do

  1. Resolve the 1 Deprecated module finding(s) in Dependency Hygiene. — One of this dimension's main actionable groups (1 warning-level).

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

D13 · REDACTED Scanning0.0 / 10Critical✓ Tool-verified

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

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

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Prevented

10 secret(s) detected.

REDACTED

What to do

  1. Resolve the 21 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (7), REDACTED (6), REDACTED. — One of this dimension's main actionable groups (21 issue-level).
  2. 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.

D14 · License Compliance10.0 / 10Exemplary○ Nothing flagged

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Verified

0 of 114 packages use a banned license. ★ DEPTH: this repository's MSBuild projects declare 5 direct `PackageReference`(s), and 109 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, a Python pyproject.toml/requirements.txt (pip/uv/Poetry), a Maven POM 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.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity Hotspots9.6 / 10Stronggated by 80 serious findings✓ Tool-verified

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

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

Maturity: Documented → Verified → Prevented · effective 9.6 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: src/meta/src/barrier/checkpoint/state.rs (16×96=1536); src/sqlparser/src/ast/mod.rs (7×149=1043); src/frontend/src/handler/mod.rs (4×181=724) Repeated repair below the complexity floor: src/meta/src/manager/env.rs (7 of 9 changes were fixes); src/meta/src/barrier/schedule.rs (5 of 9 changes were fixes); src/meta/src/controller/catalog/mod.rs (5 of 8 changes were fixes)

Hotspot: src/meta/src/barrier/checkpoint/state.rs · ×67src/meta/src/barrier/checkpoint/state.rs:460
Repeated repair: src/meta/src/manager/env.rs · ×13src/meta/src/manager/env.rs:434

What to do

  1. Resolve the 67 Hotspot finding(s) in Churn × Complexity Hotspots — start with REDACTED (12), create_table.rs (2), config.rs (2). — One of this dimension's main actionable groups (67 warning-level).
  2. Resolve the 13 Repeated repair finding(s) in Churn × Complexity Hotspots — start with REDACTED (4), env.rs, schedule.rs. — One of this dimension's main actionable groups (13 warning-level).

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

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

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

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

Maturity: Documented → Verified → Prevented · effective 9.6 / 10 · rule-coverage 100% · ceiling Documented

78 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is src/stream/src/executor/match_recognize/incremental.rs. Counted over 2027 of the 2900 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 · ×9
Further sole-owners (lower concentration)

✓ On the Gold path — maintain.

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

D17 · Explicit Debt9.7 / 10Stronggated by 2 serious findings✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 9.7 / 10 · rule-coverage 100% · ceiling Prevented

2 deducted debt markers + 0 dead symbols across 0 LoC in the .NET projects (0.2/KLoC) → score 9.7. Measured on the .NET source only: .rs (94% of production source) was not read, and carries at least 1,008 uncounted task marker(s) in 551 file(s).

TodoCommentintegration_tests/client-library/csharp/NpgsqlTest.cs:84
CommentedOutCodeREDACTED:35

What to do

  1. Resolve the 1 TodoComment finding(s) in Explicit Debt — start with NpgsqlTest.cs. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 CommentedOutCode finding(s) in Explicit Debt — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
  3. 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.

D19 · Documentation Quality10.0 / 10Exemplary○ Nothing flagged

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

1 of 1 documentation facets pass in full. 111 document(s) read across 1 unit(s).

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

D26 · Project Cohesion10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether each project is a focused, coherent unit rather than an oversized grab-bag.

Method: Project size overshoot penalties (LoC / public-type count / namespace count, 2-of-3 flag) weighted by log magnitude. Exhaustive across projects, deterministic, LLM-independent.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

0 of 1 projects flagged as possibly oversized/incoherent.

✓ On the Gold path — maintain.

Detailed fixes: d26_recommendation.md.

D28 · Secrets (history)9.0 / 10Adequategated by 1 critical finding✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 9.0 / 10 · rule-coverage 100% · ceiling Documented

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

REDACTED
REDACTED

What to do

  1. Resolve the 1 REDACTED finding(s) in Secrets (history) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  2. Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).

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

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

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

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

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

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

131 finding(s): 0 critical, 106 high, 15 medium, 10 low. 66 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 17 file(s) — `REDACTED` (lines 127–138, lines 138–155), `src/batch/src/error.rs` (line 39), `src/common/src/array/data_chunk.rs` (line 388, line 423, line 447, …), `src/common/src/array/stream_chunk.rs` (lines 278–332, line 388, line 396, …), `src/connector/src/sink/log_store.rs` (lines 133–138), … (+12 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. Separately, one or more rules could not re-parse an embedded snippet in 9 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

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

What to do

  1. Resolve the 19 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED (2), REDACTED (2). — One of this dimension's main actionable groups (19 issue-level).
  2. Resolve the 6 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (6 issue-level).
  3. No action in Static Analysis (SAST) — all 66 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (66 issue-level, 0 of them charged here).

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

D30 · Dependency Vulnerabilities0.0 / 10Critical✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

78 finding(s): 4 critical, 14 high, 58 medium, 2 low.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

  1. Resolve the 14 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (6), REDACTED (5), REDACTED (3). — One of this dimension's main actionable groups (14 issue-level).
  2. Resolve the 2 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
  3. Resolve the 2 Critical vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).

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

D31 · IaC & Container Security0.0 / 10Critical✓ Tool-verified

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

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

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

112 finding(s): 0 critical, 59 high, 52 medium, 1 low.

REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 59 High IaC finding(s) in IaC & Container Security — start with REDACTED (21), REDACTED (13), REDACTED (10). — One of this dimension's main actionable groups (59 issue-level).
  2. Resolve the 52 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (30), REDACTED (8), REDACTED (5). — One of this dimension's main actionable groups (52 warning-level).
  3. Resolve the 1 Low IaC finding(s) in IaC & Container Security — start with REDACTED. — One of this dimension's main actionable groups (1 recommendation-level).

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

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

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

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

Maturity: Documented → Verified → Prevented · effective 6.3 / 10 · rule-coverage 100% · ceiling Documented

749 of 2027 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is src/meta/src/stream/stream_graph/assignment.rs. Counted over 2027 of the 2900 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned knowledge · ×43src/meta/src/stream/stream_graph/assignment.rs:1
Orphaned file · ×706dashboard/components/FragmentGraph.tsx:1
Further orphaned files (smaller)

What to do

  1. Resolve the 706 Orphaned file finding(s) in Knowledge Freshness — start with REDACTED (24), lib.rs (5), error.rs (5). — One of this dimension's main actionable groups (706 recommendation-level).
  2. Resolve the 43 Orphaned knowledge finding(s) in Knowledge Freshness — start with lib.rs (3), assignment.rs, PostgresConnectorConfig.java. — One of this dimension's main actionable groups (43 issue-level).
  3. Resolve the 1 Further orphaned files (smaller) finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).

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

D35 · Change Coupling9.0 / 10Adequategated by 77 critical findings✓ Tool-verified

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

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

Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. 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.

Maturity: Documented → Verified → Prevented · effective 9.0 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: panic_store.rs↔store_impl.rs 100%; monitored_store.rs↔panic_store.rs 100%; pure.rs↔strong.rs 93%

Boundary-crossing change coupling: pure.rs ↔ strong.rs · ×77src/frontend/src/expr/pure.rs:1
Change coupling: monitored_store.rs ↔ traced_store.rs · ×47src/storage/src/monitor/monitored_store.rs:1
Change-coupling hub: panic_store.rs → replay_impl.rs, hummock_storage.rs, local_hummock_storage.rs, monitored_store.rs, traced_store.rs, store_impl.rs · ×10src/storage/src/panic_store.rs
Change coupling clique: batch_delete.rs, batch_insert.rs, batch_update.rs · ×2src/frontend/src/optimizer/plan_node/batch_delete.rs

What to do

  1. Resolve the 77 Boundary-crossing change coupling finding(s) in Change Coupling — start with hummock_service.rs (6), risingwave-dev-dashboard.dashboard.py (5), alter_streaming_rate_limit.rs (4). — One of this dimension's main actionable groups (77 issue-level).
  2. Resolve the 47 Change coupling finding(s) in Change Coupling — start with REDACTED (2), test_utils.rs (2), alter_table_with_sr.rs (2). — One of this dimension's main actionable groups (47 warning-level).
  3. Resolve the 10 Change-coupling hub finding(s) in Change Coupling — start with REDACTED (2), panic_store.rs, stream_hash_agg.rs. — One of this dimension's main actionable groups (10 warning-level).

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

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

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

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

Maturity: Documented → Verified → Prevented · effective 2.5 / 10 · rule-coverage 100% · ceiling Documented

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

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

  1. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).

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

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

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

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

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

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

✓ On the Gold path — maintain.

Detailed fixes: d37_recommendation.md.

D43 · Malicious Dependencies10.0 / 10Exemplary✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

No dependency in any ecosystem this repository declares is published as malicious.

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

D44 · Platform End-of-Life10.0 / 10Exemplary✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 15 platform declaration(s) and 54 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.

✓ On the Gold path — maintain.

Detailed fixes: d44_recommendation.md.

Frontend & cross-cutting dimensions

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

AC2 · Forms & labels4.0 / 10Weak✓ Tool-verified

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

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

Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing it renders carries one either (a name prop is the form-submission key, not a label). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed. (×2) — dashboard/pages/await_tree.tsx:120, dashboard/pages/fragment_graph.tsx:411
  • This UI-library field component has no label / aria-label / aria-labelledby / id — and neither does anything it renders (a name prop is the form-submission key, not a label) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed. — dashboard/pages/cpu_profiling.tsx:199
  • This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed. — dashboard/pages/explain_distsql.tsx:39

What to do

  • Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
AC3 · Page structure10.0 / 10Exemplary○ Nothing flagged

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

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

Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

AC5 · ARIA correctness10.0 / 10Exemplary○ Nothing flagged

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

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

Coverage: Population: elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) that carry a role or an aria-* attribute; roles and token values are checked against the ARIA enums exhaustively within that set. An expression-valued (dynamic) role or aria-* value is skipped rather than guessed, and markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

AC6 · Visual & motion safety6.6 / 10Adequate✓ Tool-verified

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

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

Coverage: Population: styled elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx), plus in-repo <style> blocks, in-repo .css files and CSS-in-JS literals. Colour contrast is computed from LITERAL colour pairs only (hex/rgb/hsl/named, including var() tokens and Tailwind neutral utilities) — computed, runtime-themed and external-CDN colour is never resolved, so this is a partial read of contrast by construction. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • <span> moves — its inline style sets `animation: loading` — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:. — dashboard/components/Relations.tsx:382

What to do

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

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

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

Coverage: Population: the repository's own tooling configuration — lint config, test and CI files — NOT the markup. It is read for a configured accessibility checker and an automated accessibility assertion (axe/pa11y/Lighthouse, or a native-toolkit equivalent), and it credits an INVOCATION, never a mention: a licence filename, an import comment or a doc reference earns no rung. Enforcement configured entirely outside the repository leaves no evidence here and cannot be credited.

  • No accessibility enforcement found — no a11y linter (eslint-plugin-jsx-a11y) and no axe/pa11y/Lighthouse in tests or CI. Start with the linter to catch issues at author time. What was searched, so you can tell an absence from a miss: the 24 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.

What to do

  • Enforce accessibility in the toolchain: add eslint-plugin-jsx-a11y, then assert with jest-axe in tests, then gate axe/pa11y/Lighthouse in CI.
AX10 · Code composition0.0 / 10Critical✓ Tool-verified

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.

AX3 · Project dependency cycles10.0 / 10Exemplary✓ Tool-verified

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.

AX4 · Dependency direction10.0 / 10Exemplary✓ Tool-verified

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.

AX6 · Interface segregation10.0 / 10Exemplary✓ Tool-verified

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.

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.

AX9 · CQS / query purity10.0 / 10Exemplary✓ Tool-verified

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.

C2 · Access Controls10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether access is authorized by default — a framework authorization attribute/decorator or policy, or imperative guard methods (throw-on-violation) called from handlers.

Method: Roslyn scan: [Authorize] usage and authorization policies, plus imperative throw-on-violation guard methods detected via syntax. Deterministic.

DM1 · Aggregate boundaries10.0 / 10Exemplary✓ Tool-verified

Other · Domain Modelling — Whether an aggregate references another aggregate by identity rather than embedding it by object reference.

Method: Roslyn (DDD-gated): aggregate roots identified by convention; each aggregate field checked for direct references to other aggregates versus id-only. Deterministic, DDD-native.

Coverage: Population: aggregate roots identified by AggregateRoot/IAggregateRoot base/interface NAME convention; reference-by-identity then checked exhaustively within that set — a root not using those names is invisible.

DM2 · Strongly-typed ids10.0 / 10Exemplary✓ Tool-verified

Other · Domain Modelling — Whether domain identifiers are strongly typed (a newtype wrapper) rather than raw primitives — consistency once an idiom exists.

Method: Roslyn (DDD-gated): strongly-typed id adoption on domain entities/events; raw Guid/int/string ids counted versus wrapped types. An id wrapper is recognised by VALUE SEMANTICS, not by being a struct — a record struct, a record class (`record ApartmentId(Guid Value)`) or a class declared by a typed-id base (`class MemberId : TypedIdValueBase`) all count, while a plain mutable class (reference equality) and a verb-phrase query record (`GetCustomerById`) do not. Deterministic, adoption percentage.

Coverage: Population: id-like members by *Id/*Key NAME suffix; strongly-typed-ID shape then checked semantically — non-suffixed identifiers are not seen.

DM4 · Rich vs anemic domain model7.9 / 10Strong✓ Tool-verified

Other · Domain Modelling — Whether domain entities own their behaviour (invariant-enforcing commands) rather than being data-only structs driven by a foreign service.

Method: Roslyn (DDD-gated): entity method BODIES classified mutator-vs-query — only methods that mutate the entity's own declared state count as invariant-protecting behaviour, so a getter/passthrough doesn't rescue an anemic class. Deterministic, exhaustive over domain-layer entities.

Coverage: Population: entities by name/base convention; rich-vs-anemic judged by classifying each method body mutator-vs-query — logic-bearing domain types outside the convention are invisible.

  • `BatchManagerMetrics` is a data-only domain entity with `pub` mutable state and no invariant-enforcing behaviour of its own, while the repo holds the logic in a foreign service/manager/use-case — the anemic domain model. Move the behaviour onto the entity so it enforces its own invariants (or make it an immutable value object with private fields) rather than being driven from outside. — src/batch/src/monitor/stats.rs:111
  • `BatchSpillMetrics` is a data-only domain entity with `pub` mutable state and no invariant-enforcing behaviour of its own, while the repo holds the logic in a foreign service/manager/use-case — the anemic domain model. Move the behaviour onto the entity so it enforces its own invariants (or make it an immutable value object with private fields) rather than being driven from outside. — src/batch/src/monitor/stats.rs:154
  • `DistributedQueryMetrics` is a data-only domain entity with `pub` mutable state and no invariant-enforcing behaviour of its own, while the repo holds the logic in a foreign service/manager/use-case — the anemic domain model. Move the behaviour onto the entity so it enforces its own invariants (or make it an immutable value object with private fields) rather than being driven from outside. — src/frontend/src/scheduler/distributed/stats.rs:26
  • `RefreshCycleActors` is a data-only domain entity with `pub` mutable state and no invariant-enforcing behaviour of its own, while the repo holds the logic in a foreign service/manager/use-case — the anemic domain model. Move the behaviour onto the entity so it enforces its own invariants (or make it an immutable value object with private fields) rather than being driven from outside. — src/meta/src/stream/refresh_manager.rs:59
  • `HummockStateStoreMetrics` is a data-only domain entity with `pub` mutable state and no invariant-enforcing behaviour of its own, while the repo holds the logic in a foreign service/manager/use-case — the anemic domain model. Move the behaviour onto the entity so it enforces its own invariants (or make it an immutable value object with private fields) rather than being driven from outside. — src/storage/src/monitor/hummock_state_store_metrics.rs:43

What to do

  • Move the domain logic onto the entity (invariant-enforcing `&mut self` commands) instead of a foreign service.
DM5 · Encapsulated state10.0 / 10Exemplary✓ Tool-verified

Other · Domain Modelling — Whether a domain type's identity-bearing field stays immutable — a `pub` mutable field under a hand-rolled Hash/PartialEq breaks the value-identity invariant.

Method: Roslyn (DDD-gated): entities scanned for publicly writable state — public setters, and (C#/VB) own mutable collections handed out through an auto-property, a public field or a bare-field expression getter, where a computed/copying getter is never charged. One finding per entity; score softened when Marten/EF rehydration frameworks present. Deterministic, framework-aware.

Coverage: Population: entities by convention; encapsulation (setter shape) checked exhaustively within the set.

DM6 · Domain ↔ infrastructure boundary10.0 / 10Exemplary✓ Tool-verified

Other · Domain Modelling — Whether the domain layer stays free of infrastructure dependencies — a domain aggregate fused to a persistence ORM (diesel/sea-orm/sqlx) on its own declaration (active-record) couples the domain to infrastructure. The clean-architecture dependency rule.

Method: Roslyn (DDD-gated): domain-layer types scanned for infrastructure usage in member SIGNATURES and inside method/accessor BODIES — resolved calls and object-creations into EF/Marten/HTTP/Mongo/Redis/message-bus types (not just a namespace allowlist). Deterministic, symbol-resolved, exhaustive over domain-layer bodies, DDD-native.

Coverage: Domain layer identified by NAMESPACE heuristic; infrastructure then resolved by symbol in member SIGNATURES and method/accessor BODIES — rename the layer and the check evaporates.

DM7 · Repository granularity1.0 / 10Critical✓ Tool-verified

Other · Domain Modelling — Whether repositories are per aggregate root (not per child entity) and keep the persistence query handle behind the contract, so the root's invariants can't be bypassed.

Method: Roslyn (DDD-gated): repository abstraction detection; repositories over non-aggregate-root entities flagged, and (C#/VB) repository INTERFACES whose members return a live persistence query handle (IQueryable/DbSet/IMongoQueryable) — implementations and specification evaluators are out of population by design, since composing a query internally is what an implementation is for. Deterministic, DDD-native.

Coverage: Population: repositories + aggregate roots by NAME convention; per-root repository rule checked within the set.

  • `SpringTestRepository` is a repository over `SpringTest`, which is an entity but not an aggregate root. Repositories should be per aggregate ROOT — loading/saving a child entity independently lets callers bypass the root's invariants. Access `SpringTest` through its owning aggregate instead. — integration_tests/client-library/spring-boot/src/main/java/com/risingwave/SpringTestRepository.java:8

What to do

  • Define repositories per aggregate root and keep the query handle inside them; reach child entities through their root so invariants can't be bypassed.
ES1 · Fold determinism10.0 / 10Exemplary✓ Tool-verified

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.

ES2 · Immutable events10.0 / 10Exemplary✓ Tool-verified

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.

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

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

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

  • 1270 code files changed in the last 6 months but the README was not touched — it may no longer reflect the system.

What to do

  • Add a build/run (quick start) section to the root README — the first thing a newcomer needs.
  • 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 1 of 1 project(s) that lack one — worth up to 2 pts.
  • Review the README against recent changes; refresh the parts that drifted.
M2 · Architecture documentation5.0 / 10Adequate✓ Tool-verified

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

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

  • No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.

What to do

  • Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

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

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

M4 · Documentation accuracy10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

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

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.

P2 · Observability8.1 / 10Strong✓ Tool-verified

Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.

Method: Filesystem/Roslyn scan: structured-logging frameworks (Serilog, NLog), OpenTelemetry, and health-check endpoint patterns. Exhaustive, deterministic.

  • Only 55/80 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `.`, `dashboard`, `develop/sql_bench`, `e2e_test/iceberg` and 20 more.

What to do

  • Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
  • Add a health-check endpoint (a /health route on your axum/actix router) so orchestrators and load balancers can probe liveness/readiness.
P3 · Security & performance tooling8.0 / 10Strong✓ Tool-verified

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

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

  • `REDACTED` run(s) a static-analysis scan, but no workflow that runs one is triggered by a pull request (or a merge queue, or an unfiltered push) — the scan fires on a schedule or a manual dispatch only. A vulnerable change therefore merges clean and is reported on the next scheduled run, by which time it is on the default branch and the only remedy is a follow-up fix. Add the pull-request trigger to the workflow that runs the scan so the finding arrives before the merge rather than after it.

What to do

  • Trigger your SAST workflow on pull requests — a scan that only runs on a cron reports history, it does not gate.
  • Dependabot is configured but does not watch `nuget`, `npm`, `gomod`, `pip` — add those `package-ecosystem` entries to REDACTED 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.
P4 · Deployment & Rollback10.0 / 10Exemplary✓ Tool-verified

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

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

P5 · DR & Backup7.0 / 10Strong✓ Tool-verified

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

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

What to do

  • Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).
P6 · Release Hygiene10.0 / 10Exemplary✓ Tool-verified

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

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

P7 · Outbound HTTP resilience3.0 / 10Weak✓ Tool-verified

Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.

Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.

  • `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — dashboard/lib/api/api.ts:48
  • `RestClient.builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×2) — java/connector-node/risingwave-sink-es-7/src/main/java/com/risingwave/connector/ElasticRestHighLevelClientAdapter.java:61, java/connector-node/risingwave-sink-es-7/src/main/java/com/risingwave/connector/OpensearchRestHighLevelClientAdapter.java:58
  • `Client::builder()` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — src/common/secret/src/vault_client.rs:170
  • `reqwest::get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×5) — src/common/src/telemetry/mod.rs:180, src/connector/codec/src/decoder/json/mod.rs:133, src/connector/src/parser/utils.rs:76, …
  • `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — src/common/telemetry_event/src/util.rs:32
  • `reqwest::Client::builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×3) — src/connector/src/sink/doris.rs:493, src/connector/src/sink/http.rs:310, src/connector/src/sink/turbopuffer.rs:458
  • `reqwest::ClientBuilder::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — src/object_store/src/object/opendal_engine/s3.rs:112

What to do

  • Bound every outbound call: pass `signal: AbortSignal.timeout(ms)` to `fetch`, set `timeout` on the axios instance (`axios.create({ timeout })`), and add retries with back-off (`axios-retry`, `p-retry`) and a breaker (`opossum`, `cockatiel`) around dependencies that fail.
  • Set connect and read timeouts on every client (`RestTemplateBuilder.connectTimeout/readTimeout`, WebClient `responseTimeout`, `HttpRequest.Builder.timeout`, `HttpURLConnection.setReadTimeout`, Feign `connectTimeout`/`readTimeout` in configuration), and wrap calls to dependencies in resilience4j `@Retry`/`@CircuitBreaker`/`@TimeLimiter` (or Spring Retry).
  • Give every client a whole-request bound: `reqwest::Client::builder().timeout(Duration::from_secs(10))` (never `reqwest::get` or `Client::new()`, which have none), ureq's `timeout_global`, or wrap the call in `tokio::time::timeout`; add retry with back-off (`reqwest-retry`'s `RetryTransientMiddleware`, `backoff`) around dependencies that fail.
PF1 · Benchmark discipline10.0 / 10Exemplary✓ Tool-verified

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.

PF2 · Allocation hygiene6.7 / 10Adequate✓ Tool-verified

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.

What to do

  • Raise allocation-aware density on the hot paths — currently 37 use(s) across 24,736 production line(s) (~1.5/1k). More of the idioms below on the allocation-heavy paths climbs this toward 10.
  • Java: on hot paths, work through buffer views (ByteBuffer/LongBuffer slices, MemorySegment) instead of copies, avoid boxing with primitive collections (fastutil, Eclipse Collections, HPPC, Trove), presize collections and StringBuilders, and pool expensive buffers (Netty's pooled allocator, commons-pool).
PF3 · Async & latency hygiene10.0 / 10Exemplary✓ Tool-verified

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.

R1 · Type Safety8.2 / 10Strong✓ 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.
R10 · Code Duplication8.6 / 10Strong✓ Tool-verified

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.

  • dashboard/pages/cpu_profiling.tsx:41 · dashboard/pages/heap_profiling.tsx:48 — the two spans are one implementation copied and then locally edited — 621 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. — dashboard/pages/cpu_profiling.tsx:41
  • dashboard/pages/fragment_graph.tsx:337 · dashboard/pages/relation_graph.tsx:93 — the two spans are one implementation copied and then locally edited — 329 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. — dashboard/pages/fragment_graph.tsx:337
  • dashboard/pages/await_tree.tsx:133 · dashboard/pages/heap_profiling.tsx:277 — 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. — dashboard/pages/await_tree.tsx:133
  • dashboard/components/FragmentGraph.tsx:529 · dashboard/components/RelationGraph.tsx:221 — 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. — dashboard/components/FragmentGraph.tsx:529
  • dashboard/components/FragmentGraph.tsx:328 · dashboard/components/FragmentGraph.tsx:533 · dashboard/components/RelationGraph.tsx:223 · dashboard/components/RelationGraph.tsx:380 — 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. — dashboard/components/FragmentGraph.tsx:328
  • dashboard/lib/api/streamingStats.ts:83 · dashboard/lib/api/streamingStats.ts:118 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — dashboard/lib/api/streamingStats.ts:83
  • dashboard/components/utils/stroke-icons.tsx:124 · dashboard/components/utils/stroke-icons.tsx:233 — 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. — dashboard/components/utils/stroke-icons.tsx:124
  • dashboard/pages/cluster.tsx:293 · dashboard/pages/cluster.tsx:309 — 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. — dashboard/pages/cluster.tsx:293
  • dashboard/lib/algo.ts:31 · dashboard/lib/algo.ts:52 — the two spans are one implementation copied and then locally edited — 63 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. — dashboard/lib/algo.ts:31
  • dashboard/components/FragmentGraph.tsx:246 · dashboard/components/FragmentGraph.tsx:262 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — dashboard/components/FragmentGraph.tsx:246
  • dashboard/pages/await_tree.tsx:103 · dashboard/pages/fragment_graph.tsx:372 · dashboard/pages/heap_profiling.tsx:204 — 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. — dashboard/pages/await_tree.tsx:103
  • dashboard/components/FragmentDependencyGraph.tsx:159 · dashboard/components/FragmentDependencyGraph.tsx:171 — 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. — dashboard/components/FragmentDependencyGraph.tsx:159
  • dashboard/components/FragmentGraph.tsx:188 · dashboard/components/RelationGraph.tsx:127 — 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. — dashboard/components/FragmentGraph.tsx:188
  • dashboard/components/FragmentGraph.tsx:148 · dashboard/components/RelationGraph.tsx:92 — 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. — dashboard/components/FragmentGraph.tsx:148
  • dashboard/components/utils/backPressure.tsx:19 · dashboard/components/utils/backPressure.tsx:73 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — dashboard/components/utils/backPressure.tsx:19
  • dashboard/components/FragmentGraph.tsx:509 · dashboard/components/RelationGraph.tsx:203 — 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. — dashboard/components/FragmentGraph.tsx:509
  • dashboard/pages/fragment_graph.tsx:403 · dashboard/pages/fragment_graph.tsx:414 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — dashboard/pages/fragment_graph.tsx:403
  • dashboard/pages/await_tree.tsx:71 · dashboard/pages/await_tree.tsx:80 · dashboard/pages/await_tree.tsx:88 — all 3 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. — dashboard/pages/await_tree.tsx:71
  • dashboard/pages/fragment_graph.tsx:454 · dashboard/pages/fragment_graph.tsx:462 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — dashboard/pages/fragment_graph.tsx:454

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.
R2 · Cyclomatic Complexity10.0 / 10Exemplary✓ Tool-verified

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

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

R3 · Large Files7.7 / 10Strong✓ 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.

  • dashboard/components/FragmentGraph.tsx has 531 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — dashboard/components/FragmentGraph.tsx:1
  • dashboard/pages/fragment_graph.tsx has 477 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — dashboard/pages/fragment_graph.tsx:1
  • dashboard/components/Relations.tsx has 436 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — dashboard/components/Relations.tsx:1

What to do

  • Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
R6 · Tooling10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

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

  • 4 file(s) (~199 LoC) were excluded from dead-code analysis — declare main/module/exports or a conventional entry (src/index.*, an index.html script) so reachability can see this package.
  • 50 file(s) (~6860 LoC) were excluded from dead-code analysis. This package's entry point(s) resolved, but the walk stopped one hop in: dashboard/pages/await_tree.tsx imports '../proto/gen/monitor_service', which is not in the scanned tree. That is usually a generated or build-output module, so reachability cannot see past it and no dead-code claim is made about this package. Nothing is necessarily wrong here. — dashboard
  • 2 file(s) (~54 LoC) were excluded from dead-code analysis — declare main/module/exports or a conventional entry (src/index.*, an index.html script) so reachability can see this package. — src/utils/pgwire/tests/js
  • Nothing imports this binding — it is safe to review for removal. (×4) — dashboard/lib/api/streaming.ts:125, dashboard/lib/layout.ts:59, dashboard/lib/layout.ts:61, …
  • This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it. (×2) — dashboard/pages/fragment_graph.tsx:137, dashboard/pages/heap_profiling.tsx:43

What to do

  • Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
R8 · Dependency Hygiene5.5 / 10Adequate✓ Tool-verified

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

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

  • Declared in dashboard/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. (×3)

What to do

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

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

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

  • dashboard/components/CatalogModal.tsx → dashboard/components/Relations.tsx → dashboard/components/CatalogModal.tsx — dashboard/components/CatalogModal.tsx:36
  • dashboard/lib/api/streamingStats.ts → dashboard/pages/fragment_graph.tsx → dashboard/lib/api/streamingStats.ts — dashboard/lib/api/streamingStats.ts:17

What to do

  • Break each cycle by extracting the shared piece into a module both sides can import.
S1 · Web-Security Posture2.0 / 10Critical✓ Tool-verified

Other · Security — Read from this repository's Rust source: cryptographic hygiene (weak hash or cipher, key material fixed in the source) and outbound TLS (certificate validation, protocol version) — facts about code that hold whether or not it serves anything itself. This repository commits the configuration that serves its own HTTP surface, so that configuration was read in full for the security response headers it sets. This repository serves HTTP itself (`axum::serve(` (src/utils/openai_embedding_service/src/lib.rs:99)), so its Rust source was also read for the server controls: TLS served or HSTS set, security response headers, cookie flags and inbound validation — each credited where its Rust spelling appears in production source, not proven on every route. A Rocket 0.5 application is credited the headers Rocket's default `Shield` sends unless it attaches its own, and its cookie jar's SameSite=Strict default; a session middleware its default cookie flags.

Method: Roslyn plus filesystem scan: HSTS/security headers, secure cookies, input validation, middleware order, weak crypto (MD5/SHA1/DES); HTTPS-metadata context-aware. On a repository with no .NET source it reads JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Elixir source itself (test, vendored, generated and minified paths not) for the arms that hold whether or not the code serves HTTP: a weak hash or cipher, key material fixed in the source, a TLS client that accepts any certificate, and (JavaScript/TypeScript, Ruby, Scala, Rust and Elixir) an obsolete TLS version; the server controls are not assessed there, and a Dart, Ruby, Scala, Rust or Elixir repository that serves no HTTP of its own is N/A on them. Deterministic.

  • `set_verify(SslVerifyMode::NONE` is set on a TLS client, so every peer certificate is accepted — including one an attacker presents. Chain, expiry, revocation and hostname are all skipped, so an attacker on the network path can present any certificate and read or rewrite the traffic — the connection is encrypted to the attacker, not to the intended host. Remove the override so the TLS stack verifies the peer — reqwest, native-tls, rustls and openssl's `SslConnector` all check the chain and hostname when nothing is set. If the server presents a self-signed or privately-issued certificate, trust THAT issuer rather than every certificate: `reqwest::ClientBuilder::add_root_certificate(Certificate::from_pem(…))`, a rustls `RootCertStore` holding its CA, or `SslConnectorBuilder::set_ca_file`, which keeps the chain and hostname checks on. (×3) — src/connector/src/connector_common/postgres.rs:614, src/connector/src/connector_common/postgres.rs:627, src/connector/src/connector_common/postgres.rs:642
  • MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call. (×6) — src/expr/impl/src/scalar/md5.rs:20, src/expr/impl/src/scalar/md5.rs:25, src/expr/impl/src/scalar/sha.rs:21, …
  • None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is configured — defense in depth, even when a reverse proxy could set them. This is reported because `REDACTED` builds the web-server image that serves this application, so the configuration that would carry these headers is in this repository and was read in full. (−2.0 on this card.) — integration_tests/iceberg-sink/Dockerfile:1

What to do

  • Stop accepting every TLS certificate: delete `danger_accept_invalid_certs(true)` / `SslVerifyMode::NONE` / the rustls verifier that returns `ServerCertVerified::assertion()` unconditionally, and trust a self-signed or private server by adding its CA as a root (`add_root_certificate`, a rustls `RootCertStore`) — never by switching verification off. This repository constructs a TLS client that accepts any certificate at 3 sites, not one: `src/connector/src/connector_common/postgres.rs:614` (`set_verify(SslVerifyMode::NONE`), `src/connector/src/connector_common/postgres.rs:627` (`set_verify(SslVerifyMode::NONE`), `src/connector/src/connector_common/postgres.rs:642` (`set_verify_hostname(false)`). Each is a separate decision — fixing only the line this row cites leaves the others in place.
  • Review each MD5/SHA1 use by what it protects: replace it with SHA-256+ (or a KDF for passwords) where the digest is security-relevant, and switch it to a non-cryptographic hash (xxhash, murmurhash) where it only derives an identifier such as a cache key. This repository constructs a collision-broken hash (MD5/SHA1) at 6 sites, not one: `src/expr/impl/src/scalar/md5.rs:20` (`Md5::digest`), `src/expr/impl/src/scalar/md5.rs:25` (`Md5::digest`), `src/expr/impl/src/scalar/sha.rs:21` (`Sha1::digest`), `src/expr/impl/src/udf/wasm.rs:287` (`Md5::digest`), `src/frontend/src/user/user_authentication.rs:120` (`Md5::new`), `src/frontend/src/user/user_authentication.rs:149` (`Md5::new`). Each is a separate decision — fixing only the line this row cites leaves the others in place.
  • Set security response headers on the surface this repository serves: an `add_header` directive per header in the nginx/Caddy/Apache config, a `_headers` / `vercel.json` / `netlify.toml` entry for a static host, or `helmet()` in the HTTP server. `Content-Security-Policy` is the one that pays for itself first — it is what contains an injected script once one reaches the page — followed by `X-Content-Type-Options: nosniff` and a frame policy (`X-Frame-Options: DENY`, or CSP `frame-ancestors`). Where the app is served from a build container, the header configuration belongs in the image beside the built assets, so it ships with them rather than depending on where it lands.
X20 · Mistyped argument guard10.0 / 10Exemplary○ Nothing flagged

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 `NullPointerException` (Java, Kotlin, Scala), `ArgumentError.notNull` (Dart) or `ArgumentNullException` (F#'s `nullArg`) 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.

X23 · Unguarded diagnostic materialisation10.0 / 10Exemplary○ Nothing flagged

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.

X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether an enhanced `for` leaves the collection it is walking alone — a body that adds to or removes from the very collection the loop is iterating invalidates the fail-fast iterator it is holding, so the next `next()` throws `ConcurrentModificationException` and the remaining elements are never seen. Whether a `for` loop leaves the `RefCell` it is walking alone — safe Rust rejects a body that changes the collection its loop borrows at compile time, except through interior mutability: a `RefCell` borrowed in the loop's header stays borrowed until the loop ends, so a `borrow_mut()` of it inside the body panics with `already borrowed: BorrowMutError` and the remaining elements are never seen. Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` 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.

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.

WCAG coverage — what static analysis assessed

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

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

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

Reference — by lens

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

LensScoreRatingImpact
Code Health80%StrongSolid.
Architecture63%Adequate — gated by AX10Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity69%AdequateAcceptable, with room to improve.
Readiness59%Adequate — gated by D13, P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security50%Weak — gated by D29, D30, D31, D36, S1Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Domain Modelling68%Adequate — gated by DM7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Event Sourcing100%ExemplaryStrongest area.
Accessibility59%AdequateAcceptable, with room to improve.
Performance86%StrongSolid.
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.

  • SC1 Supply-chain hygiene — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X10 Duplicated predicate — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 5 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not included — 61 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 image/media element found in the parsed markup — AC1 not applicable here.
  • AC4 Keyboard semantics — No interactive element found in the parsed markup — AC4 not applicable here.
  • AX1 Captive dependencies — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No Go request handler (a net/http, Gin, Echo, Fiber or fasthttp handler, or a gRPC service method) is declared as a method or function, and no handler function literal writes a value captured from outside it, so no state is shared between request goroutines. No class in this Java code is a Spring, JSR-330 or CDI singleton bean. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. PHP builds its object graph per request and shares none of it between requests. Rust's compiler refuses unsynchronised shared mutation — a value shared across threads must be Sync — so the race this check looks for cannot be written. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • 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 18 — an image could not be pulled) — risingwave-standalone Pulling grafana-0 Pulling postgres-0 Error Get "https://registry-1.docker.io/v2/": Forbidden prometheus-0 Error context canceled minio-0 Error context canceled vector Error context canceled grafana-0 Error context canceled risingwave-standalone Error Get "https://registry-1.docker.io/v2/": Forbidden Error response from daemon: Get "https://registry-1.docker.io/v2/": Forbidden; the earlier `compose pull` step reported: grafana-0 Pulling minio-0 Pulling postgres-0 Error Get "https://registry-1.docker.io/v2/": Forbidden prometheus-0 Error context canceled minio-0 Error context canceled vector Error context canceled grafana-0 Error context canceled risingwave-standalone Error Get "https://registry-1.docker.io/v2/": Forbidden Error response from daemon: Get "https://registry-1.docker.io/v2/": Forbidden; the runtime sandbox reaches registries only through the in-fence pull-through mirror, so an image the mirror does not carry cannot be fetched — this is a limit of our sandbox, not of your stack; 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 a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no data at rest for these controls to protect.
  • C3 Audit Trail — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a store configured outside this repository, for instance), the trail belongs to wherever that data is stored.
  • C4 Data Retention — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no personal data whose lifetime a retention limit would bound.
  • C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no personal data for a data subject to erase, export or consent over.
  • 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 .NET solution, but this repository's production source is mostly .go, .java, .php, .py, .rb, .rs, .ts, .tsx — the .NET project files present are an immaterial minority — so the dimension does not apply.
  • D20 ADR Quality — N/A — ADRs are expected on deployable products with a user-facing host, not consumed libraries; no ADR log is required here.
  • D21 Naming Consistency — Naming consistency is measured on C# only; Go, Java, JavaScript, PHP, Python, Rust, TypeScript not measured.
  • D22 Internal API Consistency — API consistency is measured on C# only; the exposed Rust surface was not measured.
  • D23 Boundary Type-Coupling — single shared-core project — no cross-context coupling to assess
  • D24 Comment Value — D24 reads C# and Visual Basic comments only; comments in this repository's .go, .java, .php, .py, .rb, .rs, .ts, .tsx source were not judged.
  • 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) — 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.
  • D39 IL Efficiency — IL not measured — the analyzer's build of the target did not succeed
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D7 Architectural Integrity — no checkable ADRs and no dependency cycles — architectural integrity not assessed
  • D8 Code Coverage — 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 could not be measured — the jest suite in src/utils/pgwire/tests/js/ ran and not one test passed (FAIL test/pgwire.test.ts), so the coverage would describe the failed run, not the code. 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. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan. Alternatively, commit the lcov/Cobertura report your CI produces and it is read without a re-run.
  • DM3 Integration-event coupling — no integration events detected — coupling check not applicable
  • 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
  • ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
  • GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
  • IC1 Incompleteness & stubs — reported, not scored — this repository's C# declares no analysable method bodies (a constants, record or DTO assembly), and this score is a density of unfinished work per method, which has no denominator here. The file-level signals below were still collected and are shown in full
  • P12 CI test-gate honesty — 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.
  • P8 Schema migrations — Hibernate, SQLAlchemy, SeaORM, 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.
  • R4 Test Coverage — 9 test file(s) reach none of 47 production file(s) via imports — exercised outside the JS import graph (integration/bundled), not import-reachable
  • R5 Dependency Freshness — uses a pnpm lockfile — dependency freshness not measured here; JS/npm CVEs are scored in D30 (Dependency Vulnerabilities), which answers every ecosystem
  • X1 Async correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X12 Unreachable branch — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X13 Undrained process stream — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X14 Bypassable address classification — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X15 Unvalidated length from an untrusted reader — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X16 Unfloored truncation loop — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X17 Uncapped recursion over a caller-supplied document — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X18 Disposal-pattern correctness — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X19 Unrestored process-global state — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X2 Cancellation propagation — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X21 Side-effecting pattern guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X22 Contradicted release guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X24 Document value interpolated into markup unescaped — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X25 Inert configuration knob — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X26 Unsynchronised callback handoff — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X29 Per-element action decided by a fixed element — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X3 Exception handling — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X30 Support guard that admits what it rejects — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X32 Type resolved by simple name across every loaded assembly — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X4 Structured logging — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

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

Critical — 335 finding(s)
D35 · Change Coupling · Boundary-crossing change coupling · ×77
  • Boundary-crossing change coupling: pure.rs ↔ strong.rs src/frontend/src/expr/pure.rs:1 — `src/frontend/src/expr/pure.rs` (context expr) and `src/frontend/src/optimizer/plan_expr_visitor/strong.rs` (context optimizer) sit in DIFFERENT parts of the tree yet change together 93% of the time (43 of the 46 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 43 shared commits counted here, the most recent 3 are `6e8b2689` feat(expr): support volatile timestamp and uuid functions (#26362); `4339a18e` feat(expr): support array overlap predicates (#25597); `55bf4572` feat(expr): implement crc32 and crc32c bytea functions (#24964) — run `git show` on any of them.
  • Boundary-crossing change coupling: mock_hummock_meta_client.rs ↔ hummock_meta_client.rs src/meta/src/hummock/mock_hummock_meta_client.rs:1 — `src/meta/src/hummock/mock_hummock_meta_client.rs` (context meta) and `src/storage/src/hummock/hummock_meta_client.rs` (context storage) sit in DIFFERENT parts of the tree yet change together 93% of the time (14 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 14 shared commits counted here, the most recent 3 are `68694f40` feat(compaction): support manual compact target level (#25765); `78494334` refactor(meta): improve the determinism of trigger_manual_compaction …; `1611e1bf` feat(proto): introduce iceberg compaction proto (#21778) — run `git show` on any of them.
  • Boundary-crossing change coupling: SinkWriterStreamObserver.java ↔ remote.rs java/connector-node/risingwave-connector-service/src/main/java/com/risingwave/connector/SinkWriterStreamObserver.java:1 — `java/connector-node/risingwave-connector-service/src/main/java/com/risingwave/connector/SinkWriterStreamObserver.java` (context java) and `src/connector/src/sink/remote.rs` (context connector) sit in DIFFERENT parts of the tree yet change together 83% of the time (10 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `001ac816` fix: change JNI sink normal logs to debug level (#19758); `ff495144` fix: deprecate `SinkPayloadFormat` (#16723); `f47a892e` feat(sink): support es sink struct and refactor es sink (#14231) — run `git show` on any of them.
  • Boundary-crossing change coupling: lib.rs ↔ meta_client.rs src/meta/service/src/lib.rs:1 — `src/meta/service/src/lib.rs` (context meta) and `src/rpc_client/src/meta_client.rs` (context rpc_client) sit in DIFFERENT parts of the tree yet change together 83% of the time (10 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `f2d2606b` refactor: deduplicate await-tree fetching & add registry for meta nod…; `1611e1bf` feat(proto): introduce iceberg compaction proto (#21778); `5bb02eae` feat(iceberg): support iceberg jdbc catalog views (#21400) — run `git show` on any of them.
  • Boundary-crossing change coupling: catalog_service.rs ↔ ddl_controller.rs src/frontend/src/catalog/catalog_service.rs:1 — `src/frontend/src/catalog/catalog_service.rs` (context catalog) and `src/meta/src/rpc/ddl_controller.rs` (context meta) sit in DIFFERENT parts of the tree yet change together 79% of the time (37 of the 47 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 37 shared commits counted here, the most recent 3 are `642a453c` fix(meta): synchronize catalog versions with frontend notifications (…; `b927f6c8` feat(ddl): support resource group alter for databases, sinks and inde…; `fa7a8840` feat(meta): support wait jobs (#25133) — run `git show` on any of them.
  • Boundary-crossing change coupling: risingwave-dev-dashboard.dashboard.py ↔ compactor_metrics.rs grafana/risingwave-dev-dashboard.dashboard.py:1 — `grafana/risingwave-dev-dashboard.dashboard.py` (context grafana) and `src/storage/src/monitor/compactor_metrics.rs` (context storage) sit in DIFFERENT parts of the tree yet change together 79% of the time (11 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `92f70db9` feat(storage): support block_size metrics (#17660); `035da38d` feat(storage): Improve task measurement on the compactor side with pa…; `3e976cc3` chore(metric): fix table id filter and some panel reorgs (#12148) — run `git show` on any of them.
  • Boundary-crossing change coupling: builtin_scalar.rs ↔ strong.rs src/frontend/src/binder/expr/function/builtin_scalar.rs:1 — `src/frontend/src/binder/expr/function/builtin_scalar.rs` (context binder) and `src/frontend/src/optimizer/plan_expr_visitor/strong.rs` (context optimizer) sit in DIFFERENT parts of the tree yet change together 78% of the time (28 of the 36 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 28 shared commits counted here, the most recent 3 are `6e8b2689` feat(expr): support volatile timestamp and uuid functions (#26362); `4339a18e` feat(expr): support array overlap predicates (#25597); `55bf4572` feat(expr): implement crc32 and crc32c bytea functions (#24964) — run `git show` on any of them.
  • Boundary-crossing change coupling: builtin_scalar.rs ↔ pure.rs src/frontend/src/binder/expr/function/builtin_scalar.rs:1 — `src/frontend/src/binder/expr/function/builtin_scalar.rs` (context binder) and `src/frontend/src/expr/pure.rs` (context expr) sit in DIFFERENT parts of the tree yet change together 78% of the time (28 of the 36 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 28 shared commits counted here, the most recent 3 are `6e8b2689` feat(expr): support volatile timestamp and uuid functions (#26362); `4339a18e` feat(expr): support array overlap predicates (#25597); `55bf4572` feat(expr): implement crc32 and crc32c bytea functions (#24964) — run `git show` on any of them.
  • Boundary-crossing change coupling: Binding.java ↔ macros.rs java/java-binding/src/main/java/com/risingwave/java/binding/Binding.java:1 — `java/java-binding/src/main/java/com/risingwave/java/binding/Binding.java` (context java) and `src/jni_core/src/macros.rs` (context jni_core) sit in DIFFERENT parts of the tree yet change together 78% of the time (14 of the 18 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 14 shared commits counted here, the most recent 3 are `aace224a` fix(cdc): share type compatibility validation for schema changes (#26…; `d21c9335` fix(mysql-cdc): introduce `OpendalSchemaHistory` to resolve the schem…; `54711c25` refactor(connector):  correctly log java exceptions (#20840) — run `git show` on any of them.
  • Boundary-crossing change coupling: opts.rs ↔ state_table.rs src/storage/hummock_trace/src/opts.rs:1 — `src/storage/hummock_trace/src/opts.rs` (context storage) and `src/stream/src/common/table/state_table.rs` (context stream) sit in DIFFERENT parts of the tree yet change together 75% of the time (12 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 12 shared commits counted here, the most recent 3 are `f6628e44` feat(observability): add fragment-level immutable memtable memory met…; `11222b5d` feat(storage): support state clean for watermark in either pk or valu…; `053e1e61` feat(storage): batch add flushed imm to uploader (#22342) — run `git show` on any of them.
  • Boundary-crossing change coupling: rw_fragments.rs ↔ stream_service.rs src/frontend/src/catalog/system_catalog/rw_catalog/rw_fragments.rs:1 — `src/frontend/src/catalog/system_catalog/rw_catalog/rw_fragments.rs` (context catalog) and `src/meta/service/src/stream_service.rs` (context meta) sit in DIFFERENT parts of the tree yet 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, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `914f962d` perf: avoid fetching stream nodes in system catalogs (#24641); `3512bee3` feat: expose parallelism_policy in fragment metadata and system catal…; `aa180c40` feat(meta): let stream actors in fragment share same stream node (#20… — run `git show` on any of them.
  • Boundary-crossing change coupling: vnode_placement.rs ↔ scale.rs src/common/src/vnode_mapping/vnode_placement.rs:1 — `src/common/src/vnode_mapping/vnode_placement.rs` (context common) and `src/meta/src/stream/scale.rs` (context meta) sit in DIFFERENT parts of the tree yet 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, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `709894d8` fix: Fix the panic issue with the parallelism() call (#19849); `9bc0b1fb` feat: introduce node label (#19153); `8d5b62b1` feat: variable vnode count support in batch/streaming scheduler (#18407) — run `git show` on any of them.
  • Boundary-crossing change coupling: hummock_service.rs ↔ hummock_meta_client.rs src/meta/service/src/hummock_service.rs:1 — `src/meta/service/src/hummock_service.rs` (context meta) and `src/rpc_client/src/hummock_meta_client.rs` (context rpc_client) sit in DIFFERENT parts of the tree yet change together 71% of the time (10 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `68694f40` feat(compaction): support manual compact target level (#25765); `78494334` refactor(meta): improve the determinism of trigger_manual_compaction …; `1611e1bf` feat(proto): introduce iceberg compaction proto (#21778) — run `git show` on any of them.
  • Boundary-crossing change coupling: hummock_service.rs ↔ main.rs src/ctl/src/common/hummock_service.rs:1 — `src/ctl/src/common/hummock_service.rs` (context ctl) and `src/storage/hummock_test/src/bin/replay/main.rs` (context storage) sit in DIFFERENT parts of the tree yet change together 71% of the time (12 of the 17 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 12 shared commits counted here, the most recent 3 are `cd1686d2` fix: fix sstable serde to avoid losing bloom filter (#24025); `6a70b106` feat(storage): support hummock FLAT index (#21820); `7688ce1f` chore: bump foyer + mixtrics (#22360) — run `git show` on any of them.
  • Boundary-crossing change coupling: cluster_service.rs ↔ meta_client.rs src/meta/service/src/cluster_service.rs:1 — `src/meta/service/src/cluster_service.rs` (context meta) and `src/rpc_client/src/meta_client.rs` (context rpc_client) sit in DIFFERENT parts of the tree yet change together 71% of the time (12 of the 17 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 12 shared commits counted here, the most recent 3 are `4afdad11` fix(batch): mask serving workers with version mismatch (#26559); `086b9030` refactor(meta): deprecate is_unschedulable for worker (#25003); `200ed05c` feat(meta): add a rpc to fetch meta store endpoint (#19594) — run `git show` on any of them.
  • Boundary-crossing change coupling: function_catalog.rs ↔ REDACTED src/frontend/src/catalog/function_catalog.rs:1 — `src/frontend/src/catalog/function_catalog.rs` (context catalog) and `src/meta/src/controller/mod.rs` (context meta) sit in DIFFERENT parts of the tree yet change together 70% of the time (7 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `4dd038f1` chore(function): expose created_at and created_at_cluster_version for…; `0cc54b3f` feat(udf): introduce async and batched JavaScript UDF (#20403); `94154c03` refactor(udf): remove `function_type` field previously used by Deno U… — run `git show` on any of them.
  • Boundary-crossing change coupling: REDACTED ↔ parser.rs src/frontend/src/handler/mod.rs:1 — `src/frontend/src/handler/mod.rs` (context handler) and `src/sqlparser/src/parser.rs` (context sqlparser) sit in DIFFERENT parts of the tree yet change together 69% of the time (84 of the 122 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 84 shared commits counted here, the most recent 3 are `7c5bb80f` feat(iceberg): support orphan file cleanup (#26303); `7897e558` feat(storage): support runtime file cache clearing (#26577); `013bc9c9` feat(meta): support typed fragment rate limits (#26183) — run `git show` on any of them.
  • Boundary-crossing change coupling: hummock_service.rs ↔ meta_client.rs src/meta/service/src/hummock_service.rs:1 — `src/meta/service/src/hummock_service.rs` (context meta) and `src/rpc_client/src/meta_client.rs` (context rpc_client) sit in DIFFERENT parts of the tree yet change together 67% of the time (24 of the 36 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 24 shared commits counted here, the most recent 3 are `68694f40` feat(compaction): support manual compact target level (#25765); `78494334` refactor(meta): improve the determinism of trigger_manual_compaction …; `1611e1bf` feat(proto): introduce iceberg compaction proto (#21778) — run `git show` on any of them.
  • Boundary-crossing change coupling: hummock_service.rs ↔ hummock_meta_client.rs src/meta/service/src/hummock_service.rs:1 — `src/meta/service/src/hummock_service.rs` (context meta) and `src/storage/src/hummock/hummock_meta_client.rs` (context storage) sit in DIFFERENT parts of the tree yet change together 67% of the time (10 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `68694f40` feat(compaction): support manual compact target level (#25765); `78494334` refactor(meta): improve the determinism of trigger_manual_compaction …; `1611e1bf` feat(proto): introduce iceberg compaction proto (#21778) — run `git show` on any of them.
  • Boundary-crossing change coupling: SinkWriterStreamObserver.java ↔ connector_client.rs java/connector-node/risingwave-connector-service/src/main/java/com/risingwave/connector/SinkWriterStreamObserver.java:1 — `java/connector-node/risingwave-connector-service/src/main/java/com/risingwave/connector/SinkWriterStreamObserver.java` (context java) and `src/rpc_client/src/connector_client.rs` (context rpc_client) sit in DIFFERENT parts of the tree yet change together 67% of the time (8 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `ff495144` fix: deprecate `SinkPayloadFormat` (#16723); `f47a892e` feat(sink): support es sink struct and refactor es sink (#14231); `27fbce9f` refactor(sink): remove unnecessary StartEpoch of remote sink (#13806) — run `git show` on any of them.
  • Boundary-crossing change coupling: alter_streaming_rate_limit.rs ↔ ddl.rs src/frontend/src/handler/alter_streaming_rate_limit.rs:1 — `src/frontend/src/handler/alter_streaming_rate_limit.rs` (context handler) and `src/sqlparser/src/ast/ddl.rs` (context sqlparser) sit in DIFFERENT parts of the tree yet change together 67% of the time (8 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `91a0a91c` feat(frontend): support sink backfill rate limit (#24075); `9cc5d229` feat(frontend,meta): support alter fragment rate limit (#20795); `68c38d7b` revert:feat(frontend): support alter source pause/resume (#19636) (#2… — run `git show` on any of them.
  • Boundary-crossing change coupling: alter_streaming_rate_limit.rs ↔ parser.rs src/frontend/src/handler/alter_streaming_rate_limit.rs:1 — `src/frontend/src/handler/alter_streaming_rate_limit.rs` (context handler) and `src/sqlparser/src/parser.rs` (context sqlparser) sit in DIFFERENT parts of the tree yet change together 67% of the time (8 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `91a0a91c` feat(frontend): support sink backfill rate limit (#24075); `9cc5d229` feat(frontend,meta): support alter fragment rate limit (#20795); `68c38d7b` revert:feat(frontend): support alter source pause/resume (#19636) (#2… — run `git show` on any of them.
  • Boundary-crossing change coupling: parser.rs ↔ pg_response.rs src/sqlparser/src/parser.rs:1 — `src/sqlparser/src/parser.rs` (context sqlparser) and `src/utils/pgwire/src/pg_response.rs` (context utils) sit in DIFFERENT parts of the tree yet change together 65% of the time (17 of the 26 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 17 shared commits counted here, the most recent 3 are `feb8d927` feat: support alter compaction group config via sql (#24346); `fa7a8840` feat(meta): support wait jobs (#25133); `38175bba` feat(sql): add BACKUP and delete meta snapshot commands (#25042) — run `git show` on any of them.
  • Boundary-crossing change coupling: hummock_service.rs ↔ hummock_iterator.rs src/ctl/src/common/hummock_service.rs:1 — `src/ctl/src/common/hummock_service.rs` (context ctl) and `src/java_binding/src/hummock_iterator.rs` (context java_binding) sit in DIFFERENT parts of the tree yet change together 65% of the time (11 of the 17 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `cd1686d2` fix: fix sstable serde to avoid losing bloom filter (#24025); `6a70b106` feat(storage): support hummock FLAT index (#21820); `7688ce1f` chore: bump foyer + mixtrics (#22360) — run `git show` on any of them.
  • Boundary-crossing change coupling: binary_op.rs ↔ pure.rs src/frontend/src/binder/expr/binary_op.rs:1 — `src/frontend/src/binder/expr/binary_op.rs` (context binder) and `src/frontend/src/expr/pure.rs` (context expr) sit in DIFFERENT parts of the tree yet change together 64% of the time (16 of the 25 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 16 shared commits counted here, the most recent 3 are `4339a18e` feat(expr): support array overlap predicates (#25597); `0444a8fc` feat(expr): `vector || vector` concatenation (#22745); `99a1c26d` feat(expr): more `vector` distance functions (#22647) — run `git show` on any of them.
  • + 52 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 41 more in this group — see findings.md.
D31 · IaC & Container Security · High IaC · ×59
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 34 more in this group — see findings.md.
D34 · Knowledge Freshness · Orphaned knowledge · ×43
  • Orphaned knowledge src/meta/src/stream/stream_graph/assignment.rs:1 — No living knowledge remains for this large file — its last meaningful change has decayed away, so if it breaks, no one currently understands it. It does carry its own tests, so the behaviour is pinned even though the understanding is gone: schedule a read-through, using those tests as the specification, before the next change lands here.
  • Orphaned knowledge java/connector-node/risingwave-source-cdc/src/main/java/io/debezium/connector/postgresql/PostgresConnectorConfig.java:1 — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge src/stream/src/executor/over_window/frame_finder.rs:1 — No living knowledge remains for this large file — its last meaningful change has decayed away, so if it breaks, no one currently understands it. It does carry its own tests, so the behaviour is pinned even though the understanding is gone: schedule a read-through, using those tests as the specification, before the next change lands here.
  • Orphaned knowledge src/meta/model/migration/src/m20230908_072257_init.rs:1 — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge src/stream/src/executor/dynamic_filter.rs:1 — No living knowledge remains for this large file — its last meaningful change has decayed away, so if it breaks, no one currently understands it. It does carry its own tests, so the behaviour is pinned even though the understanding is gone: schedule a read-through, using those tests as the specification, before the next change lands here.
  • Orphaned knowledge src/connector/src/source/kafka/stats.rs:1 — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge src/connector/src/parser/debezium/mongo_json_parser.rs:1 — No living knowledge remains for this large file — its last meaningful change has decayed away, so if it breaks, no one currently understands it. It does carry its own tests, so the behaviour is pinned even though the understanding is gone: schedule a read-through, using those tests as the specification, before the next change lands here.
  • Orphaned knowledge src/error/src/code.rs:1 — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge java/connector-node/risingwave-source-cdc/src/main/java/io/debezium/connector/postgresql/connection/pgoutput/PgOutputMessageDecoder.java:1 — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge src/expr/impl/src/window_function/buffer.rs:1 — No living knowledge remains for this large file — its last meaningful change has decayed away, so if it breaks, no one currently understands it. It does carry its own tests, so the behaviour is pinned even though the understanding is gone: schedule a read-through, using those tests as the specification, before the next change lands here.
  • Orphaned knowledge src/stream/src/executor/aggregate/minput.rs:1 — No living knowledge remains for this large file — its last meaningful change has decayed away, so if it breaks, no one currently understands it. It does carry its own tests, so the behaviour is pinned even though the understanding is gone: schedule a read-through, using those tests as the specification, before the next change lands here.
  • Orphaned knowledge src/frontend/src/optimizer/plan_node/generic/agg.rs:1 — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge src/stream/src/executor/top_n/top_n_cache.rs:1 — No living knowledge remains for this large file — its last meaningful change has decayed away, so if it breaks, no one currently understands it. It does carry its own tests, so the behaviour is pinned even though the understanding is gone: schedule a read-through, using those tests as the specification, before the next change lands here.
  • Orphaned knowledge src/utils/resource_util/src/lib.rs:1 — No living knowledge remains for this large file — its last meaningful change has decayed away, so if it breaks, no one currently understands it. It does carry its own tests, so the behaviour is pinned even though the understanding is gone: schedule a read-through, using those tests as the specification, before the next change lands here.
  • Orphaned knowledge src/frontend/src/handler/handle_privilege.rs:1 — No living knowledge remains for this large file — its last meaningful change has decayed away, so if it breaks, no one currently understands it. It does carry its own tests, so the behaviour is pinned even though the understanding is gone: schedule a read-through, using those tests as the specification, before the next change lands here.
  • Orphaned knowledge src/meta/src/rpc/election/sql.rs:1 — No living knowledge remains for this large file — its last meaningful change has decayed away, so if it breaks, no one currently understands it. It does carry its own tests, so the behaviour is pinned even though the understanding is gone: schedule a read-through, using those tests as the specification, before the next change lands here.
  • Orphaned knowledge src/stream/src/executor/aggregate/hash_agg.rs:1 — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge src/expr/impl/src/scalar/cmp.rs:1 — No living knowledge remains for this large file — its last meaningful change has decayed away, so if it breaks, no one currently understands it. It does carry its own tests, so the behaviour is pinned even though the understanding is gone: schedule a read-through, using those tests as the specification, before the next change lands here.
  • Orphaned knowledge src/stream/src/executor/upstream_sink_union.rs:1 — No living knowledge remains for this large file — its last meaningful change has decayed away, so if it breaks, no one currently understands it. It does carry its own tests, so the behaviour is pinned even though the understanding is gone: schedule a read-through, using those tests as the specification, before the next change lands here.
  • Orphaned knowledge src/stream/src/executor/aggregate/distinct.rs:1 — No living knowledge remains for this large file — its last meaningful change has decayed away, so if it breaks, no one currently understands it. It does carry its own tests, so the behaviour is pinned even though the understanding is gone: schedule a read-through, using those tests as the specification, before the next change lands here.
  • Orphaned knowledge src/common/src/array/struct_array.rs:1 — No living knowledge remains for this large file — its last meaningful change has decayed away, so if it breaks, no one currently understands it. It does carry its own tests, so the behaviour is pinned even though the understanding is gone: schedule a read-through, using those tests as the specification, before the next change lands here.
  • Orphaned knowledge src/common/src/util/memcmp_encoding.rs:1 — No living knowledge remains for this large file — its last meaningful change has decayed away, so if it breaks, no one currently understands it. It does carry its own tests, so the behaviour is pinned even though the understanding is gone: schedule a read-through, using those tests as the specification, before the next change lands here.
  • Orphaned knowledge src/batch/executors/src/executor/join/local_lookup_join.rs:1 — No living knowledge remains for this large file — its last meaningful change has decayed away, so if it breaks, no one currently understands it. It does carry its own tests, so the behaviour is pinned even though the understanding is gone: schedule a read-through, using those tests as the specification, before the next change lands here.
  • Orphaned knowledge src/expr/macro/src/lib.rs:1 — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge src/frontend/src/handler/create_table/col_id_gen.rs:1 — No living knowledge remains for this large file — its last meaningful change has decayed away, so if it breaks, no one currently understands it. It does carry its own tests, so the behaviour is pinned even though the understanding is gone: schedule a read-through, using those tests as the specification, before the next change lands here.
  • + 18 more in this group — see findings.md.
D13 · REDACTED Scanning · Leaked secret · ×21
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · High CVE · ×14
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
DM4 · Rich vs anemic domain model · Anemic domain model · ×5
  • Anemic domain model: BatchManagerMetrics src/batch/src/monitor/stats.rs:111 — `BatchManagerMetrics` is a data-only domain entity with `pub` mutable state and no invariant-enforcing behaviour of its own, while the repo holds the logic in a foreign service/manager/use-case — the anemic domain model. Move the behaviour onto the entity so it enforces its own invariants (or make it an immutable value object with private fields) rather than being driven from outside.
  • Anemic domain model: BatchSpillMetrics src/batch/src/monitor/stats.rs:154 — `BatchSpillMetrics` is a data-only domain entity with `pub` mutable state and no invariant-enforcing behaviour of its own, while the repo holds the logic in a foreign service/manager/use-case — the anemic domain model. Move the behaviour onto the entity so it enforces its own invariants (or make it an immutable value object with private fields) rather than being driven from outside.
  • Anemic domain model: DistributedQueryMetrics src/frontend/src/scheduler/distributed/stats.rs:26 — `DistributedQueryMetrics` is a data-only domain entity with `pub` mutable state and no invariant-enforcing behaviour of its own, while the repo holds the logic in a foreign service/manager/use-case — the anemic domain model. Move the behaviour onto the entity so it enforces its own invariants (or make it an immutable value object with private fields) rather than being driven from outside.
  • Anemic domain model: RefreshCycleActors src/meta/src/stream/refresh_manager.rs:59 — `RefreshCycleActors` is a data-only domain entity with `pub` mutable state and no invariant-enforcing behaviour of its own, while the repo holds the logic in a foreign service/manager/use-case — the anemic domain model. Move the behaviour onto the entity so it enforces its own invariants (or make it an immutable value object with private fields) rather than being driven from outside.
  • Anemic domain model: HummockStateStoreMetrics src/storage/src/monitor/hummock_state_store_metrics.rs:43 — `HummockStateStoreMetrics` is a data-only domain entity with `pub` mutable state and no invariant-enforcing behaviour of its own, while the repo holds the logic in a foreign service/manager/use-case — the anemic domain model. Move the behaviour onto the entity so it enforces its own invariants (or make it an immutable value object with private fields) rather than being driven from outside.
S1 · Web-Security Posture · TLS certificate validation disabled · ×3
  • TLS certificate validation disabled src/connector/src/connector_common/postgres.rs:614 — `set_verify(SslVerifyMode::NONE` is set on a TLS client, so every peer certificate is accepted — including one an attacker presents. Chain, expiry, revocation and hostname are all skipped, so an attacker on the network path can present any certificate and read or rewrite the traffic — the connection is encrypted to the attacker, not to the intended host. Remove the override so the TLS stack verifies the peer — reqwest, native-tls, rustls and openssl's `SslConnector` all check the chain and hostname when nothing is set. If the server presents a self-signed or privately-issued certificate, trust THAT issuer rather than every certificate: `reqwest::ClientBuilder::add_root_certificate(Certificate::from_pem(…))`, a rustls `RootCertStore` holding its CA, or `SslConnectorBuilder::set_ca_file`, which keeps the chain and hostname checks on.
  • TLS certificate validation disabled src/connector/src/connector_common/postgres.rs:627 — `set_verify(SslVerifyMode::NONE` is set on a TLS client, so every peer certificate is accepted — including one an attacker presents. Chain, expiry, revocation and hostname are all skipped, so an attacker on the network path can present any certificate and read or rewrite the traffic — the connection is encrypted to the attacker, not to the intended host. Remove the override so the TLS stack verifies the peer — reqwest, native-tls, rustls and openssl's `SslConnector` all check the chain and hostname when nothing is set. If the server presents a self-signed or privately-issued certificate, trust THAT issuer rather than every certificate: `reqwest::ClientBuilder::add_root_certificate(Certificate::from_pem(…))`, a rustls `RootCertStore` holding its CA, or `SslConnectorBuilder::set_ca_file`, which keeps the chain and hostname checks on.
  • TLS certificate validation disabled src/connector/src/connector_common/postgres.rs:642 — `set_verify(SslVerifyMode::NONE` is set on a TLS client, so every peer certificate is accepted — including one an attacker presents. Chain, expiry, revocation and hostname are all skipped, so an attacker on the network path can present any certificate and read or rewrite the traffic — the connection is encrypted to the attacker, not to the intended host. Remove the override so the TLS stack verifies the peer — reqwest, native-tls, rustls and openssl's `SslConnector` all check the chain and hostname when nothing is set. If the server presents a self-signed or privately-issued certificate, trust THAT issuer rather than every certificate: `reqwest::ClientBuilder::add_root_certificate(Certificate::from_pem(…))`, a rustls `RootCertStore` holding its CA, or `SslConnectorBuilder::set_ca_file`, which keeps the chain and hostname checks on.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Critical CVE · ×2
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Critical vulnerability · ×2
  • REDACTED
  • REDACTED
R9 · Circular Imports · Import cycle (2 files) · ×2
  • Import cycle (2 files) dashboard/components/CatalogModal.tsx:36 — dashboard/components/CatalogModal.tsx → dashboard/components/Relations.tsx → dashboard/components/CatalogModal.tsx
  • Import cycle (2 files) dashboard/lib/api/streamingStats.ts:17 — dashboard/lib/api/streamingStats.ts → dashboard/pages/fragment_graph.tsx → dashboard/lib/api/streamingStats.ts
D28 · Secrets (history) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
Serious — 3002 finding(s)
D3 · God Classes · MethodTooLong · ×235
  • MethodTooLong: DatabaseCheckpointControl.apply_command src/meta/src/barrier/checkpoint/state.rs:460 — MethodTooLong — apply_command runs 1208 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 1108 over it, 12.08× 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: StreamingMetrics.new src/stream/src/executor/monitor/streaming_stats.rs:274 — MethodTooLong — new runs 1087 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 987 over it, 10.87× 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: Migration.up src/meta/model/migration/src/m20230908_072257_init.rs:12 — MethodTooLong — up runs 859 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 759 over it, 8.59× 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: MetaMetrics.new src/meta/src/rpc/metrics.rs:296 — MethodTooLong — new runs 644 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 544 over it, 6.44× 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: Statement.fmt_unchecked src/sqlparser/src/ast/mod.rs:1827 — MethodTooLong — fmt_unchecked runs 622 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 522 over it, 6.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: Binder.bind_builtin_scalar_function src/frontend/src/binder/expr/function/builtin_scalar.rs:31 — MethodTooLong — bind_builtin_scalar_function runs 598 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 498 over it, 5.98× 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: PartialGraphRecoverer.inject_database_initial_barrier src/meta/src/barrier/rpc.rs:622 — MethodTooLong — inject_database_initial_barrier runs 569 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 469 over it, 5.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.
  • MethodTooLong: CdcBackfillExecutor.execute_inner src/stream/src/executor/backfill/cdc/cdc_backfill.rs:488 — MethodTooLong — execute_inner runs 500 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 400 over it, 5.00× 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: ParallelizedCdcBackfillExecutor.execute_inner src/stream/src/executor/backfill/cdc/cdc_backill_v2.rs:111 — MethodTooLong — execute_inner runs 480 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 380 over it, 4.80× 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: HummockStateStoreMetrics.new src/storage/src/monitor/hummock_state_store_metrics.rs:114 — MethodTooLong — new runs 427 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 327 over it, 4.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: FunctionAttr.generate_build_scalar_function src/expr/macro/src/gen.rs:198 — MethodTooLong — generate_build_scalar_function 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.
  • MethodTooLong: JsonParseOptions.parse src/connector/src/parser/unified/json.rs:277 — MethodTooLong — parse runs 377 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 277 over it, 3.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.
  • MethodTooLong: SourceBackfillExecutorInner.execute src/stream/src/executor/source/source_backfill_executor.rs:383 — MethodTooLong — execute runs 370 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 270 over it, 3.70× 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: SourceExecutor.execute_inner src/stream/src/executor/source/source_executor.rs:616 — MethodTooLong — execute_inner runs 339 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 239 over it, 3.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: ArrangementBackfillExecutor.execute_inner src/stream/src/executor/backfill/arrangement_backfill.rs:109 — MethodTooLong — execute_inner 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.
  • MethodTooLong: MaterializeExecutor.execute_inner src/stream/src/executor/mview/materialize.rs:373 — MethodTooLong — execute_inner runs 323 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 223 over it, 3.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: LocalityProviderExecutor.execute_inner REDACTED:660 — MethodTooLong — execute_inner runs 321 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 221 over it, 3.21× 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: ImpureAnalyzer.visit_function_call src/frontend/src/expr/pure.rs:101 — MethodTooLong — visit_function_call runs 304 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 204 over it, 3.04× 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: GlobalBarrierWorker.recovery_inner src/meta/src/barrier/worker.rs:1154 — MethodTooLong — recovery_inner runs 301 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 201 over it, 3.01× 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: CatalogController.update_connection_and_dependent_objects_props src/meta/src/controller/streaming_job.rs:3356 — MethodTooLong — update_connection_and_dependent_objects_props runs 299 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 199 over it, 2.99× 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: Strong.is_null_function_call src/frontend/src/optimizer/plan_expr_visitor/strong.rs:76 — MethodTooLong — is_null_function_call runs 297 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 197 over it, 2.97× 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: LocalQueryExecution.convert_plan_node src/frontend/src/scheduler/local.rs:260 — MethodTooLong — convert_plan_node runs 283 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 183 over it, 2.83× 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: CatalogController.create_job_catalog src/meta/src/controller/streaming_job.rs:533 — MethodTooLong — create_job_catalog runs 279 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 179 over it, 2.79× 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: GlobalBarrierWorker.run_inner src/meta/src/barrier/worker.rs:513 — MethodTooLong — run_inner runs 273 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 173 over it, 2.73× 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: CatalogController.alter_owner src/meta/src/controller/catalog/alter_op.rs:281 — MethodTooLong — alter_owner runs 270 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 170 over it, 2.70× 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.
  • + 210 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×200
  • FileTooLong: src/parser.rs src/sqlparser/src/parser.rs — FileTooLong — 4599 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 97% of them inside a single declaration: Parser (198-6884). The bar is 500 significant lines; this is 4099 over it, 9.20× 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: controller/streaming_job.rs src/meta/src/controller/streaming_job.rs — FileTooLong — 3046 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 89% of them inside a single declaration: CatalogController (249-3969). The bar is 500 significant lines; this is 2546 over it, 6.09× 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: ast/mod.rs src/sqlparser/src/ast/mod.rs — FileTooLong — 2676 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 2176 over it, 5.35× 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/meta_client.rs src/rpc_client/src/meta_client.rs — FileTooLong — 2175 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: MetaClient (4 blocks, 141-2309). The bar is 500 significant lines; this is 1675 over it, 4.35× 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: controller/utils.rs src/meta/src/controller/utils.rs — FileTooLong — 1962 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 61 free functions. The bar is 500 significant lines; this is 1462 over it, 3.92× 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: rpc/ddl_controller.rs src/meta/src/rpc/ddl_controller.rs — FileTooLong — 1941 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 82% of them inside a single declaration: DdlController (2 blocks, 282-2487). The bar is 500 significant lines; this is 1441 over it, 3.88× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: join/hash_join.rs src/batch/executors/src/executor/join/hash_join.rs — FileTooLong — 1730 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 73% of them inside a single declaration: HashJoinExecutor (5 blocks, 64-2518). The bar is 500 significant lines; this is 1230 over it, 3.46× 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: monitor/streaming_stats.rs src/stream/src/executor/monitor/streaming_stats.rs — FileTooLong — 1693 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 93% of them inside a single declaration: StreamingMetrics (2 blocks, 46-2058). The bar is 500 significant lines; this is 1193 over it, 3.39× 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: table/state_table.rs src/stream/src/common/table/state_table.rs — FileTooLong — 1689 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 1189 over it, 3.38× 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: controller/fragment.rs src/meta/src/controller/fragment.rs — FileTooLong — 1584 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 88% of them inside a single declaration: CatalogController (290-2165). The bar is 500 significant lines; this is 1084 over it, 3.17× 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: handler/create_table.rs src/frontend/src/handler/create_table.rs — FileTooLong — 1568 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 1068 over it, 3.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: src/ddl_service.rs src/meta/service/src/ddl_service.rs — FileTooLong — 1568 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 92% of them inside a single declaration: DdlServiceImpl (3 blocks, 69-2022). The bar is 500 significant lines; this is 1068 over it, 3.14× 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: checkpoint/state.rs src/meta/src/barrier/checkpoint/state.rs — FileTooLong — 1495 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: DatabaseCheckpointControl (409-2083). The bar is 500 significant lines; this is 995 over it, 2.99× 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: stream_graph/fragment.rs src/meta/src/stream/stream_graph/fragment.rs — FileTooLong — 1469 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 969 over it, 2.94× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: handler/mod.rs src/frontend/src/handler/mod.rs — FileTooLong — 1426 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 926 over it, 2.85× 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/session.rs src/frontend/src/session.rs — FileTooLong — 1351 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 851 over it, 2.70× 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: iceberg_compaction/schedule.rs src/meta/src/manager/iceberg_compaction/schedule.rs — FileTooLong — 1341 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 841 over it, 2.68× 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: compaction/mod.rs src/meta/src/hummock/manager/compaction/mod.rs — FileTooLong — 1297 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 67% of them inside a single declaration: HummockManager (4 blocks, 207-1452). The bar is 500 significant lines; this is 797 over it, 2.59× 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: rpc/metrics.rs src/meta/src/rpc/metrics.rs — FileTooLong — 1266 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 766 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: compactor/mod.rs src/storage/src/hummock/compactor/mod.rs — FileTooLong — 1227 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 727 over it, 2.45× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: arrow/arrow_impl.rs src/common/src/array/arrow/arrow_impl.rs — FileTooLong — 1225 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 725 over it, 2.45× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: uploader/mod.rs src/storage/src/hummock/event_handler/uploader/mod.rs — FileTooLong — 1219 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 719 over it, 2.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: plan_node/logical_join.rs src/frontend/src/optimizer/plan_node/logical_join.rs — FileTooLong — 1216 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 92% of them inside a single declaration: LogicalJoin (11 blocks, 58-1874). The bar is 500 significant lines; this is 716 over it, 2.43× 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: barrier/rpc.rs src/meta/src/barrier/rpc.rs — FileTooLong — 1194 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 694 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: barrier/command.rs src/meta/src/barrier/command.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 65% of them inside a single declaration: Command (6 blocks, 465-1817). 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.
  • + 175 more in this group — see findings.md.
D3 · God Classes · FunctionTooLong · ×92
  • FunctionTooLong: risingwave_frontend::handler::handle src/frontend/src/handler/mod.rs:306 — FunctionTooLong — risingwave_frontend::handler::handle runs 1105 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 1005 over it, 11.05× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: risingwave_meta_node::server::start_service_as_election_leader src/meta/node/src/server.rs:317 — FunctionTooLong — risingwave_meta_node::server::start_service_as_election_leader runs 414 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 314 over it, 4.14× 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: risingwave_storage::hummock::compactor::start_iceberg_compactor src/storage/src/hummock/compactor/mod.rs:401 — FunctionTooLong — risingwave_storage::hummock::compactor::start_iceberg_compactor runs 398 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 298 over it, 3.98× 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: FragmentGraph.FragmentGraph dashboard/components/FragmentGraph.tsx:92 — FunctionTooLong — FragmentGraph runs 374 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 274 over it, 3.74× 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: risingwave_frontend::expr::type_inference::func::infer_type_for_special src/frontend/src/expr/type_inference/func.rs:323 — FunctionTooLong — risingwave_frontend::expr::type_inference::func::infer_type_for_special runs 349 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 249 over it, 3.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.
  • FunctionTooLong: risingwave_ctl::start_impl src/ctl/src/lib.rs:674 — FunctionTooLong — risingwave_ctl::start_impl 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: risedev::bin::risedev-dev::task_main src/risedevtool/src/bin/risedev-dev.rs:67 — FunctionTooLong — risedev::bin::risedev-dev::task_main runs 327 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 227 over it, 3.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.
  • FunctionTooLong: risingwave_compute::server::compute_node_serve src/compute/src/server.rs:93 — FunctionTooLong — risingwave_compute::server::compute_node_serve runs 319 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 219 over it, 3.19× 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: risingwave_frontend::handler::create_sink::gen_sink_plan src/frontend/src/handler/create_sink.rs:151 — FunctionTooLong — risingwave_frontend::handler::create_sink::gen_sink_plan runs 297 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 197 over it, 2.97× 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: risedev::risedev_env::generate_risedev_env src/risedevtool/src/risedev_env.rs:25 — FunctionTooLong — risedev::risedev_env::generate_risedev_env runs 291 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 191 over it, 2.91× 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: risingwave_frontend::handler::create_index::gen_create_index_plan src/frontend/src/handler/create_index.rs:144 — FunctionTooLong — risingwave_frontend::handler::create_index::gen_create_index_plan runs 277 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 177 over it, 2.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: risingwave_frontend::handler::show::handle_show_object src/frontend/src/handler/show.rs:501 — FunctionTooLong — risingwave_frontend::handler::show::handle_show_object 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: RelationGraph.RelationGraph dashboard/components/RelationGraph.tsx:73 — FunctionTooLong — RelationGraph 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.
  • FunctionTooLong: risingwave_frontend::handler::explain::do_handle_explain src/frontend/src/handler/explain.rs:49 — FunctionTooLong — risingwave_frontend::handler::explain::do_handle_explain runs 262 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 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.
  • FunctionTooLong: risingwave_frontend::handler::create_table::create_iceberg_engine_table src/frontend/src/handler/create_table.rs:1456 — FunctionTooLong — risingwave_frontend::handler::create_table::create_iceberg_engine_table runs 248 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 148 over it, 2.48× 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: risingwave_common_proc_macro::session_config::derive_config src/common/proc_macro/src/session_config.rs:31 — FunctionTooLong — risingwave_common_proc_macro::session_config::derive_config runs 247 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 147 over it, 2.47× 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: risingwave_storage::hummock::compactor::start_compactor src/storage/src/hummock/compactor/mod.rs:973 — FunctionTooLong — risingwave_storage::hummock::compactor::start_compactor runs 244 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 144 over it, 2.44× 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: risingwave_rt::logger::init_risingwave_logger src/utils/runtime/src/logger.rs:235 — FunctionTooLong — risingwave_rt::logger::init_risingwave_logger runs 235 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 135 over it, 2.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.
  • FunctionTooLong: risingwave_frontend::handler::handle_privilege::make_prost_privilege src/frontend/src/handler/handle_privilege.rs:46 — FunctionTooLong — risingwave_frontend::handler::handle_privilege::make_prost_privilege runs 233 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 133 over it, 2.33× 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: fragment_graph.Streaming dashboard/pages/fragment_graph.tsx:227 — FunctionTooLong — Streaming runs 232 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 132 over it, 2.32× 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: risingwave_storage::hummock::compactor::compactor_runner::compact_with_agent src/storage/src/hummock/compactor/compactor_runner.rs:323 — FunctionTooLong — risingwave_storage::hummock::compactor::compactor_runner::compact_with_agent runs 211 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 111 over it, 2.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: risingwave_storage::hummock::compactor::iceberg_compaction::memory::estimate_plan_memory src/storage/src/hummock/compactor/iceberg_compaction/memory.rs:59 — FunctionTooLong — risingwave_storage::hummock::compactor::iceberg_compaction::memory::estimate_plan_memory runs 210 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 110 over it, 2.10× 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: risingwave_frontend::handler::create_source::external_schema::bind_columns_from_source_for_non_cdc src/frontend/src/handler/create_source/external_schema.rs:92 — FunctionTooLong — risingwave_frontend::handler::create_source::external_schema::bind_columns_from_source_for_non_cdc runs 204 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 104 over it, 2.04× 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: risingwave_compute::memory::config::storage_memory_config src/compute/src/memory/config.rs:107 — FunctionTooLong — risingwave_compute::memory::config::storage_memory_config runs 201 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 101 over it, 2.01× 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: heap_profiling.HeapProfiling dashboard/pages/heap_profiling.tsx:75 — FunctionTooLong — HeapProfiling runs 195 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 95 over it, 1.95× 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.
  • + 67 more in this group — see findings.md.
D3 · God Classes · ClassTooLong · ×91
  • ClassTooLong: Parser src/sqlparser/src/parser.rs:196 — ClassTooLong — 4476 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 248 methods. The bar is 400 significant lines; this is 4076 over it, 11.19× 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: MetaClient src/rpc_client/src/meta_client.rs:141 — ClassTooLong — 1609 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 154 methods, 4 blocks, lines 141-2309. The bar is 400 significant lines; this is 1209 over it, 4.02× 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: DdlController src/meta/src/rpc/ddl_controller.rs:282 — ClassTooLong — 1591 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 51 methods, 2 blocks, lines 282-2487. The bar is 400 significant lines; this is 1191 over it, 3.98× 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: StreamingMetrics src/stream/src/executor/monitor/streaming_stats.rs:46 — ClassTooLong — 1579 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 18 methods, 2 blocks, lines 46-2058. The bar is 400 significant lines; this is 1179 over it, 3.95× 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: DdlServiceImpl src/meta/service/src/ddl_service.rs:69 — ClassTooLong — 1442 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 4 methods, 3 blocks, lines 69-2022. The bar is 400 significant lines; this is 1042 over it, 3.61× 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: HashJoinExecutor src/batch/executors/src/executor/join/hash_join.rs:64 — ClassTooLong — 1263 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 29 methods, 5 blocks, lines 64-2518. The bar is 400 significant lines; this is 863 over it, 3.16× 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: LogicalJoin src/frontend/src/optimizer/plan_node/logical_join.rs:58 — ClassTooLong — 1120 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 43 methods, 11 blocks, lines 58-1874. The bar is 400 significant lines; this is 720 over it, 2.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.
  • ClassTooLong: PostgresConnectorConfig java/connector-node/risingwave-source-cdc/src/main/java/io/debezium/connector/postgresql/PostgresConnectorConfig.java:62 — ClassTooLong — 1001 significant lines (blank, comment-only and punctuation-only lines excluded), 43 methods. The bar is 400 significant lines; this is 601 over it, 2.50× 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: DiagnoseCommand src/meta/src/manager/diagnose.rs:54 — ClassTooLong — 937 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 18 methods, 2 blocks, lines 54-1264. The bar is 400 significant lines; this is 537 over it, 2.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.
  • ClassTooLong: Statement src/sqlparser/src/ast/mod.rs:1295 — ClassTooLong — 930 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 6 methods, 4 blocks, lines 1295-4060. The bar is 400 significant lines; this is 530 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.
  • ClassTooLong: Migration src/meta/model/migration/src/m20230908_072257_init.rs:8 — ClassTooLong — 886 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 0 methods. The bar is 400 significant lines; this is 486 over it, 2.22× 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: HashJoinExecutor src/stream/src/executor/hash_join.rs:158 — ClassTooLong — 883 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, 4 blocks, lines 158-1404. The bar is 400 significant lines; this is 483 over it, 2.21× 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: GlobalBarrierWorker src/meta/src/barrier/worker.rs:85 — ClassTooLong — 880 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 16 methods, 9 blocks, lines 85-1552. The bar is 400 significant lines; this is 480 over it, 2.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.
  • ClassTooLong: Catalog src/frontend/src/catalog/root_catalog.rs:122 — ClassTooLong — 862 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 86 methods, 3 blocks, lines 122-1276. The bar is 400 significant lines; this is 462 over it, 2.16× 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: SchemaCatalog src/frontend/src/catalog/schema_catalog.rs:46 — ClassTooLong — 785 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 99 methods, 4 blocks, lines 46-1159. The bar is 400 significant lines; this is 385 over it, 1.96× 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: StreamServiceImpl src/meta/service/src/stream_service.rs:61 — ClassTooLong — 780 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 1 methods, 3 blocks, lines 61-1121. The bar is 400 significant lines; this is 380 over it, 1.95× 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: Command src/meta/src/barrier/command.rs:465 — ClassTooLong — 777 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, 6 blocks, lines 465-1817. The bar is 400 significant lines; this is 377 over it, 1.94× 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: CreatingStreamingJobControl src/meta/src/barrier/checkpoint/independent_job/creating_job/mod.rs:80 — ClassTooLong — 766 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 26 methods, 3 blocks, lines 80-1103. The bar is 400 significant lines; this is 366 over it, 1.92× 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: Condition src/frontend/src/utils/condition.rs:40 — ClassTooLong — 748 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 30 methods, 4 blocks, lines 40-1222. The bar is 400 significant lines; this is 348 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.
  • ClassTooLong: MetaMetrics src/meta/src/rpc/metrics.rs:74 — ClassTooLong — 742 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 1 methods, 3 blocks, lines 74-1128. The bar is 400 significant lines; this is 342 over it, 1.86× 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: IcebergV3JobCheckpointControl src/meta/src/barrier/checkpoint/independent_job/iceberg_v3_job/mod.rs:282 — ClassTooLong — 730 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 17 methods, 2 blocks, lines 282-1197. The bar is 400 significant lines; this is 330 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: PgProtocol src/utils/pgwire/src/pg_protocol.rs:72 — ClassTooLong — 719 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 30 methods, 3 blocks, lines 72-1306. The bar is 400 significant lines; this is 319 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.
  • ClassTooLong: MaterializeExecutor src/stream/src/executor/mview/materialize.rs:68 — ClassTooLong — 719 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, 5 blocks, lines 68-1253. The bar is 400 significant lines; this is 319 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.
  • ClassTooLong: BatchTableInner src/storage/src/table/batch_table/mod.rs:265 — ClassTooLong — 709 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 31 methods, 6 blocks, lines 265-1351. The bar is 400 significant lines; this is 309 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.
  • ClassTooLong: BatchRefreshJobCheckpointControl src/meta/src/barrier/checkpoint/independent_job/batch_refresh_job/mod.rs:191 — ClassTooLong — 706 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 19 methods, 8 blocks, lines 191-1356. The bar is 400 significant lines; this is 306 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.
  • + 66 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×68
  • Duplicated block (8 lines × 2) src/batch/executors/src/executor/hash_agg.rs:498 — src/batch/executors/src/executor/hash_agg.rs:498-505 | src/batch/executors/src/executor/order_by.rs:118-125 — before extracting anything, compare `src/batch/executors/src/executor/hash_agg.rs` and `src/batch/executors/src/executor/order_by.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 64 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) src/batch/executors/src/executor/sort_agg.rs:154 — src/batch/executors/src/executor/sort_agg.rs:154-161 | src/batch/executors/src/executor/sort_agg.rs:185-192 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) src/common/src/array/list_array.rs:810 — src/common/src/array/list_array.rs:810-817 | src/common/src/array/list_array.rs:850-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 (8 lines × 2) src/connector/src/connector_common/iceberg/jni_catalog.rs:379 — src/connector/src/connector_common/iceberg/jni_catalog.rs:379-386 | src/connector/src/connector_common/iceberg/jni_catalog.rs:478-485 — both copies are in the same file, so extract the 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) src/connector/src/sink/iceberg/commit.rs:847 — src/connector/src/sink/iceberg/commit.rs:847-854 | src/connector/src/sink/iceberg/commit.rs:872-879 — both copies are in the same file, so extract the 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) src/connector/src/sink/redis.rs:174 — src/connector/src/sink/redis.rs:174-181 | src/connector/src/sink/redis.rs:183-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 (8 lines × 2) REDACTED:119 — REDACTED:119-126 | REDACTED:157-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 (8 lines × 2) src/ctl/src/cmd_impl/hummock/validate_version.rs:78 — src/ctl/src/cmd_impl/hummock/validate_version.rs:78-85 | src/ctl/src/cmd_impl/hummock/validate_version.rs:178-185 — both copies are in the same file, so extract the 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) src/expr/impl/src/aggregate/approx_count_distinct/mod.rs:69 — src/expr/impl/src/aggregate/approx_count_distinct/mod.rs:69-76 | src/expr/impl/src/aggregate/approx_count_distinct/mod.rs:131-138 — both copies are in the same file, so extract the 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) src/expr/impl/src/aggregate/approx_count_distinct/mod.rs:85 — src/expr/impl/src/aggregate/approx_count_distinct/mod.rs:85-92 | src/expr/impl/src/aggregate/approx_count_distinct/mod.rs:147-154 — both copies are in the same file, so extract the 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) src/expr/impl/src/scalar/date_trunc.rs:46 — src/expr/impl/src/scalar/date_trunc.rs:46-53 | src/expr/impl/src/scalar/date_trunc.rs:104-111 — both copies are in the same file, so extract the 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) src/frontend/planner_test/src/lib.rs:758 — src/frontend/planner_test/src/lib.rs:758-765 | src/frontend/planner_test/src/lib.rs:819-826 — both copies are in the same file, so extract the 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) src/frontend/src/binder/relation/match_recognize.rs:1153 — src/frontend/src/binder/relation/match_recognize.rs:1153-1160 | src/stream/src/executor/match_recognize/proto.rs:50-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 (8 lines × 2) src/frontend/src/expr/session_timezone.rs:225 — src/frontend/src/expr/session_timezone.rs:225-232 | src/frontend/src/expr/session_timezone.rs:238-245 — both copies are in the same file, so extract the 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) src/frontend/src/expr/type_inference/func.rs:372 — src/frontend/src/expr/type_inference/func.rs:372-379 | src/frontend/src/expr/type_inference/func.rs:389-396 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) src/frontend/src/handler/alter_mv.rs:42 — src/frontend/src/handler/alter_mv.rs:42-49 | src/frontend/src/handler/alter_rename.rs:39-46 — 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) src/frontend/src/handler/alter_source_props.rs:110 — src/frontend/src/handler/alter_source_props.rs:110-117 | src/frontend/src/handler/create_source/validate.rs:368-375 — 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) src/frontend/src/handler/comment.rs:52 — src/frontend/src/handler/comment.rs:52-59 | src/frontend/src/handler/comment.rs:77-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.
  • Duplicated block (8 lines × 2) src/frontend/src/handler/create_aggregate.rs:123 — src/frontend/src/handler/create_aggregate.rs:123-130 | src/frontend/src/handler/create_function.rs:178-185 — before extracting anything, compare `src/frontend/src/handler/create_aggregate.rs` and `src/frontend/src/handler/create_function.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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) src/frontend/src/handler/drop_connection.rs:36 — src/frontend/src/handler/drop_connection.rs:36-43 | src/frontend/src/handler/drop_table.rs:35-42 — 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) src/frontend/src/optimizer/plan_node/stream_cdc_table_scan.rs:139 — src/frontend/src/optimizer/plan_node/stream_cdc_table_scan.rs:139-146 | src/frontend/src/optimizer/plan_node/stream_table_scan.rs:354-361 — 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) src/frontend/src/optimizer/plan_node/stream_project.rs:84 — src/frontend/src/optimizer/plan_node/stream_project.rs:84-91 | src/frontend/src/optimizer/plan_node/stream_project_set.rs:47-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 both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) src/frontend/src/optimizer/rule/index_selection_rule.rs:289 — src/frontend/src/optimizer/rule/index_selection_rule.rs:289-296 | src/frontend/src/optimizer/rule/index_selection_rule.rs:359-372 — both copies are in the same file, so extract the 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) src/meta/service/src/ddl_service.rs:276 — src/meta/service/src/ddl_service.rs:276-283 | src/meta/service/src/ddl_service.rs:315-322 — both copies are in the same file, so extract the 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) src/meta/src/barrier/command.rs:167 — src/meta/src/barrier/command.rs:167-174 | src/meta/src/controller/scale.rs:313-320 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • + 43 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Hotspot · ×67
  • Hotspot: src/meta/src/barrier/checkpoint/state.rs src/meta/src/barrier/checkpoint/state.rs:460 — src/meta/src/barrier/checkpoint/state.rs changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 96 in DatabaseCheckpointControl::apply_command at line 460. 5 of those changes were fix/bug commits, and the other 11 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:26:37 +00:00' --until='2026-10-27 04:26:37 +00:00' --full-history --no-merges -- src/meta/src/barrier/checkpoint/state.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: src/sqlparser/src/ast/mod.rs src/sqlparser/src/ast/mod.rs:1827 — src/sqlparser/src/ast/mod.rs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 149 in Statement::fmt_unchecked at line 1827. 2 of those changes were fix/bug commits, and the other 5 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:26:37 +00:00' --until='2026-10-27 04:26:37 +00:00' --full-history --no-merges -- src/sqlparser/src/ast/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: src/frontend/src/handler/mod.rs src/frontend/src/handler/mod.rs:306 — src/frontend/src/handler/mod.rs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 181 in risingwave_frontend::handler::handle at line 306. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:26:37 +00:00' --until='2026-10-27 04:26:37 +00:00' --full-history --no-merges -- src/frontend/src/handler/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: src/meta/src/barrier/worker.rs src/meta/src/barrier/worker.rs:513 — src/meta/src/barrier/worker.rs changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 53 in GlobalBarrierWorker::run_inner at line 513. 6 of those changes were fix/bug commits, 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:26:37 +00:00' --until='2026-10-27 04:26:37 +00:00' --full-history --no-merges -- src/meta/src/barrier/worker.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: src/storage/src/hummock/compactor/mod.rs src/storage/src/hummock/compactor/mod.rs:401 — src/storage/src/hummock/compactor/mod.rs changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 43 in risingwave_storage::hummock::compactor::start_iceberg_compactor at line 401. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:26:37 +00:00' --until='2026-10-27 04:26:37 +00:00' --full-history --no-merges -- src/storage/src/hummock/compactor/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: src/meta/src/controller/streaming_job.rs src/meta/src/controller/streaming_job.rs:3356 — src/meta/src/controller/streaming_job.rs changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in CatalogController::update_connection_and_dependent_objects_props at line 3356. 8 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:26:37 +00:00' --until='2026-10-27 04:26:37 +00:00' --full-history --no-merges -- src/meta/src/controller/streaming_job.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: src/meta/src/barrier/checkpoint/control.rs src/meta/src/barrier/checkpoint/control.rs:1023 — src/meta/src/barrier/checkpoint/control.rs changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in DatabaseCheckpointControl::next_complete_barrier_task at line 1023. 7 of those changes were fix/bug commits, and the other 10 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:26:37 +00:00' --until='2026-10-27 04:26:37 +00:00' --full-history --no-merges -- src/meta/src/barrier/checkpoint/control.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: src/meta/src/barrier/rpc.rs src/meta/src/barrier/rpc.rs:622 — src/meta/src/barrier/rpc.rs changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in PartialGraphRecoverer::inject_database_initial_barrier at line 622. 6 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:26:37 +00:00' --until='2026-10-27 04:26:37 +00:00' --full-history --no-merges -- src/meta/src/barrier/rpc.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: src/stream/src/executor/backfill/cdc/cdc_backfill.rs src/stream/src/executor/backfill/cdc/cdc_backfill.rs:488 — src/stream/src/executor/backfill/cdc/cdc_backfill.rs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 66 in CdcBackfillExecutor::execute_inner at line 488. 3 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:26:37 +00:00' --until='2026-10-27 04:26:37 +00:00' --full-history --no-merges -- src/stream/src/executor/backfill/cdc/cdc_backfill.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: src/connector/src/connector_common/iceberg/mod.rs src/connector/src/connector_common/iceberg/mod.rs:865 — src/connector/src/connector_common/iceberg/mod.rs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 60 in IcebergCommon::build_jni_catalog_configs at line 865. 2 of those changes were fix/bug commits, and the other 3 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:26:37 +00:00' --until='2026-10-27 04:26:37 +00:00' --full-history --no-merges -- src/connector/src/connector_common/iceberg/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: src/meta/src/manager/iceberg_compaction/schedule.rs src/meta/src/manager/iceberg_compaction/schedule.rs:1327 — src/meta/src/manager/iceberg_compaction/schedule.rs changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in IcebergCompactionManager::apply_sink_update at line 1327. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:26:37 +00:00' --until='2026-10-27 04:26:37 +00:00' --full-history --no-merges -- src/meta/src/manager/iceberg_compaction/schedule.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: src/stream/src/executor/source/source_executor.rs src/stream/src/executor/source/source_executor.rs:616 — src/stream/src/executor/source/source_executor.rs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 53 in SourceExecutor::execute_inner at line 616. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:26:37 +00:00' --until='2026-10-27 04:26:37 +00:00' --full-history --no-merges -- src/stream/src/executor/source/source_executor.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: src/meta/src/barrier/command.rs src/meta/src/barrier/command.rs:634 — src/meta/src/barrier/command.rs changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in Command::fmt at line 634. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:26:37 +00:00' --until='2026-10-27 04:26:37 +00:00' --full-history --no-merges -- src/meta/src/barrier/command.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: src/stream/src/executor/sink.rs src/stream/src/executor/sink.rs:592 — src/stream/src/executor/sink.rs changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in SinkExecutor::process_msg at line 592. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:26:37 +00:00' --until='2026-10-27 04:26:37 +00:00' --full-history --no-merges -- src/stream/src/executor/sink.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: src/frontend/src/planner/relation.rs src/frontend/src/planner/relation.rs:162 — src/frontend/src/planner/relation.rs changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in Planner::plan_iceberg_table at line 162. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:26:37 +00:00' --until='2026-10-27 04:26:37 +00:00' --full-history --no-merges -- src/frontend/src/planner/relation.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: src/storage/src/hummock/compactor/iceberg_compaction/iceberg_compactor_runner.rs src/storage/src/hummock/compactor/iceberg_compaction/iceberg_compactor_runner.rs:745 — src/storage/src/hummock/compactor/iceberg_compaction/iceberg_compactor_runner.rs changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in risingwave_storage::hummock::compactor::iceberg_compaction::iceberg_compactor_runner::build_task_planning_config at line 745. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:26:37 +00:00' --until='2026-10-27 04:26:37 +00:00' --full-history --no-merges -- src/storage/src/hummock/compactor/iceberg_compaction/iceberg_compactor_runner.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: src/meta/src/barrier/context/context_impl.rs src/meta/src/barrier/context/context_impl.rs:636 — src/meta/src/barrier/context/context_impl.rs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in PostCollectCommand::post_collect at line 636. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:26:37 +00:00' --until='2026-10-27 04:26:37 +00:00' --full-history --no-merges -- src/meta/src/barrier/context/context_impl.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: src/frontend/src/handler/create_sink.rs src/frontend/src/handler/create_sink.rs:151 — src/frontend/src/handler/create_sink.rs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 53 in risingwave_frontend::handler::create_sink::gen_sink_plan at line 151. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:26:37 +00:00' --until='2026-10-27 04:26:37 +00:00' --full-history --no-merges -- src/frontend/src/handler/create_sink.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: java/connector-node/risingwave-connector-service/src/main/java/com/risingwave/connector/source/common/DbzConnectorConfig.java java/connector-node/risingwave-connector-service/src/main/java/com/risingwave/connector/source/common/DbzConnectorConfig.java:158 — java/connector-node/risingwave-connector-service/src/main/java/com/risingwave/connector/source/common/DbzConnectorConfig.java changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 41 in DbzConnectorConfig.<init> at line 158. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:26:37 +00:00' --until='2026-10-27 04:26:37 +00:00' --full-history --no-merges -- java/connector-node/risingwave-connector-service/src/main/java/com/risingwave/connector/source/common/DbzConnectorConfig.java`: 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: src/meta/src/rpc/ddl_controller.rs src/meta/src/rpc/ddl_controller.rs:1127 — src/meta/src/rpc/ddl_controller.rs changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in DdlController::create_streaming_job at line 1127. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:26:37 +00:00' --until='2026-10-27 04:26:37 +00:00' --full-history --no-merges -- src/meta/src/rpc/ddl_controller.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: src/stream/src/executor/mview/materialize.rs src/stream/src/executor/mview/materialize.rs:373 — src/stream/src/executor/mview/materialize.rs changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 60 in MaterializeExecutor::execute_inner at line 373. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:26:37 +00:00' --until='2026-10-27 04:26:37 +00:00' --full-history --no-merges -- src/stream/src/executor/mview/materialize.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: src/meta/src/controller/catalog/drop_op.rs src/meta/src/controller/catalog/drop_op.rs:24 — src/meta/src/controller/catalog/drop_op.rs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 35 in CatalogController::drop_object at line 24. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:26:37 +00:00' --until='2026-10-27 04:26:37 +00:00' --full-history --no-merges -- src/meta/src/controller/catalog/drop_op.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: REDACTED REDACTED:660 — REDACTED changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 58 in LocalityProviderExecutor::execute_inner at line 660. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:26:37 +00:00' --until='2026-10-27 04:26:37 +00:00' --full-history --no-merges -- REDACTED`: 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: src/frontend/src/binder/expr/function/mod.rs src/frontend/src/binder/expr/function/mod.rs:247 — src/frontend/src/binder/expr/function/mod.rs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 43 in Binder::bind_function at line 247. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:26:37 +00:00' --until='2026-10-27 04:26:37 +00:00' --full-history --no-merges -- src/frontend/src/binder/expr/function/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: src/connector/src/connector_common/postgres.rs src/connector/src/connector_common/postgres.rs:671 — src/connector/src/connector_common/postgres.rs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in risingwave_connector::connector_common::postgres::sea_type_to_rw_type at line 671. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:26:37 +00:00' --until='2026-10-27 04:26:37 +00:00' --full-history --no-merges -- src/connector/src/connector_common/postgres.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.
  • + 42 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×55
  • Duplicated block (14 lines × 2) src/batch/executors/src/executor/hash_agg.rs:655 — src/batch/executors/src/executor/hash_agg.rs:655-668 | src/batch/executors/src/executor/join/hash_join.rs:638-651 — before extracting anything, compare `src/batch/executors/src/executor/hash_agg.rs` and `src/batch/executors/src/executor/join/hash_join.rs` as WHOLE FILES: this scan already matched 6 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.
  • Duplicated block (14 lines × 2) src/connector/src/sink/encoder/template.rs:430 — src/connector/src/sink/encoder/template.rs:430-443 | src/connector/src/sink/encoder/template.rs:448-461 — both copies are in the same file, so extract the 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) src/connector/src/source/reader/fs_reader.rs:61 — src/connector/src/source/reader/fs_reader.rs:61-74 | src/connector/src/source/reader/reader.rs:71-84 — 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) src/expr/impl/src/scalar/regexp.rs:403 — src/expr/impl/src/scalar/regexp.rs:403-416 | src/expr/impl/src/scalar/regexp.rs:435-448 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) src/frontend/planner_test/src/lib.rs:361 — src/frontend/planner_test/src/lib.rs:361-374 | src/frontend/planner_test/src/lib.rs:392-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 (14 lines × 2) src/frontend/src/binder/select.rs:472 — src/frontend/src/binder/select.rs:472-485 | src/frontend/src/binder/select.rs:517-530 — both copies are in the same file, so extract the 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) src/frontend/src/handler/alter_database_param.rs:30 — src/frontend/src/handler/alter_database_param.rs:30-43 | src/frontend/src/handler/alter_database_param.rs:83-96 — both copies are in the same file, so extract the 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) src/frontend/src/handler/create_source/external_schema.rs:362 — src/frontend/src/handler/create_source/external_schema.rs:362-376 | src/frontend/src/handler/create_source/external_schema.rs:423-436 — both copies are in the same file, so extract the 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) src/frontend/src/optimizer/rule/apply_join_transpose_rule.rs:653 — src/frontend/src/optimizer/rule/apply_join_transpose_rule.rs:653-666 | src/frontend/src/optimizer/rule/join_commute_rule.rs:88-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.
  • Duplicated block (14 lines × 2) src/frontend/src/optimizer/rule/table_function_to_internal_backfill_progress.rs:64 — src/frontend/src/optimizer/rule/table_function_to_internal_backfill_progress.rs:64-77 | src/frontend/src/optimizer/rule/table_function_to_internal_source_backfill_progress.rs:62-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 (14 lines × 2) src/frontend/src/planner/relation.rs:203 — src/frontend/src/planner/relation.rs:203-216 | src/frontend/src/planner/relation.rs:429-442 — both copies are in the same file, so extract the 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) src/frontend/src/scheduler/distributed/stage.rs:1071 — src/frontend/src/scheduler/distributed/stage.rs:1071-1084 | src/frontend/src/scheduler/distributed/stage.rs:1091-1104 — both copies are in the same file, so extract the 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) src/frontend/src/session/transaction.rs:162 — src/frontend/src/session/transaction.rs:162-175 | src/frontend/src/session/transaction.rs:180-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 (14 lines × 2) src/frontend/src/stream_fragmenter/rewrite/delta_join.rs:156 — src/frontend/src/stream_fragmenter/rewrite/delta_join.rs:156-169 | src/frontend/src/stream_fragmenter/rewrite/delta_join.rs:185-198 — both copies are in the same file, so extract the 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) src/meta/src/backup_restore/utils.rs:42 — src/meta/src/backup_restore/utils.rs:42-55 | src/meta/src/backup_restore/utils.rs:59-72 — both copies are in the same file, so extract the 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) src/meta/src/barrier/checkpoint/independent_job/creating_job/barrier_control.rs:32 — src/meta/src/barrier/checkpoint/independent_job/creating_job/barrier_control.rs:32-45 | src/meta/src/barrier/checkpoint/independent_job/iceberg_v3_job/mod.rs:97-110 — 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) src/meta/src/barrier/edge_builder.rs:543 — src/meta/src/barrier/edge_builder.rs:543-556 | src/meta/src/barrier/edge_builder.rs:627-640 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) src/meta/src/controller/catalog/alter_op.rs:52 — src/meta/src/controller/catalog/alter_op.rs:52-65 | src/meta/src/controller/catalog/alter_op.rs:887-900 — both copies are in the same file, so extract the 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) src/meta/src/controller/streaming_job.rs:735 — src/meta/src/controller/streaming_job.rs:735-748 | src/meta/src/controller/streaming_job.rs:798-812 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) src/meta/src/controller/streaming_job.rs:1373 — src/meta/src/controller/streaming_job.rs:1373-1386 | src/meta/src/controller/streaming_job.rs:1963-1976 — both copies are in the same file, so extract the 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) src/meta/src/dashboard/mod.rs:545 — src/meta/src/dashboard/mod.rs:545-558 | src/meta/src/dashboard/mod.rs:611-624 — both copies are in the same file, so extract the 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) src/meta/src/hummock/manager/time_travel.rs:478 — src/meta/src/hummock/manager/time_travel.rs:478-491 | src/meta/src/hummock/manager/time_travel.rs:519-532 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) src/meta/src/rpc/election/sql.rs:201 — src/meta/src/rpc/election/sql.rs:201-214 | src/meta/src/rpc/election/sql.rs:551-564 — both copies are in the same file, so extract the 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) src/meta/src/stream/stream_manager.rs:1059 — src/meta/src/stream/stream_manager.rs:1059-1072 | src/meta/src/stream/stream_manager.rs:1103-1116 — both copies are in the same file, so extract the 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) src/object_store/src/object/mod.rs:608 — src/object_store/src/object/mod.rs:608-621 | src/object_store/src/object/mod.rs:720-733 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 30 more in this group — see findings.md.
D31 · IaC & Container Security · Medium IaC · ×52
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 27 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×51
  • Duplicated block (9 lines × 2) src/batch/executors/src/executor/join/hash_join.rs:2090 — src/batch/executors/src/executor/join/hash_join.rs:2090-2098 | src/batch/executors/src/executor/join/hash_join.rs:2140-2148 — both copies are in the same file, so extract the 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) src/common/src/session_config/parallelism.rs:120 — src/common/src/session_config/parallelism.rs:120-128 | src/common/src/session_config/parallelism.rs:186-194 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) src/compute/src/observer/observer_manager.rs:38 — src/compute/src/observer/observer_manager.rs:38-46 | src/frontend/src/observer/observer_manager.rs:540-548 — 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) src/ctl/src/cmd_impl/profile.rs:44 — src/ctl/src/cmd_impl/profile.rs:44-52 | src/ctl/src/cmd_impl/profile.rs:114-122 — both copies are in the same file, so extract the 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) src/expr/core/src/expr/mod.rs:94 — src/expr/core/src/expr/mod.rs:94-102 | src/expr/core/src/expr/mod.rs:132-140 — both copies are in the same file, so extract the 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) src/frontend/src/binder/relation/watermark.rs:66 — src/frontend/src/binder/relation/watermark.rs:66-74 | src/frontend/src/binder/relation/window_table_function.rs:86-94 — 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) src/frontend/src/binder/relation/watermark.rs:78 — src/frontend/src/binder/relation/watermark.rs:78-86 | src/frontend/src/binder/relation/window_table_function.rs:111-119 — 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) src/frontend/src/expr/function_call.rs:307 — src/frontend/src/expr/function_call.rs:307-315 | src/frontend/src/expr/function_call_with_lambda.rs:109-117 — 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) src/frontend/src/observer/observer_manager.rs:363 — src/frontend/src/observer/observer_manager.rs:363-371 | src/frontend/src/observer/observer_manager.rs:402-410 — both copies are in the same file, so extract the 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) src/frontend/src/observer/observer_manager.rs:373 — src/frontend/src/observer/observer_manager.rs:373-381 | src/frontend/src/observer/observer_manager.rs:412-420 — both copies are in the same file, so extract the 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) src/frontend/src/optimizer/plan_node/batch_log_seq_scan.rs:92 — src/frontend/src/optimizer/plan_node/batch_log_seq_scan.rs:92-100 | src/frontend/src/optimizer/plan_node/batch_sys_seq_scan.rs:66-74 — 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) src/frontend/src/optimizer/plan_node/stream_asof_join.rs:140 — src/frontend/src/optimizer/plan_node/stream_asof_join.rs:140-148 | src/frontend/src/optimizer/plan_node/stream_hash_join.rs:289-297 — before extracting anything, compare `src/frontend/src/optimizer/plan_node/stream_asof_join.rs` and `src/frontend/src/optimizer/plan_node/stream_hash_join.rs` as WHOLE FILES: this scan already matched 6 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. 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) src/frontend/src/optimizer/plan_node/stream_iceberg_with_pk_index_writer.rs:129 — src/frontend/src/optimizer/plan_node/stream_iceberg_with_pk_index_writer.rs:129-137 | src/frontend/src/optimizer/plan_node/stream_sink.rs:948-956 — 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) src/frontend/src/optimizer/plan_node/stream_materialize.rs:642 — src/frontend/src/optimizer/plan_node/stream_materialize.rs:642-650 | src/frontend/src/optimizer/plan_node/stream_vector_index_write.rs:216-224 — 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) src/frontend/src/webhook/mod.rs:189 — src/frontend/src/webhook/mod.rs:189-197 | src/frontend/src/webhook/mod.rs:207-215 — both copies are in the same file, so extract the 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) src/meta/src/barrier/checkpoint/independent_job/iceberg_v3_job/mod.rs:1106 — src/meta/src/barrier/checkpoint/independent_job/iceberg_v3_job/mod.rs:1106-1114 | src/meta/src/barrier/checkpoint/independent_job/iceberg_v3_job/mod.rs:1172-1180 — both copies are in the same file, so extract the 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) src/meta/src/barrier/info.rs:1074 — src/meta/src/barrier/info.rs:1074-1082 | src/meta/src/barrier/info.rs:1122-1130 — both copies are in the same file, so extract the 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) src/meta/src/controller/catalog/alter_op.rs:510 — src/meta/src/controller/catalog/alter_op.rs:510-518 | src/meta/src/controller/catalog/util.rs:142-150 — 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) src/meta/src/controller/streaming_job.rs:3189 — src/meta/src/controller/streaming_job.rs:3189-3197 | src/meta/src/controller/streaming_job.rs:3273-3281 — both copies are in the same file, so extract the 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) src/meta/src/controller/streaming_job.rs:4111 — src/meta/src/controller/streaming_job.rs:4111-4119 | src/meta/src/controller/streaming_job.rs:4172-4181 — both copies are in the same file, so extract the 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) src/meta/src/hummock/manager/time_travel.rs:753 — src/meta/src/hummock/manager/time_travel.rs:753-761 | src/meta/src/hummock/manager/time_travel.rs:779-787 — both copies are in the same file, so extract the 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) src/meta/src/stream/scale.rs:233 — src/meta/src/stream/scale.rs:233-241 | src/meta/src/stream/scale.rs:293-301 — both copies are in the same file, so extract the 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) src/risedevtool/src/bin/risedev-dev.rs:269 — src/risedevtool/src/bin/risedev-dev.rs:269-277 | src/risedevtool/src/bin/risedev-dev.rs:430-438 — both copies are in the same file, so extract the 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) src/risedevtool/src/task/compactor_service.rs:85 — src/risedevtool/src/task/compactor_service.rs:85-93 | src/risedevtool/src/task/frontend_service.rs:98-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.
  • Duplicated block (9 lines × 2) src/sqlparser/src/ast/mod.rs:3104 — src/sqlparser/src/ast/mod.rs:3104-3113 | src/sqlparser/src/ast/query.rs:432-440 — 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.
  • + 26 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×50
  • Duplicated block (7 lines × 2) src/batch/executors/src/executor/aggregation/orderby.rs:105 — src/batch/executors/src/executor/aggregation/orderby.rs:105-111 | src/frontend/src/datafusion/aggregate/orderby.rs:106-112 — before extracting anything, compare `src/batch/executors/src/executor/aggregation/orderby.rs` and `src/frontend/src/datafusion/aggregate/orderby.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 49 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) src/batch/executors/src/executor/aggregation/orderby.rs:120 — src/batch/executors/src/executor/aggregation/orderby.rs:120-126 | src/frontend/src/datafusion/aggregate/orderby.rs:121-127 — before extracting anything, compare `src/batch/executors/src/executor/aggregation/orderby.rs` and `src/frontend/src/datafusion/aggregate/orderby.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 49 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) src/batch/executors/src/executor/hash_agg.rs:364 — src/batch/executors/src/executor/hash_agg.rs:364-370 | src/batch/executors/src/executor/order_by.rs:369-375 — before extracting anything, compare `src/batch/executors/src/executor/hash_agg.rs` and `src/batch/executors/src/executor/order_by.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 64 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) src/batch/executors/src/executor/join/hash_join.rs:383 — src/batch/executors/src/executor/join/hash_join.rs:383-389 | src/batch/executors/src/executor/join/hash_join.rs:410-416 — both copies are in the same file, so extract the 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) src/connector/src/connector_common/iceberg/jni_catalog.rs:241 — src/connector/src/connector_common/iceberg/jni_catalog.rs:241-247 | src/connector/src/connector_common/iceberg/jni_catalog.rs:273-279 — both copies are in the same file, so extract the 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) src/connector/src/sink/clickhouse.rs:197 — src/connector/src/sink/clickhouse.rs:197-203 | src/connector/src/sink/clickhouse.rs:211-217 — both copies are in the same file, so extract the 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) src/connector/src/sink/clickhouse.rs:238 — src/connector/src/sink/clickhouse.rs:238-244 | src/connector/src/sink/clickhouse.rs:280-286 — both copies are in the same file, so extract the 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) src/connector/src/sink/clickhouse.rs:257 — src/connector/src/sink/clickhouse.rs:257-263 | src/connector/src/sink/clickhouse.rs:299-305 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) src/connector/src/sink/elasticsearch_opensearch/elasticsearch_opensearch_client.rs:112 — src/connector/src/sink/elasticsearch_opensearch/elasticsearch_opensearch_client.rs:112-119 | src/connector/src/sink/elasticsearch_opensearch/elasticsearch_opensearch_client.rs:141-147 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) src/connector/src/sink/encoder/json.rs:397 — src/connector/src/sink/encoder/json.rs:397-403 | src/connector/src/sink/encoder/json.rs:415-421 — both copies are in the same file, so extract the 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) src/connector/src/sink/iceberg/config.rs:196 — src/connector/src/sink/iceberg/config.rs:196-202 | src/connector/src/sink/iceberg/config.rs:205-211 — both copies are in the same file, so extract the 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) src/connector/src/source/reader/reader.rs:203 — src/connector/src/source/reader/reader.rs:203-209 | src/connector/src/source/reader/reader.rs:230-237 — both copies are in the same file, so extract the 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) src/expr/macro/src/gen.rs:1029 — src/expr/macro/src/gen.rs:1029-1035 | src/expr/macro/src/gen.rs:1040-1046 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) src/frontend/src/binder/bind_context.rs:357 — src/frontend/src/binder/bind_context.rs:357-363 | src/frontend/src/binder/bind_context.rs:365-371 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) src/frontend/src/binder/insert.rs:401 — src/frontend/src/binder/insert.rs:401-407 | src/frontend/src/binder/insert.rs:432-438 — both copies are in the same file, so extract the 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) src/frontend/src/binder/relation/watermark.rs:38 — src/frontend/src/binder/relation/watermark.rs:38-44 | src/frontend/src/binder/relation/window_table_function.rs:57-63 — 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) src/frontend/src/catalog/system_catalog/rw_catalog/rw_schemas.rs:34 — src/frontend/src/catalog/system_catalog/rw_catalog/rw_schemas.rs:34-40 | src/frontend/src/catalog/system_catalog/rw_catalog/rw_system_tables.rs:36-42 — 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) src/frontend/src/handler/drop_sink.rs:35 — src/frontend/src/handler/drop_sink.rs:35-41 | src/frontend/src/handler/drop_subscription.rs:34-40 — 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) src/frontend/src/optimizer/plan_node/logical_filter.rs:82 — src/frontend/src/optimizer/plan_node/logical_filter.rs:82-88 | src/frontend/src/optimizer/plan_node/stream_filter.rs:62-68 — 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) src/frontend/src/optimizer/plan_node/logical_gap_fill.rs:221 — src/frontend/src/optimizer/plan_node/logical_gap_fill.rs:221-227 | src/frontend/src/optimizer/plan_node/logical_gap_fill.rs:230-236 — both copies are in the same file, so extract the 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) src/frontend/src/optimizer/plan_node/logical_kafka_scan.rs:185 — src/frontend/src/optimizer/plan_node/logical_kafka_scan.rs:185-191 | src/frontend/src/optimizer/plan_node/logical_kafka_scan.rs:196-202 — both copies are in the same file, so extract the 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) src/frontend/src/optimizer/plan_node/stream_exchange.rs:91 — src/frontend/src/optimizer/plan_node/stream_exchange.rs:91-97 | src/frontend/src/optimizer/plan_node/stream_row_id_gen.rs:44-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 (7 lines × 2) src/frontend/src/optimizer/plan_node/stream_group_topn.rs:145 — src/frontend/src/optimizer/plan_node/stream_group_topn.rs:145-151 | src/frontend/src/optimizer/plan_node/stream_topn.rs:83-89 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) src/frontend/src/webhook/websocket.rs:483 — src/frontend/src/webhook/websocket.rs:483-489 | src/frontend/src/webhook/websocket.rs:531-537 — both copies are in the same file, so extract the 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) src/meta/src/controller/catalog/mod.rs:415 — src/meta/src/controller/catalog/mod.rs:415-421 | src/meta/src/controller/streaming_job.rs:1813-1819 — 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.
  • + 25 more in this group — see findings.md.
D2 · Cognitive Complexity · risingwave_frontend · ×48
  • risingwave_frontend::handler::handle (cognitive 100) src/frontend/src/handler/mod.rs:306 — risingwave_frontend::handler::handle has cognitive complexity 100 (threshold 15). Drivers by points: if/else 26 (56 pts), match/switch 19 (40 pts), loops 1 (3 pts), boolean chains 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.
  • risingwave_frontend::expr::type_inference::func::infer_type_for_special (cognitive 98) src/frontend/src/expr/type_inference/func.rs:323 — risingwave_frontend::expr::type_inference::func::infer_type_for_special has cognitive complexity 98 (threshold 15). Drivers by points: if/else 18 (40 pts), match/switch 20 (35 pts), loops 8 (17 pts), boolean chains 6 (nesting depth added 46). 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.
  • risingwave_frontend::handler::create_sink::gen_sink_plan (cognitive 95) src/frontend/src/handler/create_sink.rs:151 — risingwave_frontend::handler::create_sink::gen_sink_plan has cognitive complexity 95 (threshold 15). Drivers by points: if/else 43 (75 pts), boolean chains 8, loops 3 (8 pts), match/switch 3 (4 pts) (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • risingwave_frontend::handler::create_source::bind_all_columns (cognitive 76) src/frontend/src/handler/create_source.rs:251 — risingwave_frontend::handler::create_source::bind_all_columns has cognitive complexity 76 (threshold 15). Drivers by points: if/else 20 (58 pts), loops 2 (9 pts), match/switch 3 (7 pts), boolean chains 2 (nesting depth added 49). 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.
  • risingwave_frontend::handler::handle_privilege::make_prost_privilege (cognitive 67) src/frontend/src/handler/handle_privilege.rs:46 — risingwave_frontend::handler::handle_privilege::make_prost_privilege has cognitive complexity 67 (threshold 15). Drivers by points: loops 22 (45 pts), match/switch 7 (18 pts), if/else 1 (4 pts) (nesting depth added 37). 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.
  • risingwave_frontend::handler::explain::do_handle_explain (cognitive 53) src/frontend/src/handler/explain.rs:49 — risingwave_frontend::handler::explain::do_handle_explain has cognitive complexity 53 (threshold 15). Drivers by points: if/else 14 (28 pts), match/switch 9 (23 pts), boolean chains 2 (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.
  • risingwave_frontend::handler::create_index::gen_create_index_plan (cognitive 52) src/frontend/src/handler/create_index.rs:144 — risingwave_frontend::handler::create_index::gen_create_index_plan has cognitive complexity 52 (threshold 15). Drivers by points: if/else 25 (30 pts), match/switch 7 (11 pts), boolean chains 7, loops 3 (4 pts) (nesting depth added 10). 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.
  • risingwave_frontend::optimizer::plan_node::logical_kafka_scan::expr_to_kafka_timestamp_range (cognitive 46) src/frontend/src/optimizer/plan_node/logical_kafka_scan.rs:129 — risingwave_frontend::optimizer::plan_node::logical_kafka_scan::expr_to_kafka_timestamp_range has cognitive complexity 46 (threshold 15). Drivers by points: if/else 18 (35 pts), match/switch 6 (9 pts), boolean chains 2 (nesting depth added 20). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • risingwave_frontend::datafusion::project_set::project_set_stream (cognitive 45) src/frontend/src/datafusion/project_set.rs:284 — risingwave_frontend::datafusion::project_set::project_set_stream has cognitive complexity 45 (threshold 15). Drivers by points: if/else 6 (22 pts), loops 6 (16 pts), match/switch 1 (5 pts), boolean chains 2 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • risingwave_frontend::handler::create_source::bind_source_pk (cognitive 40) src/frontend/src/handler/create_source.rs:539 — risingwave_frontend::handler::create_source::bind_source_pk has cognitive complexity 40 (threshold 15). Drivers by points: if/else 20 (34 pts), loops 1 (3 pts), boolean chains 2, 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.
  • risingwave_frontend::handler::create_source::bind_create_source_or_table_with_connector (cognitive 39) src/frontend/src/handler/create_source.rs:905 — risingwave_frontend::handler::create_source::bind_create_source_or_table_with_connector has cognitive complexity 39 (threshold 15). Drivers by points: if/else 19 (28 pts), boolean chains 5, loops 2 (4 pts), match/switch 1 (2 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.
  • risingwave_frontend::optimizer::plan_node::stream_hash_join::derive_watermark_for_hash_join (cognitive 39) src/frontend/src/optimizer/plan_node/stream_hash_join.rs:88 — risingwave_frontend::optimizer::plan_node::stream_hash_join::derive_watermark_for_hash_join has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (30 pts), boolean chains 7, loops 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • risingwave_frontend::handler::create_table::create_iceberg_engine_table (cognitive 36) src/frontend/src/handler/create_table.rs:1456 — risingwave_frontend::handler::create_table::create_iceberg_engine_table has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (24 pts), match/switch 3 (11 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • risingwave_frontend::handler::alter_table_column::handle_alter_table_column (cognitive 34) src/frontend/src/handler/alter_table_column.rs:118 — risingwave_frontend::handler::alter_table_column::handle_alter_table_column has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (24 pts), loops 2 (6 pts), boolean chains 3, match/switch 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.
  • risingwave_frontend::handler::create_source::validate::validate_compatibility (cognitive 32) src/frontend/src/handler/create_source/validate.rs:221 — risingwave_frontend::handler::create_source::validate::validate_compatibility has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 9, 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.
  • risingwave_frontend::handler::alter_owner::handle_alter_owner (cognitive 31) src/frontend/src/handler/alter_owner.rs:49 — risingwave_frontend::handler::alter_owner::handle_alter_owner has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (27 pts), loops 1 (3 pts), match/switch 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • risingwave_frontend::utils::iceberg_predicate::rw_expr_to_iceberg_predicate (cognitive 31) src/frontend/src/utils/iceberg_predicate.rs:178 — risingwave_frontend::utils::iceberg_predicate::rw_expr_to_iceberg_predicate has cognitive complexity 31 (threshold 15). Drivers by points: if/else 5 (15 pts), match/switch 6 (12 pts), loops 1 (4 pts) (nesting depth added 19). 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.
  • risingwave_frontend::webhook::websocket::try_handle_connection (cognitive 31) src/frontend/src/webhook/websocket.rs:230 — risingwave_frontend::webhook::websocket::try_handle_connection has cognitive complexity 31 (threshold 15). Drivers by points: match/switch 8 (19 pts), if/else 4 (10 pts), boolean chains 1, loops 1 (nesting depth added 17). 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.
  • risingwave_frontend::handler::create_source::external_schema::bind_columns_from_source_for_non_cdc (cognitive 30) src/frontend/src/handler/create_source/external_schema.rs:92 — risingwave_frontend::handler::create_source::external_schema::bind_columns_from_source_for_non_cdc has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (25 pts), boolean chains 3, match/switch 2 (nesting depth added 10). Of this number, 28 points are the body's own statements and 2 belong to one function item 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.
  • risingwave_frontend::handler::alter_user::alter_prost_user_info (cognitive 27) src/frontend/src/handler/alter_user.rs:34 — risingwave_frontend::handler::alter_user::alter_prost_user_info has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 7, 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.
  • risingwave_frontend::utils::with_options::resolve_connection_ref_and_secret_ref (cognitive 27) src/frontend/src/utils/with_options.rs:272 — risingwave_frontend::utils::with_options::resolve_connection_ref_and_secret_ref has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 3 (5 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.
  • risingwave_frontend::catalog::purify::try_purify_table_source_create_sql_ast (cognitive 26) src/frontend/src/catalog/purify.rs:53 — risingwave_frontend::catalog::purify::try_purify_table_source_create_sql_ast has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 4, 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.
  • risingwave_frontend::handler::alter_set_schema::handle_alter_set_schema (cognitive 24) src/frontend/src/handler/alter_set_schema.rs:30 — risingwave_frontend::handler::alter_set_schema::handle_alter_set_schema has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (20 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.
  • risingwave_frontend::handler::cdc::parse_postgres_cdc_external_table_name (cognitive 24) src/frontend/src/handler/cdc.rs:166 — risingwave_frontend::handler::cdc::parse_postgres_cdc_external_table_name has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (19 pts), match/switch 1 (3 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.
  • risingwave_frontend::handler::drop_user::handle_drop_user (cognitive 24) src/frontend/src/handler/drop_user.rs:24 — risingwave_frontend::handler::drop_user::handle_drop_user has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (22 pts), boolean chains 1, 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.
  • + 23 more in this group — see findings.md.
D35 · Change Coupling · Change coupling · ×47
  • Change coupling: monitored_store.rs ↔ traced_store.rs src/storage/src/monitor/monitored_store.rs:1 — `src/storage/src/monitor/monitored_store.rs` and `src/storage/src/monitor/traced_store.rs` change together 92% of the time (22 of the 24 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 22 shared commits counted here, the most recent 3 are `0e2472ac` refactor(storage): use new higher rank lifetime assumption to avoid u…; `c6dfb1be` feat(storage): define vector read write trait (#21398); `f3f51e0d` refactor(storage): extract epoch control common methods (#21397) — run `git show` on any of them.
  • Change coupling: stream_project.rs ↔ stream_project_set.rs src/frontend/src/optimizer/plan_node/stream_project.rs:1 — `src/frontend/src/optimizer/plan_node/stream_project.rs` and `src/frontend/src/optimizer/plan_node/stream_project_set.rs` change together 92% of the time (11 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `ef3e9e6e` fix(planner): reject impure expressions on retract stream on `to_prot…; `dc3a3fc1` refactor(optimizer): some clean up for stream nodes' constructors (#1…; `96498a4b` refactor(optimizer): unify watermark derivation and monotonicity deri… — run `git show` on any of them.
  • Change coupling: hash_agg.rs ↔ simple_agg.rs src/stream/src/from_proto/hash_agg.rs:1 — `src/stream/src/from_proto/hash_agg.rs` and `src/stream/src/from_proto/simple_agg.rs` change together 90% of the time (9 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise 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 `6f25c038` fix(hash agg): split `AggGroup` inter states and outputs change build…; `96bca4ce` refactor(streaming): clean up unnecessary `metrics` field in agg exec…; `4726cdd3` fix(stream agg): use executor schema derived by optimizer instead of … — run `git show` on any of them.
  • Change coupling: simd_json_parser.rs ↔ simd_json_parser.rs src/connector/src/parser/debezium/simd_json_parser.rs:1 — `src/connector/src/parser/debezium/simd_json_parser.rs` and `src/connector/src/parser/maxwell/simd_json_parser.rs` change together 87% of the time (13 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 13 shared commits counted here, the most recent 3 are `af8aee94` fix(mysql-cdc): up cast all unsigned int types (#23278); `755c8202` feat(cdc): allow user config `debezium.time.precision.mode` to handle…; `9b5bcdc3` refactor(source): cleanup unused `ParserProperties::key_encoding_conf… — run `git show` on any of them.
  • Change coupling: create_sink.rs ↔ drop_sink.rs src/frontend/src/handler/create_sink.rs:1 — `src/frontend/src/handler/create_sink.rs` and `src/frontend/src/handler/drop_sink.rs` change together 80% of the time (12 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 12 shared commits counted here, the most recent 3 are `92b1757b` feat(frontend): improve notifications for slow DDL (CREATE TABLE and …; `f8414794` feat: manage all catalogs of the iceberg table in a transactional man…; `db6887f4` refactor(meta): deprecate incoming sinks fields in Table (#23091) — run `git show` on any of them.
  • Change coupling: stream_simple_agg.rs ↔ stream_stateless_simple_agg.rs src/frontend/src/optimizer/plan_node/stream_simple_agg.rs:1 — `src/frontend/src/optimizer/plan_node/stream_simple_agg.rs` and `src/frontend/src/optimizer/plan_node/stream_stateless_simple_agg.rs` change together 79% of the time (11 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `ef3e9e6e` fix(planner): reject impure expressions on retract stream on `to_prot…; `3abd4da1` refactor(optimizer): introduce `Upsert` stream kind & reject it in ma…; `4d629b76` fix(optimizer): let it panic when calling `dist_column_indices` on `S… — run `git show` on any of them.
  • Change coupling: stream_group_topn.rs ↔ stream_topn.rs src/frontend/src/optimizer/plan_node/stream_group_topn.rs:1 — `src/frontend/src/optimizer/plan_node/stream_group_topn.rs` and `src/frontend/src/optimizer/plan_node/stream_topn.rs` change together 79% of the time (11 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `62e18582` feat(stream): forward watermarks through TopN executors (#27056); `3abd4da1` refactor(optimizer): introduce `Upsert` stream kind & reject it in ma…; `a1f114c0` fix(stream topn): fix pk indices of `TopN` and `GroupTopN` (#12840) — run `git show` on any of them.
  • Change coupling: fs_fetch.rs ↔ trad_source.rs src/stream/src/from_proto/source/fs_fetch.rs:1 — `src/stream/src/from_proto/source/fs_fetch.rs` and `src/stream/src/from_proto/source/trad_source.rs` change together 75% of the time (9 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise 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 `21f60ba1` fix(source): complete S3/GCS FULL_RELOAD refresh (#26016); `3572992f` refactor: make batch posix source follow new stream plan (#23504); `ff495144` fix: deprecate `SinkPayloadFormat` (#16723) — run `git show` on any of them.
  • Change coupling: json_parser.rs ↔ simd_json_parser.rs src/connector/src/parser/json_parser.rs:1 — `src/connector/src/parser/json_parser.rs` and `src/connector/src/parser/maxwell/simd_json_parser.rs` change together 73% of the time (11 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `af175db5` feat(source): `encode json` option `timestamptz.handling.mode` (#16265); `61ab2cd6` feat(source): support json schema (#11797); `cf0940c6` refactor(connector): avoid using macro in parser (#10120) — run `git show` on any of them.
  • Change coupling: expr_udf.rs ↔ user_defined.rs src/expr/core/src/expr/expr_udf.rs:1 — `src/expr/core/src/expr/expr_udf.rs` and `src/expr/core/src/table_function/user_defined.rs` change together 72% of the time (13 of the 18 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 13 shared commits counted here, the most recent 3 are `0cc54b3f` feat(udf): introduce async and batched JavaScript UDF (#20403); `94154c03` refactor(udf): remove `function_type` field previously used by Deno U…; `ff02b76c` fix(udf): add `embedded-python-udf` feature and fix dockerfile (#15328) — run `git show` on any of them.
  • Change coupling: tests.rs ↔ stream_manager.rs src/stream/src/task/barrier_worker/tests.rs:1 — `src/stream/src/task/barrier_worker/tests.rs` and `src/stream/src/task/stream_manager.rs` change together 70% of the time (14 of the 20 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 14 shared commits counted here, the most recent 3 are `9e06d990` refactor(stream): reorg types and add docs for BarrierWorker and stuf…; `3b3a1c5f` refactor(barrier): explicitly maintain database barrier state separat… (at that commit the file was still `src/stream/src/task/barrier_manager/tests.rs`); `a3c6e48c` refactor: unify to subscribe mutation via barrier sender (#18255) (at that commit the file was still `src/stream/src/task/barrier_manager/tests.rs`) — run `git show` on any of them.
  • Change coupling: REDACTED ↔ REDACTED src/meta/src/barrier/checkpoint/independent_job/batch_refresh_job/mod.rs:1 — `src/meta/src/barrier/checkpoint/independent_job/batch_refresh_job/mod.rs` and `src/meta/src/barrier/checkpoint/independent_job/creating_job/mod.rs` change together 70% of the time (7 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `6c209699` refactor(meta): unify independent checkpoint job handling (#26980); `f8c59cff` refactor(meta): unify independent job actor rendering (#26979); `094da6ff` feat(iceberg): prepare PK-index compaction switching (#26975) — run `git show` on any of them.
  • Change coupling: stream_dynamic_filter.rs ↔ stream_union.rs src/frontend/src/optimizer/plan_node/stream_dynamic_filter.rs:1 — `src/frontend/src/optimizer/plan_node/stream_dynamic_filter.rs` and `src/frontend/src/optimizer/plan_node/stream_union.rs` change together 70% of the time (7 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise 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 `3abd4da1` refactor(optimizer): introduce `Upsert` stream kind & reject it in ma…; `bd150ec3` refactor(plan_node_fmt): only 9 types are left!! (#10359); `c75ad9f5` refactor(explain): introduce `formatter_debug_plan_node` for convenie… — run `git show` on any of them.
  • Change coupling: test_utils.rs ↔ store_impl.rs src/storage/src/hummock/iterator/test_utils.rs:1 — `src/storage/src/hummock/iterator/test_utils.rs` and `src/storage/src/store_impl.rs` change together 69% of the time (11 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `cd1686d2` fix: fix sstable serde to avoid losing bloom filter (#24025); `6a70b106` feat(storage): support hummock FLAT index (#21820); `7688ce1f` chore: bump foyer + mixtrics (#22360) — run `git show` on any of them.
  • Change coupling: main.rs ↔ store_impl.rs src/storage/hummock_test/src/bin/replay/main.rs:1 — `src/storage/hummock_test/src/bin/replay/main.rs` and `src/storage/src/store_impl.rs` change together 68% of the time (13 of the 19 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 13 shared commits counted here, the most recent 3 are `cd1686d2` fix: fix sstable serde to avoid losing bloom filter (#24025); `6a70b106` feat(storage): support hummock FLAT index (#21820); `7688ce1f` chore: bump foyer + mixtrics (#22360) — run `git show` on any of them.
  • Change coupling: managed_state.rs ↔ tests.rs src/stream/src/task/barrier_worker/managed_state.rs:1 — `src/stream/src/task/barrier_worker/managed_state.rs` and `src/stream/src/task/barrier_worker/tests.rs` change together 65% of the time (13 of the 20 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 13 shared commits counted here, the most recent 3 are `a4257b12` feat(meta): support Iceberg V3 change log truncation (#27465); `73387f59` fix(meta): fence stale exchange requests across database recovery (#2…; `9e06d990` refactor(stream): reorg types and add docs for BarrierWorker and stuf… — run `git show` on any of them.
  • Change coupling: status.rs ↔ rpc.rs src/meta/src/barrier/checkpoint/independent_job/creating_job/status.rs:1 — `src/meta/src/barrier/checkpoint/independent_job/creating_job/status.rs` and `src/meta/src/barrier/rpc.rs` change together 62% of the time (13 of the 21 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) 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 13 shared commits counted here, the most recent 3 are `89727dbc` refactor(stream): delay snapshot backfill runtime edges (#26776); `6c209699` refactor(meta): unify independent checkpoint job handling (#26980); `06415d7f` refactor(meta): unify independent job reset handling (#26806) — run `git show` on any of them.
  • Change coupling: chain.rs ↔ values.rs src/stream/src/executor/chain.rs:1 — `src/stream/src/executor/chain.rs` and `src/stream/src/executor/values.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, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise 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 `438ab534` feat(ddl): Make UpstreamSinkUnion node dynamically handle upstreams (…; `0c8b4c34` refactor(stream): store shared context in local barrier manager (#21257); `29d2e1ef` refactor: track progress minor refactor (#18446) — run `git show` on any of them.
  • Change coupling: FragmentGraph.tsx ↔ relation_graph.tsx dashboard/components/FragmentGraph.tsx:1 — `dashboard/components/FragmentGraph.tsx` and `dashboard/pages/relation_graph.tsx` 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, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `59dccd3d` feat(dashboard): add Prometheus-based streaming stats with backpressu…; `ada38dc0` feat(dashboard): add throughput (rows/s) metrics (#19972); `ad95d102` feat(dashboard): improve relation & fragment graph (#19872) — run `git show` on any of them.
  • Change coupling: config.rs ↔ risedev_env.rs src/risedevtool/src/config.rs:1 — `src/risedevtool/src/config.rs` and `src/risedevtool/src/risedev_env.rs` change together 59% of the time (13 of the 22 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 13 shared commits counted here, the most recent 3 are `87880454` feat(connector): initialize Oracle heartbeat tables automatically and…; `7e5b5f5f` feat(risedev): support Docker-backed clickhouse sink tests (#26653); `f6d53aeb` test(iceberg): add Glue catalog e2e coverage (#26167) — run `git show` on any of them.
  • Change coupling: state_table.rs ↔ sort.rs src/stream/src/common/table/state_table.rs:1 — `src/stream/src/common/table/state_table.rs` and `src/stream/src/executor/eowc/sort.rs` change together 59% of the time (10 of the 17 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `1fb03281` fix(stream): hide rows below the pending watermark from state table r…; `8641a0c6` fix(streaming): some executors should always clear the cache on scali…; `0ab6a4a8` feat(storage): wait committed epoch when update vnode bitmap (#20492) (at that commit the file was still `src/stream/src/executor/sort.rs`) — run `git show` on any of them.
  • Change coupling: apply_agg_transpose_rule.rs ↔ distinct_agg_rule.rs src/frontend/src/optimizer/rule/apply_agg_transpose_rule.rs:1 — `src/frontend/src/optimizer/rule/apply_agg_transpose_rule.rs` and `src/frontend/src/optimizer/rule/distinct_agg_rule.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, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise 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 `6834de8b` feat(frontend): add stateless two-phase `ApproxPercentile` (#17469); `95956671` feat: disable some two phase agg (#12185); `f9025d1b` feat(frontend): support grouping sets (#10807) — run `git show` on any of them.
  • Change coupling: alter_table_with_sr.rs ↔ create_table.rs src/frontend/src/handler/alter_table_with_sr.rs:1 — `src/frontend/src/handler/alter_table_with_sr.rs` and `src/frontend/src/handler/create_table.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, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise 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 `b5e216c4` feat: enable clippy lints for stack overflow detection & fix warnings…; `1211b82d` refactor(frontend): defer converting into `PbTable` or `PbSource` unt…; `f0db87be` feat(frontend): use purified definition for replacing table (#20131) — run `git show` on any of them.
  • Change coupling: alter_table_with_sr.rs ↔ create_sink.rs src/frontend/src/handler/alter_table_with_sr.rs:1 — `src/frontend/src/handler/alter_table_with_sr.rs` and `src/frontend/src/handler/create_sink.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, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise 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 `db6887f4` refactor(meta): deprecate incoming sinks fields in Table (#23091); `1211b82d` refactor(frontend): defer converting into `PbTable` or `PbSource` unt…; `b7d763ac` refactor: remove `col_index_mapping` when replacing table (#21685) — run `git show` on any of them.
  • Change coupling: stage.rs ↔ local.rs src/frontend/src/scheduler/distributed/stage.rs:1 — `src/frontend/src/scheduler/distributed/stage.rs` and `src/frontend/src/scheduler/local.rs` change together 57% of the time (26 of the 46 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 26 shared commits counted here, the most recent 3 are `7eda10ef` fix(batch): cap masked fragment mapping parallelism (#26560); `ee473f1a` refactor(frontend): per convention PlanNodeType enum (#22792); `ba76431f` feat(batch): add `batch_expr_strict_mode` to ignore expression error … — run `git show` on any of them.
  • + 22 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×47
  • Duplicated block (6 lines × 2) src/batch/executors/src/executor/iceberg_scan.rs:186 — src/batch/executors/src/executor/iceberg_scan.rs:186-191 | src/batch/executors/src/executor/source.rs:98-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.
  • Duplicated block (6 lines × 2) src/common/heap_profiling/src/profile_service.rs:128 — src/common/heap_profiling/src/profile_service.rs:128-133 | src/common/heap_profiling/src/profile_service.rs:141-146 — both copies are in the same file, so extract the 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) src/connector/src/connector_common/iceberg/jni_catalog.rs:317 — src/connector/src/connector_common/iceberg/jni_catalog.rs:317-322 | src/connector/src/connector_common/iceberg/jni_catalog.rs:376-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 (6 lines × 2) src/connector/src/parser/unified/debezium.rs:1361 — src/connector/src/parser/unified/debezium.rs:1361-1366 | src/connector/src/parser/unified/debezium.rs:1396-1401 — both copies are in the same file, so extract the 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) src/connector/src/source/pulsar/source/reader.rs:430 — src/connector/src/source/pulsar/source/reader.rs:430-435 | src/connector/src/source/pulsar/source/reader.rs:470-475 — both copies are in the same file, so extract the 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) src/expr/core/src/expr/expr_udf.rs:62 — src/expr/core/src/expr/expr_udf.rs:62-67 | src/expr/core/src/table_function/user_defined.rs:52-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 (6 lines × 2) src/expr/macro/src/gen.rs:342 — src/expr/macro/src/gen.rs:342-347 | src/expr/macro/src/gen.rs:352-357 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) src/expr/macro/src/gen.rs:777 — src/expr/macro/src/gen.rs:777-783 | src/expr/macro/src/gen.rs:1146-1151 — both copies are in the same file, so extract the 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) src/expr/macro/src/lib.rs:427 — src/expr/macro/src/lib.rs:427-432 | src/expr/macro/src/lib.rs:455-460 — both copies are in the same file, so extract the 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) src/expr/macro/src/lib.rs:473 — src/expr/macro/src/lib.rs:473-478 | src/expr/macro/src/lib.rs:491-496 — both copies are in the same file, so extract the 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) src/frontend/src/expr/table_function.rs:194 — src/frontend/src/expr/table_function.rs:194-199 | src/frontend/src/optimizer/rule/table_function_to_file_scan_rule.rs:72-77 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) src/frontend/src/optimizer/plan_node/stream_simple_agg.rs:121 — src/frontend/src/optimizer/plan_node/stream_simple_agg.rs:121-126 | src/frontend/src/optimizer/plan_node/stream_stateless_simple_agg.rs:95-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 (6 lines × 2) src/frontend/src/optimizer/rule/apply_join_transpose_rule.rs:611 — src/frontend/src/optimizer/rule/apply_join_transpose_rule.rs:611-616 | src/frontend/src/optimizer/rule/index_selection_rule.rs:745-750 — 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) src/frontend/src/scheduler/distributed/stage.rs:407 — src/frontend/src/scheduler/distributed/stage.rs:407-416 | src/frontend/src/scheduler/distributed/stage.rs:434-439 — both copies are in the same file, so extract the 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) src/jni_core/src/lib.rs:1104 — src/jni_core/src/lib.rs:1104-1109 | src/jni_core/src/lib.rs:1228-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 (6 lines × 2) src/meta/src/controller/catalog/util.rs:100 — src/meta/src/controller/catalog/util.rs:100-105 | src/meta/src/controller/catalog/util.rs:321-326 — both copies are in the same file, so extract the 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) src/meta/src/manager/diagnose.rs:186 — src/meta/src/manager/diagnose.rs:186-191 | src/meta/src/manager/diagnose.rs:1034-1039 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) src/sqlparser/src/parser.rs:5790 — src/sqlparser/src/parser.rs:5790-5796 | src/sqlparser/src/parser.rs:6846-6851 — both copies are in the same file, so extract the 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) src/storage/src/mem_table.rs:265 — src/storage/src/mem_table.rs:265-270 | src/storage/src/mem_table.rs:331-336 — both copies are in the same file, so extract the 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) src/stream/src/executor/dynamic_filter.rs:238 — src/stream/src/executor/dynamic_filter.rs:238-243 | src/stream/src/executor/dynamic_filter.rs:247-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.
  • Duplicated block (6 lines × 2) src/stream/src/executor/over_window/frame_finder.rs:414 — src/stream/src/executor/over_window/frame_finder.rs:414-419 | src/stream/src/executor/over_window/frame_finder.rs:434-439 — both copies are in the same file, so extract the 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) src/stream/src/executor/top_n/group_top_n.rs:202 — src/stream/src/executor/top_n/group_top_n.rs:202-207 | src/stream/src/executor/top_n/group_top_n_appendonly.rs:185-190 — before extracting anything, compare `src/stream/src/executor/top_n/group_top_n.rs` and `src/stream/src/executor/top_n/group_top_n_appendonly.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 69 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 (6 lines × 2) src/batch/executors/src/executor/project_set.rs:208 — src/batch/executors/src/executor/project_set.rs:208-213 | src/stream/src/executor/project/project_set.rs:362-367 — 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) src/common/src/array/num256_array.rs:133 — src/common/src/array/num256_array.rs:133-138 | src/common/src/array/primitive_array.rs:304-309 — 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) src/connector/src/sink/snowflake_redshift/redshift.rs:357 — src/connector/src/sink/snowflake_redshift/redshift.rs:357-362 | src/connector/src/sink/snowflake_redshift/snowflake.rs:628-633 — 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.
  • + 22 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×46
  • Duplicated block (10 lines × 2) src/batch/executors/src/executor/aggregation/orderby.rs:78 — src/batch/executors/src/executor/aggregation/orderby.rs:78-87 | src/frontend/src/datafusion/aggregate/orderby.rs:79-88 — before extracting anything, compare `src/batch/executors/src/executor/aggregation/orderby.rs` and `src/frontend/src/datafusion/aggregate/orderby.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 2) src/batch/executors/src/executor/hash_agg.rs:436 — src/batch/executors/src/executor/hash_agg.rs:436-445 | src/batch/executors/src/executor/order_by.rs:401-410 — before extracting anything, compare `src/batch/executors/src/executor/hash_agg.rs` and `src/batch/executors/src/executor/order_by.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 64 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) src/connector/src/sink/starrocks.rs:584 — src/connector/src/sink/starrocks.rs:584-593 | src/connector/src/sink/starrocks.rs:607-616 — both copies are in the same file, so extract the 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) src/expr/impl/src/scalar/jsonb_path.rs:77 — src/expr/impl/src/scalar/jsonb_path.rs:77-86 | src/expr/impl/src/scalar/jsonb_path.rs:99-108 — both copies are in the same file, so extract the 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) src/expr/macro/src/gen.rs:153 — src/expr/macro/src/gen.rs:153-162 | src/expr/macro/src/gen.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) src/expr/macro/src/gen.rs:470 — src/expr/macro/src/gen.rs:470-479 | src/expr/macro/src/gen.rs:1304-1313 — both copies are in the same file, so extract the 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) src/frontend/src/binder/for_system.rs:36 — src/frontend/src/binder/for_system.rs:36-45 | src/frontend/src/binder/for_system.rs:53-62 — both copies are in the same file, so extract the 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) src/frontend/src/handler/alter_owner.rs:94 — src/frontend/src/handler/alter_owner.rs:94-103 | src/frontend/src/handler/alter_owner.rs:108-117 — both copies are in the same file, so extract the 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) src/frontend/src/handler/alter_rename.rs:296 — src/frontend/src/handler/alter_rename.rs:296-305 | src/frontend/src/handler/drop_database.rs:62-71 — 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) src/frontend/src/handler/create_aggregate.rs:138 — src/frontend/src/handler/create_aggregate.rs:138-147 | src/frontend/src/handler/create_function.rs:193-202 — before extracting anything, compare `src/frontend/src/handler/create_aggregate.rs` and `src/frontend/src/handler/create_function.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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) src/frontend/src/handler/create_function.rs:187 — src/frontend/src/handler/create_function.rs:187-196 | src/frontend/src/handler/create_sql_function.rs:159-168 — before extracting anything, compare `src/frontend/src/handler/create_function.rs` and `src/frontend/src/handler/create_sql_function.rs` as WHOLE FILES: this scan already matched 4 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. 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) src/frontend/src/optimizer/plan_node/generic/hop_window.rs:253 — src/frontend/src/optimizer/plan_node/generic/hop_window.rs:253-262 | src/frontend/src/optimizer/plan_node/generic/hop_window.rs:275-284 — both copies are in the same file, so extract the 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) src/frontend/src/optimizer/plan_node/generic/join.rs:234 — src/frontend/src/optimizer/plan_node/generic/join.rs:234-243 | src/frontend/src/optimizer/plan_node/stream_hash_join.rs:356-365 — before extracting anything, compare `src/frontend/src/optimizer/plan_node/generic/join.rs` and `src/frontend/src/optimizer/plan_node/stream_hash_join.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 2) src/frontend/src/optimizer/plan_node/generic/join.rs:243 — src/frontend/src/optimizer/plan_node/generic/join.rs:243-252 | src/frontend/src/optimizer/plan_node/stream_asof_join.rs:179-188 — before extracting anything, compare `src/frontend/src/optimizer/plan_node/generic/join.rs` and `src/frontend/src/optimizer/plan_node/stream_asof_join.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 (10 lines × 2) src/frontend/src/optimizer/plan_node/generic/join.rs:332 — src/frontend/src/optimizer/plan_node/generic/join.rs:332-341 | src/frontend/src/optimizer/plan_node/generic/join.rs:345-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 (10 lines × 2) src/frontend/src/optimizer/plan_node/generic/join.rs:511 — src/frontend/src/optimizer/plan_node/generic/join.rs:511-520 | src/frontend/src/optimizer/plan_node/generic/join.rs:534-543 — both copies are in the same file, so extract the 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) src/frontend/src/optimizer/plan_node/generic/table_scan.rs:268 — src/frontend/src/optimizer/plan_node/generic/table_scan.rs:268-277 | src/frontend/src/optimizer/rule/index_selection_rule.rs:193-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.
  • Duplicated block (10 lines × 2) src/frontend/src/optimizer/plan_node/logical_join.rs:431 — src/frontend/src/optimizer/plan_node/logical_join.rs:431-440 | src/frontend/src/optimizer/plan_node/logical_join.rs:1204-1213 — both copies are in the same file, so extract the 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) src/frontend/src/optimizer/plan_node/logical_union.rs:201 — src/frontend/src/optimizer/plan_node/logical_union.rs:201-210 | src/frontend/src/optimizer/plan_node/logical_union.rs:275-284 — both copies are in the same file, so extract the 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) src/frontend/src/optimizer/plan_node/stream_asof_join.rs:228 — src/frontend/src/optimizer/plan_node/stream_asof_join.rs:228-237 | src/frontend/src/optimizer/plan_node/stream_hash_join.rs:581-590 — before extracting anything, compare `src/frontend/src/optimizer/plan_node/stream_asof_join.rs` and `src/frontend/src/optimizer/plan_node/stream_hash_join.rs` as WHOLE FILES: this scan already matched 6 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. 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) src/frontend/src/optimizer/plan_node/stream_locality_provider.rs:257 — src/frontend/src/optimizer/plan_node/stream_locality_provider.rs:257-266 | src/frontend/src/optimizer/plan_node/stream_table_scan.rs:275-284 — 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) src/frontend/src/utils/with_options.rs:548 — src/frontend/src/utils/with_options.rs:548-557 | src/frontend/src/utils/with_options.rs:559-568 — both copies are in the same file, so extract the 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) src/meta/src/barrier/checkpoint/state.rs:500 — src/meta/src/barrier/checkpoint/state.rs:500-509 | src/meta/src/barrier/checkpoint/state.rs:1399-1408 — both copies are in the same file, so extract the 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) src/meta/src/barrier/edge_builder.rs:625 — src/meta/src/barrier/edge_builder.rs:625-634 | src/meta/src/barrier/edge_builder.rs:682-691 — both copies are in the same file, so extract the 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) src/meta/src/controller/catalog/alter_op.rs:347 — src/meta/src/controller/catalog/alter_op.rs:347-356 | src/meta/src/controller/catalog/alter_op.rs:416-425 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 21 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×44
  • Duplicated block (11 lines × 2) src/batch/executors/src/executor/hop_window.rs:180 — src/batch/executors/src/executor/hop_window.rs:180-190 | src/stream/src/executor/hop_window.rs:142-152 — before extracting anything, compare `src/batch/executors/src/executor/hop_window.rs` and `src/stream/src/executor/hop_window.rs` as WHOLE FILES: this scan already matched 4 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.
  • Duplicated block (11 lines × 2) src/batch/executors/src/executor/join/distributed_lookup_join.rs:265 — src/batch/executors/src/executor/join/distributed_lookup_join.rs:265-275 | src/batch/executors/src/executor/join/local_lookup_join.rs:476-486 — 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) src/batch/executors/src/executor/join/nested_loop_join.rs:293 — src/batch/executors/src/executor/join/nested_loop_join.rs:293-303 | src/batch/executors/src/executor/join/nested_loop_join.rs:468-478 — both copies are in the same file, so extract the 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) src/connector/src/sink/catalog/mod.rs:458 — src/connector/src/sink/catalog/mod.rs:458-468 | src/connector/src/sink/mod.rs:371-381 — 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) src/connector/src/sink/iceberg/writer.rs:411 — src/connector/src/sink/iceberg/writer.rs:411-421 | src/connector/src/sink/iceberg/writer.rs:627-637 — both copies are in the same file, so extract the 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) src/connector/src/source/cdc/external/postgres.rs:444 — src/connector/src/source/cdc/external/postgres.rs:444-454 | src/connector/src/source/cdc/external/postgres.rs:455-465 — both copies are in the same file, so extract the 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) src/frontend/src/binder/expr/function/mod.rs:1066 — src/frontend/src/binder/expr/function/mod.rs:1066-1076 | src/frontend/src/binder/select.rs:362-372 — 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) src/frontend/src/handler/alter_set_schema.rs:56 — src/frontend/src/handler/alter_set_schema.rs:56-66 | src/frontend/src/handler/alter_set_schema.rs:70-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 (11 lines × 2) src/frontend/src/handler/explain_analyze_stream_job.rs:224 — src/frontend/src/handler/explain_analyze_stream_job.rs:224-234 | src/frontend/src/handler/explain_analyze_stream_job.rs:240-250 — both copies are in the same file, so extract the 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) src/frontend/src/monitor/stats.rs:215 — src/frontend/src/monitor/stats.rs:215-225 | src/meta/src/rpc/metrics.rs:1704-1714 — 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) src/frontend/src/optimizer/delta_join_solver.rs:344 — src/frontend/src/optimizer/delta_join_solver.rs:344-354 | src/frontend/src/optimizer/delta_join_solver.rs:369-379 — both copies are in the same file, so extract the 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) src/frontend/src/optimizer/plan_node/logical_project.rs:125 — src/frontend/src/optimizer/plan_node/logical_project.rs:125-135 | src/frontend/src/optimizer/plan_node/logical_project_set.rs:212-222 — before extracting anything, compare `src/frontend/src/optimizer/plan_node/logical_project.rs` and `src/frontend/src/optimizer/plan_node/logical_project_set.rs` as WHOLE FILES: this scan already matched 5 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. 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) src/frontend/src/optimizer/plan_node/logical_project.rs:155 — src/frontend/src/optimizer/plan_node/logical_project.rs:155-165 | src/frontend/src/optimizer/plan_node/logical_project_set.rs:255-265 — before extracting anything, compare `src/frontend/src/optimizer/plan_node/logical_project.rs` and `src/frontend/src/optimizer/plan_node/logical_project_set.rs` as WHOLE FILES: this scan already matched 5 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. 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) src/frontend/src/optimizer/plan_node/stream_asof_join.rs:212 — src/frontend/src/optimizer/plan_node/stream_asof_join.rs:212-222 | src/frontend/src/optimizer/plan_node/stream_hash_join.rs:536-546 — before extracting anything, compare `src/frontend/src/optimizer/plan_node/stream_asof_join.rs` and `src/frontend/src/optimizer/plan_node/stream_hash_join.rs` as WHOLE FILES: this scan already matched 6 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. 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) src/frontend/src/optimizer/plan_node/stream_eowc_gap_fill.rs:177 — src/frontend/src/optimizer/plan_node/stream_eowc_gap_fill.rs:177-187 | src/frontend/src/optimizer/plan_node/stream_gap_fill.rs:175-185 — before extracting anything, compare `src/frontend/src/optimizer/plan_node/stream_eowc_gap_fill.rs` and `src/frontend/src/optimizer/plan_node/stream_gap_fill.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 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) src/frontend/src/optimizer/rule/apply_join_transpose_rule.rs:369 — src/frontend/src/optimizer/rule/apply_join_transpose_rule.rs:369-379 | src/frontend/src/optimizer/rule/apply_join_transpose_rule.rs:540-551 — both copies are in the same file, so extract the 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) src/frontend/src/optimizer/rule/min_max_on_index_rule.rs:116 — src/frontend/src/optimizer/rule/min_max_on_index_rule.rs:116-126 | src/frontend/src/optimizer/rule/min_max_on_index_rule.rs:186-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 (11 lines × 2) src/frontend/src/stream_fragmenter/rewrite/delta_join.rs:293 — src/frontend/src/stream_fragmenter/rewrite/delta_join.rs:293-303 | src/frontend/src/stream_fragmenter/rewrite/delta_join.rs:305-315 — both copies are in the same file, so extract the 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) src/meta/src/controller/fragment.rs:735 — src/meta/src/controller/fragment.rs:735-745 | src/meta/src/controller/fragment.rs:746-756 — both copies are in the same file, so extract the 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) src/meta/src/controller/fragment.rs:1692 — src/meta/src/controller/fragment.rs:1692-1702 | src/meta/src/controller/scale.rs:124-134 — 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) src/meta/src/hummock/manager/timer_task.rs:303 — src/meta/src/hummock/manager/timer_task.rs:303-313 | src/meta/src/hummock/manager/timer_task.rs:322-332 — both copies are in the same file, so extract the 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) src/risedevtool/src/task/meta_node_service.rs:151 — src/risedevtool/src/task/meta_node_service.rs:151-161 | src/risedevtool/src/task/meta_node_service.rs:175-185 — both copies are in the same file, so extract the 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) src/sqlparser/src/parser.rs:2176 — src/sqlparser/src/parser.rs:2176-2186 | src/sqlparser/src/parser.rs:2651-2661 — both copies are in the same file, so extract the 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) src/stream/src/common/table/state_table.rs:2070 — src/stream/src/common/table/state_table.rs:2070-2080 | src/stream/src/common/table/state_table.rs:2155-2165 — both copies are in the same file, so extract the 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) src/stream/src/executor/asof_join.rs:221 — src/stream/src/executor/asof_join.rs:221-231 | src/stream/src/executor/hash_join.rs:385-395 — before extracting anything, compare `src/stream/src/executor/asof_join.rs` and `src/stream/src/executor/hash_join.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 245 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.
  • + 19 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×40
  • Duplicated block (13 lines × 2) src/batch/executors/src/executor/join/hash_join.rs:505 — src/batch/executors/src/executor/join/hash_join.rs:505-517 | src/batch/executors/src/executor/order_by.rs:134-146 — 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) src/batch/executors/src/executor/join/hash_join.rs:744 — src/batch/executors/src/executor/join/hash_join.rs:744-756 | src/batch/executors/src/executor/join/lookup_join_base.rs:212-224 — 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) src/batch/executors/src/executor/join/nested_loop_join.rs:311 — src/batch/executors/src/executor/join/nested_loop_join.rs:311-323 | src/batch/executors/src/executor/join/nested_loop_join.rs:499-511 — both copies are in the same file, so extract the 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) src/batch/executors/src/executor/join/nested_loop_join.rs:381 — src/batch/executors/src/executor/join/nested_loop_join.rs:381-393 | src/batch/executors/src/executor/join/nested_loop_join.rs:425-437 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) src/common/src/types/to_binary.rs:104 — src/common/src/types/to_binary.rs:104-116 | src/common/src/types/to_binary.rs:127-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 (13 lines × 2) src/connector/src/sink/elasticsearch_opensearch/elasticsearch_opensearch_config.rs:258 — src/connector/src/sink/elasticsearch_opensearch/elasticsearch_opensearch_config.rs:258-270 | src/connector/src/sink/elasticsearch_opensearch/elasticsearch_opensearch_config.rs:272-284 — both copies are in the same file, so extract the 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) src/connector/src/source/cdc/external/postgres.rs:404 — src/connector/src/source/cdc/external/postgres.rs:404-416 | src/connector/src/source/cdc/external/postgres.rs:695-707 — both copies are in the same file, so extract the 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) src/frontend/src/catalog/system_catalog/rw_catalog/rw_iceberg_all_files.rs:100 — src/frontend/src/catalog/system_catalog/rw_catalog/rw_iceberg_all_files.rs:100-112 | src/frontend/src/catalog/system_catalog/rw_catalog/rw_iceberg_files.rs:92-104 — before extracting anything, compare `src/frontend/src/catalog/system_catalog/rw_catalog/rw_iceberg_all_files.rs` and `src/frontend/src/catalog/system_catalog/rw_catalog/rw_iceberg_files.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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) src/frontend/src/metrics_reader.rs:126 — src/frontend/src/metrics_reader.rs:126-138 | src/meta/src/dashboard/mod.rs:902-914 — before extracting anything, compare `src/frontend/src/metrics_reader.rs` and `src/meta/src/dashboard/mod.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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) src/frontend/src/optimizer/plan_node/stream_cdc_table_scan.rs:166 — src/frontend/src/optimizer/plan_node/stream_cdc_table_scan.rs:166-178 | src/frontend/src/optimizer/plan_node/stream_source_scan.rs:108-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 (13 lines × 2) src/frontend/src/optimizer/plan_node/stream_eowc_gap_fill.rs:150 — src/frontend/src/optimizer/plan_node/stream_eowc_gap_fill.rs:150-162 | src/frontend/src/optimizer/plan_node/stream_gap_fill.rs:143-155 — before extracting anything, compare `src/frontend/src/optimizer/plan_node/stream_eowc_gap_fill.rs` and `src/frontend/src/optimizer/plan_node/stream_gap_fill.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 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) src/frontend/src/optimizer/rule/apply_join_transpose_rule.rs:350 — src/frontend/src/optimizer/rule/apply_join_transpose_rule.rs:350-362 | src/frontend/src/optimizer/rule/apply_join_transpose_rule.rs:510-522 — both copies are in the same file, so extract the 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) src/frontend/src/optimizer/rule/except_to_anti_join_rule.rs:26 — src/frontend/src/optimizer/rule/except_to_anti_join_rule.rs:26-38 | src/frontend/src/optimizer/rule/intersect_to_semi_join_rule.rs:28-40 — 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) src/java_binding/src/lib.rs:56 — src/java_binding/src/lib.rs:56-68 | src/jni_core/src/jvm_runtime.rs:161-173 — 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) src/meta/model/migration/src/m20240820_081248_add_time_travel_per_table_epoch.rs:14 — src/meta/model/migration/src/m20240820_081248_add_time_travel_per_table_epoch.rs:14-26 | src/meta/model/migration/src/m20240820_081248_add_time_travel_per_table_epoch.rs:33-45 — both copies are in the same file, so extract the 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) src/meta/service/src/ddl_service.rs:1570 — src/meta/service/src/ddl_service.rs:1570-1582 | src/meta/service/src/ddl_service.rs:1593-1605 — both copies are in the same file, so extract the 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) src/meta/src/controller/streaming_job.rs:662 — src/meta/src/controller/streaming_job.rs:662-674 | src/meta/src/controller/streaming_job.rs:835-847 — both copies are in the same file, so extract the 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) src/meta/src/controller/streaming_job.rs:1470 — src/meta/src/controller/streaming_job.rs:1470-1482 | src/meta/src/controller/streaming_job.rs:2522-2534 — both copies are in the same file, so extract the 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) src/meta/src/controller/streaming_job.rs:3429 — src/meta/src/controller/streaming_job.rs:3429-3441 | src/meta/src/controller/streaming_job.rs:3476-3488 — both copies are in the same file, so extract the 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) src/meta/src/manager/diagnose.rs:891 — src/meta/src/manager/diagnose.rs:891-903 | src/meta/src/manager/diagnose.rs:948-960 — both copies are in the same file, so extract the 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) src/sqlparser/src/parser.rs:2901 — src/sqlparser/src/parser.rs:2901-2913 | src/sqlparser/src/parser.rs:3016-3028 — both copies are in the same file, so extract the 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) src/storage/src/hummock/store/local_hummock_storage.rs:848 — src/storage/src/hummock/store/local_hummock_storage.rs:848-860 | src/storage/src/hummock/store/local_hummock_storage.rs:930-942 — both copies are in the same file, so extract the 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) src/stream/src/executor/asof_join.rs:233 — src/stream/src/executor/asof_join.rs:233-245 | src/stream/src/executor/hash_join.rs:402-414 — before extracting anything, compare `src/stream/src/executor/asof_join.rs` and `src/stream/src/executor/hash_join.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 245 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) src/stream/src/executor/backfill/cdc/upstream_table/snapshot.rs:181 — src/stream/src/executor/backfill/cdc/upstream_table/snapshot.rs:181-193 | src/stream/src/executor/backfill/cdc/upstream_table/snapshot.rs:275-287 — both copies are in the same file, so extract the 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) src/stream/src/executor/over_window/range_cache.rs:233 — src/stream/src/executor/over_window/range_cache.rs:233-245 | src/stream/src/executor/over_window/range_cache.rs:279-291 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 15 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×40
  • Duplicated block (5 lines × 2) src/connector/src/sink/doris_starrocks_connector.rs:245 — src/connector/src/sink/doris_starrocks_connector.rs:245-249 | src/connector/src/sink/doris_starrocks_connector.rs:505-509 — both copies are in the same file, so extract the 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) src/connector/src/sink/snowflake_redshift/redshift.rs:726 — src/connector/src/sink/snowflake_redshift/redshift.rs:726-730 | src/connector/src/sink/snowflake_redshift/redshift.rs:763-767 — both copies are in the same file, so extract the 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) src/connector/src/source/cdc/external/mysql.rs:942 — src/connector/src/source/cdc/external/mysql.rs:942-946 | REDACTED:417-421 — 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) src/expr/core/src/aggregate/def.rs:183 — src/expr/core/src/aggregate/def.rs:183-187 | src/expr/core/src/aggregate/def.rs:202-206 — both copies are in the same file, so extract the 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) src/frontend/src/catalog/system_catalog/rw_catalog/rw_relation_info.rs:212 — src/frontend/src/catalog/system_catalog/rw_catalog/rw_relation_info.rs:212-216 | src/frontend/src/catalog/system_catalog/rw_catalog/rw_relation_info.rs:231-235 — both copies are in the same file, so extract the 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) src/frontend/src/expr/utils.rs:342 — src/frontend/src/expr/utils.rs:342-346 | src/frontend/src/expr/utils.rs:355-359 — both copies are in the same file, so extract the 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) src/frontend/src/observer/observer_manager.rs:260 — src/frontend/src/observer/observer_manager.rs:260-264 | src/frontend/src/observer/observer_manager.rs:281-285 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) src/frontend/src/optimizer/plan_node/batch_hash_join.rs:237 — src/frontend/src/optimizer/plan_node/batch_hash_join.rs:237-241 | src/frontend/src/optimizer/plan_node/batch_nested_loop_join.rs:128-132 — 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) src/frontend/src/optimizer/plan_node/batch_log_seq_scan.rs:90 — src/frontend/src/optimizer/plan_node/batch_log_seq_scan.rs:90-94 | src/frontend/src/optimizer/plan_node/stream_cdc_table_scan.rs:131-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 both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) src/frontend/src/optimizer/rule/apply_join_transpose_rule.rs:257 — src/frontend/src/optimizer/rule/apply_join_transpose_rule.rs:257-261 | src/frontend/src/optimizer/rule/apply_join_transpose_rule.rs:343-347 — both copies are in the same file, so extract the 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) src/frontend/src/optimizer/rule/apply_join_transpose_rule.rs:389 — src/frontend/src/optimizer/rule/apply_join_transpose_rule.rs:389-393 | src/frontend/src/optimizer/rule/apply_join_transpose_rule.rs:560-564 — both copies are in the same file, so extract the 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) src/meta/src/controller/catalog/util.rs:649 — src/meta/src/controller/catalog/util.rs:649-653 | src/meta/src/controller/catalog/util.rs:659-663 — both copies are in the same file, so extract the 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) src/meta/src/controller/streaming_job.rs:3179 — src/meta/src/controller/streaming_job.rs:3179-3183 | src/meta/src/controller/streaming_job.rs:3252-3256 — both copies are in the same file, so extract the 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) src/meta/src/hummock/compaction/picker/manual_compaction_picker.rs:302 — src/meta/src/hummock/compaction/picker/manual_compaction_picker.rs:302-307 | src/meta/src/hummock/compaction/picker/min_overlap_compaction_picker.rs:152-156 — 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) src/object_store/src/object/mem.rs:232 — src/object_store/src/object/mem.rs:232-236 | src/object_store/src/object/sim/mod.rs:102-106 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) src/sqlparser/src/parser.rs:2490 — src/sqlparser/src/parser.rs:2490-2494 | src/sqlparser/src/parser.rs:2509-2513 — both copies are in the same file, so extract the 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) src/storage/hummock_sdk/src/key.rs:242 — src/storage/hummock_sdk/src/key.rs:242-246 | src/storage/hummock_sdk/src/key.rs:273-277 — both copies are in the same file, so extract the 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) src/storage/src/hummock/compactor/compaction_utils.rs:302 — src/storage/src/hummock/compactor/compaction_utils.rs:302-306 | src/storage/src/hummock/compactor/shared_buffer_compact.rs:380-384 — 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) src/stream/src/common/table/state_table.rs:1352 — src/stream/src/common/table/state_table.rs:1352-1356 | src/stream/src/common/table/state_table.rs:1412-1416 — both copies are in the same file, so extract the 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) src/stream/src/executor/approx_percentile/local.rs:69 — src/stream/src/executor/approx_percentile/local.rs:69-73 | src/stream/src/executor/approx_percentile/local.rs: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) src/stream/src/executor/backfill/utils.rs:139 — src/stream/src/executor/backfill/utils.rs:139-143 | src/stream/src/executor/backfill/utils.rs:150-154 — both copies are in the same file, so extract the 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) src/stream/src/executor/iceberg_with_pk_index/compaction_resolver.rs:411 — src/stream/src/executor/iceberg_with_pk_index/compaction_resolver.rs:411-415 | src/stream/src/executor/iceberg_with_pk_index/compaction_resolver.rs:456-460 — both copies are in the same file, so extract the 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) src/stream/src/executor/iceberg_with_pk_index/compaction_resolver.rs:426 — src/stream/src/executor/iceberg_with_pk_index/compaction_resolver.rs:426-430 | src/stream/src/executor/iceberg_with_pk_index/compaction_resolver.rs:472-476 — both copies are in the same file, so extract the 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) src/batch/executors/src/executor/hash_agg.rs:462 — src/batch/executors/src/executor/hash_agg.rs:462-466 | src/batch/executors/src/executor/order_by.rs:418-422 — before extracting anything, compare `src/batch/executors/src/executor/hash_agg.rs` and `src/batch/executors/src/executor/order_by.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 64 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) src/frontend/src/catalog/source_catalog.rs:130 — src/frontend/src/catalog/source_catalog.rs:130-134 | src/frontend/src/catalog/table_catalog.rs:293-297 — 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.
  • + 15 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×34
  • Duplicated block (12 lines × 2) src/batch/executors/src/executor/aggregation/orderby.rs:136 — src/batch/executors/src/executor/aggregation/orderby.rs:136-147 | src/frontend/src/datafusion/aggregate/orderby.rs:137-148 — before extracting anything, compare `src/batch/executors/src/executor/aggregation/orderby.rs` and `src/frontend/src/datafusion/aggregate/orderby.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 2) src/batch/executors/src/executor/join/hash_join.rs:1257 — src/batch/executors/src/executor/join/hash_join.rs:1257-1268 | src/batch/executors/src/executor/join/hash_join.rs:1506-1517 — both copies are in the same file, so extract the 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) src/common/src/util/scan_range.rs:147 — src/common/src/util/scan_range.rs:147-158 | src/common/src/util/scan_range.rs:199-210 — both copies are in the same file, so extract the 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) src/connector/src/sink/dynamodb.rs:166 — src/connector/src/sink/dynamodb.rs:166-177 | src/connector/src/sink/dynamodb.rs:262-273 — both copies are in the same file, so extract the 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) src/expr/impl/src/scalar/jsonb_delete.rs:315 — src/expr/impl/src/scalar/jsonb_delete.rs:315-326 | src/expr/impl/src/scalar/jsonb_delete.rs:348-359 — both copies are in the same file, so extract the 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) src/frontend/src/binder/expr/function/mod.rs:378 — src/frontend/src/binder/expr/function/mod.rs:378-389 | src/frontend/src/binder/expr/function/mod.rs:428-439 — both copies are in the same file, so extract the 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) src/frontend/src/expr/mod.rs:712 — src/frontend/src/expr/mod.rs:712-723 | src/frontend/src/expr/mod.rs:728-739 — both copies are in the same file, so extract the 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) src/frontend/src/handler/create_database.rs:71 — src/frontend/src/handler/create_database.rs:71-82 | src/frontend/src/handler/create_schema.rs:65-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 both call sites, so a change lands once.
  • Duplicated block (12 lines × 2) src/frontend/src/optimizer/plan_node/generic/join.rs:230 — src/frontend/src/optimizer/plan_node/generic/join.rs:230-241 | src/frontend/src/optimizer/plan_node/stream_asof_join.rs:165-176 — before extracting anything, compare `src/frontend/src/optimizer/plan_node/generic/join.rs` and `src/frontend/src/optimizer/plan_node/stream_asof_join.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 (12 lines × 2) src/frontend/src/optimizer/plan_node/logical_project.rs:415 — src/frontend/src/optimizer/plan_node/logical_project.rs:415-426 | src/frontend/src/optimizer/plan_node/logical_project_set.rs:446-457 — before extracting anything, compare `src/frontend/src/optimizer/plan_node/logical_project.rs` and `src/frontend/src/optimizer/plan_node/logical_project_set.rs` as WHOLE FILES: this scan already matched 5 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. 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) src/frontend/src/optimizer/plan_node/utils.rs:384 — src/frontend/src/optimizer/plan_node/utils.rs:384-395 | src/frontend/src/optimizer/plan_node/utils.rs:435-446 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) src/jni_core/src/lib.rs:1209 — src/jni_core/src/lib.rs:1209-1220 | src/jni_core/src/lib.rs:1284-1295 — both copies are in the same file, so extract the 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) src/meta/service/src/ddl_service.rs:1950 — src/meta/service/src/ddl_service.rs:1950-1961 | src/meta/service/src/ddl_service.rs:2000-2011 — both copies are in the same file, so extract the 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) src/meta/src/barrier/checkpoint/state.rs:1785 — src/meta/src/barrier/checkpoint/state.rs:1785-1796 | src/meta/src/barrier/checkpoint/state.rs:1874-1885 — both copies are in the same file, so extract the 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) src/sqlparser/src/ast/mod.rs:748 — src/sqlparser/src/ast/mod.rs:748-759 | src/sqlparser/src/ast/mod.rs:762-773 — both copies are in the same file, so extract the 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) src/storage/src/monitor/traced_store.rs:190 — src/storage/src/monitor/traced_store.rs:190-201 | src/storage/src/monitor/traced_store.rs:210-221 — both copies are in the same file, so extract the 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) src/storage/src/monitor/traced_store.rs:374 — src/storage/src/monitor/traced_store.rs:374-385 | src/storage/src/monitor/traced_store.rs:394-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 (12 lines × 2) src/stream/src/common/log_store_impl/kv_log_store/serde.rs:648 — src/stream/src/common/log_store_impl/kv_log_store/serde.rs:648-659 | src/stream/src/common/log_store_impl/kv_log_store/serde.rs:679-690 — both copies are in the same file, so extract the 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) src/stream/src/executor/aggregate/agg_group.rs:479 — src/stream/src/executor/aggregate/agg_group.rs:479-490 | src/stream/src/executor/aggregate/agg_group.rs:553-564 — both copies are in the same file, so extract the 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) src/stream/src/executor/aggregate/hash_agg.rs:463 — src/stream/src/executor/aggregate/hash_agg.rs:463-474 | src/stream/src/executor/aggregate/hash_agg.rs:480-491 — both copies are in the same file, so extract the 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) src/stream/src/executor/asof_join.rs:530 — src/stream/src/executor/asof_join.rs:530-541 | src/stream/src/executor/hash_join.rs:820-831 — before extracting anything, compare `src/stream/src/executor/asof_join.rs` and `src/stream/src/executor/hash_join.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 245 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) src/stream/src/executor/join/asof_join.rs:399 — src/stream/src/executor/join/asof_join.rs:399-410 | src/stream/src/executor/join/asof_join.rs:425-436 — both copies are in the same file, so extract the 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) REDACTED:880 — REDACTED:880-891 | REDACTED:912-923 — both copies are in the same file, so extract the 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) src/stream/src/executor/over_window/range_cache.rs:247 — src/stream/src/executor/over_window/range_cache.rs:247-258 | src/stream/src/executor/over_window/range_cache.rs:294-305 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) src/stream/src/executor/source/batch_source/batch_opendal_fs_fetch.rs:229 — src/stream/src/executor/source/batch_source/batch_opendal_fs_fetch.rs:229-240 | src/stream/src/executor/source/source_executor.rs:856-867 — 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.
  • + 9 more in this group — see findings.md.
D3 · God Classes · TooManyMethods · ×30
  • TooManyMethods: Parser src/sqlparser/src/parser.rs:196 — TooManyMethods — 248 methods, declared across 2 files: src/parser.rs (245), ast/statement.rs (3). The bar is 30 methods; this is 218 over it, 8.27× 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: CatalogController src/meta/src/controller/catalog/mod.rs:119 — TooManyMethods — 222 methods, declared across 10 files: controller/fragment.rs (59), catalog/get_op.rs (38), controller/streaming_job.rs (31), catalog/list_op.rs (28), +6 more file(s). The bar is 30 methods; this is 192 over it, 7.40× 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: Binder src/frontend/src/binder/mod.rs:96 — TooManyMethods — 189 methods, declared across 32 files: expr/mod.rs (34), binder/mod.rs (29), relation/mod.rs (19), function/mod.rs (15), +28 more file(s). The bar is 30 methods; this is 159 over it, 6.30× 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: MetaClient src/rpc_client/src/meta_client.rs:141 — TooManyMethods — 154 methods. The bar is 30 methods; this is 124 over it, 5.13× 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: HummockManager src/meta/src/hummock/manager/mod.rs:155 — TooManyMethods — 132 methods, declared across 16 files: compaction/mod.rs (29), manager/versioning.rs (14), manager/mod.rs (12), compaction/compaction_group_manager.rs (11), +12 more file(s). The bar is 30 methods; this is 102 over it, 4.40× 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: SchemaCatalog src/frontend/src/catalog/schema_catalog.rs:46 — 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: Catalog src/frontend/src/catalog/root_catalog.rs:122 — TooManyMethods — 86 methods. The bar is 30 methods; this is 56 over it, 2.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: SessionImpl src/frontend/src/session.rs:748 — TooManyMethods — 63 methods, declared across 3 files: src/session.rs (48), session/transaction.rs (11), handler/privilege.rs (4). The bar is 30 methods; this is 33 over it, 2.10× 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: MetadataManager src/meta/src/manager/metadata.rs:44 — 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: ExprImpl src/frontend/src/expr/mod.rs:144 — TooManyMethods — 55 methods. The bar is 30 methods; this is 25 over it, 1.83× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: DdlController src/meta/src/rpc/ddl_controller.rs:282 — TooManyMethods — 51 methods. The bar is 30 methods; this is 21 over it, 1.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: TableCatalog src/frontend/src/catalog/table_catalog.rs:83 — TooManyMethods — 49 methods. The bar is 30 methods; this is 19 over it, 1.63× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: IcebergCompactionManager src/meta/src/manager/iceberg_compaction/mod.rs:58 — TooManyMethods — 48 methods, declared across 6 files: iceberg_compaction/schedule.rs (21), iceberg_compaction/gc.rs (10), iceberg_compaction/mod.rs (6), schedule/report.rs (5), +2 more file(s). The bar is 30 methods; this is 18 over it, 1.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: StateTableInner src/stream/src/common/table/state_table.rs:188 — TooManyMethods — 48 methods. The bar is 30 methods; this is 18 over it, 1.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Planner src/frontend/src/planner/mod.rs:37 — TooManyMethods — 47 methods, declared across 12 files: planner/relation.rs (22), planner/select.rs (8), planner/mod.rs (7), planner/set_operation.rs (2), +8 more file(s). The bar is 30 methods; this is 17 over it, 1.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: PostgresConnection java/connector-node/risingwave-source-cdc/src/main/java/io/debezium/connector/postgresql/connection/PostgresConnection.java:85 — TooManyMethods — 45 methods. The bar is 30 methods; this is 15 over it, 1.50× 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: InflightDatabaseInfo src/meta/src/barrier/info.rs:446 — TooManyMethods — 45 methods. The bar is 30 methods; this is 15 over it, 1.50× 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: Binding java/java-binding/src/main/java/com/risingwave/java/binding/Binding.java:21 — TooManyMethods — 44 methods. The bar is 30 methods; this is 14 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: DataChunk src/common/src/array/data_chunk.rs:66 — TooManyMethods — 44 methods, declared across 3 files: array/data_chunk.rs (40), array/data_chunk_iter.rs (3), hash/key_v2.rs (1). The bar is 30 methods; this is 14 over it, 1.47× 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: PostgresConnectorConfig java/connector-node/risingwave-source-cdc/src/main/java/io/debezium/connector/postgresql/PostgresConnectorConfig.java:62 — TooManyMethods — 43 methods. The bar is 30 methods; this is 13 over it, 1.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.
  • TooManyMethods: LogicalJoin src/frontend/src/optimizer/plan_node/logical_join.rs:58 — TooManyMethods — 43 methods. The bar is 30 methods; this is 13 over it, 1.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.
  • TooManyMethods: OptimizerContext src/frontend/src/optimizer/optimizer_context.rs:83 — TooManyMethods — 41 methods. The bar is 30 methods; this is 11 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Interval src/common/src/types/interval.rs:44 — TooManyMethods — 38 methods. The bar is 30 methods; this is 8 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ColIndexMapping src/common/src/util/column_index_mapping.rs:27 — TooManyMethods — 36 methods, declared across 2 files: util/column_index_mapping.rs (27), utils/column_index_mapping.rs (9). The bar is 30 methods; this is 6 over it, 1.20× 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: Panels grafana/dashboard/common.py:116 — TooManyMethods — 34 methods. The bar is 30 methods; this is 4 over it, 1.13× 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.
  • + 5 more in this group — see findings.md.
D1 · Cyclomatic Complexity · risingwave_frontend · ×29
  • risingwave_frontend::handler::handle (cyclomatic 181) src/frontend/src/handler/mod.rs:306 — risingwave_frontend::handler::handle has cyclomatic complexity 181 (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.
  • risingwave_frontend::expr::type_inference::func::infer_type_for_special (cyclomatic 88) src/frontend/src/expr/type_inference/func.rs:323 — risingwave_frontend::expr::type_inference::func::infer_type_for_special has cyclomatic complexity 88 (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.
  • risingwave_frontend::handler::create_sink::gen_sink_plan (cyclomatic 53) src/frontend/src/handler/create_sink.rs:151 — risingwave_frontend::handler::create_sink::gen_sink_plan has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • risingwave_frontend::handler::handle_privilege::make_prost_privilege (cyclomatic 51) src/frontend/src/handler/handle_privilege.rs:46 — risingwave_frontend::handler::handle_privilege::make_prost_privilege has cyclomatic complexity 51 (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.
  • risingwave_frontend::handler::create_index::gen_create_index_plan (cyclomatic 43) src/frontend/src/handler/create_index.rs:144 — risingwave_frontend::handler::create_index::gen_create_index_plan has cyclomatic complexity 43 (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.
  • risingwave_frontend::binder::expr::bind_data_type (cyclomatic 37) src/frontend/src/binder/expr/mod.rs:1069 — risingwave_frontend::binder::expr::bind_data_type 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.
  • risingwave_frontend::stream_fragmenter::build_fragment (cyclomatic 34) src/frontend/src/stream_fragmenter/mod.rs:421 — risingwave_frontend::stream_fragmenter::build_fragment 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.
  • risingwave_frontend::handler::explain::do_handle_explain (cyclomatic 33) src/frontend/src/handler/explain.rs:49 — risingwave_frontend::handler::explain::do_handle_explain has cyclomatic complexity 33 (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.
  • risingwave_frontend::handler::show::handle_show_object (cyclomatic 33) src/frontend/src/handler/show.rs:501 — risingwave_frontend::handler::show::handle_show_object has cyclomatic complexity 33 (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.
  • risingwave_frontend::optimizer::plan_node::logical_kafka_scan::expr_to_kafka_timestamp_range (cyclomatic 31) src/frontend/src/optimizer/plan_node/logical_kafka_scan.rs:129 — risingwave_frontend::optimizer::plan_node::logical_kafka_scan::expr_to_kafka_timestamp_range 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.
  • risingwave_frontend::handler::alter_user::alter_prost_user_info (cyclomatic 29) src/frontend/src/handler/alter_user.rs:34 — risingwave_frontend::handler::alter_user::alter_prost_user_info has cyclomatic complexity 29 (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.
  • risingwave_frontend::handler::create_source::bind_create_source_or_table_with_connector (cyclomatic 28) src/frontend/src/handler/create_source.rs:905 — risingwave_frontend::handler::create_source::bind_create_source_or_table_with_connector 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.
  • risingwave_frontend::handler::create_source::validate::validate_compatibility (cyclomatic 26) src/frontend/src/handler/create_source/validate.rs:221 — risingwave_frontend::handler::create_source::validate::validate_compatibility 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.
  • risingwave_frontend::handler::create_user::handle_create_user (cyclomatic 26) src/frontend/src/handler/create_user.rs:30 — risingwave_frontend::handler::create_user::handle_create_user 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.
  • risingwave_frontend::handler::alter_owner::handle_alter_owner (cyclomatic 25) src/frontend/src/handler/alter_owner.rs:49 — risingwave_frontend::handler::alter_owner::handle_alter_owner 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.
  • risingwave_frontend::handler::create_source::bind_source_pk (cyclomatic 25) src/frontend/src/handler/create_source.rs:539 — risingwave_frontend::handler::create_source::bind_source_pk 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.
  • risingwave_frontend::handler::create_source::external_schema::bind_columns_from_source_for_non_cdc (cyclomatic 25) src/frontend/src/handler/create_source/external_schema.rs:92 — risingwave_frontend::handler::create_source::external_schema::bind_columns_from_source_for_non_cdc has cyclomatic complexity 25 (threshold 15). Of this number, 23 points are the body's own statements and 2 belong to one function item 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.
  • risingwave_frontend::handler::create_source::bind_all_columns (cyclomatic 24) src/frontend/src/handler/create_source.rs:251 — risingwave_frontend::handler::create_source::bind_all_columns 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.
  • risingwave_frontend::webhook::websocket::try_handle_connection (cyclomatic 23) src/frontend/src/webhook/websocket.rs:230 — risingwave_frontend::webhook::websocket::try_handle_connection 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.
  • risingwave_frontend::handler::alter_table_column::handle_alter_table_column (cyclomatic 22) src/frontend/src/handler/alter_table_column.rs:118 — risingwave_frontend::handler::alter_table_column::handle_alter_table_column 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.
  • risingwave_frontend::optimizer::plan_node::stream_hash_join::derive_watermark_for_hash_join (cyclomatic 22) src/frontend/src/optimizer/plan_node/stream_hash_join.rs:88 — risingwave_frontend::optimizer::plan_node::stream_hash_join::derive_watermark_for_hash_join 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.
  • risingwave_frontend::handler::create_function::handle_create_function (cyclomatic 19) src/frontend/src/handler/create_function.rs:42 — risingwave_frontend::handler::create_function::handle_create_function 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.
  • risingwave_frontend::handler::alter_set_schema::handle_alter_set_schema (cyclomatic 18) src/frontend/src/handler/alter_set_schema.rs:30 — risingwave_frontend::handler::alter_set_schema::handle_alter_set_schema 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.
  • risingwave_frontend::optimizer::rule::over_window_to_topn_rule::handle_rank_preds (cyclomatic 18) src/frontend/src/optimizer/rule/over_window_to_topn_rule.rs:299 — risingwave_frontend::optimizer::rule::over_window_to_topn_rule::handle_rank_preds 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.
  • risingwave_frontend::utils::iceberg_predicate::rw_expr_to_iceberg_predicate (cyclomatic 18) src/frontend/src/utils/iceberg_predicate.rs:178 — risingwave_frontend::utils::iceberg_predicate::rw_expr_to_iceberg_predicate has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • + 4 more in this group — see findings.md.
D2 · Cognitive Complexity · Parser · ×23
  • Parser::parse_table_and_joins (cognitive 59) src/sqlparser/src/parser.rs:5501 — Parser::parse_table_and_joins has cognitive complexity 59 (threshold 15). Drivers by points: if/else 16 (40 pts), match/switch 5 (18 pts), loops 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.
  • Parser::parse_alter_table (cognitive 51) src/sqlparser/src/parser.rs:3348 — Parser::parse_alter_table has cognitive complexity 51 (threshold 15). Drivers by points: if/else 36 (48 pts), boolean chains 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Parser::parse_alter_view (cognitive 45) src/sqlparser/src/parser.rs:3634 — Parser::parse_alter_view has cognitive complexity 45 (threshold 15). Drivers by points: if/else 24 (35 pts), boolean chains 10 (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.
  • Parser::parse_infix (cognitive 42) src/sqlparser/src/parser.rs:1306 — Parser::parse_infix has cognitive complexity 42 (threshold 15). Drivers by points: if/else 25 (34 pts), match/switch 4 (8 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.
  • Parser::parse_prefix (cognitive 39) src/sqlparser/src/parser.rs:590 — Parser::parse_prefix has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (28 pts), match/switch 4 (9 pts), boolean chains 2 (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.
  • Parser::parse_alter_sink (cognitive 35) src/sqlparser/src/parser.rs:3753 — Parser::parse_alter_sink has cognitive complexity 35 (threshold 15). Drivers by points: if/else 23 (32 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Parser::parse_alter_source (cognitive 33) src/sqlparser/src/parser.rs:3907 — Parser::parse_alter_source has cognitive complexity 33 (threshold 15). Drivers by points: if/else 23 (31 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.
  • Parser::parse_format_encode_with_connector (cognitive 29) src/sqlparser/src/ast/statement.rs:237 — Parser::parse_format_encode_with_connector has cognitive complexity 29 (threshold 15). Drivers by points: if/else 17 (28 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Parser::parse_create_table (cognitive 29) src/sqlparser/src/parser.rs:2600 — Parser::parse_create_table has cognitive complexity 29 (threshold 15). Drivers by points: if/else 21 (27 pts), boolean chains 2 (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.
  • Parser::parse_alter_index (cognitive 29) src/sqlparser/src/parser.rs:3549 — Parser::parse_alter_index has cognitive complexity 29 (threshold 15). Drivers by points: if/else 17 (26 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Parser::parse_alter_database (cognitive 24) src/sqlparser/src/parser.rs:3263 — Parser::parse_alter_database has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (23 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.
  • Parser::parse_optional_pattern_quantifier (cognitive 24) src/sqlparser/src/parser.rs:6029 — Parser::parse_optional_pattern_quantifier has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (16 pts), match/switch 3 (7 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.
  • Parser::parse_create_database (cognitive 23) src/sqlparser/src/parser.rs:2052 — Parser::parse_create_database has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (19 pts), match/switch 1 (3 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.
  • Parser::parse_optional_column_option (cognitive 21) src/sqlparser/src/parser.rs:2877 — Parser::parse_optional_column_option has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 2, loops 1 (2 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.
  • Parser::parse_table_factor_inner (cognitive 21) src/sqlparser/src/parser.rs:5664 — Parser::parse_table_factor_inner has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (19 pts), match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Parser::parse_create (cognitive 20) src/sqlparser/src/parser.rs:1982 — Parser::parse_create has cognitive complexity 20 (threshold 15). Drivers by points: if/else 19 (20 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.
  • Parser::parse_columns_with_watermark (cognitive 19) src/sqlparser/src/parser.rs:2800 — Parser::parse_columns_with_watermark has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (17 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.
  • Parser::parse_optional_table_constraint (cognitive 18) src/sqlparser/src/parser.rs:2989 — Parser::parse_optional_table_constraint has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, 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.
  • Parser::parse_alter (cognitive 18) src/sqlparser/src/parser.rs:3221 — Parser::parse_alter has cognitive complexity 18 (threshold 15). Drivers by points: if/else 18. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • Parser::parse_query (cognitive 18) src/sqlparser/src/parser.rs:4920 — Parser::parse_query has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 3, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Parser::parse_grant_revoke_privileges_objects (cognitive 18) src/sqlparser/src/parser.rs:6188 — Parser::parse_grant_revoke_privileges_objects has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14 (15 pts), match/switch 1 (3 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.
  • Parser::parse_set (cognitive 17) src/sqlparser/src/parser.rs:5179 — Parser::parse_set has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), match/switch 2 (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.
  • Parser::parse_alter_subscription (cognitive 16) src/sqlparser/src/parser.rs:3861 — Parser::parse_alter_subscription has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (15 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.
D2 · Cognitive Complexity · risingwave_meta · ×22
  • risingwave_meta::controller::system_param::merge_params (cognitive 54) src/meta/src/controller/system_param.rs:112 — risingwave_meta::controller::system_param::merge_params has cognitive complexity 54 (threshold 15). Drivers by points: if/else 18 (36 pts), match/switch 18 (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.
  • risingwave_meta::dashboard::handlers::get_streaming_stats_from_prometheus (cognitive 54) src/meta/src/dashboard/mod.rs:783 — risingwave_meta::dashboard::handlers::get_streaming_stats_from_prometheus has cognitive complexity 54 (threshold 15). Drivers by points: if/else 14 (33 pts), loops 8 (17 pts), boolean chains 4 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • risingwave_meta::controller::utils::check_relation_name_duplicate (cognitive 45) src/meta/src/controller/utils.rs:803 — risingwave_meta::controller::utils::check_relation_name_duplicate has cognitive complexity 45 (threshold 15). Drivers by points: if/else 30 (40 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.
  • risingwave_meta::serving::start_serving_vnode_mapping_worker (cognitive 42) src/meta/src/serving/mod.rs:268 — risingwave_meta::serving::start_serving_vnode_mapping_worker has cognitive complexity 42 (threshold 15). Drivers by points: if/else 6 (26 pts), match/switch 4 (14 pts), boolean chains 1, loops 1 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • risingwave_meta::stream::stream_graph::state_match::match_graph::dfs (cognitive 26) src/meta/src/stream/stream_graph/state_match.rs:442 — risingwave_meta::stream::stream_graph::state_match::match_graph::dfs has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 4 (8 pts), match/switch 2 (5 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.
  • risingwave_meta::hummock::metrics_utils::trigger_sst_stat (cognitive 25) src/meta/src/hummock/metrics_utils.rs:138 — risingwave_meta::hummock::metrics_utils::trigger_sst_stat has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 4 (7 pts), boolean chains 4 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • risingwave_meta::barrier::context::recovery::render_runtime_info (cognitive 24) src/meta/src/barrier/context/recovery.rs:96 — risingwave_meta::barrier::context::recovery::render_runtime_info has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 7 (12 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.
  • risingwave_meta::manager::iceberg_compaction::gc::plan_manifest_rewrite (cognitive 23) src/meta/src/manager/iceberg_compaction/gc.rs:68 — risingwave_meta::manager::iceberg_compaction::gc::plan_manifest_rewrite has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • risingwave_meta::controller::scale::find_no_shuffle_graphs (cognitive 22) src/meta/src/controller/scale.rs:1636 — risingwave_meta::controller::scale::find_no_shuffle_graphs has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 4 (8 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.
  • risingwave_meta::barrier::utils::collect_resp_info (cognitive 21) src/meta/src/barrier/utils.rs:47 — risingwave_meta::barrier::utils::collect_resp_info has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (5 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • risingwave_meta::hummock::manager::table_change_log::resolve_table_change_log_truncate_epochs (cognitive 21) src/meta/src/hummock/manager/table_change_log.rs:89 — risingwave_meta::hummock::manager::table_change_log::resolve_table_change_log_truncate_epochs has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 5 (8 pts), match/switch 1 (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.
  • risingwave_meta::dashboard::handlers::get_streaming_stats (cognitive 20) src/meta/src/dashboard/mod.rs:704 — risingwave_meta::dashboard::handlers::get_streaming_stats has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 5 (8 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.
  • risingwave_meta::manager::iceberg_pk_index_sink::coordinator::coalesce_position_delete_files (cognitive 19) src/meta/src/manager/iceberg_pk_index_sink/coordinator.rs:871 — risingwave_meta::manager::iceberg_pk_index_sink::coordinator::coalesce_position_delete_files has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 5 (6 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.
  • risingwave_meta::stream::source_manager::split_assignment::reassign_splits (cognitive 19) src/meta/src/stream/source_manager/split_assignment.rs:508 — risingwave_meta::stream::source_manager::split_assignment::reassign_splits has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 4, loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • risingwave_meta::barrier::checkpoint::state::render_actors (cognitive 18) src/meta/src/barrier/checkpoint/state.rs:267 — risingwave_meta::barrier::checkpoint::state::render_actors has cognitive complexity 18 (threshold 15). Drivers by points: loops 6 (12 pts), if/else 3 (6 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.
  • risingwave_meta::hummock::manager::compaction::compaction_group_manager::update_compaction_config (cognitive 18) src/meta/src/hummock/manager/compaction/compaction_group_manager.rs:664 — risingwave_meta::hummock::manager::compaction::compaction_group_manager::update_compaction_config has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (15 pts), match/switch 1 (2 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.
  • risingwave_meta::stream::scale::build_reschedule_commands (cognitive 18) src/meta/src/stream/scale.rs:820 — risingwave_meta::stream::scale::build_reschedule_commands has cognitive complexity 18 (threshold 15). Drivers by points: loops 5 (11 pts), match/switch 1 (4 pts), if/else 2 (3 pts) (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.
  • risingwave_meta::stream::stream_graph::assignment::assign_hierarchical (cognitive 18) src/meta/src/stream/stream_graph/assignment.rs:382 — risingwave_meta::stream::stream_graph::assignment::assign_hierarchical has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 4 (7 pts), match/switch 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.
  • risingwave_meta::barrier::checkpoint::state::resolve_no_shuffle_ensembles (cognitive 17) src/meta/src/barrier/checkpoint/state.rs:188 — risingwave_meta::barrier::checkpoint::state::resolve_no_shuffle_ensembles has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 5 (7 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.
  • risingwave_meta::manager::iceberg_pk_index_sink::coordinator::probe_committed_data_files (cognitive 16) src/meta/src/manager/iceberg_pk_index_sink/coordinator.rs:609 — risingwave_meta::manager::iceberg_pk_index_sink::coordinator::probe_committed_data_files has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 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.
  • risingwave_meta::stream::stream_graph::assignment::assign_items_weighted_with_scale_fn (cognitive 16) src/meta/src/stream/stream_graph/assignment.rs:96 — risingwave_meta::stream::stream_graph::assignment::assign_items_weighted_with_scale_fn has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), loops 3 (4 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • risingwave_meta::stream::stream_graph::fragment::rewrite_refresh_schema_sink_fragment (cognitive 16) src/meta/src/stream/stream_graph/fragment.rs:749 — risingwave_meta::stream::stream_graph::fragment::rewrite_refresh_schema_sink_fragment has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (15 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, 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.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×22
  • Duplicated block (15 lines × 2) src/batch/executors/src/executor/join/mod.rs:111 — src/batch/executors/src/executor/join/mod.rs:111-125 | src/stream/src/executor/join/mod.rs:86-100 — 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 (15 lines × 2) src/expr/impl/src/udf/wasm.rs:63 — src/expr/impl/src/udf/wasm.rs:63-77 | src/expr/impl/src/udf/wasm.rs:151-165 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2) src/expr/macro/src/parse.rs:293 — src/expr/macro/src/parse.rs:293-307 | src/frontend/macro/src/lib.rs:77-91 — 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 (15 lines × 2) src/frontend/src/handler/alter_set_schema.rs:97 — src/frontend/src/handler/alter_set_schema.rs:97-111 | src/frontend/src/handler/alter_set_schema.rs:114-128 — both copies are in the same file, so extract the 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) src/frontend/src/metrics_reader.rs:213 — src/frontend/src/metrics_reader.rs:213-227 | src/frontend/src/metrics_reader.rs:233-247 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2) src/frontend/src/optimizer/plan_node/batch_hop_window.rs:172 — src/frontend/src/optimizer/plan_node/batch_hop_window.rs:172-186 | src/frontend/src/optimizer/plan_node/stream_hop_window.rs:141-155 — 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 (15 lines × 2) src/frontend/src/optimizer/plan_node/logical_agg.rs:1644 — src/frontend/src/optimizer/plan_node/logical_agg.rs:1644-1658 | src/frontend/src/optimizer/plan_node/logical_topn.rs:338-352 — 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 (15 lines × 2) src/frontend/src/optimizer/rule/min_max_on_index_rule.rs:148 — src/frontend/src/optimizer/rule/min_max_on_index_rule.rs:148-162 | src/frontend/src/optimizer/rule/top_n_on_index_rule.rs:85-99 — 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 (15 lines × 2) src/frontend/src/scheduler/distributed/stage.rs:748 — src/frontend/src/scheduler/distributed/stage.rs:748-762 | src/frontend/src/scheduler/local.rs:655-669 — 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 (15 lines × 2) src/meta/src/controller/catalog/util.rs:442 — src/meta/src/controller/catalog/util.rs:442-456 | src/meta/src/controller/catalog/util.rs:490-504 — both copies are in the same file, so extract the 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) src/meta/src/hummock/compaction/selector/tombstone_compaction_selector.rs:60 — src/meta/src/hummock/compaction/selector/tombstone_compaction_selector.rs:60-74 | src/meta/src/hummock/compaction/selector/ttl_selector.rs:55-69 — 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 (15 lines × 2) src/meta/src/manager/iceberg_compaction/schedule.rs:1251 — src/meta/src/manager/iceberg_compaction/schedule.rs:1251-1265 | src/meta/src/manager/iceberg_compaction/schedule.rs:1368-1382 — both copies are in the same file, so extract the 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) src/meta/src/stream/stream_manager.rs:1182 — src/meta/src/stream/stream_manager.rs:1182-1196 | src/meta/src/stream/stream_manager.rs:1213-1227 — both copies are in the same file, so extract the 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) src/object_store/src/object/s3.rs:287 — src/object_store/src/object/s3.rs:287-301 | src/object_store/src/object/s3.rs:367-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 (15 lines × 2) src/storage/src/hummock/iterator/skip_watermark.rs:524 — src/storage/src/hummock/iterator/skip_watermark.rs:524-538 | src/storage/src/hummock/iterator/skip_watermark.rs:595-609 — both copies are in the same file, so extract the 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) src/storage/src/hummock/store/local_hummock_storage.rs:905 — src/storage/src/hummock/store/local_hummock_storage.rs:905-919 | src/storage/src/hummock/store/local_hummock_storage.rs:1024-1038 — both copies are in the same file, so extract the 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) src/stream/src/executor/backfill/arrangement_backfill.rs:341 — src/stream/src/executor/backfill/arrangement_backfill.rs:341-355 | src/stream/src/executor/backfill/arrangement_backfill.rs:395-409 — both copies are in the same file, so extract the 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) src/stream/src/executor/eowc/eowc_gap_fill.rs:105 — src/stream/src/executor/eowc/eowc_gap_fill.rs:105-119 | src/stream/src/executor/eowc/eowc_gap_fill.rs:125-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 (15 lines × 2) src/stream/src/executor/source/fs_fetch_executor.rs:295 — src/stream/src/executor/source/fs_fetch_executor.rs:295-309 | src/stream/src/executor/source/iceberg_fetch_executor.rs:279-293 — before extracting anything, compare `src/stream/src/executor/source/fs_fetch_executor.rs` and `src/stream/src/executor/source/iceberg_fetch_executor.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 71 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) src/connector/src/sink/iceberg/writer.rs:1047 — src/connector/src/sink/iceberg/writer.rs:1047-1061 | src/connector/src/sink/iceberg/writer.rs:1066-1082 — both copies are in the same file, so extract the 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) src/storage/src/hummock/compactor/shared_buffer_compact.rs:83 — src/storage/src/hummock/compactor/shared_buffer_compact.rs:83-97 | src/storage/src/hummock/compactor/shared_buffer_compact.rs:98-112 — both copies are in the same file, so extract the 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) integration_tests/scripts/compatibility/cli.py:37 — integration_tests/scripts/compatibility/cli.py:37-51 | integration_tests/scripts/compatibility/cli.py:60-74 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D2 · Cognitive Complexity · Binder · ×20
  • Binder::bind_builtin_scalar_function (cognitive 77) src/frontend/src/binder/expr/function/builtin_scalar.rs:31 — Binder::bind_builtin_scalar_function has cognitive complexity 77 (threshold 15). Drivers by points: if/else 53 (59 pts), boolean chains 9, match/switch 5 (6 pts), loops 3 (nesting depth added 7). Of this number, 73 points are the body's own statements and 4 belong to 2 function items inside it that branch. 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.
  • Binder::bind_gap_fill (cognitive 65) src/frontend/src/binder/relation/gap_fill.rs:36 — Binder::bind_gap_fill has cognitive complexity 65 (threshold 15). Drivers by points: if/else 19 (54 pts), loops 3 (6 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 40). 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.
  • Binder::bind_function (cognitive 62) src/frontend/src/binder/expr/function/mod.rs:247 — Binder::bind_function has cognitive complexity 62 (threshold 15). Drivers by points: if/else 40 (53 pts), boolean chains 6, match/switch 2 (3 pts) (nesting depth added 14). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • Binder::bind_match_recognize (cognitive 50) src/frontend/src/binder/relation/match_recognize.rs:148 — Binder::bind_match_recognize has cognitive complexity 50 (threshold 15). Drivers by points: if/else 16 (31 pts), loops 9 (10 pts), match/switch 4 (7 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.
  • Binder::bind_catalog_relation_by_name (cognitive 44) src/frontend/src/binder/relation/table_or_source.rs:110 — Binder::bind_catalog_relation_by_name has cognitive complexity 44 (threshold 15). Drivers by points: if/else 21 (36 pts), boolean chains 5, loops 1 (2 pts), 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.
  • Binder::lower_measure (cognitive 42) src/frontend/src/binder/relation/match_recognize.rs:540 — Binder::lower_measure has cognitive complexity 42 (threshold 15). Drivers by points: if/else 21 (34 pts), boolean chains 6, match/switch 1 (2 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.
  • Binder::bind_column (cognitive 40) src/frontend/src/binder/expr/column.rs:26 — Binder::bind_column has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (22 pts), match/switch 5 (12 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Binder::bind_insert (cognitive 36) src/frontend/src/binder/insert.rs:104 — Binder::bind_insert has cognitive complexity 36 (threshold 15). Drivers by points: if/else 23 (32 pts), boolean chains 2, match/switch 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Binder::bind_join_constraint (cognitive 33) src/frontend/src/binder/relation/join.rs:150 — Binder::bind_join_constraint has cognitive complexity 33 (threshold 15). Drivers by points: if/else 5 (16 pts), match/switch 4 (9 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 20). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • Binder::bind_window_function (cognitive 29) src/frontend/src/binder/expr/function/window.rs:58 — Binder::bind_window_function has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (18 pts), match/switch 5 (11 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Binder::bind_update (cognitive 29) src/frontend/src/binder/update.rs:125 — Binder::bind_update has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 5 (11 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Binder::bind_table_function (cognitive 22) src/frontend/src/binder/relation/table_function.rs:36 — Binder::bind_table_function has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (20 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.
  • Binder::bind_grouping_items_expr_in_select (cognitive 22) src/frontend/src/binder/select.rs:488 — Binder::bind_grouping_items_expr_in_select has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 5 (19 pts), loops 2 (3 pts) (nesting depth added 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • Binder::corresponding (cognitive 20) src/frontend/src/binder/set_expr.rs:234 — Binder::corresponding has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (5 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.
  • Binder::resolve_iceberg_metadata_relation (cognitive 19) src/frontend/src/binder/relation/table_or_source.rs:303 — Binder::resolve_iceberg_metadata_relation has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (17 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.
  • Binder::check_privilege (cognitive 19) src/frontend/src/binder/relation/table_or_source.rs:472 — Binder::check_privilege has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 3, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Binder::check_convert_simple_form (cognitive 18) src/frontend/src/binder/expr/mod.rs:767 — Binder::check_convert_simple_form has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (17 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.
  • Binder::bind_expr_inner (cognitive 17) src/frontend/src/binder/expr/mod.rs:66 — Binder::bind_expr_inner has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 1, match/switch 1 (nesting depth added 5). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • Binder::check_constant_case_when_optimization (cognitive 17) src/frontend/src/binder/expr/mod.rs:648 — Binder::check_constant_case_when_optimization has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (16 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.
  • Binder::bind_ordered_set_agg (cognitive 16) src/frontend/src/binder/expr/function/aggregate.rs:98 — Binder::bind_ordered_set_agg has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D30 · Dependency Vulnerabilities · Medium advisory (unsound) · ×19
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Medium vulnerability · ×17
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×17
  • Duplicated block (16 lines × 2) src/batch/executors/src/executor/sort_over_window.rs:63 — src/batch/executors/src/executor/sort_over_window.rs:63-78 | src/stream/src/from_proto/over_window.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 (16 lines × 2) src/frontend/src/optimizer/plan_node/batch_kafka_scan.rs:123 — src/frontend/src/optimizer/plan_node/batch_kafka_scan.rs:123-138 | src/frontend/src/optimizer/plan_node/batch_source.rs:107-122 — 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 (16 lines × 2) src/frontend/src/optimizer/plan_node/logical_dedup.rs:93 — src/frontend/src/optimizer/plan_node/logical_dedup.rs:93-108 | src/frontend/src/optimizer/plan_node/logical_over_window.rs:729-744 — 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 (16 lines × 2) src/meta/src/barrier/checkpoint/recovery.rs:395 — src/meta/src/barrier/checkpoint/recovery.rs:395-410 | src/meta/src/barrier/checkpoint/recovery.rs:479-494 — both copies are in the same file, so extract the 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) src/meta/src/controller/catalog/alter_op.rs:137 — src/meta/src/controller/catalog/alter_op.rs:137-152 | src/meta/src/controller/catalog/alter_op.rs:230-245 — both copies are in the same file, so extract the 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) src/meta/src/controller/streaming_job.rs:659 — src/meta/src/controller/streaming_job.rs:659-674 | src/meta/src/controller/streaming_job.rs:732-747 — both copies are in the same file, so extract the 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) src/storage/src/hummock/store/version.rs:906 — src/storage/src/hummock/store/version.rs:906-921 | src/storage/src/hummock/store/version.rs:955-970 — both copies are in the same file, so extract the 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) src/stream/src/executor/asof_join.rs:425 — src/stream/src/executor/asof_join.rs:425-440 | src/stream/src/executor/asof_join.rs:451-466 — both copies are in the same file, so extract the 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) src/stream/src/executor/asof_join.rs:435 — src/stream/src/executor/asof_join.rs:435-450 | src/stream/src/executor/hash_join.rs:701-716 — before extracting anything, compare `src/stream/src/executor/asof_join.rs` and `src/stream/src/executor/hash_join.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 245 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) src/stream/src/executor/asof_join.rs:627 — src/stream/src/executor/asof_join.rs:627-642 | src/stream/src/executor/asof_join.rs:729-744 — both copies are in the same file, so extract the 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) src/stream/src/executor/eowc/eowc_gap_fill.rs:191 — src/stream/src/executor/eowc/eowc_gap_fill.rs:191-206 | src/stream/src/executor/gap_fill.rs:381-396 — before extracting anything, compare `src/stream/src/executor/eowc/eowc_gap_fill.rs` and `src/stream/src/executor/gap_fill.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 78 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 (16 lines × 2) src/stream/src/executor/gap_fill.rs:632 — src/stream/src/executor/gap_fill.rs:632-647 | src/stream/src/executor/gap_fill.rs:752-767 — both copies are in the same file, so extract the 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) src/stream/src/executor/hash_join.rs:691 — src/stream/src/executor/hash_join.rs:691-706 | src/stream/src/executor/hash_join.rs:719-734 — both copies are in the same file, so extract the 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) src/stream/src/executor/top_n/top_n_appendonly.rs:87 — src/stream/src/executor/top_n/top_n_appendonly.rs:87-102 | src/stream/src/executor/top_n/top_n_plain.rs:113-128 — before extracting anything, compare `src/stream/src/executor/top_n/top_n_appendonly.rs` and `src/stream/src/executor/top_n/top_n_plain.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 (16 lines × 2) java/connector-node/risingwave-sink-jdbc/src/main/java/com/risingwave/connector/BatchAppendOnlyJDBCSink.java:354 — java/connector-node/risingwave-sink-jdbc/src/main/java/com/risingwave/connector/BatchAppendOnlyJDBCSink.java:354-369 | java/connector-node/risingwave-sink-jdbc/src/main/java/com/risingwave/connector/JDBCSink.java:396-411 — before extracting anything, compare `java/connector-node/risingwave-sink-jdbc/src/main/java/com/risingwave/connector/BatchAppendOnlyJDBCSink.java` and `java/connector-node/risingwave-sink-jdbc/src/main/java/com/risingwave/connector/JDBCSink.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 97 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (16 lines × 2) src/stream/src/executor/test_utils/hash_join_executor.rs:169 — src/stream/src/executor/test_utils/hash_join_executor.rs:169-184 | src/stream/src/executor/test_utils/hash_join_executor.rs:200-215 — both copies are in the same file, so extract the 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) REDACTED:449 — REDACTED:449-464 | REDACTED:483-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.
D1 · Cyclomatic Complexity · risingwave_connector · ×16
  • risingwave_connector::sink::encoder::avro::on_field (cyclomatic 52) src/connector/src/sink/encoder/avro.rs:411 — risingwave_connector::sink::encoder::avro::on_field has cyclomatic complexity 52 (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.
  • risingwave_connector::sink::sqlserver::bind_params (cyclomatic 52) src/connector/src/sink/sqlserver.rs:741 — risingwave_connector::sink::sqlserver::bind_params has cyclomatic complexity 52 (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.
  • risingwave_connector::sink::encoder::proto::on_field (cyclomatic 49) src/connector/src/sink/encoder/proto.rs:314 — risingwave_connector::sink::encoder::proto::on_field 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.
  • risingwave_connector::sink::encoder::json::datum_to_json_object (cyclomatic 40) src/connector/src/sink/encoder/json.rs:230 — risingwave_connector::sink::encoder::json::datum_to_json_object has cyclomatic complexity 40 (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.
  • risingwave_connector::parser::unified::debezium::extract_bson_field (cyclomatic 37) src/connector/src/parser/unified/debezium.rs:809 — risingwave_connector::parser::unified::debezium::extract_bson_field 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.
  • risingwave_connector::source::cdc::external::mysql::mysql_type_to_rw_type (cyclomatic 36) src/connector/src/source/cdc/external/mysql.rs:448 — risingwave_connector::source::cdc::external::mysql::mysql_type_to_rw_type has cyclomatic complexity 36 (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. This is NOT this file's highest cyclomatic complexity: risingwave_connector::source::cdc::external::mysql::type_name_to_mysql_type (cyclomatic 49) 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 function is counted neither in this dimension's figures nor in its score.
  • risingwave_connector::parser::unified::debezium::bson_extract_number (cyclomatic 35) src/connector/src/parser/unified/debezium.rs:997 — risingwave_connector::parser::unified::debezium::bson_extract_number 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.
  • risingwave_connector::parser::unified::debezium::parse_schema_change (cyclomatic 28) src/connector/src/parser/unified/debezium.rs:294 — risingwave_connector::parser::unified::debezium::parse_schema_change 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.
  • risingwave_connector::sink::encoder::bson::datum_to_bson (cyclomatic 27) src/connector/src/sink/encoder/bson.rs:103 — risingwave_connector::sink::encoder::bson::datum_to_bson 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.
  • risingwave_connector::parser::mysql::mysql_datum_to_rw_datum (cyclomatic 25) src/connector/src/parser/mysql.rs:109 — risingwave_connector::parser::mysql::mysql_datum_to_rw_datum 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.
  • risingwave_connector::parser::parse_message_stream (cyclomatic 22) src/connector/src/parser/mod.rs:375 — risingwave_connector::parser::parse_message_stream 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.
  • risingwave_connector::sink::iceberg::create_table::create_table_if_not_exists_impl (cyclomatic 21) src/connector/src/sink/iceberg/create_table.rs:126 — risingwave_connector::sink::iceberg::create_table::create_table_if_not_exists_impl 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.
  • risingwave_connector::sink::http::validate_http_sink (cyclomatic 19) src/connector/src/sink/http.rs:97 — risingwave_connector::sink::http::validate_http_sink 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.
  • risingwave_connector::parser::unified::debezium::extract_bson_id (cyclomatic 17) src/connector/src/parser/unified/debezium.rs:742 — risingwave_connector::parser::unified::debezium::extract_bson_id has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • risingwave_connector::sink::deltalake::check_field_type (cyclomatic 17) src/connector/src/sink/deltalake.rs:281 — risingwave_connector::sink::deltalake::check_field_type has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • risingwave_connector::sink::iceberg::create_table::field_is_compatible (cyclomatic 16) src/connector/src/sink/iceberg/create_table.rs:366 — risingwave_connector::sink::iceberg::create_table::field_is_compatible has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Parser · ×16
  • Parser::parse_infix (cyclomatic 47) src/sqlparser/src/parser.rs:1306 — Parser::parse_infix has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Parser::parse_prefix (cyclomatic 43) src/sqlparser/src/parser.rs:590 — Parser::parse_prefix has cyclomatic complexity 43 (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.
  • Parser::parse_alter_table (cyclomatic 33) src/sqlparser/src/parser.rs:3348 — Parser::parse_alter_table 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. This is NOT this file's highest cyclomatic complexity: Parser::parse_statement (cyclomatic 43) 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 function is counted neither in this dimension's figures nor in its score.
  • Parser::parse_alter_view (cyclomatic 31) src/sqlparser/src/parser.rs:3634 — Parser::parse_alter_view 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. This is NOT this file's highest cyclomatic complexity: Parser::parse_statement (cyclomatic 43) 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 function is counted neither in this dimension's figures nor in its score.
  • Parser::parse_table_and_joins (cyclomatic 28) src/sqlparser/src/parser.rs:5501 — Parser::parse_table_and_joins 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. This is NOT this file's highest cyclomatic complexity: Parser::parse_statement (cyclomatic 43) 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 function is counted neither in this dimension's figures nor in its score.
  • Parser::parse_optional_pattern_quantifier (cyclomatic 26) src/sqlparser/src/parser.rs:6029 — Parser::parse_optional_pattern_quantifier 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. This is NOT this file's highest cyclomatic complexity: Parser::parse_statement (cyclomatic 43) 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 function is counted neither in this dimension's figures nor in its score.
  • Parser::parse_show (cyclomatic 25) src/sqlparser/src/parser.rs:5250 — Parser::parse_show 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. This is NOT this file's highest cyclomatic complexity: Parser::parse_statement (cyclomatic 43) 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 function is counted neither in this dimension's figures nor in its score.
  • Parser::parse_alter_sink (cyclomatic 23) src/sqlparser/src/parser.rs:3753 — Parser::parse_alter_sink 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. This is NOT this file's highest cyclomatic complexity: Parser::parse_statement (cyclomatic 43) 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 function is counted neither in this dimension's figures nor in its score.
  • Parser::parse_grant_revoke_privileges_objects (cyclomatic 23) src/sqlparser/src/parser.rs:6188 — Parser::parse_grant_revoke_privileges_objects 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. This is NOT this file's highest cyclomatic complexity: Parser::parse_statement (cyclomatic 43) 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 function is counted neither in this dimension's figures nor in its score.
  • Parser::parse_alter_source (cyclomatic 22) src/sqlparser/src/parser.rs:3907 — Parser::parse_alter_source 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. This is NOT this file's highest cyclomatic complexity: Parser::parse_statement (cyclomatic 43) 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 function is counted neither in this dimension's figures nor in its score.
  • Parser::parse_create (cyclomatic 19) src/sqlparser/src/parser.rs:1982 — Parser::parse_create 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. This is NOT this file's highest cyclomatic complexity: Parser::parse_statement (cyclomatic 43) 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 function is counted neither in this dimension's figures nor in its score.
  • Parser::parse_alter (cyclomatic 18) src/sqlparser/src/parser.rs:3221 — Parser::parse_alter 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. This is NOT this file's highest cyclomatic complexity: Parser::parse_statement (cyclomatic 43) 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 function is counted neither in this dimension's figures nor in its score.
  • Parser::parse_alter_index (cyclomatic 17) src/sqlparser/src/parser.rs:3549 — Parser::parse_alter_index has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: Parser::parse_statement (cyclomatic 43) 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 function is counted neither in this dimension's figures nor in its score.
  • Parser::parse_format_encode_with_connector (cyclomatic 16) src/sqlparser/src/ast/statement.rs:237 — Parser::parse_format_encode_with_connector 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.
  • Parser::parse_create_table (cyclomatic 16) src/sqlparser/src/parser.rs:2600 — Parser::parse_create_table 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. This is NOT this file's highest cyclomatic complexity: Parser::parse_statement (cyclomatic 43) 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 function is counted neither in this dimension's figures nor in its score.
  • Parser::parse_value_and_obj_ref (cyclomatic 16) src/sqlparser/src/parser.rs:4258 — Parser::parse_value_and_obj_ref 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. This is NOT this file's highest cyclomatic complexity: Parser::parse_statement (cyclomatic 43) 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 function is counted neither in this dimension's figures nor in its score.
D2 · Cognitive Complexity · risingwave_connector · ×16
  • risingwave_connector::parser::unified::debezium::parse_schema_change (cognitive 115) src/connector/src/parser/unified/debezium.rs:294 — risingwave_connector::parser::unified::debezium::parse_schema_change has cognitive complexity 115 (threshold 15). Drivers by points: match/switch 10 (61 pts), if/else 13 (45 pts), loops 2 (6 pts), boolean chains 3 (nesting depth added 87). 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.
  • risingwave_connector::parser::parse_message_stream (cognitive 69) src/connector/src/parser/mod.rs:375 — risingwave_connector::parser::parse_message_stream has cognitive complexity 69 (threshold 15). Drivers by points: if/else 10 (36 pts), loops 6 (19 pts), match/switch 4 (14 pts) (nesting depth added 49). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • risingwave_connector::sink::encoder::avro::on_field (cognitive 48) src/connector/src/sink/encoder/avro.rs:411 — risingwave_connector::sink::encoder::avro::on_field has cognitive complexity 48 (threshold 15). Drivers by points: match/switch 23 (42 pts), if/else 3 (6 pts) (nesting depth added 22). 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.
  • risingwave_connector::parser::unified::debezium::extract_bson_field (cognitive 45) src/connector/src/parser/unified/debezium.rs:809 — risingwave_connector::parser::unified::debezium::extract_bson_field has cognitive complexity 45 (threshold 15). Drivers by points: if/else 20 (32 pts), boolean chains 5, loops 2 (4 pts), match/switch 3 (4 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.
  • risingwave_connector::sink::encoder::proto::on_field (cognitive 43) src/connector/src/sink/encoder/proto.rs:314 — risingwave_connector::sink::encoder::proto::on_field has cognitive complexity 43 (threshold 15). Drivers by points: match/switch 21 (36 pts), if/else 4 (5 pts), boolean chains 2 (nesting depth added 16). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • risingwave_connector::parser::unified::debezium::bson_extract_number (cognitive 41) src/connector/src/parser/unified/debezium.rs:997 — risingwave_connector::parser::unified::debezium::bson_extract_number has cognitive complexity 41 (threshold 15). Drivers by points: if/else 16 (26 pts), match/switch 6 (13 pts), boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • risingwave_connector::sink::iceberg::metadata::scan_iceberg_metadata (cognitive 31) src/connector/src/sink/iceberg/metadata.rs:143 — risingwave_connector::sink::iceberg::metadata::scan_iceberg_metadata has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 4 (12 pts), match/switch 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.
  • risingwave_connector::sink::encoder::json::datum_to_json_object (cognitive 29) src/connector/src/sink/encoder/json.rs:230 — risingwave_connector::sink::encoder::json::datum_to_json_object has cognitive complexity 29 (threshold 15). Drivers by points: match/switch 9 (16 pts), loops 4 (10 pts), if/else 2 (3 pts) (nesting depth added 14). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • risingwave_connector::sink::iceberg::create_table::create_table_if_not_exists_impl (cognitive 23) src/connector/src/sink/iceberg/create_table.rs:126 — risingwave_connector::sink::iceberg::create_table::create_table_if_not_exists_impl has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (12 pts), match/switch 5 (7 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.
  • risingwave_connector::sink::http::validate_http_sink (cognitive 21) src/connector/src/sink/http.rs:97 — risingwave_connector::sink::http::validate_http_sink has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (9 pts), match/switch 4 (7 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • risingwave_connector::sink::iceberg::create_table::parse_order_key_exprs (cognitive 21) src/connector/src/sink/iceberg/create_table.rs:540 — risingwave_connector::sink::iceberg::create_table::parse_order_key_exprs has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 2 (7 pts), 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.
  • risingwave_connector::source::iceberg::scan_task_to_chunk_with_deletes (cognitive 21) src/connector/src/source/iceberg/mod.rs:465 — risingwave_connector::source::iceberg::scan_task_to_chunk_with_deletes has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 1, loops 1, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • risingwave_connector::sink::iceberg::create_table::field_is_compatible (cognitive 19) src/connector/src/sink/iceberg/create_table.rs:366 — risingwave_connector::sink::iceberg::create_table::field_is_compatible has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 3, match/switch 2 (3 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.
  • risingwave_connector::sink::sqlserver::bind_params (cognitive 18) src/connector/src/sink/sqlserver.rs:741 — risingwave_connector::sink::sqlserver::bind_params has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 6 (17 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.
  • risingwave_connector::parser::mysql::mysql_datum_to_rw_datum (cognitive 16) src/connector/src/parser/mysql.rs:109 — risingwave_connector::parser::mysql::mysql_datum_to_rw_datum has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 6 (14 pts), if/else 1 (2 pts) (nesting depth added 9). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • risingwave_connector::sink::encoder::bson::datum_to_bson (cognitive 16) src/connector/src/sink/encoder/bson.rs:103 — risingwave_connector::sink::encoder::bson::datum_to_bson has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), match/switch 4 (6 pts), loops 1 (2 pts) (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×16
  • Duplicated block (18 lines × 2) src/connector/src/sink/batching_log_sink.rs:67 — src/connector/src/sink/batching_log_sink.rs:67-84 | src/connector/src/sink/writer.rs:150-167 — 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) src/expr/impl/src/scalar/jsonb_delete.rs:352 — src/expr/impl/src/scalar/jsonb_delete.rs:352-369 | src/expr/impl/src/scalar/jsonb_set.rs:114-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 (18 lines × 2) src/frontend/src/handler/create_function.rs:118 — src/frontend/src/handler/create_function.rs:118-135 | src/frontend/src/handler/create_sql_function.rs:100-117 — before extracting anything, compare `src/frontend/src/handler/create_function.rs` and `src/frontend/src/handler/create_sql_function.rs` as WHOLE FILES: this scan already matched 4 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. 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 (18 lines × 2) src/frontend/src/metrics_reader.rs:108 — src/frontend/src/metrics_reader.rs:108-125 | src/frontend/src/metrics_reader.rs:137-154 — both copies are in the same file, so extract the 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) src/meta/service/src/hummock_service.rs:440 — src/meta/service/src/hummock_service.rs:440-457 | src/meta/service/src/hummock_service.rs:492-509 — both copies are in the same file, so extract the 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) src/meta/src/barrier/checkpoint/state.rs:557 — src/meta/src/barrier/checkpoint/state.rs:557-574 | src/meta/src/barrier/checkpoint/state.rs:1012-1029 — both copies are in the same file, so extract the 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) src/meta/src/dashboard/mod.rs:707 — src/meta/src/dashboard/mod.rs:707-724 | src/meta/src/dashboard/mod.rs:790-807 — both copies are in the same file, so extract the 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) src/meta/src/dashboard/mod.rs:731 — src/meta/src/dashboard/mod.rs:731-748 | src/meta/src/dashboard/mod.rs:812-829 — both copies are in the same file, so extract the 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) src/storage/hummock_sdk/src/compaction_group/hummock_version_ext.rs:294 — src/storage/hummock_sdk/src/compaction_group/hummock_version_ext.rs:294-311 | src/storage/hummock_sdk/src/compaction_group/hummock_version_ext.rs:877-894 — both copies are in the same file, so extract the 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) src/storage/src/hummock/iterator/skip_watermark.rs:206 — src/storage/src/hummock/iterator/skip_watermark.rs:206-223 | src/storage/src/hummock/iterator/skip_watermark.rs:566-583 — both copies are in the same file, so extract the 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) src/stream/src/common/table/state_table.rs:2082 — src/stream/src/common/table/state_table.rs:2082-2099 | src/stream/src/common/table/state_table.rs:2168-2185 — both copies are in the same file, so extract the 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) src/stream/src/executor/over_window/over_partition.rs:1047 — src/stream/src/executor/over_window/over_partition.rs:1047-1064 | src/stream/src/executor/over_window/over_partition.rs:1091-1108 — both copies are in the same file, so extract the 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) src/stream/src/executor/source/batch_source/batch_iceberg_list.rs:76 — src/stream/src/executor/source/batch_source/batch_iceberg_list.rs:76-93 | src/stream/src/executor/source/batch_source/batch_posix_fs_list.rs:209-226 — before extracting anything, compare `src/stream/src/executor/source/batch_source/batch_iceberg_list.rs` and `src/stream/src/executor/source/batch_source/batch_posix_fs_list.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 45 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 (18 lines × 2) src/batch/executors/src/executor/hash_agg.rs:690 — src/batch/executors/src/executor/hash_agg.rs:690-707 | src/batch/executors/src/executor/join/hash_join.rs:678-695 — before extracting anything, compare `src/batch/executors/src/executor/hash_agg.rs` and `src/batch/executors/src/executor/join/hash_join.rs` as WHOLE FILES: this scan already matched 6 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.
  • Duplicated block (18 lines × 2) e2e_test/udf/remote_java/src/main/java/com/example/UdfExample.java:235 — e2e_test/udf/remote_java/src/main/java/com/example/UdfExample.java:235-252 | e2e_test/udf/remote_java/src/main/java/com/example/UdfExample.java:299-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. 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) e2e_test/s3/file_source.py:332 — e2e_test/s3/file_source.py:332-349 | e2e_test/s3/file_source.py:449-466 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D2 · Cognitive Complexity · risingwave_storage · ×15
  • risingwave_storage::hummock::compactor::start_iceberg_compactor (cognitive 139) src/storage/src/hummock/compactor/mod.rs:401 — risingwave_storage::hummock::compactor::start_iceberg_compactor has cognitive complexity 139 (threshold 15). Drivers by points: if/else 20 (89 pts), match/switch 10 (39 pts), loops 3 (8 pts), boolean chains 3 (nesting depth added 103). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • risingwave_storage::hummock::compactor::start_compactor (cognitive 84) src/storage/src/hummock/compactor/mod.rs:973 — risingwave_storage::hummock::compactor::start_compactor has cognitive complexity 84 (threshold 15). Drivers by points: if/else 10 (43 pts), match/switch 9 (36 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 61). Of this number, 81 points are the body's own statements and 3 belong to one function item 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.
  • risingwave_storage::hummock::compactor::iceberg_compaction::memory::estimate_plan_memory (cognitive 48) src/storage/src/hummock/compactor/iceberg_compaction/memory.rs:59 — risingwave_storage::hummock::compactor::iceberg_compaction::memory::estimate_plan_memory has cognitive complexity 48 (threshold 15). Drivers by points: if/else 41 (43 pts), boolean chains 2, match/switch 1 (2 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.
  • risingwave_storage::hummock::compactor::start_shared_compactor (cognitive 44) src/storage/src/hummock/compactor/mod.rs:1342 — risingwave_storage::hummock::compactor::start_shared_compactor has cognitive complexity 44 (threshold 15). Drivers by points: match/switch 7 (28 pts), if/else 3 (13 pts), boolean chains 2, loops 1 (nesting depth added 31). 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.
  • risingwave_storage::hummock::compactor::compactor_runner::compact_and_build_sst (cognitive 43) src/storage/src/hummock/compactor/compactor_runner.rs:758 — risingwave_storage::hummock::compactor::compactor_runner::compact_and_build_sst has cognitive complexity 43 (threshold 15). Drivers by points: if/else 17 (33 pts), boolean chains 6, match/switch 1 (3 pts), loops 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.
  • risingwave_storage::hummock::local_version::pinned_version::start_pinned_version_worker (cognitive 38) src/storage/src/hummock/local_version/pinned_version.rs:197 — risingwave_storage::hummock::local_version::pinned_version::start_pinned_version_worker has cognitive complexity 38 (threshold 15). Drivers by points: match/switch 6 (19 pts), if/else 4 (11 pts), loops 4 (7 pts), boolean chains 1 (nesting depth added 23). 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.
  • risingwave_storage::hummock::compactor::shared_buffer_compact::compact_shared_buffer (cognitive 32) src/storage/src/hummock/compactor/shared_buffer_compact.rs:145 — risingwave_storage::hummock::compactor::shared_buffer_compact::compact_shared_buffer has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 6 (12 pts), match/switch 2 (5 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.
  • risingwave_storage::hummock::compactor::iceberg_compaction::iceberg_compactor_runner::build_task_planning_config (cognitive 31) src/storage/src/hummock/compactor/iceberg_compaction/iceberg_compactor_runner.rs:745 — risingwave_storage::hummock::compactor::iceberg_compaction::iceberg_compactor_runner::build_task_planning_config has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16 (24 pts), match/switch 3 (4 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • risingwave_storage::hummock::compactor::compactor_runner::compact_with_agent (cognitive 23) src/storage/src/hummock/compactor/compactor_runner.rs:323 — risingwave_storage::hummock::compactor::compactor_runner::compact_with_agent has cognitive complexity 23 (threshold 15). Drivers by points: match/switch 6 (14 pts), if/else 5, loops 3 (4 pts) (nesting depth added 9). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • risingwave_storage::hummock::utils::filter_with_delete_range (cognitive 22) src/storage/src/hummock/utils.rs:539 — risingwave_storage::hummock::utils::filter_with_delete_range has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 1 (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.
  • risingwave_storage::hummock::compactor::shared_buffer_compact::generate_splits (cognitive 20) src/storage/src/hummock/compactor/shared_buffer_compact.rs:330 — risingwave_storage::hummock::compactor::shared_buffer_compact::generate_splits has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 3 (5 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • risingwave_storage::hummock::utils::merge_stream (cognitive 20) src/storage/src/hummock/utils.rs:785 — risingwave_storage::hummock::utils::merge_stream has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 5 (16 pts), if/else 1 (3 pts), 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.
  • risingwave_storage::hummock::validator::validate_ssts (cognitive 20) src/storage/src/hummock/validator.rs:32 — risingwave_storage::hummock::validator::validate_ssts has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 2 (3 pts), match/switch 1 (2 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.
  • risingwave_storage::hummock::compactor::iterator::filter_block_metas (cognitive 18) src/storage/src/hummock/compactor/iterator.rs:541 — risingwave_storage::hummock::compactor::iterator::filter_block_metas has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • risingwave_storage::hummock::compactor::compaction_utils::generate_splits (cognitive 16) src/storage/src/hummock/compactor/compaction_utils.rs:244 — risingwave_storage::hummock::compactor::compaction_utils::generate_splits has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 2 (5 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.
D2 · Cognitive Complexity · CatalogController · ×15
  • CatalogController::drop_object (cognitive 46) src/meta/src/controller/catalog/drop_op.rs:24 — CatalogController::drop_object has cognitive complexity 46 (threshold 15). Drivers by points: if/else 13 (22 pts), loops 6 (10 pts), boolean chains 8, match/switch 5 (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.
  • CatalogController::grant_default_privileges (cognitive 43) src/meta/src/controller/user.rs:527 — CatalogController::grant_default_privileges has cognitive complexity 43 (threshold 15). Drivers by points: loops 10 (26 pts), if/else 7 (16 pts), boolean chains 1 (nesting depth added 25). 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.
  • CatalogController::update_connection_and_dependent_objects_props (cognitive 40) src/meta/src/controller/streaming_job.rs:3356 — CatalogController::update_connection_and_dependent_objects_props has cognitive complexity 40 (threshold 15). Drivers by points: if/else 12 (24 pts), loops 8 (14 pts), boolean chains 2 (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.
  • CatalogController::get_table_change_log_truncate_info (cognitive 34) src/meta/src/controller/streaming_job.rs:250 — CatalogController::get_table_change_log_truncate_info has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (25 pts), match/switch 3 (7 pts), loops 2 (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.
  • CatalogController::clean_dirty_sink_downstreams (cognitive 32) src/meta/src/controller/catalog/util.rs:509 — CatalogController::clean_dirty_sink_downstreams has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (24 pts), loops 3 (4 pts), match/switch 1 (4 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.
  • CatalogController::try_abort_creating_streaming_job (cognitive 32) src/meta/src/controller/streaming_job.rs:1088 — CatalogController::try_abort_creating_streaming_job has cognitive complexity 32 (threshold 15). Drivers by points: if/else 17 (24 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • CatalogController::create_job_catalog (cognitive 30) src/meta/src/controller/streaming_job.rs:533 — CatalogController::create_job_catalog has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (22 pts), match/switch 3 (5 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • CatalogController::finish_replace_streaming_job_inner (cognitive 28) src/meta/src/controller/streaming_job.rs:2105 — CatalogController::finish_replace_streaming_job_inner has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 6 (10 pts), boolean chains 3, match/switch 2 (nesting depth added 9). Of this number, 21 points are the body's own statements and 7 belong to one function item 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.
  • CatalogController::update_fragment_rate_limit_by_fragment_id (cognitive 27) src/meta/src/controller/streaming_job.rs:3794 — CatalogController::update_fragment_rate_limit_by_fragment_id has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (18 pts), match/switch 4 (9 pts) (nesting depth added 16). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • CatalogController::revoke_privilege (cognitive 27) src/meta/src/controller/user.rs:348 — CatalogController::revoke_privilege has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (21 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • CatalogController::alter_owner (cognitive 21) src/meta/src/controller/catalog/alter_op.rs:281 — CatalogController::alter_owner has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (6 pts), boolean chains 1, match/switch 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.
  • CatalogController::clean_dirty_creating_jobs (cognitive 17) src/meta/src/controller/catalog/mod.rs:631 — CatalogController::clean_dirty_creating_jobs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, match/switch 3 (5 pts), boolean chains 4 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • CatalogController::post_collect_job_fragments (cognitive 17) src/meta/src/controller/streaming_job.rs:1396 — CatalogController::post_collect_job_fragments has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (14 pts), match/switch 2 (3 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.
  • CatalogController::grant_privilege (cognitive 17) src/meta/src/controller/user.rs:232 — CatalogController::grant_privilege has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 4 (6 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • CatalogController::finish_streaming_job_inner (cognitive 16) src/meta/src/controller/streaming_job.rs:1794 — CatalogController::finish_streaming_job_inner has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 2 (7 pts), match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D3 · God Classes · TooManyFields · ×15
  • TooManyFields: StreamingMetrics src/stream/src/executor/monitor/streaming_stats.rs:46 — TooManyFields — 137 stored fields beside 18 methods. The bar is 30 stored fields; this is 107 over it, 4.57× 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: StorageOpts src/storage/src/opts.rs:24 — TooManyFields — 117 stored fields. The bar is 30 stored fields; this is 87 over it, 3.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: MetaOpts src/meta/src/manager/env.rs:95 — TooManyFields — 102 stored fields beside 1 method. The bar is 30 stored fields; this is 72 over it, 3.40× 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: MetaMetrics src/meta/src/rpc/metrics.rs:74 — TooManyFields — 93 stored fields beside 1 method. The bar is 30 stored fields; this is 63 over it, 3.10× 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: SessionConfig src/common/src/session_config/mod.rs:101 — TooManyFields — 86 stored fields beside 3 methods. The bar is 30 stored fields; this is 56 over it, 2.87× 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: MetaConfig src/common/src/config/meta.rs:133 — TooManyFields — 73 stored fields. The bar is 30 stored fields; this is 43 over it, 2.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: StorageConfig src/common/src/config/storage.rs:23 — TooManyFields — 67 stored fields. The bar is 30 stored fields; this is 37 over it, 2.23× 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: StreamingDeveloperConfig src/common/src/config/streaming.rs:82 — TooManyFields — 62 stored fields beside 1 method. The bar is 30 stored fields; this is 32 over it, 2.07× 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: HummockStateStoreMetrics src/storage/src/monitor/hummock_state_store_metrics.rs:43 — TooManyFields — 45 stored fields beside 2 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: NexmarkProperties src/connector/src/source/nexmark/mod.rs:50 — TooManyFields — 44 stored fields. The bar is 30 stored fields; this is 14 over it, 1.47× 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: TableCatalog src/frontend/src/catalog/table_catalog.rs:83 — TooManyFields — 43 stored fields beside 49 methods. 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: IcebergCommon src/connector/src/connector_common/iceberg/mod.rs:57 — TooManyFields — 41 stored fields beside 21 methods. The bar is 30 stored fields; this is 11 over it, 1.37× 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: IcebergConfig src/connector/src/sink/iceberg/config.rs:301 — TooManyFields — 39 stored fields beside 27 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: MetadataV2 src/storage/backup/src/meta_snapshot_v2.rs:89 — 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: MetaNodeOpts src/meta/node/src/lib.rs:46 — TooManyFields — 33 stored fields. The bar is 30 stored fields; this is 3 over it, 1.10× 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.
D1 · Cyclomatic Complexity · Binder · ×14
  • Binder::bind_builtin_scalar_function (cyclomatic 62) src/frontend/src/binder/expr/function/builtin_scalar.rs:31 — Binder::bind_builtin_scalar_function has cyclomatic complexity 62 (threshold 15). Of this number, 59 points are the body's own statements and 3 belong to 2 function items inside it that branch. 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.
  • Binder::resolve_binary_operator (cyclomatic 57) src/frontend/src/binder/expr/binary_op.rs:79 — Binder::resolve_binary_operator has cyclomatic complexity 57 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • Binder::bind_expr_inner (cyclomatic 53) src/frontend/src/binder/expr/mod.rs:66 — Binder::bind_expr_inner has cyclomatic complexity 53 (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.
  • Binder::bind_function (cyclomatic 43) src/frontend/src/binder/expr/function/mod.rs:247 — Binder::bind_function has cyclomatic complexity 43 (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.
  • Binder::bind_match_recognize (cyclomatic 38) src/frontend/src/binder/relation/match_recognize.rs:148 — Binder::bind_match_recognize 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.
  • Binder::lower_measure (cyclomatic 30) src/frontend/src/binder/relation/match_recognize.rs:540 — Binder::lower_measure has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Binder::bind_gap_fill (cyclomatic 25) src/frontend/src/binder/relation/gap_fill.rs:36 — Binder::bind_gap_fill 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.
  • Binder::bind_catalog_relation_by_name (cyclomatic 25) src/frontend/src/binder/relation/table_or_source.rs:110 — Binder::bind_catalog_relation_by_name 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.
  • Binder::bind_column (cyclomatic 24) src/frontend/src/binder/expr/column.rs:26 — Binder::bind_column 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.
  • Binder::bind_insert (cyclomatic 22) src/frontend/src/binder/insert.rs:104 — Binder::bind_insert 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.
  • Binder::bind_update (cyclomatic 19) src/frontend/src/binder/update.rs:125 — Binder::bind_update 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.
  • Binder::bind_window_function (cyclomatic 17) src/frontend/src/binder/expr/function/window.rs:58 — Binder::bind_window_function 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.
  • Binder::bind_join_constraint (cyclomatic 17) src/frontend/src/binder/relation/join.rs:150 — Binder::bind_join_constraint has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • Binder::bind_table_function (cyclomatic 16) src/frontend/src/binder/relation/table_function.rs:36 — Binder::bind_table_function 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.
D2 · Cognitive Complexity · HashJoinExecutor · ×14
  • HashJoinExecutor::do_execute (cognitive 72) src/batch/executors/src/executor/join/hash_join.rs:478 — HashJoinExecutor::do_execute has cognitive complexity 72 (threshold 15). Drivers by points: if/else 14 (35 pts), loops 11 (27 pts), match/switch 3 (7 pts), boolean chains 3 (nesting depth added 41). 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.
  • HashJoinExecutor::do_left_outer_join (cognitive 46) src/batch/executors/src/executor/join/hash_join.rs:859 — HashJoinExecutor::do_left_outer_join has cognitive complexity 46 (threshold 15). Drivers by points: if/else 11 (38 pts), loops 3 (8 pts) (nesting depth added 32). 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.
  • HashJoinExecutor::handle_watermark (cognitive 33) src/stream/src/executor/hash_join.rs:815 — HashJoinExecutor::handle_watermark has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 4 (10 pts), boolean chains 3 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • HashJoinExecutor::handle_match_rows (cognitive 29) src/stream/src/executor/hash_join.rs:1087 — HashJoinExecutor::handle_match_rows has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 3 (5 pts), match/switch 4 (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.
  • HashJoinExecutor::do_inner_join (cognitive 26) src/batch/executors/src/executor/join/hash_join.rs:779 — HashJoinExecutor::do_inner_join has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 3 (7 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.
  • HashJoinExecutor::handle_match_row (cognitive 25) src/stream/src/executor/hash_join.rs:1264 — HashJoinExecutor::handle_match_row has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 1 (4 pts), boolean chains 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.
  • HashJoinExecutor::do_left_outer_join_with_non_equi_condition (cognitive 22) src/batch/executors/src/executor/join/hash_join.rs:949 — HashJoinExecutor::do_left_outer_join_with_non_equi_condition has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 3 (7 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.
  • HashJoinExecutor::do_full_outer_join_with_non_equi_condition (cognitive 22) src/batch/executors/src/executor/join/hash_join.rs:1560 — HashJoinExecutor::do_full_outer_join_with_non_equi_condition has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 4 (8 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.
  • HashJoinExecutor::find_asof_matched_rows (cognitive 22) src/batch/executors/src/executor/join/hash_join.rs:2002 — HashJoinExecutor::find_asof_matched_rows has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (15 pts), match/switch 1 (4 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • HashJoinExecutor::do_left_semi_join_with_non_equi_condition (cognitive 21) src/batch/executors/src/executor/join/hash_join.rs:1093 — HashJoinExecutor::do_left_semi_join_with_non_equi_condition has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (14 pts), loops 3 (7 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.
  • HashJoinExecutor::do_full_outer_join (cognitive 21) src/batch/executors/src/executor/join/hash_join.rs:1491 — HashJoinExecutor::do_full_outer_join has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 4 (8 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.
  • HashJoinExecutor::into_stream (cognitive 21) src/stream/src/executor/hash_join.rs:584 — HashJoinExecutor::into_stream has cognitive complexity 21 (threshold 15). Drivers by points: loops 6 (16 pts), if/else 1 (3 pts), match/switch 1 (2 pts) (nesting depth added 13). 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.
  • HashJoinExecutor::eq_join_oneside (cognitive 20) src/stream/src/executor/hash_join.rs:949 — HashJoinExecutor::eq_join_oneside has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 3 (7 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.
  • HashJoinExecutor::do_left_anti_join_with_non_equi_condition (cognitive 18) src/batch/executors/src/executor/join/hash_join.rs:1164 — HashJoinExecutor::do_left_anti_join_with_non_equi_condition has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (7 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.
D2 · Cognitive Complexity · risingwave_stream · ×14
  • risingwave_stream::executor::temporal_join::phase1::handle_chunk (cognitive 69) src/stream/src/executor/temporal_join.rs:448 — risingwave_stream::executor::temporal_join::phase1::handle_chunk has cognitive complexity 69 (threshold 15). Drivers by points: if/else 15 (41 pts), loops 5 (19 pts), match/switch 3 (7 pts), boolean chains 2 (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.
  • risingwave_stream::executor::barrier_align::barrier_align (cognitive 44) src/stream/src/executor/barrier_align.rs:45 — risingwave_stream::executor::barrier_align::barrier_align has cognitive complexity 44 (threshold 15). Drivers by points: match/switch 8 (26 pts), loops 5 (15 pts), if/else 2 (3 pts) (nesting depth added 29). 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.
  • risingwave_stream::executor::backfill::snapshot_backfill::executor::make_consume_snapshot_stream (cognitive 38) src/stream/src/executor/backfill/snapshot_backfill/executor.rs:586 — risingwave_stream::executor::backfill::snapshot_backfill::executor::make_consume_snapshot_stream has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (31 pts), match/switch 2 (3 pts), boolean chains 2, loops 2 (nesting depth added 19). Of this number, 36 points are the body's own statements and 2 belong to one function item 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.
  • risingwave_stream::executor::lookup::sides::align_barrier (cognitive 36) src/stream/src/executor/lookup/sides.rs:124 — risingwave_stream::executor::lookup::sides::align_barrier has cognitive complexity 36 (threshold 15). Drivers by points: match/switch 7 (19 pts), loops 6 (17 pts) (nesting depth added 23). 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.
  • risingwave_stream::executor::lookup::sides::stream_lookup_arrange_this_epoch (cognitive 31) src/stream/src/executor/lookup/sides.rs:299 — risingwave_stream::executor::lookup::sides::stream_lookup_arrange_this_epoch has cognitive complexity 31 (threshold 15). Drivers by points: loops 6 (18 pts), match/switch 4 (13 pts) (nesting depth added 21). 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.
  • risingwave_stream::common::log_store_impl::kv_log_store::serde::stream_de::may_merge_update (cognitive 29) src/stream/src/common/log_store_impl/kv_log_store/serde.rs:787 — risingwave_stream::common::log_store_impl::kv_log_store::serde::stream_de::may_merge_update has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (28 pts), loops 1 (nesting depth added 17). 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.
  • risingwave_stream::executor::exchange::input::remote_input::run_inner (cognitive 21) src/stream/src/executor/exchange/input.rs:239 — risingwave_stream::executor::exchange::input::remote_input::run_inner has cognitive complexity 21 (threshold 15). Drivers by points: if/else 3 (8 pts), match/switch 3 (8 pts), loops 2 (5 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.
  • risingwave_stream::from_proto::source::trad_source::create_source_desc_builder (cognitive 19) src/stream/src/from_proto/source/trad_source.rs:43 — risingwave_stream::from_proto::source::trad_source::create_source_desc_builder has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 4, 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.
  • risingwave_stream::executor::over_window::frame_finder::find_curr_for_rows_frame (cognitive 18) src/stream/src/executor/over_window/frame_finder.rs:219 — risingwave_stream::executor::over_window::frame_finder::find_curr_for_rows_frame 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.
  • risingwave_stream::executor::temporal_join::align_input (cognitive 18) src/stream/src/executor/temporal_join.rs:263 — risingwave_stream::executor::temporal_join::align_input has cognitive complexity 18 (threshold 15). Drivers by points: if/else 2 (8 pts), loops 3 (7 pts), match/switch 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.
  • risingwave_stream::executor::dispatch::try_batch_barriers (cognitive 16) src/stream/src/executor/dispatch.rs:580 — risingwave_stream::executor::dispatch::try_batch_barriers has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 1, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • risingwave_stream::executor::iceberg_with_pk_index::compaction_resolver::collect_input_dvs (cognitive 16) src/stream/src/executor/iceberg_with_pk_index/compaction_resolver.rs:324 — risingwave_stream::executor::iceberg_with_pk_index::compaction_resolver::collect_input_dvs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (12 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.
  • risingwave_stream::executor::iceberg_with_pk_index::position_delete_handler_impl::seed_from_delete_manifests (cognitive 16) src/stream/src/executor/iceberg_with_pk_index/position_delete_handler_impl.rs:286 — risingwave_stream::executor::iceberg_with_pk_index::position_delete_handler_impl::seed_from_delete_manifests has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (3 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.
  • risingwave_stream::executor::lookup::sides::stream_lookup_arrange_prev_epoch (cognitive 16) src/stream/src/executor/lookup/sides.rs:215 — risingwave_stream::executor::lookup::sides::stream_lookup_arrange_prev_epoch has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 2 (6 pts), if/else 2 (5 pts), loops 3 (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.
D30 · Dependency Vulnerabilities · Medium advisory (unmaintained) · ×14
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×14
  • Duplicated block (17 lines × 2) src/batch/executors/src/executor/join/hash_join.rs:1327 — src/batch/executors/src/executor/join/hash_join.rs:1327-1343 | src/batch/executors/src/executor/join/hash_join.rs:1444-1460 — both copies are in the same file, so extract the 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) src/batch/src/task/consistent_hash_shuffle_channel.rs:118 — src/batch/src/task/consistent_hash_shuffle_channel.rs:118-134 | src/batch/src/task/hash_shuffle_channel.rs:114-130 — before extracting anything, compare `src/batch/src/task/consistent_hash_shuffle_channel.rs` and `src/batch/src/task/hash_shuffle_channel.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 64 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) src/frontend/src/datafusion/aggregate/single_phase.rs:331 — src/frontend/src/datafusion/aggregate/single_phase.rs:331-347 | src/frontend/src/datafusion/aggregate/two_phase.rs:304-320 — 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) src/frontend/src/expr/table_function.rs:303 — src/frontend/src/expr/table_function.rs:303-319 | src/frontend/src/expr/table_function.rs:390-406 — both copies are in the same file, so extract the 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) src/frontend/src/optimizer/rule/table_function_to_mysql_query_rule.rs:44 — src/frontend/src/optimizer/rule/table_function_to_mysql_query_rule.rs:44-60 | src/frontend/src/optimizer/rule/table_function_to_postgres_query_rule.rs:45-61 — before extracting anything, compare `src/frontend/src/optimizer/rule/table_function_to_mysql_query_rule.rs` and `src/frontend/src/optimizer/rule/table_function_to_postgres_query_rule.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 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) src/meta/src/barrier/checkpoint/independent_job/batch_refresh_job/mod.rs:273 — src/meta/src/barrier/checkpoint/independent_job/batch_refresh_job/mod.rs:273-289 | src/meta/src/barrier/checkpoint/state.rs:359-375 — before extracting anything, compare `src/meta/src/barrier/checkpoint/independent_job/batch_refresh_job/mod.rs` and `src/meta/src/barrier/checkpoint/state.rs` as WHOLE FILES: this scan already matched 3 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 (17 lines × 2) src/storage/hummock_sdk/src/compaction_group/hummock_version_ext.rs:336 — src/storage/hummock_sdk/src/compaction_group/hummock_version_ext.rs:336-352 | src/storage/hummock_sdk/src/compaction_group/hummock_version_ext.rs:930-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 (17 lines × 2) src/storage/src/hummock/iterator/mod.rs:398 — src/storage/src/hummock/iterator/mod.rs:398-414 | src/storage/src/hummock/iterator/mod.rs:436-452 — both copies are in the same file, so extract the 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) src/stream/src/executor/asof_join.rs:552 — src/stream/src/executor/asof_join.rs:552-568 | src/stream/src/executor/hash_join.rs:851-867 — before extracting anything, compare `src/stream/src/executor/asof_join.rs` and `src/stream/src/executor/hash_join.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 245 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) src/stream/src/executor/join/asof_join.rs:480 — src/stream/src/executor/join/asof_join.rs:480-496 | src/stream/src/executor/join/asof_join.rs:540-556 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (17 lines × 2) src/stream/src/executor/project/project_scalar.rs:339 — src/stream/src/executor/project/project_scalar.rs:339-355 | src/stream/src/executor/project/project_set.rs:132-148 — 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) src/stream/src/executor/top_n/group_top_n.rs:180 — src/stream/src/executor/top_n/group_top_n.rs:180-196 | src/stream/src/executor/top_n/group_top_n_appendonly.rs:163-179 — before extracting anything, compare `src/stream/src/executor/top_n/group_top_n.rs` and `src/stream/src/executor/top_n/group_top_n_appendonly.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 69 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) src/utils/pgwire/src/ldap_auth.rs:240 — src/utils/pgwire/src/ldap_auth.rs:240-256 | src/utils/pgwire/src/ldap_auth.rs:344-360 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (17 lines × 2) java/connector-node/risingwave-connector-service/src/main/java/com/risingwave/connector/source/common/PostgresValidator.java:312 — java/connector-node/risingwave-connector-service/src/main/java/com/risingwave/connector/source/common/PostgresValidator.java:312-328 | java/connector-node/risingwave-connector-service/src/main/java/com/risingwave/connector/source/common/SqlServerValidator.java:334-350 — 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.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×14
  • Duplicated block (10 lines × 3) src/batch/executors/src/executor/join/hash_join.rs:991 — src/batch/executors/src/executor/join/hash_join.rs:991-1000 | src/batch/executors/src/executor/join/hash_join.rs:1201-1210 | src/batch/executors/src/executor/join/hash_join.rs:1608-1617 — 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) src/batch/executors/src/executor/join/hash_join.rs:1335 — src/batch/executors/src/executor/join/hash_join.rs:1335-1344 | src/batch/executors/src/executor/join/hash_join.rs:1452-1461 | src/batch/executors/src/executor/join/hash_join.rs:1606-1615 — 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) src/batch/executors/src/executor/join/nested_loop_join.rs:256 — src/batch/executors/src/executor/join/nested_loop_join.rs:256-268 | src/batch/executors/src/executor/join/nested_loop_join.rs:382-391 | src/batch/executors/src/executor/join/nested_loop_join.rs:426-435 — 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) src/batch/executors/src/executor/sort_over_window.rs:63 — src/batch/executors/src/executor/sort_over_window.rs:63-72 | src/stream/src/from_proto/eowc_over_window.rs:40-49 | src/stream/src/from_proto/over_window.rs:42-51 — 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 (10 lines × 3) src/connector/src/parser/unified/debezium.rs:750 — src/connector/src/parser/unified/debezium.rs:750-759 | src/connector/src/parser/unified/debezium.rs:815-824 | src/connector/src/parser/unified/debezium.rs:1187-1196 — 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) src/frontend/src/catalog/system_catalog/mod.rs:245 — src/frontend/src/catalog/system_catalog/mod.rs:245-254 | src/meta/src/controller/fragment.rs:1580-1589 | src/meta/src/manager/diagnose.rs:1350-1359 — 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 (10 lines × 3) src/frontend/src/handler/alter_owner.rs:89 — src/frontend/src/handler/alter_owner.rs:89-98 | src/frontend/src/handler/alter_owner.rs:134-143 | src/frontend/src/handler/alter_owner.rs:151-160 — 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) src/frontend/src/handler/alter_owner.rs:122 — src/frontend/src/handler/alter_owner.rs:122-131 | src/frontend/src/handler/alter_owner.rs:139-148 | src/frontend/src/handler/alter_owner.rs:156-165 — 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) src/frontend/src/optimizer/rule/apply_join_transpose_rule.rs:245 — src/frontend/src/optimizer/rule/apply_join_transpose_rule.rs:245-254 | src/frontend/src/optimizer/rule/apply_join_transpose_rule.rs:330-339 | src/frontend/src/optimizer/rule/apply_join_transpose_rule.rs:475-484 — 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) src/meta/model/migration/src/m20240304_074901_subscription.rs:13 — src/meta/model/migration/src/m20240304_074901_subscription.rs:13-22 | src/meta/model/migration/src/m20240506_112555_subscription_partial_ckpt.rs:14-23 | src/meta/model/migration/src/m20240506_112555_subscription_partial_ckpt.rs:64-73 — 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 (10 lines × 3) src/batch/src/task/broadcast_channel.rs:57 — src/batch/src/task/broadcast_channel.rs:57-66 | src/batch/src/task/consistent_hash_shuffle_channel.rs:136-145 | src/batch/src/task/hash_shuffle_channel.rs:132-141 — before extracting anything, compare `src/batch/src/task/consistent_hash_shuffle_channel.rs` and `src/batch/src/task/hash_shuffle_channel.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 64 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 × 3) src/frontend/src/expr/type_inference/func.rs:493 — src/frontend/src/expr/type_inference/func.rs:493-502 | src/frontend/src/expr/type_inference/func.rs:506-515 | src/frontend/src/expr/type_inference/func.rs:519-528 — 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) integration_tests/feature-store/server/src/model.rs:187 — integration_tests/feature-store/server/src/model.rs:187-196 | integration_tests/feature-store/server/src/server_pb.rs:366-375 | integration_tests/feature-store/simulator/src/server_pb.rs:366-375 — before extracting anything, compare `integration_tests/feature-store/server/src/model.rs` and `integration_tests/feature-store/server/src/server_pb.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 85 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 × 3) integration_tests/feature-store/server/src/model.rs:357 — integration_tests/feature-store/server/src/model.rs:357-366 | integration_tests/feature-store/server/src/server_pb.rs:676-685 | integration_tests/feature-store/simulator/src/server_pb.rs:676-685 — before extracting anything, compare `integration_tests/feature-store/server/src/model.rs` and `integration_tests/feature-store/server/src/server_pb.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 85 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.
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×14
  • Outbound HTTP without resilience dashboard/lib/api/api.ts:48 — `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience java/connector-node/risingwave-sink-es-7/src/main/java/com/risingwave/connector/ElasticRestHighLevelClientAdapter.java:61 — `RestClient.builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience java/connector-node/risingwave-sink-es-7/src/main/java/com/risingwave/connector/OpensearchRestHighLevelClientAdapter.java:58 — `RestClient.builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience src/common/secret/src/vault_client.rs:170 — `Client::builder()` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience src/common/src/telemetry/mod.rs:180 — `reqwest::get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience src/common/telemetry_event/src/util.rs:32 — `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience src/connector/codec/src/decoder/json/mod.rs:133 — `reqwest::get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience src/connector/src/parser/utils.rs:76 — `reqwest::get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience src/connector/src/sink/doris.rs:493 — `reqwest::Client::builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience src/connector/src/sink/http.rs:310 — `reqwest::Client::builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience src/connector/src/sink/turbopuffer.rs:458 — `reqwest::Client::builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience src/meta/dashboard/src/proxy.rs:85 — `reqwest::get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience src/object_store/src/object/opendal_engine/s3.rs:112 — `reqwest::ClientBuilder::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience src/utils/pgwire/src/pg_server.rs:236 — `reqwest::get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
D15 · Churn × Complexity Hotspots · Repeated repair · ×13
  • Repeated repair: src/meta/src/manager/env.rs src/meta/src/manager/env.rs:434 — src/meta/src/manager/env.rs changed 9 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 3 (its worst body is MetaSrvEnv::new at line 434), 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(meta): do not serialize secret store private key in MetaOpts (#27586)”; “fix: make SQL option redaction allowlist configurable (#27560)”; “fix(iceberg): recover compaction schedules after meta restart (#27449)”; “fix(meta): stabilize automatic compaction group split and merge (#27044)”. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:26:37 +00:00' --until='2026-10-27 04:26:37 +00:00' --full-history --no-merges -- src/meta/src/manager/env.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: src/meta/src/barrier/schedule.rs src/meta/src/barrier/schedule.rs:635 — src/meta/src/barrier/schedule.rs changed 9 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is ScheduledBarriers::mark_ready at line 635), 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(refresh): finish a table refresh only after all materialize actors and abandon it on recovery (#27041)”; “fix(stream): derive NOW progress from elapsed time (#27209)”; “fix(meta): fence sink coordinators during recovery (#27180)”; “fix(stream): use database barrier interval for now (#27118)”. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:26:37 +00:00' --until='2026-10-27 04:26:37 +00:00' --full-history --no-merges -- src/meta/src/barrier/schedule.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: src/meta/src/controller/catalog/mod.rs src/meta/src/controller/catalog/mod.rs:631 — src/meta/src/controller/catalog/mod.rs changed 8 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is CatalogController::clean_dirty_creating_jobs at line 631), 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(meta): synchronize catalog versions with frontend notifications (#27408)”; “fix(meta): support DROP CONNECTOR on tables with more than one internal table (#27363)”; “fix(meta): preserve recoverable foreground jobs after recovery (#26472)”; “fix(meta): unify creating job catalog notifications (#26557)”. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:26:37 +00:00' --until='2026-10-27 04:26:37 +00:00' --full-history --no-merges -- src/meta/src/controller/catalog/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.
  • Repeated repair: src/meta/src/barrier/checkpoint/recovery.rs src/meta/src/barrier/checkpoint/recovery.rs:184 — src/meta/src/barrier/checkpoint/recovery.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 7 (its worst body is DatabaseRecoveringState::poll_next_event at line 184), 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(stream): derive NOW progress from elapsed time (#27209)”; “fix(meta): fence sink coordinators during recovery (#27180)”; “fix(stream): use database barrier interval for now (#27118)”; “fix(meta): preserve recoverable foreground jobs after recovery (#26472)”. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:26:37 +00:00' --until='2026-10-27 04:26:37 +00:00' --full-history --no-merges -- src/meta/src/barrier/checkpoint/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.
  • Repeated repair: src/common/src/config/meta.rs src/common/src/config/meta.rs:97 — src/common/src/config/meta.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 3 (its worst body is DefaultParallelism::deserialize at line 97), 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(iceberg): recover compaction schedules after meta restart (#27449)”; “fix(meta): stabilize automatic compaction group split and merge (#27044)”; “fix(meta): handle incoming sinks in table drops and ALTER MV concurrency checks (#26667)”; “fix(meta): preserve recoverable foreground jobs after recovery (#26472)”. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:26:37 +00:00' --until='2026-10-27 04:26:37 +00:00' --full-history --no-merges -- src/common/src/config/meta.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: src/storage/src/hummock/sstable/forward_sstable_iterator.rs src/storage/src/hummock/sstable/forward_sstable_iterator.rs:65 — src/storage/src/hummock/sstable/forward_sstable_iterator.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 10 (its worst body is SstableIterator::new at line 65), 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(storage): handle exhausted prefetch streams during seek (#27161)”; “fix(storage): bound SST scans and point gets by table ID (#27048)”; “fix(storage): collect point get iterator stats (#26405)”; “fix(storage): enforce scan range in forward SST iterator (#26480)”. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:26:37 +00:00' --until='2026-10-27 04:26:37 +00:00' --full-history --no-merges -- src/storage/src/hummock/sstable/forward_sstable_iterator.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: src/utils/pgwire/src/pg_server.rs src/utils/pgwire/src/pg_server.rs:325 — src/utils/pgwire/src/pg_server.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 6 (its worst body is UserAuthenticator::authenticate at line 325), 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: make SQL option redaction allowlist configurable (#27560)”; “fix(pgwire): stream query results incrementally (#26727)”; “fix(pgwire): support configurable OAuth audience (#26531)”; “fix(pgwire): tolerate mixed-key JWKS for OAuth (#26416)”. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:26:37 +00:00' --until='2026-10-27 04:26:37 +00:00' --full-history --no-merges -- src/utils/pgwire/src/pg_server.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: src/stream/src/common/log_store_impl/kv_log_store/mod.rs src/stream/src/common/log_store_impl/kv_log_store/mod.rs:109 — src/stream/src/common/log_store_impl/kv_log_store/mod.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 5 (its worst body is LogStoreVnodeProgress::apply_per_vnode at line 109), 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(metrics): hide actor IDs below debug level (#26950)”; “fix(stream): support changelog over a singleton input (#27524)”; “fix: make exponential backoff schedules explicit (#26815)”; “fix(stream): make kv log store rewind backoff escalate gradually (#26753)”. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:26:37 +00:00' --until='2026-10-27 04:26:37 +00:00' --full-history --no-merges -- src/stream/src/common/log_store_impl/kv_log_store/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.
  • Repeated repair: src/meta/src/manager/metadata.rs src/meta/src/manager/metadata.rs:116 — src/meta/src/manager/metadata.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 13 (its worst body is ActiveStreamingWorkerNodes::changed at line 116), 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(meta): synchronize catalog versions with frontend notifications (#27408)”; “fix(refresh): finish a table refresh only after all materialize actors and abandon it on recovery (#27041)”; “fix(meta): preserve recoverable foreground jobs after recovery (#26472)”. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:26:37 +00:00' --until='2026-10-27 04:26:37 +00:00' --full-history --no-merges -- src/meta/src/manager/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.
  • Repeated repair: src/frontend/src/optimizer/plan_node/logical_agg.rs src/frontend/src/optimizer/plan_node/logical_agg.rs:1518 — src/frontend/src/optimizer/plan_node/logical_agg.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 13 (its worst body is LogicalAgg::to_stream_with_stream_input at line 1518), 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(frontend): bind correlated references to their owning scope (#27540)”; “fix(optimizer): output NULL for streaming sum when no non-NULL input is left (#27429)”; “fix(frontend): do not pushdown volatile predicate into aggregate (#26830)”. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:26:37 +00:00' --until='2026-10-27 04:26:37 +00:00' --full-history --no-merges -- src/frontend/src/optimizer/plan_node/logical_agg.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: REDACTED REDACTED:83 — REDACTED 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 7 (its worst body is SqlServerExternalTable::connect at line 83), 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(cdc): escape identifiers in external table snapshot queries (#27606)”; “fix(connector): preserve SQL Server composite primary key order (#27160)”; “fix(cdc): fail initial backfill on invalid primary keys (#26513)”. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:26:37 +00:00' --until='2026-10-27 04:26:37 +00:00' --full-history --no-merges -- REDACTED`: 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: src/connector/src/source/google_pubsub/mod.rs src/connector/src/source/google_pubsub/mod.rs:177 — src/connector/src/source/google_pubsub/mod.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 4 (its worst body is PubsubProperties::subscriber_config at line 177), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(connector): restore base64 Pub/Sub source credentials (#27603)”; “fix(connector): preserve Pub/Sub emulator precedence (#27151)”; “fix(connector): avoid Pub/Sub streaming pull flow-control stalls (#26817)”. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:26:37 +00:00' --until='2026-10-27 04:26:37 +00:00' --full-history --no-merges -- src/connector/src/source/google_pubsub/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.
  • Repeated repair: src/connector/src/source/cdc/external/mod.rs src/connector/src/source/cdc/external/mod.rs:61 — src/connector/src/source/cdc/external/mod.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 6 (its worst body is ExternalCdcTableType::from_properties at line 61), 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(stream): preserve CDC events during recovery startup (#27031)”; “fix(cdc): diagnose postgres select privilege (#26079)”; “fix(cdc): fail initial backfill on invalid primary keys (#26513)”. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 04:26:37 +00:00' --until='2026-10-27 04:26:37 +00:00' --full-history --no-merges -- src/connector/src/source/cdc/external/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.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×13
  • Duplicated block (19 lines × 2) src/connector/src/sink/coordinate.rs:128 — src/connector/src/sink/coordinate.rs:128-146 | src/connector/src/sink/decouple_checkpoint_log_sink.rs:76-94 — 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) src/connector/src/sink/doris_starrocks_connector.rs:306 — src/connector/src/sink/doris_starrocks_connector.rs:306-324 | src/connector/src/sink/doris_starrocks_connector.rs:636-654 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (19 lines × 2) src/frontend/src/optimizer/plan_node/batch_over_window.rs:102 — src/frontend/src/optimizer/plan_node/batch_over_window.rs:102-120 | src/frontend/src/optimizer/plan_node/stream_over_window.rs:162-180 — 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) src/frontend/src/scheduler/local.rs:543 — src/frontend/src/scheduler/local.rs:543-561 | src/frontend/src/scheduler/local.rs:566-584 — both copies are in the same file, so extract the 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) src/meta/src/barrier/checkpoint/state.rs:811 — src/meta/src/barrier/checkpoint/state.rs:811-829 | src/meta/src/barrier/checkpoint/state.rs:932-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 (19 lines × 2) src/meta/src/hummock/compaction/picker/space_reclaim_compaction_picker.rs:83 — src/meta/src/hummock/compaction/picker/space_reclaim_compaction_picker.rs:83-101 | src/meta/src/hummock/compaction/picker/space_reclaim_compaction_picker.rs:137-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 (19 lines × 2) src/meta/src/rpc/ddl_controller.rs:1355 — src/meta/src/rpc/ddl_controller.rs:1355-1373 | src/meta/src/rpc/ddl_controller.rs:1414-1432 — both copies are in the same file, so extract the 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) src/storage/src/hummock/store/local_hummock_storage.rs:441 — src/storage/src/hummock/store/local_hummock_storage.rs:441-459 | src/storage/src/memory.rs:1120-1138 — 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 (19 lines × 2) src/stream/src/executor/backfill/cdc/cdc_backfill.rs:690 — src/stream/src/executor/backfill/cdc/cdc_backfill.rs:690-708 | src/stream/src/executor/backfill/cdc/cdc_backfill.rs:781-799 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (19 lines × 2) src/stream/src/executor/nested_loop_temporal_join.rs:194 — src/stream/src/executor/nested_loop_temporal_join.rs:194-212 | src/stream/src/executor/temporal_join.rs:736-754 — before extracting anything, compare `src/stream/src/executor/nested_loop_temporal_join.rs` and `src/stream/src/executor/temporal_join.rs` as WHOLE FILES: this scan already matched 6 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. 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 (19 lines × 2) src/stream/src/executor/top_n/top_n_cache.rs:419 — src/stream/src/executor/top_n/top_n_cache.rs:419-437 | src/stream/src/executor/top_n/top_n_cache.rs:459-477 — both copies are in the same file, so extract the 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) src/stream/src/from_proto/eowc_gap_fill.rs:52 — src/stream/src/from_proto/eowc_gap_fill.rs:52-70 | src/stream/src/from_proto/gap_fill.rs:50-68 — 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) docs/metrics/extract.py:561 — docs/metrics/extract.py:561-579 | docs/metrics/extract.py:596-614 — both copies are in the same file, so extract the 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.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×13
  • Duplicated block (8 lines × 3) src/expr/impl/src/scalar/to_char.rs:268 — src/expr/impl/src/scalar/to_char.rs:268-275 | src/expr/impl/src/scalar/to_char.rs:286-293 | src/expr/impl/src/scalar/to_char.rs:335-342 — 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) src/expr/impl/src/scalar/to_char.rs:267 — src/expr/impl/src/scalar/to_char.rs:267-274 | src/expr/impl/src/scalar/to_char.rs:334-341 | src/expr/impl/src/scalar/to_char.rs:344-351 — 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) src/frontend/src/optimizer/plan_node/logical_agg.rs:1308 — src/frontend/src/optimizer/plan_node/logical_agg.rs:1308-1315 | src/frontend/src/optimizer/plan_node/logical_over_window.rs:575-582 | src/frontend/src/optimizer/plan_node/logical_project_set.rs:281-288 — before extracting anything, compare `src/frontend/src/optimizer/plan_node/logical_agg.rs` and `src/frontend/src/optimizer/plan_node/logical_over_window.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 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 × 3) src/frontend/src/optimizer/plan_node/stream_asof_join.rs:227 — src/frontend/src/optimizer/plan_node/stream_asof_join.rs:227-234 | src/frontend/src/optimizer/plan_node/stream_hash_join.rs:580-587 | src/frontend/src/optimizer/plan_node/stream_temporal_join.rs:245-252 — before extracting anything, compare `src/frontend/src/optimizer/plan_node/stream_asof_join.rs` and `src/frontend/src/optimizer/plan_node/stream_hash_join.rs` as WHOLE FILES: this scan already matched 6 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. 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 × 3) src/risedevtool/src/task/compactor_service.rs:71 — src/risedevtool/src/task/compactor_service.rs:71-78 | src/risedevtool/src/task/compute_node_service.rs:78-85 | src/risedevtool/src/task/meta_node_service.rs:249-256 — before extracting anything, compare `src/risedevtool/src/task/compactor_service.rs` and `src/risedevtool/src/task/compute_node_service.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 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 × 3) src/storage/src/mem_table.rs:154 — src/storage/src/mem_table.rs:154-161 | src/storage/src/mem_table.rs:212-219 | src/storage/src/mem_table.rs:298-305 — 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) src/stream/src/executor/source/batch_source/batch_posix_fs_list.rs:246 — src/stream/src/executor/source/batch_source/batch_posix_fs_list.rs:246-253 | src/stream/src/executor/source/fs_list_executor.rs:148-155 | src/stream/src/executor/source/iceberg_list_executor.rs:219-226 — 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) src/frontend/src/optimizer/plan_node/generic/cdc_scan.rs:244 — src/frontend/src/optimizer/plan_node/generic/cdc_scan.rs:244-251 | src/frontend/src/optimizer/plan_node/generic/sys_scan.rs:133-140 | src/frontend/src/optimizer/plan_node/generic/table_scan.rs:420-427 — before extracting anything, compare `src/frontend/src/optimizer/plan_node/generic/cdc_scan.rs` and `src/frontend/src/optimizer/plan_node/generic/table_scan.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 × 3) src/frontend/src/optimizer/plan_node/logical_except.rs:70 — src/frontend/src/optimizer/plan_node/logical_except.rs:70-77 | src/frontend/src/optimizer/plan_node/logical_intersect.rs:69-76 | src/frontend/src/optimizer/plan_node/logical_union.rs:91-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 all 3 call sites, so a change lands once.
  • Duplicated block (8 lines × 3) src/frontend/src/optimizer/plan_node/logical_except.rs:89 — src/frontend/src/optimizer/plan_node/logical_except.rs:89-96 | src/frontend/src/optimizer/plan_node/logical_intersect.rs:88-95 | src/frontend/src/optimizer/plan_node/logical_union.rs:110-117 — 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 (8 lines × 3) src/stream/src/executor/source/batch_source/batch_opendal_fs_fetch.rs:219 — src/stream/src/executor/source/batch_source/batch_opendal_fs_fetch.rs:219-226 | src/stream/src/executor/source/batch_source/batch_opendal_fs_list.rs:200-210 | src/stream/src/executor/source/batch_source/batch_posix_fs_fetch.rs:300-308 — 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 (8 lines × 3) java/connector-node/risingwave-sink-jdbc/src/main/java/com/risingwave/connector/jdbc/MySqlDialect.java:99 — java/connector-node/risingwave-sink-jdbc/src/main/java/com/risingwave/connector/jdbc/MySqlDialect.java:99-106 | java/connector-node/risingwave-sink-jdbc/src/main/java/com/risingwave/connector/jdbc/PostgresDialect.java:132-139 | java/connector-node/risingwave-sink-jdbc/src/main/java/com/risingwave/connector/jdbc/SqlServerDialect.java:135-142 — before extracting anything, compare `java/connector-node/risingwave-sink-jdbc/src/main/java/com/risingwave/connector/jdbc/MySqlDialect.java` and `java/connector-node/risingwave-sink-jdbc/src/main/java/com/risingwave/connector/jdbc/SqlServerDialect.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 64 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. 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 × 3) integration_tests/client-library/python/crud.py:12 — integration_tests/client-library/python/crud.py:12-25 | integration_tests/client-library/python/crud.py:67-76 | integration_tests/client-library/python/materializeview.py:34-41 — 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.
D2 · Cognitive Complexity · HummockManager · ×12
  • HummockManager::get_compact_tasks_impl (cognitive 36) src/meta/src/hummock/manager/compaction/mod.rs:348 — HummockManager::get_compact_tasks_impl has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (23 pts), loops 5 (8 pts), match/switch 2 (5 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.
  • HummockManager::truncate_time_travel_metadata (cognitive 36) src/meta/src/hummock/manager/time_travel.rs:70 — HummockManager::truncate_time_travel_metadata has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (24 pts), loops 9 (12 pts) (nesting depth added 13). Of this number, 35 points are the body's own statements and 1 belongs to one function item 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.
  • HummockManager::report_compact_tasks_impl (cognitive 34) src/meta/src/hummock/manager/compaction/mod.rs:843 — HummockManager::report_compact_tasks_impl has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (22 pts), match/switch 3 (7 pts), loops 3, boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • HummockManager::commit_epoch (cognitive 33) src/meta/src/hummock/manager/commit_epoch.rs:75 — HummockManager::commit_epoch has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (19 pts), loops 9 (13 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • HummockManager::filter_out_objects_by_time_travel (cognitive 32) src/meta/src/hummock/manager/time_travel.rs:441 — HummockManager::filter_out_objects_by_time_travel has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 6 (12 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.
  • HummockManager::merge_compaction_group_impl (cognitive 29) src/meta/src/hummock/manager/compaction/compaction_group_schedule/topology.rs:66 — HummockManager::merge_compaction_group_impl has cognitive complexity 29 (threshold 15). Drivers by points: if/else 19 (23 pts), loops 3, match/switch 1 (2 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • HummockManager::check_dead_task (cognitive 23) src/meta/src/hummock/manager/timer_task.rs:595 — HummockManager::check_dead_task has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 5 (10 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.
  • HummockManager::split_compaction_group_impl (cognitive 22) src/meta/src/hummock/manager/compaction/compaction_group_schedule/topology.rs:456 — HummockManager::split_compaction_group_impl has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (15 pts), loops 3 (4 pts), boolean chains 3 (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.
  • HummockManager::write_time_travel_metadata (cognitive 22) src/meta/src/hummock/manager/time_travel.rs:646 — HummockManager::write_time_travel_metadata has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 7). Of this number, 14 points are the body's own statements and 8 belong to one function item 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.
  • HummockManager::correct_commit_ssts (cognitive 19) src/meta/src/hummock/manager/commit_epoch.rs:392 — HummockManager::correct_commit_ssts has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 5 (7 pts), match/switch 1 (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.
  • HummockManager::apply_split_weight_by_vnode_partition (cognitive 18) src/meta/src/hummock/manager/compaction/mod.rs:1231 — HummockManager::apply_split_weight_by_vnode_partition has cognitive complexity 18 (threshold 15). Drivers by points: loops 5 (9 pts), if/else 4 (5 pts), boolean chains 4 (nesting depth added 5). 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.
  • HummockManager::commit_epoch_sanity_check (cognitive 18) src/meta/src/hummock/manager/context.rs:208 — HummockManager::commit_epoch_sanity_check has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 2, 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.
D2 · Cognitive Complexity · risingwave_ctl · ×10
  • risingwave_ctl::cmd_impl::meta::cluster_info::source_split_info (cognitive 38) src/ctl/src/cmd_impl/meta/cluster_info.rs:35 — risingwave_ctl::cmd_impl::meta::cluster_info::source_split_info has cognitive complexity 38 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 6 (12 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.
  • risingwave_ctl::cmd_impl::hummock::compaction_group::build_compaction_config_vec (cognitive 30) src/ctl/src/cmd_impl/hummock/compaction_group.rs:53 — risingwave_ctl::cmd_impl::hummock::compaction_group::build_compaction_config_vec has cognitive complexity 30 (threshold 15). Drivers by points: if/else 30. 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.
  • risingwave_ctl::cmd_impl::hummock::sst_dump::sst_dump (cognitive 30) src/ctl/src/cmd_impl/hummock/sst_dump.rs:70 — risingwave_ctl::cmd_impl::hummock::sst_dump::sst_dump has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 3 (8 pts), match/switch 1 (4 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.
  • risingwave_ctl::cmd_impl::meta::reschedule::unregister_workers (cognitive 30) src/ctl/src/cmd_impl/meta/reschedule.rs:183 — risingwave_ctl::cmd_impl::meta::reschedule::unregister_workers has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 4 (5 pts), match/switch 3 (5 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.
  • risingwave_ctl::cmd_impl::hummock::list_version::list_version (cognitive 22) src/ctl/src/cmd_impl/hummock/list_version.rs:20 — risingwave_ctl::cmd_impl::hummock::list_version::list_version has cognitive complexity 22 (threshold 15). Drivers by points: loops 7 (18 pts), if/else 3, 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.
  • risingwave_ctl::cmd_impl::hummock::validate_version::print_version_delta_in_archive (cognitive 21) src/ctl/src/cmd_impl/hummock/validate_version.rs:171 — risingwave_ctl::cmd_impl::hummock::validate_version::print_version_delta_in_archive has cognitive complexity 21 (threshold 15). Drivers by points: if/else 2 (11 pts), loops 4 (10 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.
  • risingwave_ctl::cmd_impl::meta::cluster_info::cluster_info (cognitive 18) src/ctl/src/cmd_impl/meta/cluster_info.rs:138 — risingwave_ctl::cmd_impl::meta::cluster_info::cluster_info has cognitive complexity 18 (threshold 15). Drivers by points: loops 6 (10 pts), if/else 4 (7 pts), match/switch 1 (nesting depth added 7). 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.
  • risingwave_ctl::cmd_impl::bench::do_bench (cognitive 17) src/ctl/src/cmd_impl/bench.rs:82 — risingwave_ctl::cmd_impl::bench::do_bench has cognitive complexity 17 (threshold 15). Drivers by points: loops 5 (13 pts), if/else 1 (3 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.
  • risingwave_ctl::cmd_impl::hummock::compaction_group::list_compaction_status (cognitive 17) src/ctl/src/cmd_impl/hummock/compaction_group.rs:197 — risingwave_ctl::cmd_impl::hummock::compaction_group::list_compaction_status has cognitive complexity 17 (threshold 15). Drivers by points: loops 6 (15 pts), if/else 2 (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.
  • risingwave_ctl::cmd_impl::hummock::migrate_legacy_object::migrate_legacy_object (cognitive 17) src/ctl/src/cmd_impl/hummock/migrate_legacy_object.rs:30 — risingwave_ctl::cmd_impl::hummock::migrate_legacy_object::migrate_legacy_object has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 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.
D35 · Change Coupling · Change-coupling hub · ×10
  • Change-coupling hub: panic_store.rs → replay_impl.rs, hummock_storage.rs, local_hummock_storage.rs, monitored_store.rs, traced_store.rs, store_impl.rs src/storage/src/panic_store.rs — `src/storage/src/panic_store.rs` changes together with 6 other files — `src/storage/hummock_test/src/bin/replay/replay_impl.rs`, `src/storage/src/hummock/store/hummock_storage.rs`, `src/storage/src/hummock/store/local_hummock_storage.rs`, `src/storage/src/monitor/monitored_store.rs`, `src/storage/src/monitor/traced_store.rs`, `src/storage/src/store_impl.rs` — none of which declares a dependency on it: one file is the hub of 6 separate couplings, not 6 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 6.
  • Change-coupling hub: stream_hash_agg.rs → stream_hop_window.rs, stream_project_set.rs, stream_simple_agg.rs, stream_stateless_simple_agg.rs, stream_union.rs src/frontend/src/optimizer/plan_node/stream_hash_agg.rs — `src/frontend/src/optimizer/plan_node/stream_hash_agg.rs` changes together with 5 other files — `src/frontend/src/optimizer/plan_node/stream_hop_window.rs`, `src/frontend/src/optimizer/plan_node/stream_project_set.rs`, `src/frontend/src/optimizer/plan_node/stream_simple_agg.rs`, `src/frontend/src/optimizer/plan_node/stream_stateless_simple_agg.rs`, `src/frontend/src/optimizer/plan_node/stream_union.rs` — none of which declares a dependency on it: one file is the hub of 5 separate couplings, not 5 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 5.
  • Change-coupling hub: REDACTED → Layout.tsx, streaming.ts, relation_graph.tsx src/meta/src/dashboard/mod.rs — `src/meta/src/dashboard/mod.rs` changes together with 3 other files — `dashboard/components/Layout.tsx`, `dashboard/lib/api/streaming.ts`, `dashboard/pages/relation_graph.tsx` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
  • Change-coupling hub: kafka.rs → debezium_json.rs, kinesis.rs, nats.rs, pulsar.rs, utils.rs src/connector/src/sink/kafka.rs — `src/connector/src/sink/kafka.rs` changes together with 5 other files — `src/connector/src/sink/formatter/debezium_json.rs`, `src/connector/src/sink/kinesis.rs`, `src/connector/src/sink/nats.rs`, `src/connector/src/sink/pulsar.rs`, `src/connector/src/sink/utils.rs` — none of which declares a dependency on it: one file is the hub of 5 separate couplings, not 5 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 5.
  • Change-coupling hub: replay_impl.rs → monitored_store.rs, traced_store.rs, store_impl.rs src/storage/hummock_test/src/bin/replay/replay_impl.rs — `src/storage/hummock_test/src/bin/replay/replay_impl.rs` changes together with 3 other files — `src/storage/src/monitor/monitored_store.rs`, `src/storage/src/monitor/traced_store.rs`, `src/storage/src/store_impl.rs` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
  • Change-coupling hub: batch_hash_join.rs → batch_lookup_join.rs, stream_delta_join.rs, stream_hash_join.rs src/frontend/src/optimizer/plan_node/batch_hash_join.rs — `src/frontend/src/optimizer/plan_node/batch_hash_join.rs` changes together with 3 other files — `src/frontend/src/optimizer/plan_node/batch_lookup_join.rs`, `src/frontend/src/optimizer/plan_node/stream_delta_join.rs`, `src/frontend/src/optimizer/plan_node/stream_hash_join.rs` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
  • Change-coupling hub: stream_hop_window.rs → stream_dynamic_filter.rs, stream_hash_join.rs, stream_project.rs, stream_project_set.rs src/frontend/src/optimizer/plan_node/stream_hop_window.rs — `src/frontend/src/optimizer/plan_node/stream_hop_window.rs` changes together with 4 other files — `src/frontend/src/optimizer/plan_node/stream_dynamic_filter.rs`, `src/frontend/src/optimizer/plan_node/stream_hash_join.rs`, `src/frontend/src/optimizer/plan_node/stream_project.rs`, `src/frontend/src/optimizer/plan_node/stream_project_set.rs` — none of which declares a dependency on it: one file is the hub of 4 separate couplings, not 4 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 4.
  • Change-coupling hub: reader.rs → reader.rs, reader.rs, reader.rs src/connector/src/source/nexmark/source/reader.rs — `src/connector/src/source/nexmark/source/reader.rs` changes together with 3 other files — `src/connector/src/source/cdc/source/reader.rs`, `src/connector/src/source/datagen/source/reader.rs`, `src/connector/src/source/kafka/source/reader.rs` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
  • Change-coupling hub: REDACTED → config.rs, risedev_env.rs, service_config.rs src/risedevtool/src/task/mod.rs — `src/risedevtool/src/task/mod.rs` changes together with 3 other files — `src/risedevtool/src/config.rs`, `src/risedevtool/src/risedev_env.rs`, `src/risedevtool/src/service_config.rs` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
  • Change-coupling hub: scale_service.rs → recovery.rs, scale.rs, stream_manager.rs src/meta/service/src/scale_service.rs — `src/meta/service/src/scale_service.rs` changes together with 3 other files — `src/meta/src/barrier/context/recovery.rs`, `src/meta/src/stream/scale.rs`, `src/meta/src/stream/stream_manager.rs` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
D4 · Code Duplication · Duplicated block (22 lines × 2) · ×10
  • Duplicated block (22 lines × 2) src/connector/src/sink/iceberg/commit.rs:361 — src/connector/src/sink/iceberg/commit.rs:361-382 | src/connector/src/sink/iceberg/commit.rs:542-563 — both copies are in the same file, so extract the 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 (22 lines × 2) src/frontend/planner_test/src/lib.rs:466 — src/frontend/planner_test/src/lib.rs:466-487 | src/frontend/src/handler/mod.rs:468-489 — 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) src/frontend/src/handler/describe.rs:366 — src/frontend/src/handler/describe.rs:366-387 | src/frontend/src/utils/stream_graph_formatter.rs:238-259 — 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) src/meta/service/src/ddl_service.rs:1174 — src/meta/service/src/ddl_service.rs:1174-1195 | src/meta/service/src/ddl_service.rs:1230-1251 — both copies are in the same file, so extract the 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 (22 lines × 2) src/meta/src/hummock/model/ext/hummock.rs:315 — src/meta/src/hummock/model/ext/hummock.rs:315-336 | src/storage/backup/src/meta_snapshot_v2.rs:257-278 — 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) src/sqlparser/src/parser.rs:5895 — src/sqlparser/src/parser.rs:5895-5916 | src/sqlparser/src/parser.rs:6606-6627 — both copies are in the same file, so extract the 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 (22 lines × 2) src/stream/src/executor/source/fs_fetch_executor.rs:464 — src/stream/src/executor/source/fs_fetch_executor.rs:464-485 | src/stream/src/executor/source/iceberg_fetch_executor.rs:410-431 — before extracting anything, compare `src/stream/src/executor/source/fs_fetch_executor.rs` and `src/stream/src/executor/source/iceberg_fetch_executor.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 71 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 (22 lines × 2) src/stream/src/executor/top_n/group_top_n.rs:116 — src/stream/src/executor/top_n/group_top_n.rs:116-137 | src/stream/src/executor/top_n/group_top_n_appendonly.rs:122-143 — before extracting anything, compare `src/stream/src/executor/top_n/group_top_n.rs` and `src/stream/src/executor/top_n/group_top_n_appendonly.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 69 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 (22 lines × 2) java/connector-node/risingwave-source-cdc/src/main/java/io/debezium/connector/postgresql/PostgresStreamingChangeEventSource.java:389 — java/connector-node/risingwave-source-cdc/src/main/java/io/debezium/connector/postgresql/PostgresStreamingChangeEventSource.java:389-410 | java/connector-node/risingwave-source-cdc/src/main/java/io/debezium/connector/postgresql/PostgresStreamingChangeEventSource.java:578-599 — both copies are in the same file, so extract the 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 `java/connector-node/risingwave-source-cdc/src/main/java/io/debezium/connector/postgresql/PostgresStreamingChangeEventSource.java:389` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `java/connector-node/risingwave-source-cdc/src/main/java/io/debezium/connector/postgresql/PostgresStreamingChangeEventSource.java:412` calls `probeConnectionIfNeeded` and `java/connector-node/risingwave-source-cdc/src/main/java/io/debezium/connector/postgresql/PostgresStreamingChangeEventSource.java:601` 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 (22 lines × 2) REDACTED:124 — REDACTED:124-145 | REDACTED:149-170 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D1 · Cyclomatic Complexity · risingwave_storage · ×9
  • risingwave_storage::hummock::compactor::start_iceberg_compactor (cyclomatic 43) src/storage/src/hummock/compactor/mod.rs:401 — risingwave_storage::hummock::compactor::start_iceberg_compactor 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.
  • risingwave_storage::hummock::compactor::start_compactor (cyclomatic 30) src/storage/src/hummock/compactor/mod.rs:973 — risingwave_storage::hummock::compactor::start_compactor has cyclomatic complexity 30 (threshold 15). Of this number, 29 points are the body's own statements and 1 belongs to one function item 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.
  • risingwave_storage::hummock::compactor::iceberg_compaction::memory::estimate_plan_memory (cyclomatic 27) src/storage/src/hummock/compactor/iceberg_compaction/memory.rs:59 — risingwave_storage::hummock::compactor::iceberg_compaction::memory::estimate_plan_memory has cyclomatic complexity 27 (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.
  • risingwave_storage::hummock::compactor::compactor_runner::compact_and_build_sst (cyclomatic 23) src/storage/src/hummock/compactor/compactor_runner.rs:758 — risingwave_storage::hummock::compactor::compactor_runner::compact_and_build_sst 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.
  • risingwave_storage::hummock::compactor::iceberg_compaction::iceberg_compactor_runner::build_task_planning_config (cyclomatic 22) src/storage/src/hummock/compactor/iceberg_compaction/iceberg_compactor_runner.rs:745 — risingwave_storage::hummock::compactor::iceberg_compaction::iceberg_compactor_runner::build_task_planning_config 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.
  • risingwave_storage::hummock::compactor::start_shared_compactor (cyclomatic 19) src/storage/src/hummock/compactor/mod.rs:1342 — risingwave_storage::hummock::compactor::start_shared_compactor 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.
  • risingwave_storage::hummock::compactor::compactor_runner::compact_with_agent (cyclomatic 18) src/storage/src/hummock/compactor/compactor_runner.rs:323 — risingwave_storage::hummock::compactor::compactor_runner::compact_with_agent has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • risingwave_storage::hummock::compactor::shared_buffer_compact::compact_shared_buffer (cyclomatic 18) src/storage/src/hummock/compactor/shared_buffer_compact.rs:145 — risingwave_storage::hummock::compactor::shared_buffer_compact::compact_shared_buffer 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.
  • risingwave_storage::hummock::local_version::pinned_version::start_pinned_version_worker (cyclomatic 16) src/storage/src/hummock/local_version/pinned_version.rs:197 — risingwave_storage::hummock::local_version::pinned_version::start_pinned_version_worker has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · CatalogController · ×9
  • CatalogController::drop_object (cyclomatic 35) src/meta/src/controller/catalog/drop_op.rs:24 — CatalogController::drop_object 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.
  • CatalogController::create_job_catalog (cyclomatic 25) src/meta/src/controller/streaming_job.rs:533 — CatalogController::create_job_catalog 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.
  • CatalogController::finish_replace_streaming_job_inner (cyclomatic 23) src/meta/src/controller/streaming_job.rs:2105 — CatalogController::finish_replace_streaming_job_inner has cyclomatic complexity 23 (threshold 15). Of this number, 18 points are the body's own statements and 5 belong to one function item inside it that branches. 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.
  • CatalogController::update_connection_and_dependent_objects_props (cyclomatic 22) src/meta/src/controller/streaming_job.rs:3356 — CatalogController::update_connection_and_dependent_objects_props 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.
  • CatalogController::alter_owner (cyclomatic 21) src/meta/src/controller/catalog/alter_op.rs:281 — CatalogController::alter_owner has cyclomatic complexity 21 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • CatalogController::update_fragment_rate_limit_by_fragment_id (cyclomatic 20) src/meta/src/controller/streaming_job.rs:3794 — CatalogController::update_fragment_rate_limit_by_fragment_id 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.
  • CatalogController::try_abort_creating_streaming_job (cyclomatic 19) src/meta/src/controller/streaming_job.rs:1088 — CatalogController::try_abort_creating_streaming_job 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.
  • CatalogController::revoke_privilege (cyclomatic 16) src/meta/src/controller/user.rs:348 — CatalogController::revoke_privilege 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.
  • CatalogController::grant_default_privileges (cyclomatic 16) src/meta/src/controller/user.rs:527 — CatalogController::grant_default_privileges has cyclomatic complexity 16 (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.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×9
  • Duplicated block (11 lines × 3) src/common/src/array/arrow/arrow_iceberg.rs:131 — src/common/src/array/arrow/arrow_iceberg.rs:131-141 | src/common/src/array/arrow/arrow_iceberg.rs:501-511 | src/common/src/array/arrow/arrow_impl.rs:362-372 — 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 (11 lines × 3) src/expr/impl/src/udf/wasm.rs:59 — src/expr/impl/src/udf/wasm.rs:59-69 | src/expr/impl/src/udf/wasm.rs:147-157 | src/expr/impl/src/udf/wasm.rs:186-196 — 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) src/frontend/src/handler/alter_set_schema.rs:84 — src/frontend/src/handler/alter_set_schema.rs:84-94 | src/frontend/src/handler/alter_set_schema.rs:100-111 | src/frontend/src/handler/alter_set_schema.rs:117-128 — 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) src/frontend/src/optimizer/plan_node/batch_delete.rs:69 — src/frontend/src/optimizer/plan_node/batch_delete.rs:69-79 | src/frontend/src/optimizer/plan_node/batch_insert.rs:81-91 | src/frontend/src/optimizer/plan_node/batch_update.rs:72-82 — 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 (11 lines × 3) src/meta/src/hummock/manager/compaction/compaction_group_manager.rs:306 — src/meta/src/hummock/manager/compaction/compaction_group_manager.rs:306-316 | src/meta/src/hummock/manager/compaction/compaction_group_schedule/normalize.rs:203-213 | src/meta/src/hummock/manager/versioning.rs:317-327 — 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 (11 lines × 3) src/stream/src/executor/backfill/cdc/cdc_backfill.rs:596 — src/stream/src/executor/backfill/cdc/cdc_backfill.rs:596-606 | src/stream/src/executor/backfill/cdc/cdc_backfill.rs:690-700 | src/stream/src/executor/backfill/cdc/cdc_backfill.rs:781-791 — 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) src/stream/src/from_proto/lookup.rs:77 — src/stream/src/from_proto/lookup.rs:77-87 | src/stream/src/from_proto/temporal_join.rs:95-105 | src/stream/src/from_proto/temporal_join.rs:179-189 — 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 (11 lines × 3) src/frontend/src/expr/table_function.rs:308 — src/frontend/src/expr/table_function.rs:308-318 | src/frontend/src/expr/table_function.rs:395-405 | src/frontend/src/expr/table_function.rs:566-580 — 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) docs/metrics/extract.py:558 — docs/metrics/extract.py:558-568 | docs/metrics/extract.py:593-603 | docs/metrics/extract.py:640-650 — 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. 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 after the matched lines, `docs/metrics/extract.py:651` calls `extract_labels` and `docs/metrics/extract.py:569` 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.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×9
  • Duplicated block (9 lines × 3) src/batch/executors/src/executor/hash_agg.rs:399 — src/batch/executors/src/executor/hash_agg.rs:399-407 | src/batch/executors/src/executor/join/hash_join.rs:342-350 | src/batch/executors/src/executor/join/hash_join.rs:370-378 — before extracting anything, compare `src/batch/executors/src/executor/hash_agg.rs` and `src/batch/executors/src/executor/join/hash_join.rs` as WHOLE FILES: this scan already matched 6 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.
  • Duplicated block (9 lines × 3) src/connector/src/sink/doris.rs:397 — src/connector/src/sink/doris.rs:397-405 | src/connector/src/sink/doris.rs:410-418 | src/connector/src/sink/doris.rs:424-432 — 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) src/frontend/src/handler/alter_connection_props.rs:49 — src/frontend/src/handler/alter_connection_props.rs:49-57 | src/frontend/src/handler/alter_sink_props.rs:59-67 | src/frontend/src/handler/alter_table_props.rs:87-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 all 3 call sites, so a change lands once.
  • Duplicated block (9 lines × 3) src/frontend/src/optimizer/plan_node/generic/join.rs:246 — src/frontend/src/optimizer/plan_node/generic/join.rs:246-254 | src/frontend/src/optimizer/plan_node/stream_asof_join.rs:182-190 | src/frontend/src/optimizer/plan_node/stream_hash_join.rs:375-383 — before extracting anything, compare `src/frontend/src/optimizer/plan_node/generic/join.rs` and `src/frontend/src/optimizer/plan_node/stream_asof_join.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 (9 lines × 3) src/frontend/src/scheduler/distributed/stage.rs:748 — src/frontend/src/scheduler/distributed/stage.rs:748-756 | src/frontend/src/scheduler/fast_insert.rs:44-52 | src/frontend/src/scheduler/local.rs:655-663 — 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) src/meta/src/barrier/edge_builder.rs:542 — src/meta/src/barrier/edge_builder.rs:542-550 | src/meta/src/barrier/edge_builder.rs:626-634 | src/meta/src/barrier/edge_builder.rs:683-691 — 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) src/risedevtool/src/bin/risedev-dev.rs:270 — src/risedevtool/src/bin/risedev-dev.rs:270-278 | src/risedevtool/src/bin/risedev-dev.rs:351-359 | src/risedevtool/src/bin/risedev-dev.rs:370-378 — 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) src/storage/src/mem_table.rs:163 — src/storage/src/mem_table.rs:163-171 | src/storage/src/mem_table.rs:221-229 | src/storage/src/mem_table.rs:307-315 — 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) src/frontend/src/binder/select.rs:74 — src/frontend/src/binder/select.rs:74-82 | src/frontend/src/binder/select.rs:84-92 | src/frontend/src/binder/select.rs:93-102 — 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.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×9
  • Duplicated block (5 lines × 3) src/frontend/src/optimizer/plan_node/batch_delete.rs:62 — src/frontend/src/optimizer/plan_node/batch_delete.rs:62-66 | src/frontend/src/optimizer/plan_node/batch_insert.rs:74-78 | src/frontend/src/optimizer/plan_node/batch_update.rs:65-69 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
  • Duplicated block (5 lines × 3) src/frontend/src/optimizer/plan_node/stream_hash_agg.rs:200 — src/frontend/src/optimizer/plan_node/stream_hash_agg.rs:200-204 | src/frontend/src/optimizer/plan_node/stream_simple_agg.rs:122-126 | src/frontend/src/optimizer/plan_node/stream_stateless_simple_agg.rs:96-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 all 3 call sites, so a change lands once.
  • Duplicated block (5 lines × 3) src/risedevtool/src/bin/risedev-dev.rs:177 — src/risedevtool/src/bin/risedev-dev.rs:177-181 | src/risedevtool/src/bin/risedev-dev.rs:225-229 | src/risedevtool/src/bin/risedev-dev.rs:448-453 — 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 (5 lines × 3) src/stream/src/executor/top_n/top_n_state.rs:179 — src/stream/src/executor/top_n/top_n_state.rs:179-184 | src/stream/src/executor/top_n/top_n_state.rs:251-255 | src/stream/src/executor/top_n/top_n_state.rs:283-287 — 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 (5 lines × 3) src/frontend/src/optimizer/plan_node/logical_table_function.rs:81 — src/frontend/src/optimizer/plan_node/logical_table_function.rs:81-85 | src/frontend/src/optimizer/plan_node/logical_values.rs:99-103 | src/frontend/src/optimizer/plan_node/logical_vector_search.rs:241-245 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
  • Duplicated block (5 lines × 3) src/frontend/src/optimizer/plan_node/stream_delta_join.rs:237 — src/frontend/src/optimizer/plan_node/stream_delta_join.rs:237-241 | src/frontend/src/optimizer/plan_node/stream_hash_join.rs:730-734 | src/frontend/src/optimizer/plan_node/stream_stateless_simple_agg.rs:119-123 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
  • Duplicated block (5 lines × 3) src/frontend/src/optimizer/plan_node/stream_over_window.rs:150 — src/frontend/src/optimizer/plan_node/stream_over_window.rs:150-154 | src/frontend/src/optimizer/plan_node/stream_stateless_simple_agg.rs:81-85 | src/frontend/src/optimizer/plan_node/stream_topn.rs:97-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 all 3 call sites, so a change lands once.
  • Duplicated block (5 lines × 3) src/cmd_all/src/standalone.rs:110 — src/cmd_all/src/standalone.rs:110-114 | src/cmd_all/src/standalone.rs:117-121 | src/cmd_all/src/standalone.rs:124-128 — 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 (5 lines × 3) java/connector-node/risingwave-connector-service/src/main/java/com/risingwave/connector/FileSinkFactory.java:30 — java/connector-node/risingwave-connector-service/src/main/java/com/risingwave/connector/FileSinkFactory.java:30-34 | java/connector-node/risingwave-sink-cassandra/src/main/java/com/risingwave/connector/CassandraFactory.java:39-43 | java/connector-node/risingwave-sink-es-7/src/main/java/com/risingwave/connector/EsSinkFactory.java:36-40 — 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.
D6 · Cohesion (LCOM4) · Low cohesion · ×9
  • Low cohesion: StreamingMetrics (LCOM4 16) src/stream/src/executor/monitor/streaming_stats.rs:46 — StreamingMetrics's methods fall into 16 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 16 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: MonitoredConnection (LCOM4 8) src/common/metrics/src/monitor/connection.rs:60 — MonitoredConnection's methods fall into 8 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 8 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: SessionImpl (LCOM4 7) src/frontend/src/session.rs:748 — SessionImpl's methods fall into 7 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 7 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Interval (LCOM4 6) src/common/src/types/interval.rs:44 — Interval's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: MonitorServiceImpl (LCOM4 5) src/compute/src/rpc/service/monitor_service.rs:55 — MonitorServiceImpl's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: FeatureStoreServer (LCOM4 4) integration_tests/feature-store/server/src/feature_store.rs:13 — FeatureStoreServer's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: DeltaLakeSinkCommitter (LCOM4 4) src/connector/src/sink/deltalake.rs:571 — DeltaLakeSinkCommitter's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: StreamServiceImpl (LCOM4 4) src/meta/service/src/stream_service.rs:61 — StreamServiceImpl's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: MetadataV2 (LCOM4 4) src/storage/backup/src/meta_snapshot_v2.rs:89 — MetadataV2's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
D2 · Cognitive Complexity · risingwave_common · ×8
  • risingwave_common::system_param::set_system_param (cognitive 145) src/common/src/system_param/mod.rs:329 — risingwave_common::system_param::set_system_param has cognitive complexity 145 (threshold 15). Drivers by points: if/else 90 (144 pts), match/switch 1 (nesting depth added 54). 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.
  • risingwave_common::types::variant::parse_path (cognitive 53) src/common/src/types/variant.rs:929 — risingwave_common::types::variant::parse_path has cognitive complexity 53 (threshold 15). Drivers by points: if/else 9 (33 pts), loops 5 (15 pts), boolean chains 3, match/switch 1 (2 pts) (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.
  • risingwave_common::vnode_mapping::vnode_placement::place_vnode (cognitive 39) src/common/src/vnode_mapping/vnode_placement.rs:29 — risingwave_common::vnode_mapping::vnode_placement::place_vnode has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (28 pts), loops 7 (10 pts), 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.
  • risingwave_common::util::stream_graph_visitor::visit_stream_node_tables_inner (cognitive 37) src/common/src/util/stream_graph_visitor.rs:104 — risingwave_common::util::stream_graph_visitor::visit_stream_node_tables_inner has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (21 pts), loops 6 (11 pts), match/switch 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.
  • risingwave_common::system_param::derive_missing_fields (cognitive 36) src/common/src/system_param/mod.rs:208 — risingwave_common::system_param::derive_missing_fields has cognitive complexity 36 (threshold 15). Drivers by points: boolean chains 18, if/else 18. 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.
  • risingwave_common::array::arrow::arrow_impl::is_parquet_schema_match_source_schema (cognitive 25) src/common/src/array/arrow/arrow_impl.rs:1841 — risingwave_common::array::arrow::arrow_impl::is_parquet_schema_match_source_schema has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (20 pts), boolean chains 2, loops 1 (2 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.
  • risingwave_common::system_param::check_missing_params (cognitive 18) src/common/src/system_param/mod.rs:175 — risingwave_common::system_param::check_missing_params has cognitive complexity 18 (threshold 15). Drivers by points: if/else 18. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (risingwave_common::system_param::validate_init_system_params) 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.
  • risingwave_common::system_param::validate_init_system_params (cognitive 18) src/common/src/system_param/mod.rs:420 — risingwave_common::system_param::validate_init_system_params has cognitive complexity 18 (threshold 15). Drivers by points: if/else 18. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (risingwave_common::system_param::check_missing_params) 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.
D2 · Cognitive Complexity · risingwave_expr_impl · ×8
  • risingwave_expr_impl::scalar::to_char::format_inner (cognitive 63) src/expr/impl/src/scalar/to_char.rs:244 — risingwave_expr_impl::scalar::to_char::format_inner has cognitive complexity 63 (threshold 15). Drivers by points: if/else 28 (58 pts), match/switch 3 (5 pts) (nesting depth added 32). 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.
  • risingwave_expr_impl::scalar::regexp::regexp_replace (cognitive 60) src/expr/impl/src/scalar/regexp.rs:271 — risingwave_expr_impl::scalar::regexp::regexp_replace has cognitive complexity 60 (threshold 15). Drivers by points: if/else 18 (45 pts), loops 3 (11 pts), boolean chains 2, match/switch 2 (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.
  • risingwave_expr_impl::scalar::jsonb_set::jsonbb_set_path (cognitive 38) src/expr/impl/src/scalar/jsonb_set.rs:75 — risingwave_expr_impl::scalar::jsonb_set::jsonbb_set_path has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (28 pts), loops 3 (8 pts), boolean chains 1, match/switch 1 (nesting depth added 21). 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.
  • risingwave_expr_impl::scalar::jsonb_delete::jsonbb_remove_path (cognitive 25) src/expr/impl/src/scalar/jsonb_delete.rs:307 — risingwave_expr_impl::scalar::jsonb_delete::jsonbb_remove_path has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 2 (4 pts), match/switch 1 (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.
  • risingwave_expr_impl::scalar::regexp::regexp_split_to_array (cognitive 20) src/expr/impl/src/scalar/regexp.rs:466 — risingwave_expr_impl::scalar::regexp::regexp_split_to_array has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (18 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.
  • risingwave_expr_impl::scalar::array_concat::array_cat (cognitive 19) src/expr/impl/src/scalar/array_concat.rs:91 — risingwave_expr_impl::scalar::array_concat::array_cat has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 3 (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.
  • risingwave_expr_impl::scalar::similar_to_escape::similar_escape_internal (cognitive 18) src/expr/impl/src/scalar/similar_to_escape.rs:20 — risingwave_expr_impl::scalar::similar_to_escape::similar_escape_internal has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (10 pts), match/switch 2 (6 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.
  • risingwave_expr_impl::window_function::range_utils::range_diff (cognitive 17) src/expr/impl/src/window_function/range_utils.rs:57 — risingwave_expr_impl::window_function::range_utils::range_diff has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 3, match/switch 1 (2 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.
D30 · Dependency Vulnerabilities · Medium CVE · ×8
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×8
  • Members sharing a duplicated core (4 members, 50+ identical tokens) src/batch/executors/src/executor/hop_window.rs:144 — src/batch/executors/src/executor/hop_window.rs:144-200 | src/expr/core/src/expr/test_utils.rs:96-191 | src/frontend/src/optimizer/plan_node/generic/hop_window.rs:191-288 | src/stream/src/executor/hop_window.rs:72-224 — 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) src/frontend/src/optimizer/rule/table_function_to_file_scan_rule.rs:28 — src/frontend/src/optimizer/rule/table_function_to_file_scan_rule.rs:28-132 | src/frontend/src/optimizer/rule/table_function_to_mssql_query_rule.rs:52-110 | src/frontend/src/optimizer/rule/table_function_to_mysql_query_rule.rs:27-80 | src/frontend/src/optimizer/rule/table_function_to_postgres_query_rule.rs:27-85 — 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) src/meta/src/controller/catalog/alter_op.rs:39 — src/meta/src/controller/catalog/alter_op.rs:39-65 | src/meta/src/controller/catalog/alter_op.rs:286-625 | src/meta/src/controller/catalog/alter_op.rs:825-865 | src/meta/src/controller/catalog/alter_op.rs:871-900 — 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) src/risedevtool/src/task/compactor_service.rs:65 — src/risedevtool/src/task/compactor_service.rs:65-102 | src/risedevtool/src/task/compute_node_service.rs:67-124 | src/risedevtool/src/task/frontend_service.rs:89-115 | src/risedevtool/src/task/meta_node_service.rs:243-287 — 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) java/connector-node/risingwave-sink-jdbc/src/main/java/com/risingwave/connector/jdbc/MySqlDialect.java:87 — java/connector-node/risingwave-sink-jdbc/src/main/java/com/risingwave/connector/jdbc/MySqlDialect.java:87-120 | java/connector-node/risingwave-sink-jdbc/src/main/java/com/risingwave/connector/jdbc/PostgresDialect.java:117-158 | java/connector-node/risingwave-sink-jdbc/src/main/java/com/risingwave/connector/jdbc/SnowflakeDialect.java:63-109 | java/connector-node/risingwave-sink-jdbc/src/main/java/com/risingwave/connector/jdbc/SqlServerDialect.java:123-156 — 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) e2e_test/s3/file_sink.py:59 — e2e_test/s3/file_sink.py:59-156 | e2e_test/s3/file_sink.py:159-374 | e2e_test/s3/file_source.py:332-439 | e2e_test/s3/file_source.py:449-531 — 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) e2e_test/webhook/websocket_sender.py:404 — e2e_test/webhook/websocket_sender.py:404-465 | e2e_test/webhook/websocket_sender.py:481-510 | e2e_test/webhook/websocket_sender.py:514-543 | e2e_test/webhook/websocket_sender.py:547-574 — 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) integration_tests/iceberg-cdc/python/script/init.py:34 — integration_tests/iceberg-cdc/python/script/init.py:34-98 | integration_tests/iceberg-sink2/python/main.py:65-112 | integration_tests/iceberg-source/python/main.py:67-87 | integration_tests/iceberg-source/python/main.py:90-107 — 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.
D4 · Code Duplication · Duplicated block (9–10 lines × 2) · ×8
  • Duplicated block (9–10 lines × 2) src/connector/src/connector_common/iceberg/mod.rs:723 — src/connector/src/connector_common/iceberg/mod.rs:723-731 | src/connector/src/connector_common/iceberg/mod.rs:1096-1105 — both copies are in the same file, so extract the 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–10 lines × 2) src/connector/src/source/cdc/enumerator/mod.rs:330 — src/connector/src/source/cdc/enumerator/mod.rs:330-338 | REDACTED:224-233 — 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–10 lines × 2) src/expr/impl/src/scalar/encdec.rs:132 — src/expr/impl/src/scalar/encdec.rs:132-141 | src/expr/impl/src/scalar/encdec.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–10 lines × 2) src/frontend/src/optimizer/plan_node/logical_join.rs:301 — src/frontend/src/optimizer/plan_node/logical_join.rs:301-309 | src/frontend/src/optimizer/plan_node/logical_join.rs:1161-1170 — both copies are in the same file, so extract the 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–10 lines × 2) src/frontend/src/optimizer/plan_node/logical_union.rs:218 — src/frontend/src/optimizer/plan_node/logical_union.rs:218-226 | src/frontend/src/optimizer/plan_node/logical_union.rs:308-317 — both copies are in the same file, so extract the 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–10 lines × 2) src/meta/src/controller/catalog/alter_op.rs:488 — src/meta/src/controller/catalog/alter_op.rs:488-497 | src/meta/src/controller/catalog/util.rs:328-336 — 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–10 lines × 2) src/meta/src/controller/fragment.rs:1362 — src/meta/src/controller/fragment.rs:1362-1371 | src/meta/src/stream/scale.rs:632-640 — 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–10 lines × 2) src/stream/src/executor/top_n/group_top_n.rs:237 — src/stream/src/executor/top_n/group_top_n.rs:237-245 | src/stream/src/executor/top_n/group_top_n_appendonly.rs:206-215 — before extracting anything, compare `src/stream/src/executor/top_n/group_top_n.rs` and `src/stream/src/executor/top_n/group_top_n_appendonly.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 69 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.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×8
  • Duplicated block (7 lines × 3) src/batch/executors/src/executor/hash_agg.rs:412 — src/batch/executors/src/executor/hash_agg.rs:412-418 | src/batch/executors/src/executor/hash_agg.rs:439-445 | src/batch/executors/src/executor/order_by.rs:404-410 — before extracting anything, compare `src/batch/executors/src/executor/hash_agg.rs` and `src/batch/executors/src/executor/order_by.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 64 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 × 3) src/batch/executors/src/executor/join/hash_join.rs:1258 — src/batch/executors/src/executor/join/hash_join.rs:1258-1264 | src/batch/executors/src/executor/join/hash_join.rs:1389-1395 | src/batch/executors/src/executor/join/hash_join.rs:1507-1513 — 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) src/batch/src/task/broadcast_channel.rs:94 — src/batch/src/task/broadcast_channel.rs:94-100 | src/batch/src/task/consistent_hash_shuffle_channel.rs:175-181 | src/batch/src/task/hash_shuffle_channel.rs:164-170 — before extracting anything, compare `src/batch/src/task/consistent_hash_shuffle_channel.rs` and `src/batch/src/task/hash_shuffle_channel.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 64 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 × 3) src/frontend/src/catalog/system_catalog/rw_catalog/rw_internal_tables.rs:62 — src/frontend/src/catalog/system_catalog/rw_catalog/rw_internal_tables.rs:62-68 | src/frontend/src/catalog/system_catalog/rw_catalog/rw_subscriptions.rs:66-74 | src/frontend/src/catalog/system_catalog/rw_catalog/rw_tables.rs:64-70 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
  • Duplicated block (7 lines × 3) src/frontend/src/optimizer/plan_node/stream_exchange.rs:115 — src/frontend/src/optimizer/plan_node/stream_exchange.rs:115-121 | src/frontend/src/optimizer/plan_node/stream_iceberg_with_pk_index_position_delete_merger.rs:54-60 | src/frontend/src/optimizer/plan_node/stream_sync_log_store.rs:44-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 all 3 call sites, so a change lands once.
  • Duplicated block (7 lines × 3) src/stream/src/executor/join/asof_join.rs:484 — src/stream/src/executor/join/asof_join.rs:484-490 | src/stream/src/executor/join/asof_join.rs:544-550 | src/stream/src/executor/join/asof_join.rs:667-673 — 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) src/frontend/src/optimizer/plan_node/batch_mssql_query.rs:59 — src/frontend/src/optimizer/plan_node/batch_mssql_query.rs:59-65 | src/frontend/src/optimizer/plan_node/batch_mysql_query.rs:46-52 | src/frontend/src/optimizer/plan_node/batch_postgres_query.rs:46-52 — 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 (7 lines × 3) src/connector/src/sink/starrocks.rs:585 — src/connector/src/sink/starrocks.rs:585-591 | src/connector/src/sink/starrocks.rs:596-602 | src/connector/src/sink/starrocks.rs:608-614 — 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.
D1 · Cyclomatic Complexity · risingwave_common · ×7
  • risingwave_common::system_param::set_system_param (cyclomatic 73) src/common/src/system_param/mod.rs:329 — risingwave_common::system_param::set_system_param has cyclomatic complexity 73 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • risingwave_common::util::stream_graph_visitor::visit_stream_node_tables_inner (cyclomatic 54) src/common/src/util/stream_graph_visitor.rs:104 — risingwave_common::util::stream_graph_visitor::visit_stream_node_tables_inner 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.
  • risingwave_common::system_param::derive_missing_fields (cyclomatic 37) src/common/src/system_param/mod.rs:208 — risingwave_common::system_param::derive_missing_fields has cyclomatic complexity 37 (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.
  • risingwave_common::vnode_mapping::vnode_placement::place_vnode (cyclomatic 22) src/common/src/vnode_mapping/vnode_placement.rs:29 — risingwave_common::vnode_mapping::vnode_placement::place_vnode 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.
  • risingwave_common::types::variant::parse_path (cyclomatic 20) src/common/src/types/variant.rs:929 — risingwave_common::types::variant::parse_path has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: risingwave_common::types::variant::append_datum_value (cyclomatic 26) 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 function is counted neither in this dimension's figures nor in its score.
  • risingwave_common::system_param::check_missing_params (cyclomatic 19) src/common/src/system_param/mod.rs:175 — risingwave_common::system_param::check_missing_params 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. This shape REPEATS in the file: one other method here (risingwave_common::system_param::validate_init_system_params) 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. This is NOT this file's highest cyclomatic complexity: risingwave_common::system_param::system_params_from_kv (cyclomatic 20) 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 function is counted neither in this dimension's figures nor in its score.
  • risingwave_common::system_param::validate_init_system_params (cyclomatic 19) src/common/src/system_param/mod.rs:420 — risingwave_common::system_param::validate_init_system_params 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. This shape REPEATS in the file: one other method here (risingwave_common::system_param::check_missing_params) 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. This is NOT this file's highest cyclomatic complexity: risingwave_common::system_param::system_params_from_kv (cyclomatic 20) 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 function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · risingwave_meta · ×7
  • risingwave_meta::controller::system_param::merge_params (cyclomatic 55) src/meta/src/controller/system_param.rs:112 — risingwave_meta::controller::system_param::merge_params has cyclomatic complexity 55 (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.
  • risingwave_meta::hummock::manager::compaction::compaction_group_manager::update_compaction_config (cyclomatic 39) src/meta/src/hummock/manager/compaction/compaction_group_manager.rs:664 — risingwave_meta::hummock::manager::compaction::compaction_group_manager::update_compaction_config has cyclomatic complexity 39 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • risingwave_meta::controller::utils::check_relation_name_duplicate (cyclomatic 26) src/meta/src/controller/utils.rs:803 — risingwave_meta::controller::utils::check_relation_name_duplicate 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.
  • risingwave_meta::dashboard::handlers::get_streaming_stats_from_prometheus (cyclomatic 24) src/meta/src/dashboard/mod.rs:783 — risingwave_meta::dashboard::handlers::get_streaming_stats_from_prometheus 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.
  • risingwave_meta::stream::stream_graph::state_match::match_graph (cyclomatic 18) src/meta/src/stream/stream_graph/state_match.rs:420 — risingwave_meta::stream::stream_graph::state_match::match_graph has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 5 of the 18 points are its own statements and the rest belongs to one function item inside it that branches (dfs). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
  • risingwave_meta::hummock::metrics_utils::trigger_sst_stat (cyclomatic 16) src/meta/src/hummock/metrics_utils.rs:138 — risingwave_meta::hummock::metrics_utils::trigger_sst_stat 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.
  • risingwave_meta::serving::start_serving_vnode_mapping_worker (cyclomatic 16) src/meta/src/serving/mod.rs:268 — risingwave_meta::serving::start_serving_vnode_mapping_worker has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HummockManager · ×7
  • HummockManager::truncate_time_travel_metadata (cyclomatic 24) src/meta/src/hummock/manager/time_travel.rs:70 — HummockManager::truncate_time_travel_metadata has cyclomatic complexity 24 (threshold 15). Of this number, 23 points are the body's own statements and 1 belongs to one function item 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.
  • HummockManager::commit_epoch (cyclomatic 23) src/meta/src/hummock/manager/commit_epoch.rs:75 — HummockManager::commit_epoch 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.
  • HummockManager::merge_compaction_group_impl (cyclomatic 22) src/meta/src/hummock/manager/compaction/compaction_group_schedule/topology.rs:66 — HummockManager::merge_compaction_group_impl 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.
  • HummockManager::get_compact_tasks_impl (cyclomatic 19) src/meta/src/hummock/manager/compaction/mod.rs:348 — HummockManager::get_compact_tasks_impl 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.
  • HummockManager::report_compact_tasks_impl (cyclomatic 19) src/meta/src/hummock/manager/compaction/mod.rs:843 — HummockManager::report_compact_tasks_impl 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.
  • HummockManager::split_compaction_group_impl (cyclomatic 18) src/meta/src/hummock/manager/compaction/compaction_group_schedule/topology.rs:456 — HummockManager::split_compaction_group_impl 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.
  • HummockManager::write_time_travel_metadata (cyclomatic 16) src/meta/src/hummock/manager/time_travel.rs:646 — HummockManager::write_time_travel_metadata has cyclomatic complexity 16 (threshold 15). Of this number, 12 points are the body's own statements and 4 belong to one function item 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.
D4 · Code Duplication · Duplicated block (14 lines × 3) · ×7
  • Duplicated block (14 lines × 3) src/batch/executors/src/executor/join/hash_join.rs:1316 — src/batch/executors/src/executor/join/hash_join.rs:1316-1329 | src/batch/executors/src/executor/join/hash_join.rs:1433-1446 | src/batch/executors/src/executor/join/hash_join.rs:1582-1595 — 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 lines × 3) src/common/metrics/src/monitor/process.rs:113 — src/common/metrics/src/monitor/process.rs:113-126 | src/common/metrics/src/monitor/process.rs:164-177 | src/common/metrics/src/monitor/process.rs:194-207 — 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 lines × 3) src/expr/macro/src/gen.rs:165 — src/expr/macro/src/gen.rs:165-178 | src/expr/macro/src/gen.rs:824-837 | src/expr/macro/src/gen.rs:1162-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 (14 lines × 3) src/frontend/src/scheduler/local.rs:333 — src/frontend/src/scheduler/local.rs:333-346 | src/frontend/src/scheduler/local.rs:378-391 | src/frontend/src/scheduler/local.rs:416-429 — 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 lines × 3) src/meta/model/migration/src/m20240304_074901_subscription.rs:55 — src/meta/model/migration/src/m20240304_074901_subscription.rs:55-68 | src/meta/model/migration/src/m20240506_112555_subscription_partial_ckpt.rs:46-59 | src/meta/model/migration/src/m20240506_112555_subscription_partial_ckpt.rs:107-120 — 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) src/meta/src/dashboard/mod.rs:888 — src/meta/src/dashboard/mod.rs:888-901 | src/meta/src/dashboard/mod.rs:915-928 | src/meta/src/dashboard/mod.rs:941-954 — 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 lines × 3) docs/metrics/extract.py:402 — docs/metrics/extract.py:402-415 | docs/metrics/extract.py:537-550 | docs/metrics/extract.py:624-637 — 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.
D4 · Code Duplication · Duplicated block (13 lines × 3) · ×7
  • Duplicated block (13 lines × 3) src/batch/executors/src/executor/join/hash_join.rs:1261 — src/batch/executors/src/executor/join/hash_join.rs:1261-1273 | src/batch/executors/src/executor/join/hash_join.rs:1323-1335 | src/batch/executors/src/executor/join/hash_join.rs:1440-1452 — 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) src/frontend/src/handler/create_aggregate.rs:91 — src/frontend/src/handler/create_aggregate.rs:91-103 | src/frontend/src/handler/create_function.rs:141-153 | src/frontend/src/handler/create_sql_function.rs:121-133 — before extracting anything, compare `src/frontend/src/handler/create_aggregate.rs` and `src/frontend/src/handler/create_function.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 × 3) src/frontend/src/optimizer/plan_node/logical_delete.rs:79 — src/frontend/src/optimizer/plan_node/logical_delete.rs:79-91 | src/frontend/src/optimizer/plan_node/logical_insert.rs:105-117 | src/frontend/src/optimizer/plan_node/logical_update.rs:82-94 — 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 (13 lines × 3) src/frontend/src/optimizer/rule/table_function_to_file_scan_rule.rs:44 — src/frontend/src/optimizer/rule/table_function_to_file_scan_rule.rs:44-56 | src/frontend/src/optimizer/rule/table_function_to_mysql_query_rule.rs:44-56 | src/frontend/src/optimizer/rule/table_function_to_postgres_query_rule.rs:45-57 — before extracting anything, compare `src/frontend/src/optimizer/rule/table_function_to_mysql_query_rule.rs` and `src/frontend/src/optimizer/rule/table_function_to_postgres_query_rule.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 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 × 3) src/frontend/src/scheduler/local.rs:320 — src/frontend/src/scheduler/local.rs:320-332 | src/frontend/src/scheduler/local.rs:363-375 | src/frontend/src/scheduler/local.rs:401-413 — 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) src/meta/src/rpc/election/sql.rs:223 — src/meta/src/rpc/election/sql.rs:223-235 | src/meta/src/rpc/election/sql.rs:398-410 | src/meta/src/rpc/election/sql.rs:573-585 — 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) src/meta/src/rpc/election/sql.rs:202 — src/meta/src/rpc/election/sql.rs:202-214 | src/meta/src/rpc/election/sql.rs:377-389 | src/meta/src/rpc/election/sql.rs:552-564 — 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.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×7
  • Duplicated block (12–13 lines × 2) src/frontend/src/binder/relation/mod.rs:270 — src/frontend/src/binder/relation/mod.rs:270-282 | src/frontend/src/binder/relation/mod.rs:326-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 (12–13 lines × 2) src/frontend/src/binder/select.rs:459 — src/frontend/src/binder/select.rs:459-470 | src/frontend/src/binder/select.rs:503-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 (12–13 lines × 2) src/frontend/src/catalog/system_catalog/rw_catalog/rw_relation_info.rs:48 — src/frontend/src/catalog/system_catalog/rw_catalog/rw_relation_info.rs:48-60 | src/frontend/src/catalog/system_catalog/rw_catalog/rw_relation_info.rs:93-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 (12–13 lines × 2) src/frontend/src/handler/alter_connection_props.rs:48 — src/frontend/src/handler/alter_connection_props.rs:48-60 | src/frontend/src/handler/alter_sink_props.rs:58-69 — 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) src/frontend/src/handler/alter_streaming_enable_unaligned_join.rs:61 — src/frontend/src/handler/alter_streaming_enable_unaligned_join.rs:61-72 | src/frontend/src/handler/describe.rs:309-321 — 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) src/sqlparser/src/ast/mod.rs:3088 — src/sqlparser/src/ast/mod.rs:3088-3100 | src/sqlparser/src/ast/query.rs:419-430 — 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) docs/metrics/extract.py:74 — docs/metrics/extract.py:74-85 | docs/metrics/extract.py:134-146 — both copies are in the same file, so extract the 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.
D5 · Coupling · Off the main sequence · ×7
  • Off the main sequence: delta_btree_map — delta_btree_map: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: risingwave_error — risingwave_error: 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: risingwave_meta_dashboard — risingwave_meta_dashboard: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: sync-point — sync-point: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
  • Off the main sequence: risingwave_sqlparser — risingwave_sqlparser: abstractness 0.05, instability 0.13, distance 0.83 — zone of pain — concrete and depended on by 7 project(s), so it's rigid to change.
  • Off the main sequence: risingwave_object_store — risingwave_object_store: abstractness 0.07, instability 0.13, distance 0.80 — zone of pain — concrete and depended on by 7 project(s), so it's rigid to change.
  • Off the main sequence: risingwave_dml — risingwave_dml: abstractness 0.00, instability 0.29, distance 0.71 — zone of pain — concrete and depended on by 5 project(s), so it's rigid to change.
D2 · Cognitive Complexity · Condition · ×6
  • Condition::analyze_group (cognitive 66) src/frontend/src/utils/condition.rs:843 — Condition::analyze_group has cognitive complexity 66 (threshold 15). Drivers by points: if/else 19 (45 pts), match/switch 4 (16 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Condition::disjunctions_to_scan_ranges (cognitive 63) src/frontend/src/utils/condition.rs:323 — Condition::disjunctions_to_scan_ranges has cognitive complexity 63 (threshold 15). Drivers by points: if/else 18 (39 pts), match/switch 4 (12 pts), boolean chains 6, loops 3 (6 pts) (nesting depth added 32). Of this number, 47 points are the body's own statements and 16 belong to one function item 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.
  • Condition::split_row_cmp_to_scan_ranges (cognitive 50) src/frontend/src/utils/condition.rs:531 — Condition::split_row_cmp_to_scan_ranges has cognitive complexity 50 (threshold 15). Drivers by points: if/else 13 (33 pts), match/switch 3 (11 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 30). 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.
  • Condition::split_to_scan_ranges (cognitive 37) src/frontend/src/utils/condition.rs:665 — Condition::split_to_scan_ranges has cognitive complexity 37 (threshold 15). Drivers by points: if/else 16 (28 pts), match/switch 3 (7 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.
  • Condition::extract_eq_conds_within_range (cognitive 20) src/frontend/src/utils/condition.rs:1065 — Condition::extract_eq_conds_within_range has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 2 (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.
  • Condition::split_by_input_col_nums (cognitive 16) src/frontend/src/utils/condition.rs:173 — Condition::split_by_input_col_nums has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 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.
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×6
  • Members sharing a duplicated core (5 members, 50+ identical tokens) src/frontend/src/catalog/system_catalog/rw_catalog/rw_connections.rs:37 — src/frontend/src/catalog/system_catalog/rw_catalog/rw_connections.rs:37-81 | src/frontend/src/catalog/system_catalog/rw_catalog/rw_functions.rs:41-72 | src/frontend/src/catalog/system_catalog/rw_catalog/rw_materialized_views.rs:43-75 | src/frontend/src/catalog/system_catalog/rw_catalog/rw_secrets.rs:33-56 | src/frontend/src/catalog/system_catalog/rw_catalog/rw_tables.rs:40-70 — 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) src/frontend/src/catalog/system_catalog/rw_catalog/rw_internal_tables.rs:39 — src/frontend/src/catalog/system_catalog/rw_catalog/rw_internal_tables.rs:39-68 | src/frontend/src/catalog/system_catalog/rw_catalog/rw_sinks.rs:52-116 | src/frontend/src/catalog/system_catalog/rw_catalog/rw_sources.rs:54-120 | src/frontend/src/catalog/system_catalog/rw_catalog/rw_subscriptions.rs:40-74 | src/frontend/src/catalog/system_catalog/rw_catalog/rw_views.rs:36-60 — 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) src/frontend/src/optimizer/plan_node/batch_hash_join.rs:105 — src/frontend/src/optimizer/plan_node/batch_hash_join.rs:105-123 | src/frontend/src/optimizer/plan_node/batch_lookup_join.rs:129-157 | src/frontend/src/optimizer/plan_node/stream_asof_join.rs:202-237 | src/frontend/src/optimizer/plan_node/stream_delta_join.rs:109-129 | src/frontend/src/optimizer/plan_node/stream_hash_join.rs:515-590 — 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) src/frontend/src/optimizer/plan_node/stream_dml.rs:35 — src/frontend/src/optimizer/plan_node/stream_dml.rs:35-62 | src/frontend/src/optimizer/plan_node/stream_exchange.rs:109-127 | src/frontend/src/optimizer/plan_node/stream_iceberg_with_pk_index_position_delete_merger.rs:44-66 | src/frontend/src/optimizer/plan_node/stream_sink.rs:188-240 | src/frontend/src/optimizer/plan_node/stream_sync_log_store.rs:39-53 — 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) src/meta/src/controller/catalog/mod.rs:1109 — src/meta/src/controller/catalog/mod.rs:1109-1119 | src/meta/src/controller/catalog/mod.rs:1268-1275 | src/meta/src/controller/catalog/mod.rs:1301-1311 | src/meta/src/controller/catalog/mod.rs:1313-1322 | src/meta/src/controller/catalog/mod.rs:1324-1334 — 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) src/meta/src/hummock/mod.rs:101 — src/meta/src/hummock/mod.rs:101-129 | src/meta/src/hummock/mod.rs:135-156 | src/meta/src/hummock/mod.rs:162-192 | src/meta/src/hummock/mod.rs:199-250 | src/meta/src/rpc/metrics.rs:1151-1202 — 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.
D4 · Code Duplication · Duplicated block (30 lines × 2) · ×6
  • Duplicated block (30 lines × 2) src/connector/src/sink/iceberg/writer.rs:834 — src/connector/src/sink/iceberg/writer.rs:834-863 | src/connector/src/sink/iceberg/writer.rs:868-897 — both copies are in the same file, so extract the 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 (30 lines × 2) src/meta/src/barrier/backfill_order_control.rs:96 — src/meta/src/barrier/backfill_order_control.rs:96-125 | src/meta/src/barrier/backfill_order_control.rs:165-194 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (30 lines × 2) src/meta/src/barrier/context/recovery.rs:1016 — src/meta/src/barrier/context/recovery.rs:1016-1045 | src/meta/src/barrier/context/recovery.rs:1140-1169 — both copies are in the same file, so extract the 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 (30 lines × 2) src/stream/src/executor/dynamic_filter.rs:144 — src/stream/src/executor/dynamic_filter.rs:144-173 | src/stream/src/executor/filter.rs:113-142 — 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 (30 lines × 2) java/connector-node/risingwave-sink-jdbc/src/main/java/com/risingwave/connector/BatchAppendOnlyJDBCSink.java:116 — java/connector-node/risingwave-sink-jdbc/src/main/java/com/risingwave/connector/BatchAppendOnlyJDBCSink.java:116-145 | java/connector-node/risingwave-sink-jdbc/src/main/java/com/risingwave/connector/JDBCSink.java:116-145 — before extracting anything, compare `java/connector-node/risingwave-sink-jdbc/src/main/java/com/risingwave/connector/BatchAppendOnlyJDBCSink.java` and `java/connector-node/risingwave-sink-jdbc/src/main/java/com/risingwave/connector/JDBCSink.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 97 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (30 lines × 2) java/connector-node/risingwave-sink-jdbc/src/main/java/com/risingwave/connector/jdbc/MySqlDialect.java:91 — java/connector-node/risingwave-sink-jdbc/src/main/java/com/risingwave/connector/jdbc/MySqlDialect.java:91-120 | java/connector-node/risingwave-sink-jdbc/src/main/java/com/risingwave/connector/jdbc/SqlServerDialect.java:127-156 — before extracting anything, compare `java/connector-node/risingwave-sink-jdbc/src/main/java/com/risingwave/connector/jdbc/MySqlDialect.java` and `java/connector-node/risingwave-sink-jdbc/src/main/java/com/risingwave/connector/jdbc/SqlServerDialect.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `java/connector-node/risingwave-sink-jdbc/src/main/java/com/risingwave/connector/jdbc/MySqlDialect.java:91` 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.
D4 · Code Duplication · Duplicated block (17–18 lines × 2) · ×6
  • Duplicated block (17–18 lines × 2) src/batch/executors/src/executor/join/hash_join.rs:805 — src/batch/executors/src/executor/join/hash_join.rs:805-822 | src/batch/executors/src/executor/join/hash_join.rs:887-903 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (17–18 lines × 2) src/frontend/src/handler/create_table.rs:602 — src/frontend/src/handler/create_table.rs:602-618 | src/frontend/src/handler/create_table.rs:870-887 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (17–18 lines × 2) src/frontend/src/optimizer/plan_node/logical_multi_join.rs:371 — src/frontend/src/optimizer/plan_node/logical_multi_join.rs:371-387 | src/frontend/src/optimizer/plan_node/logical_multi_join.rs:643-660 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (17–18 lines × 2) src/frontend/src/optimizer/plan_node/stream_project.rs:109 — src/frontend/src/optimizer/plan_node/stream_project.rs:109-125 | src/frontend/src/optimizer/plan_node/stream_project_set.rs:71-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 (17–18 lines × 2) src/storage/hummock_sdk/src/compaction_group/hummock_version_ext.rs:313 — src/storage/hummock_sdk/src/compaction_group/hummock_version_ext.rs:313-330 | src/storage/hummock_sdk/src/compaction_group/hummock_version_ext.rs:896-912 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (17–18 lines × 2) src/stream/src/executor/top_n/top_n_state.rs:179 — src/stream/src/executor/top_n/top_n_state.rs:179-196 | src/stream/src/executor/top_n/top_n_state.rs:283-299 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×6
  • Duplicated block (14–15 lines × 2) REDACTED:86 — REDACTED:86-99 | REDACTED:290-304 — both copies are in the same file, so extract the 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–15 lines × 2) src/frontend/src/planner/relation.rs:697 — src/frontend/src/planner/relation.rs:697-710 | src/frontend/src/planner/relation.rs:726-740 — both copies are in the same file, so extract the 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–15 lines × 2) src/meta/src/controller/streaming_job.rs:3055 — src/meta/src/controller/streaming_job.rs:3055-3069 | src/meta/src/controller/streaming_job.rs:3544-3557 — both copies are in the same file, so extract the 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–15 lines × 2) src/meta/src/dashboard/mod.rs:580 — src/meta/src/dashboard/mod.rs:580-593 | src/meta/src/dashboard/mod.rs:642-656 — both copies are in the same file, so extract the 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–15 lines × 2) src/stream/src/executor/backfill/cdc/cdc_backill_v2.rs:278 — src/stream/src/executor/backfill/cdc/cdc_backill_v2.rs:278-291 | src/stream/src/executor/backfill/cdc/cdc_backill_v2.rs:648-662 — both copies are in the same file, so extract the 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–15 lines × 2) src/stream/src/executor/nested_loop_temporal_join.rs:161 — src/stream/src/executor/nested_loop_temporal_join.rs:161-175 | src/stream/src/executor/temporal_join.rs:688-701 — before extracting anything, compare `src/stream/src/executor/nested_loop_temporal_join.rs` and `src/stream/src/executor/temporal_join.rs` as WHOLE FILES: this scan already matched 6 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. 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.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×6
  • Duplicated block (13–14 lines × 2) src/batch/executors/src/executor/join/hash_join.rs:1273 — src/batch/executors/src/executor/join/hash_join.rs:1273-1286 | src/batch/executors/src/executor/join/hash_join.rs:1523-1535 — both copies are in the same file, so extract the 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) src/expr/core/src/error.rs:161 — src/expr/core/src/error.rs:161-173 | src/expr/impl/src/scalar/string.rs:500-513 — 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–14 lines × 2) src/expr/impl/src/scalar/string.rs:129 — src/expr/impl/src/scalar/string.rs:129-141 | src/expr/impl/src/scalar/string.rs:204-217 — both copies are in the same file, so extract the 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) src/frontend/src/datafusion/aggregate/single_phase.rs:134 — src/frontend/src/datafusion/aggregate/single_phase.rs:134-147 | src/frontend/src/datafusion/aggregate/two_phase.rs:138-150 — 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–14 lines × 2) src/frontend/src/handler/alter_streaming_enable_unaligned_join.rs:30 — src/frontend/src/handler/alter_streaming_enable_unaligned_join.rs:30-42 | src/frontend/src/handler/describe.rs:277-290 — 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–14 lines × 2) src/stream/src/executor/mview/cache.rs:229 — src/stream/src/executor/mview/cache.rs:229-241 | src/stream/src/executor/mview/cache.rs:296-309 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×6
  • Duplicated block (12 lines × 3) src/batch/executors/src/executor/delete.rs:179 — src/batch/executors/src/executor/delete.rs:179-190 | src/batch/executors/src/executor/insert.rs:190-201 | src/batch/executors/src/executor/update.rs:214-225 — 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 (12 lines × 3) src/batch/executors/src/executor/hop_window.rs:152 — src/batch/executors/src/executor/hop_window.rs:152-163 | src/expr/core/src/expr/test_utils.rs:97-108 | src/stream/src/executor/hop_window.rs:84-95 — before extracting anything, compare `src/batch/executors/src/executor/hop_window.rs` and `src/stream/src/executor/hop_window.rs` as WHOLE FILES: this scan already matched 4 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.
  • Duplicated block (12 lines × 3) src/compute/src/server.rs:517 — src/compute/src/server.rs:517-528 | src/storage/compactor/src/server.rs:370-381 | src/storage/compactor/src/server.rs:479-491 — 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 (12 lines × 3) src/frontend/src/optimizer/plan_node/logical_agg.rs:1310 — src/frontend/src/optimizer/plan_node/logical_agg.rs:1310-1321 | src/frontend/src/optimizer/plan_node/logical_filter.rs:149-160 | src/frontend/src/optimizer/plan_node/logical_over_window.rs:577-588 — before extracting anything, compare `src/frontend/src/optimizer/plan_node/logical_agg.rs` and `src/frontend/src/optimizer/plan_node/logical_over_window.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 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 × 3) src/meta/src/controller/catalog/alter_op.rs:52 — src/meta/src/controller/catalog/alter_op.rs:52-63 | src/meta/src/controller/catalog/alter_op.rs:306-317 | src/meta/src/controller/catalog/alter_op.rs:887-898 — 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) src/storage/src/mem_table.rs:180 — src/storage/src/mem_table.rs:180-191 | src/storage/src/mem_table.rs:246-257 | src/storage/src/mem_table.rs:348-359 — 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.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×6
  • Duplicated block (11–12 lines × 2) src/connector/src/source/nexmark/source/combined_event.rs:228 — src/connector/src/source/nexmark/source/combined_event.rs:228-238 | src/connector/src/source/nexmark/source/combined_event.rs:276-287 — both copies are in the same file, so extract the 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) src/ctl/src/cmd_impl/hummock/compaction_group.rs:220 — src/ctl/src/cmd_impl/hummock/compaction_group.rs:220-231 | src/ctl/src/cmd_impl/hummock/compaction_group.rs:252-262 — both copies are in the same file, so extract the 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) src/expr/impl/src/scalar/to_char.rs:102 — src/expr/impl/src/scalar/to_char.rs:102-113 | src/expr/impl/src/scalar/to_char.rs:158-168 — both copies are in the same file, so extract the 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) src/stream/src/executor/asof_join.rs:206 — src/stream/src/executor/asof_join.rs:206-216 | src/stream/src/executor/hash_join.rs:349-360 — before extracting anything, compare `src/stream/src/executor/asof_join.rs` and `src/stream/src/executor/hash_join.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 245 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) grafana/dashboard/dev/streaming_fragments.py:57 — grafana/dashboard/dev/streaming_fragments.py:57-68 | grafana/dashboard/dev/streaming_relations.py:86-96 — 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 `grafana/dashboard/dev/streaming_fragments.py:57` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11–12 lines × 2) java/java-binding-integration-test/src/main/java/com/risingwave/java/binding/HummockReadDemo.java:87 — java/java-binding-integration-test/src/main/java/com/risingwave/java/binding/HummockReadDemo.java:87-97 | java/java-binding-integration-test/src/main/java/com/risingwave/java/binding/StreamChunkDemo.java:32-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. Read the line range as the matched WINDOW rather than a finished unit: at `java/java-binding-integration-test/src/main/java/com/risingwave/java/binding/HummockReadDemo.java:87` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×6
  • Duplicated block (6 lines × 3) src/connector/src/connector_common/iceberg/jni_catalog.rs:188 — src/connector/src/connector_common/iceberg/jni_catalog.rs:188-193 | src/connector/src/connector_common/iceberg/jni_catalog.rs:240-245 | src/connector/src/connector_common/iceberg/jni_catalog.rs:272-277 — 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) src/connector/src/source/cdc/external/postgres.rs:422 — src/connector/src/source/cdc/external/postgres.rs:422-427 | src/connector/src/source/cdc/external/postgres.rs:445-450 | src/connector/src/source/cdc/external/postgres.rs:456-461 — 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) src/frontend/src/session.rs:1223 — src/frontend/src/session.rs:1223-1228 | src/frontend/src/session.rs:1268-1273 | src/frontend/src/session.rs:1316-1321 — 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) src/stream/src/executor/dml.rs:199 — src/stream/src/executor/dml.rs:199-204 | src/stream/src/executor/source/fs_fetch_executor.rs:443-448 | src/stream/src/executor/source/iceberg_fetch_executor.rs:391-396 — before extracting anything, compare `src/stream/src/executor/source/fs_fetch_executor.rs` and `src/stream/src/executor/source/iceberg_fetch_executor.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 71 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 (6 lines × 3) src/frontend/src/optimizer/plan_node/generic/cdc_scan.rs:157 — src/frontend/src/optimizer/plan_node/generic/cdc_scan.rs:157-162 | src/frontend/src/optimizer/plan_node/generic/sys_scan.rs:52-57 | src/frontend/src/optimizer/plan_node/generic/table_scan.rs:171-176 — before extracting anything, compare `src/frontend/src/optimizer/plan_node/generic/cdc_scan.rs` and `src/frontend/src/optimizer/plan_node/generic/table_scan.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 (6 lines × 3) src/compute/src/telemetry.rs:61 — src/compute/src/telemetry.rs:61-66 | src/frontend/src/telemetry.rs:82-87 | src/storage/compactor/src/telemetry.rs:77-82 — 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.
S1 · Web-Security Posture · Weak hash algorithm · ×6
  • Weak hash algorithm src/expr/impl/src/scalar/md5.rs:20 — MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
  • Weak hash algorithm src/expr/impl/src/scalar/md5.rs:25 — MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
  • Weak hash algorithm src/expr/impl/src/scalar/sha.rs:21 — MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
  • Weak hash algorithm src/expr/impl/src/udf/wasm.rs:287 — MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
  • Weak hash algorithm src/frontend/src/user/user_authentication.rs:120 — MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
  • Weak hash algorithm src/frontend/src/user/user_authentication.rs:149 — MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
D1 · Cyclomatic Complexity · risingwave_expr_impl · ×5
  • risingwave_expr_impl::scalar::to_char::format_inner (cyclomatic 36) src/expr/impl/src/scalar/to_char.rs:244 — risingwave_expr_impl::scalar::to_char::format_inner 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.
  • risingwave_expr_impl::scalar::regexp::regexp_replace (cyclomatic 20) src/expr/impl/src/scalar/regexp.rs:271 — risingwave_expr_impl::scalar::regexp::regexp_replace 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.
  • risingwave_expr_impl::scalar::array_concat::array_cat (cyclomatic 16) src/expr/impl/src/scalar/array_concat.rs:91 — risingwave_expr_impl::scalar::array_concat::array_cat 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.
  • risingwave_expr_impl::scalar::jsonb_set::jsonbb_set_path (cyclomatic 16) src/expr/impl/src/scalar/jsonb_set.rs:75 — risingwave_expr_impl::scalar::jsonb_set::jsonbb_set_path 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.
  • risingwave_expr_impl::scalar::similar_to_escape::similar_escape_internal (cyclomatic 16) src/expr/impl/src/scalar/similar_to_escape.rs:20 — risingwave_expr_impl::scalar::similar_to_escape::similar_escape_internal 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.
D1 · Cyclomatic Complexity · risingwave_stream · ×5
  • risingwave_stream::executor::barrier_align::barrier_align (cyclomatic 23) src/stream/src/executor/barrier_align.rs:45 — risingwave_stream::executor::barrier_align::barrier_align 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.
  • risingwave_stream::executor::temporal_join::phase1::handle_chunk (cyclomatic 23) src/stream/src/executor/temporal_join.rs:448 — risingwave_stream::executor::temporal_join::phase1::handle_chunk 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.
  • risingwave_stream::executor::lookup::sides::align_barrier (cyclomatic 20) src/stream/src/executor/lookup/sides.rs:124 — risingwave_stream::executor::lookup::sides::align_barrier 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.
  • risingwave_stream::executor::lookup::sides::stream_lookup_arrange_this_epoch (cyclomatic 20) src/stream/src/executor/lookup/sides.rs:299 — risingwave_stream::executor::lookup::sides::stream_lookup_arrange_this_epoch has cyclomatic complexity 20 (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.
  • risingwave_stream::executor::backfill::snapshot_backfill::executor::make_consume_snapshot_stream (cyclomatic 19) src/stream/src/executor/backfill/snapshot_backfill/executor.rs:586 — risingwave_stream::executor::backfill::snapshot_backfill::executor::make_consume_snapshot_stream has cyclomatic complexity 19 (threshold 15). Of this number, 17 points are the body's own statements and 2 belong to one function item 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.
D29 · Static Analysis (SAST) · REDACTED · ×5
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (25 lines × 2) · ×5
  • Duplicated block (25 lines × 2) src/compute/src/rpc/service/monitor_service.rs:422 — src/compute/src/rpc/service/monitor_service.rs:422-446 | src/compute/src/rpc/service/monitor_service.rs:449-473 — both copies are in the same file, so extract the 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 lines × 2) src/storage/hummock_sdk/src/compaction_group/hummock_version_ext.rs:364 — src/storage/hummock_sdk/src/compaction_group/hummock_version_ext.rs:364-388 | src/storage/hummock_sdk/src/compaction_group/hummock_version_ext.rs:967-991 — both copies are in the same file, so extract the 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 lines × 2) src/stream/src/executor/gap_fill.rs:606 — src/stream/src/executor/gap_fill.rs:606-630 | src/stream/src/executor/gap_fill.rs:699-723 — both copies are in the same file, so extract the 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 lines × 2) src/stream/src/executor/mview/materialize.rs:469 — src/stream/src/executor/mview/materialize.rs:469-493 | src/stream/src/executor/mview/materialize.rs:534-558 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (25 lines × 2) src/meta/src/rpc/election/sql.rs:165 — src/meta/src/rpc/election/sql.rs:165-189 | src/meta/src/rpc/election/sql.rs:510-539 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×5
  • Duplicated block (20 lines × 2) src/batch/executors/src/executor/join/hash_join.rs:1004 — src/batch/executors/src/executor/join/hash_join.rs:1004-1023 | src/batch/executors/src/executor/join/hash_join.rs:1622-1641 — both copies are in the same file, so extract the 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) src/connector/src/parser/config.rs:206 — src/connector/src/parser/config.rs:206-225 | src/connector/src/parser/config.rs:249-268 — both copies are in the same file, so extract the 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) src/meta/src/stream/scale.rs:523 — src/meta/src/stream/scale.rs:523-542 | src/meta/src/stream/scale.rs:577-596 — both copies are in the same file, so extract the 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) src/storage/hummock_sdk/src/sstable_info.rs:262 — src/storage/hummock_sdk/src/sstable_info.rs:262-281 | src/storage/hummock_sdk/src/sstable_info.rs:312-331 — both copies are in the same file, so extract the 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) java/connector-node/risingwave-sink-es-7/src/main/java/com/risingwave/connector/ElasticBulkProcessorAdapter.java:43 — java/connector-node/risingwave-sink-es-7/src/main/java/com/risingwave/connector/ElasticBulkProcessorAdapter.java:43-62 | java/connector-node/risingwave-sink-es-7/src/main/java/com/risingwave/connector/OpensearchBulkProcessorAdapter.java:43-62 — 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: `BackoffPolicy` names `org.elasticsearch.action.bulk.BackoffPolicy` in one and `org.opensearch.action.bulk.BackoffPolicy` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (18–19 lines × 2) · ×5
  • Duplicated block (18–19 lines × 2) src/batch/executors/src/executor/join/hash_join.rs:982 — src/batch/executors/src/executor/join/hash_join.rs:982-1000 | src/batch/executors/src/executor/join/hash_join.rs:1193-1210 — both copies are in the same file, so extract the 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–19 lines × 2) src/batch/executors/src/executor/join/nested_loop_join.rs:393 — src/batch/executors/src/executor/join/nested_loop_join.rs:393-410 | src/batch/executors/src/executor/join/nested_loop_join.rs:479-497 — both copies are in the same file, so extract the 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–19 lines × 2) src/batch/executors/src/executor/project_set.rs:83 — src/batch/executors/src/executor/project_set.rs:83-101 | src/frontend/src/datafusion/project_set.rs:312-329 — 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–19 lines × 2) src/frontend/src/optimizer/plan_node/logical_project.rs:375 — src/frontend/src/optimizer/plan_node/logical_project.rs:375-392 | src/frontend/src/optimizer/plan_node/logical_project_set.rs:376-394 — before extracting anything, compare `src/frontend/src/optimizer/plan_node/logical_project.rs` and `src/frontend/src/optimizer/plan_node/logical_project_set.rs` as WHOLE FILES: this scan already matched 5 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. 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 (18–19 lines × 2) src/frontend/src/optimizer/plan_node/logical_scan.rs:243 — src/frontend/src/optimizer/plan_node/logical_scan.rs:243-261 | src/frontend/src/optimizer/rule/top_n_on_index_rule.rs:101-118 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (15–16 lines × 2) · ×5
  • Duplicated block (15–16 lines × 2) src/batch/executors/src/executor/log_row_seq_scan.rs:107 — src/batch/executors/src/executor/log_row_seq_scan.rs:107-122 | src/batch/executors/src/executor/row_seq_scan.rs:97-111 — 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 (15–16 lines × 2) src/frontend/src/handler/alter_rename.rs:204 — src/frontend/src/handler/alter_rename.rs:204-219 | src/frontend/src/handler/alter_source_props.rs:142-156 — 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 (15–16 lines × 2) src/frontend/src/handler/create_function.rs:100 — src/frontend/src/handler/create_function.rs:100-114 | src/frontend/src/handler/create_sql_function.rs:81-96 — before extracting anything, compare `src/frontend/src/handler/create_function.rs` and `src/frontend/src/handler/create_sql_function.rs` as WHOLE FILES: this scan already matched 4 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. 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–16 lines × 2) src/meta/src/hummock/compaction/picker/intra_compaction_picker.rs:374 — src/meta/src/hummock/compaction/picker/intra_compaction_picker.rs:374-389 | src/meta/src/hummock/compaction/picker/tier_compaction_picker.rs:97-111 — 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 (15–16 lines × 2) src/stream/src/from_proto/source/trad_source.rs:178 — src/stream/src/from_proto/source/trad_source.rs:178-192 | src/stream/src/from_proto/source_backfill.rs:46-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.
D4 · Code Duplication · Duplicated block (11–13 lines × 2) · ×5
  • Duplicated block (11–13 lines × 2) src/connector/src/sink/iceberg/writer.rs:377 — src/connector/src/sink/iceberg/writer.rs:377-389 | src/connector/src/sink/iceberg/writer.rs:511-521 — both copies are in the same file, so extract the 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–13 lines × 2) src/connector/src/sink/snowflake_redshift/snowflake.rs:1181 — src/connector/src/sink/snowflake_redshift/snowflake.rs:1181-1193 | src/connector/src/sink/snowflake_redshift/snowflake.rs:1204-1214 — both copies are in the same file, so extract the 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–13 lines × 2) src/frontend/src/optimizer/plan_node/stream_materialize.rs:689 — src/frontend/src/optimizer/plan_node/stream_materialize.rs:689-701 | src/frontend/src/optimizer/plan_node/stream_vector_index_write.rs:243-253 — 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–13 lines × 2) src/meta/src/controller/streaming_job.rs:2948 — src/meta/src/controller/streaming_job.rs:2948-2960 | src/meta/src/controller/streaming_job.rs:3580-3590 — both copies are in the same file, so extract the 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–13 lines × 2) src/storage/src/memory.rs:165 — src/storage/src/memory.rs:165-175 | src/storage/src/memory.rs:197-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.
D4 · Code Duplication · Duplicated block (10–11 lines × 2) · ×5
  • Duplicated block (10–11 lines × 2) src/frontend/src/handler/create_mv.rs:401 — src/frontend/src/handler/create_mv.rs:401-410 | src/frontend/src/handler/create_sink.rs:522-532 — 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–11 lines × 2) src/frontend/src/optimizer/rule/pull_up_correlated_predicate_agg_rule.rs:97 — src/frontend/src/optimizer/rule/pull_up_correlated_predicate_agg_rule.rs:97-106 | src/frontend/src/optimizer/rule/pull_up_correlated_predicate_rule.rs:67-77 — 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–11 lines × 2) src/meta/src/barrier/checkpoint/control.rs:924 — src/meta/src/barrier/checkpoint/control.rs:924-933 | src/meta/src/barrier/checkpoint/control.rs:938-948 — both copies are in the same file, so extract the 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–11 lines × 2) src/storage/src/table/batch_table/mod.rs:347 — src/storage/src/table/batch_table/mod.rs:347-357 | src/stream/src/common/table/state_table.rs:1141-1150 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (10–11 lines × 2) java/connector-node/python-client/pyspark-util.py:78 — java/connector-node/python-client/pyspark-util.py:78-87 | java/connector-node/python-client/pyspark-util.py:107-117 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (8 lines × 4) · ×5
  • Duplicated block (8 lines × 4) src/frontend/src/catalog/system_catalog/rw_catalog/rw_relation_info.rs:116 — src/frontend/src/catalog/system_catalog/rw_catalog/rw_relation_info.rs:116-123 | src/frontend/src/catalog/system_catalog/rw_catalog/rw_relation_info.rs:137-144 | src/frontend/src/catalog/system_catalog/rw_catalog/rw_relation_info.rs:158-165 | src/frontend/src/catalog/system_catalog/rw_catalog/rw_relation_info.rs:180-188 — 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) src/frontend/src/handler/alter_rename.rs:91 — src/frontend/src/handler/alter_rename.rs:91-98 | src/frontend/src/handler/alter_rename.rs:120-127 | src/frontend/src/handler/alter_rename.rs:150-157 | src/frontend/src/handler/alter_rename.rs:181-188 — 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) src/risedevtool/src/bin/risedev-dev.rs:270 — src/risedevtool/src/bin/risedev-dev.rs:270-277 | src/risedevtool/src/bin/risedev-dev.rs:351-359 | src/risedevtool/src/bin/risedev-dev.rs:370-377 | src/risedevtool/src/bin/risedev-dev.rs:431-439 — 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) src/common/src/array/bool_array.rs:52 — src/common/src/array/bool_array.rs:52-59 | src/common/src/array/bytes_array.rs:115-122 | src/common/src/array/num256_array.rs:157-164 | src/common/src/array/primitive_array.rs:143-150 — 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 (8 lines × 4) java/connector-node/risingwave-sink-jdbc/src/main/java/com/risingwave/connector/jdbc/MySqlDialect.java:88 — java/connector-node/risingwave-sink-jdbc/src/main/java/com/risingwave/connector/jdbc/MySqlDialect.java:88-95 | java/connector-node/risingwave-sink-jdbc/src/main/java/com/risingwave/connector/jdbc/PostgresDialect.java:118-125 | java/connector-node/risingwave-sink-jdbc/src/main/java/com/risingwave/connector/jdbc/SnowflakeDialect.java:64-71 | java/connector-node/risingwave-sink-jdbc/src/main/java/com/risingwave/connector/jdbc/SqlServerDialect.java:124-131 — before extracting anything, compare `java/connector-node/risingwave-sink-jdbc/src/main/java/com/risingwave/connector/jdbc/MySqlDialect.java` and `java/connector-node/risingwave-sink-jdbc/src/main/java/com/risingwave/connector/jdbc/SqlServerDialect.java` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `java/connector-node/risingwave-sink-jdbc/src/main/java/com/risingwave/connector/jdbc/MySqlDialect.java:88` 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.
D4 · Code Duplication · Duplicated block (6–7 lines × 2) · ×5
  • Duplicated block (6–7 lines × 2) src/batch/executors/src/executor/join/nested_loop_join.rs:286 — src/batch/executors/src/executor/join/nested_loop_join.rs:286-292 | src/batch/executors/src/executor/join/nested_loop_join.rs:461-466 — both copies are in the same file, so extract the 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–7 lines × 2) src/frontend/src/handler/query.rs:90 — src/frontend/src/handler/query.rs:90-95 | src/frontend/src/handler/query.rs:107-113 — both copies are in the same file, so extract the 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–7 lines × 2) src/meta/src/controller/catalog/util.rs:107 — src/meta/src/controller/catalog/util.rs:107-112 | src/meta/src/controller/catalog/util.rs:131-137 — both copies are in the same file, so extract the 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–7 lines × 2) src/meta/src/controller/streaming_job.rs:3203 — src/meta/src/controller/streaming_job.rs:3203-3208 | src/meta/src/controller/streaming_job.rs:3299-3305 — both copies are in the same file, so extract the 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–7 lines × 2) src/stream/src/executor/join/asof_join.rs:589 — src/stream/src/executor/join/asof_join.rs:589-595 | src/stream/src/executor/join/asof_join.rs:622-627 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D1 · Cyclomatic Complexity · risingwave_ctl · ×4
  • risingwave_ctl::start_impl (cyclomatic 62) src/ctl/src/lib.rs:674 — risingwave_ctl::start_impl has cyclomatic complexity 62 (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.
  • risingwave_ctl::cmd_impl::hummock::compaction_group::build_compaction_config_vec (cyclomatic 31) src/ctl/src/cmd_impl/hummock/compaction_group.rs:53 — risingwave_ctl::cmd_impl::hummock::compaction_group::build_compaction_config_vec has cyclomatic complexity 31 (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.
  • risingwave_ctl::cmd_impl::meta::reschedule::unregister_workers (cyclomatic 19) src/ctl/src/cmd_impl/meta/reschedule.rs:183 — risingwave_ctl::cmd_impl::meta::reschedule::unregister_workers 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.
  • risingwave_ctl::cmd_impl::meta::cluster_info::source_split_info (cyclomatic 16) src/ctl/src/cmd_impl/meta/cluster_info.rs:35 — risingwave_ctl::cmd_impl::meta::cluster_info::source_split_info has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FunctionAttr · ×4
  • FunctionAttr::generate_build_scalar_function (cyclomatic 39) src/expr/macro/src/gen.rs:198 — FunctionAttr::generate_build_scalar_function has cyclomatic complexity 39 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • FunctionAttr::generate_agg_build_fn (cyclomatic 32) src/expr/macro/src/gen.rs:859 — FunctionAttr::generate_agg_build_fn has cyclomatic complexity 32 (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.
  • FunctionAttr::parse (cyclomatic 19) src/expr/macro/src/parse.rs:27 — FunctionAttr::parse 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.
  • FunctionAttr::generate_build_table_function (cyclomatic 16) src/expr/macro/src/gen.rs:1191 — FunctionAttr::generate_build_table_function 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.
D1 · Cyclomatic Complexity · Condition · ×4
  • Condition::disjunctions_to_scan_ranges (cyclomatic 28) src/frontend/src/utils/condition.rs:323 — Condition::disjunctions_to_scan_ranges has cyclomatic complexity 28 (threshold 15). Of this number, 22 points are the body's own statements and 6 belong to one function item 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.
  • Condition::analyze_group (cyclomatic 28) src/frontend/src/utils/condition.rs:843 — Condition::analyze_group 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.
  • Condition::split_row_cmp_to_scan_ranges (cyclomatic 20) src/frontend/src/utils/condition.rs:531 — Condition::split_row_cmp_to_scan_ranges 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.
  • Condition::split_to_scan_ranges (cyclomatic 20) src/frontend/src/utils/condition.rs:665 — Condition::split_to_scan_ranges 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.
D2 · Cognitive Complexity · FunctionAttr · ×4
  • FunctionAttr::generate_agg_build_fn (cognitive 37) src/expr/macro/src/gen.rs:859 — FunctionAttr::generate_agg_build_fn has cognitive complexity 37 (threshold 15). Drivers by points: if/else 19 (21 pts), match/switch 8 (11 pts), boolean chains 5 (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • FunctionAttr::generate_build_scalar_function (cognitive 36) src/expr/macro/src/gen.rs:198 — FunctionAttr::generate_build_scalar_function has cognitive complexity 36 (threshold 15). Drivers by points: if/else 17 (18 pts), match/switch 13 (14 pts), boolean chains 4 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • FunctionAttr::parse (cognitive 23) src/expr/macro/src/parse.rs:27 — FunctionAttr::parse has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16 (19 pts), match/switch 2, boolean chains 1, 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.
  • FunctionAttr::generate_type_infer_fn (cognitive 20) src/expr/macro/src/gen.rs:80 — FunctionAttr::generate_type_infer_fn has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (20 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.
D2 · Cognitive Complexity · LogicalJoin · ×4
  • LogicalJoin::to_batch_lookup_join_with_index_selection (cognitive 25) src/frontend/src/optimizer/plan_node/logical_join.rs:266 — LogicalJoin::to_batch_lookup_join_with_index_selection has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (17 pts), match/switch 2 (6 pts), loops 1 (2 pts) (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • LogicalJoin::simplify_outer (cognitive 24) src/frontend/src/optimizer/plan_node/logical_join.rs:222 — LogicalJoin::simplify_outer has cognitive complexity 24 (threshold 15). Drivers by points: if/else 4 (14 pts), loops 2 (5 pts), match/switch 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.
  • LogicalJoin::logical_rewrite_for_stream (cognitive 24) src/frontend/src/optimizer/plan_node/logical_join.rs:1702 — LogicalJoin::logical_rewrite_for_stream has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (21 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.
  • LogicalJoin::to_stream_temporal_join_with_index_selection (cognitive 23) src/frontend/src/optimizer/plan_node/logical_join.rs:1142 — LogicalJoin::to_stream_temporal_join_with_index_selection has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (15 pts), match/switch 1 (5 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · risedev · ×4
  • risedev::bin::risedev-dev::task_main (cognitive 24) src/risedevtool/src/bin/risedev-dev.rs:67 — risedev::bin::risedev-dev::task_main has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 2, match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • risedev::risedev_env::generate_risedev_env (cognitive 22) src/risedevtool/src/risedev_env.rs:25 — risedev::risedev_env::generate_risedev_env has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (18 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • risedev::bin::risedev-docslt::extract_slt (cognitive 18) src/risedevtool/src/bin/risedev-docslt.rs:35 — risedev::bin::risedev-docslt::extract_slt has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (14 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.
  • risedev::wait::wait (cognitive 17) src/risedevtool/src/wait.rs:24 — risedev::wait::wait has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 2, match/switch 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.
D2 · Cognitive Complexity · PgProtocol · ×4
  • PgProtocol::run (cognitive 21) src/utils/pgwire/src/pg_protocol.rs:295 — PgProtocol::run has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 2 (5 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • PgProtocol::do_process_inner (cognitive 21) src/utils/pgwire/src/pg_protocol.rs:579 — PgProtocol::do_process_inner has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (17 pts), match/switch 2 (3 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.
  • PgProtocol::inner_process_query_msg_one_stmt (cognitive 20) src/utils/pgwire/src/pg_protocol.rs:872 — PgProtocol::inner_process_query_msg_one_stmt has cognitive complexity 20 (threshold 15). Drivers by points: loops 6 (12 pts), if/else 5, match/switch 1 (2 pts), boolean chains 1 (nesting depth added 7). 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.
  • PgProtocol::do_process (cognitive 18) src/utils/pgwire/src/pg_protocol.rs:399 — PgProtocol::do_process has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), match/switch 3 (5 pts), boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D29 · Static Analysis (SAST) · REDACTED · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D3 · God Classes · TooManyFunctions · ×4
  • TooManyFunctions: risingwave_expr_impl::scalar::arithmetic_op src/expr/impl/src/scalar/arithmetic_op.rs:30 — TooManyFunctions — 48 free functions. The bar is 30 free functions; this is 18 over it, 1.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyFunctions: risingwave_common::util::value_encoding src/common/src/util/value_encoding/mod.rs:131 — TooManyFunctions — 40 free functions. The bar is 30 free functions; this is 10 over it, 1.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.
  • TooManyFunctions: risingwave_expr_impl::scalar::trigonometric src/expr/impl/src/scalar/trigonometric.rs:19 — TooManyFunctions — 37 free functions. The bar is 30 free functions; this is 7 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyFunctions: risingwave_expr_impl::scalar::cmp src/expr/impl/src/scalar/cmp.rs:44 — TooManyFunctions — 32 free functions. The bar is 30 free functions; this is 2 over it, 1.07× 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.
D4 · Code Duplication · Duplicated block (23 lines × 2) · ×4
  • Duplicated block (23 lines × 2) src/batch/src/task/consistent_hash_shuffle_channel.rs:79 — src/batch/src/task/consistent_hash_shuffle_channel.rs:79-101 | src/batch/src/task/hash_shuffle_channel.rs:75-97 — before extracting anything, compare `src/batch/src/task/consistent_hash_shuffle_channel.rs` and `src/batch/src/task/hash_shuffle_channel.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 64 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 (23 lines × 2) src/meta/model/migration/src/m20240820_081248_add_time_travel_per_table_epoch.rs:55 — src/meta/model/migration/src/m20240820_081248_add_time_travel_per_table_epoch.rs:55-77 | src/meta/model/migration/src/m20240820_081248_add_time_travel_per_table_epoch.rs:151-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 (23 lines × 2) src/storage/src/table/batch_table/mod.rs:631 — src/storage/src/table/batch_table/mod.rs:631-653 | src/storage/src/table/batch_table/mod.rs:1410-1432 — both copies are in the same file, so extract the 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) src/stream/src/executor/source/batch_source/batch_opendal_fs_list.rs:164 — src/stream/src/executor/source/batch_source/batch_opendal_fs_list.rs:164-186 | src/stream/src/executor/source/fs_list_executor.rs:106-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.
D4 · Code Duplication · Duplicated block (16–17 lines × 2) · ×4
  • Duplicated block (16–17 lines × 2) src/frontend/src/metrics_reader.rs:155 — src/frontend/src/metrics_reader.rs:155-170 | src/meta/src/dashboard/mod.rs:929-945 — before extracting anything, compare `src/frontend/src/metrics_reader.rs` and `src/meta/src/dashboard/mod.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 (16–17 lines × 2) src/meta/src/barrier/checkpoint/independent_job/batch_refresh_job/mod.rs:422 — src/meta/src/barrier/checkpoint/independent_job/batch_refresh_job/mod.rs:422-437 | src/meta/src/barrier/checkpoint/state.rs:208-224 — before extracting anything, compare `src/meta/src/barrier/checkpoint/independent_job/batch_refresh_job/mod.rs` and `src/meta/src/barrier/checkpoint/state.rs` as WHOLE FILES: this scan already matched 3 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 (16–17 lines × 2) src/storage/src/hummock/utils.rs:436 — src/storage/src/hummock/utils.rs:436-451 | src/storage/src/hummock/utils.rs:480-496 — both copies are in the same file, so extract the 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 × 2) REDACTED:72 — REDACTED:72-87 | REDACTED:228-244 — both copies are in the same file, so extract the 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 `REDACTED:72` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11 lines × 4) · ×4
  • Duplicated block (11 lines × 4) src/batch/executors/src/executor/join/hash_join.rs:969 — src/batch/executors/src/executor/join/hash_join.rs:969-979 | src/batch/executors/src/executor/join/hash_join.rs:1320-1330 | src/batch/executors/src/executor/join/hash_join.rs:1437-1447 | src/batch/executors/src/executor/join/hash_join.rs:1586-1596 — 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 (11 lines × 4) src/frontend/src/utils/overwrite_options.rs:37 — src/frontend/src/utils/overwrite_options.rs:37-47 | src/frontend/src/utils/overwrite_options.rs:50-60 | src/frontend/src/utils/overwrite_options.rs:63-73 | src/frontend/src/utils/overwrite_options.rs:74-85 — 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 (11 lines × 4) src/frontend/src/optimizer/plan_node/generic/cdc_scan.rs:201 — src/frontend/src/optimizer/plan_node/generic/cdc_scan.rs:201-211 | src/frontend/src/optimizer/plan_node/generic/log_scan.rs:122-132 | src/frontend/src/optimizer/plan_node/generic/sys_scan.rs:94-104 | src/frontend/src/optimizer/plan_node/generic/table_scan.rs:361-371 — before extracting anything, compare `src/frontend/src/optimizer/plan_node/generic/cdc_scan.rs` and `src/frontend/src/optimizer/plan_node/generic/table_scan.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 × 4) e2e_test/s3/file_sink.py:141 — e2e_test/s3/file_sink.py:141-151 | e2e_test/s3/file_sink.py:355-365 | e2e_test/s3/file_source.py:406-416 | e2e_test/s3/file_source.py:513-523 — there are 4 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 4 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (9–11 lines × 2) · ×4
  • Duplicated block (9–11 lines × 2) src/common/src/util/scan_range.rs:176 — src/common/src/util/scan_range.rs:176-184 | src/common/src/util/scan_range.rs:214-224 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9–11 lines × 2) src/connector/src/source/pulsar/source/reader.rs:506 — src/connector/src/source/pulsar/source/reader.rs:506-514 | src/connector/src/source/pulsar/source/reader.rs:520-530 — both copies are in the same file, so extract the 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–11 lines × 2) src/frontend/src/optimizer/plan_node/generic/join.rs:257 — src/frontend/src/optimizer/plan_node/generic/join.rs:257-265 | src/frontend/src/optimizer/plan_node/stream_hash_join.rs:389-399 — before extracting anything, compare `src/frontend/src/optimizer/plan_node/generic/join.rs` and `src/frontend/src/optimizer/plan_node/stream_hash_join.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (9–11 lines × 2) java/connector-node/risingwave-connector-service/src/main/java/com/risingwave/connector/source/core/DbzChangeEventConsumer.java:220 — java/connector-node/risingwave-connector-service/src/main/java/com/risingwave/connector/source/core/DbzChangeEventConsumer.java:220-230 | java/connector-node/risingwave-connector-service/src/main/java/com/risingwave/connector/source/core/DbzChangeEventConsumer.java:274-282 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (5 lines × 4) · ×4
  • Duplicated block (5 lines × 4) src/risedevtool/src/bin/risedev-dev.rs:186 — src/risedevtool/src/bin/risedev-dev.rs:186-191 | src/risedevtool/src/bin/risedev-dev.rs:196-200 | src/risedevtool/src/bin/risedev-dev.rs:207-211 | src/risedevtool/src/bin/risedev-dev.rs:216-220 — 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 × 4) src/storage/src/mem_table.rs:231 — src/storage/src/mem_table.rs:231-235 | src/storage/src/mem_table.rs:266-270 | src/storage/src/mem_table.rs:317-321 | src/storage/src/mem_table.rs:332-336 — 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 × 4) src/frontend/src/optimizer/plan_node/batch_delete.rs:98 — src/frontend/src/optimizer/plan_node/batch_delete.rs:98-102 | src/frontend/src/optimizer/plan_node/batch_insert.rs:128-132 | src/frontend/src/optimizer/plan_node/batch_max_one_row.rs:84-88 | src/frontend/src/optimizer/plan_node/batch_update.rs:111-115 — 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 × 4) src/frontend/src/optimizer/plan_node/logical_delete.rs:109 — src/frontend/src/optimizer/plan_node/logical_delete.rs:109-113 | src/frontend/src/optimizer/plan_node/logical_filter.rs:197-201 | src/frontend/src/optimizer/plan_node/logical_insert.rs:157-161 | src/frontend/src/optimizer/plan_node/logical_project_set.rs:357-361 — 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.
D1 · Cyclomatic Complexity · DatabaseCheckpointControl · ×3
  • DatabaseCheckpointControl::apply_command (cyclomatic 96) src/meta/src/barrier/checkpoint/state.rs:460 — DatabaseCheckpointControl::apply_command has cyclomatic complexity 96 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • DatabaseCheckpointControl::next_complete_barrier_task (cyclomatic 21) src/meta/src/barrier/checkpoint/control.rs:1023 — DatabaseCheckpointControl::next_complete_barrier_task 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.
  • DatabaseCheckpointControl::handle_new_barrier (cyclomatic 21) src/meta/src/barrier/checkpoint/control.rs:1263 — DatabaseCheckpointControl::handle_new_barrier has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HashJoinExecutor · ×3
  • HashJoinExecutor::do_execute (cyclomatic 41) src/batch/executors/src/executor/join/hash_join.rs:478 — HashJoinExecutor::do_execute has cyclomatic complexity 41 (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.
  • HashJoinExecutor::handle_match_rows (cyclomatic 20) src/stream/src/executor/hash_join.rs:1087 — HashJoinExecutor::handle_match_rows 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.
  • HashJoinExecutor::handle_watermark (cyclomatic 17) src/stream/src/executor/hash_join.rs:815 — HashJoinExecutor::handle_watermark has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Decimal · ×3
  • Decimal::checked_powd (cyclomatic 30) src/common/src/types/decimal.rs:657 — Decimal::checked_powd has cyclomatic complexity 30 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • Decimal::mul (cyclomatic 24) src/common/src/types/decimal.rs:370 — Decimal::mul 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.
  • Decimal::div (cyclomatic 20) src/common/src/types/decimal.rs:330 — Decimal::div has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · Inner · ×3
  • Inner::execute (cyclomatic 30) src/stream/src/executor/project/project_set.rs:94 — Inner::execute has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Inner::execute (cyclomatic 27) src/stream/src/executor/project/project_scalar.rs:252 — Inner::execute 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.
  • Inner::execute (cyclomatic 19) src/stream/src/executor/project/materialized_exprs.rs:148 — Inner::execute has cyclomatic complexity 19 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · SinkExecutor · ×3
  • SinkExecutor::process_msg (cyclomatic 28) src/stream/src/executor/sink.rs:592 — SinkExecutor::process_msg 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.
  • SinkExecutor::execute_consume_log (cyclomatic 20) src/stream/src/executor/sink.rs:757 — SinkExecutor::execute_consume_log 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.
  • SinkExecutor::execute_write_log (cyclomatic 18) src/stream/src/executor/sink.rs:470 — SinkExecutor::execute_write_log 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.
D2 · Cognitive Complexity · DatabaseCheckpointControl · ×3
  • DatabaseCheckpointControl::apply_command (cognitive 167) src/meta/src/barrier/checkpoint/state.rs:460 — DatabaseCheckpointControl::apply_command has cognitive complexity 167 (threshold 15). Drivers by points: if/else 48 (92 pts), loops 25 (66 pts), match/switch 4 (7 pts), boolean chains 2 (nesting depth added 88). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • DatabaseCheckpointControl::next_complete_barrier_task (cognitive 41) src/meta/src/barrier/checkpoint/control.rs:1023 — DatabaseCheckpointControl::next_complete_barrier_task has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (34 pts), loops 3 (4 pts), match/switch 1 (2 pts), boolean chains 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.
  • DatabaseCheckpointControl::handle_new_barrier (cognitive 34) src/meta/src/barrier/checkpoint/control.rs:1263 — DatabaseCheckpointControl::handle_new_barrier has cognitive complexity 34 (threshold 15). Drivers by points: if/else 17 (30 pts), boolean chains 3, match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Inner · ×3
  • Inner::execute (cognitive 118) src/stream/src/executor/project/project_set.rs:94 — Inner::execute has cognitive complexity 118 (threshold 15). Drivers by points: if/else 11 (48 pts), loops 10 (43 pts), match/switch 5 (24 pts), boolean chains 3 (nesting depth added 89). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Inner::execute (cognitive 81) src/stream/src/executor/project/project_scalar.rs:252 — Inner::execute has cognitive complexity 81 (threshold 15). Drivers by points: if/else 16 (53 pts), match/switch 5 (17 pts), loops 3 (10 pts), boolean chains 1 (nesting depth added 56). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Inner::execute (cognitive 60) src/stream/src/executor/project/materialized_exprs.rs:148 — Inner::execute has cognitive complexity 60 (threshold 15). Drivers by points: loops 8 (32 pts), if/else 5 (16 pts), match/switch 3 (10 pts), boolean chains 2 (nesting depth added 42). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · AsOfJoinExecutor · ×3
  • AsOfJoinExecutor::eq_join_right (cognitive 96) src/stream/src/executor/asof_join.rs:769 — AsOfJoinExecutor::eq_join_right has cognitive complexity 96 (threshold 15). Drivers by points: if/else 24 (66 pts), match/switch 6 (21 pts), loops 2 (5 pts), boolean chains 4 (nesting depth added 60). 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.
  • AsOfJoinExecutor::eq_join_left (cognitive 60) src/stream/src/executor/asof_join.rs:579 — AsOfJoinExecutor::eq_join_left has cognitive complexity 60 (threshold 15). Drivers by points: if/else 16 (46 pts), match/switch 4 (12 pts), boolean chains 1, loops 1 (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • AsOfJoinExecutor::into_stream (cognitive 21) src/stream/src/executor/asof_join.rs:323 — AsOfJoinExecutor::into_stream has cognitive complexity 21 (threshold 15). Drivers by points: loops 6 (16 pts), if/else 1 (3 pts), match/switch 1 (2 pts) (nesting depth added 13). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · SinkExecutor · ×3
  • SinkExecutor::process_msg (cognitive 89) src/stream/src/executor/sink.rs:592 — SinkExecutor::process_msg has cognitive complexity 89 (threshold 15). Drivers by points: if/else 16 (54 pts), loops 6 (24 pts), match/switch 2 (6 pts), boolean chains 5 (nesting depth added 60). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SinkExecutor::execute_consume_log (cognitive 49) src/stream/src/executor/sink.rs:757 — SinkExecutor::execute_consume_log has cognitive complexity 49 (threshold 15). Drivers by points: if/else 13 (28 pts), match/switch 4 (13 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SinkExecutor::execute_write_log (cognitive 38) src/stream/src/executor/sink.rs:470 — SinkExecutor::execute_write_log has cognitive complexity 38 (threshold 15). Drivers by points: if/else 7 (28 pts), match/switch 2 (6 pts), boolean chains 3, 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.
D2 · Cognitive Complexity · IcebergCommon · ×3
  • IcebergCommon::build_jni_catalog_configs (cognitive 85) src/connector/src/connector_common/iceberg/mod.rs:865 — IcebergCommon::build_jni_catalog_configs has cognitive complexity 85 (threshold 15). Drivers by points: if/else 46 (72 pts), boolean chains 7, match/switch 3 (5 pts), loops 1 (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.
  • IcebergCommon::build_native_rest_catalog_props (cognitive 16) src/connector/src/connector_common/iceberg/mod.rs:679 — IcebergCommon::build_native_rest_catalog_props has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14 (15 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.
  • IcebergCommon::adls_file_io_props (cognitive 16) src/connector/src/connector_common/iceberg/mod.rs:754 — IcebergCommon::adls_file_io_props 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.
D2 · Cognitive Complexity · HummockVersionCommon · ×3
  • HummockVersionCommon::build_sst_delta_infos (cognitive 75) src/storage/hummock_sdk/src/compaction_group/hummock_version_ext.rs:390 — HummockVersionCommon::build_sst_delta_infos has cognitive complexity 75 (threshold 15). Drivers by points: if/else 15 (49 pts), loops 7 (21 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 50). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • HummockVersionCommon::apply_version_delta (cognitive 61) src/storage/hummock_sdk/src/compaction_group/hummock_version_ext.rs:514 — HummockVersionCommon::apply_version_delta has cognitive complexity 61 (threshold 15). Drivers by points: if/else 20 (48 pts), loops 6 (7 pts), boolean chains 3, match/switch 1 (3 pts) (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • HummockVersionCommon::init_with_parent_group_v2 (cognitive 22) src/storage/hummock_sdk/src/compaction_group/hummock_version_ext.rs:870 — HummockVersionCommon::init_with_parent_group_v2 has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (18 pts), 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.
D2 · Cognitive Complexity · Tokenizer · ×3
  • Tokenizer::next_token (cognitive 68) src/sqlparser/src/tokenizer.rs:396 — Tokenizer::next_token has cognitive complexity 68 (threshold 15). Drivers by points: if/else 11 (34 pts), match/switch 11 (28 pts), loops 1 (4 pts), boolean chains 2 (nesting depth added 43). 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.
  • Tokenizer::tokenize_dollar_preceded_value (cognitive 30) src/sqlparser/src/tokenizer.rs:681 — Tokenizer::tokenize_dollar_preceded_value has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 4 (14 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.
  • Tokenizer::unescape_c_style (cognitive 27) src/sqlparser/src/tokenizer.rs:869 — Tokenizer::unescape_c_style has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (13 pts), match/switch 2 (7 pts), boolean chains 4, loops 3 (nesting depth added 8). Most of this is not in the body itself: 11 of the 27 points are its own statements and the rest belongs to 2 function items inside it that branch (hex_byte_process, octal_byte_process). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · HashAggExecutor · ×3
  • HashAggExecutor::do_execute (cognitive 61) src/batch/executors/src/executor/hash_agg.rs:495 — HashAggExecutor::do_execute has cognitive complexity 61 (threshold 15). Drivers by points: loops 14 (36 pts), if/else 9 (19 pts), match/switch 2 (4 pts), boolean chains 2 (nesting depth added 34). 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.
  • HashAggExecutor::execute_inner (cognitive 50) src/stream/src/executor/aggregate/hash_agg.rs:561 — HashAggExecutor::execute_inner has cognitive complexity 50 (threshold 15). Drivers by points: if/else 10 (34 pts), loops 6 (14 pts), match/switch 1 (2 pts) (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.
  • HashAggExecutor::flush_data (cognitive 27) src/stream/src/executor/aggregate/hash_agg.rs:412 — HashAggExecutor::flush_data has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 4 (7 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.
D2 · Cognitive Complexity · OverPartition · ×3
  • OverPartition::build_changes (cognitive 49) src/stream/src/executor/over_window/over_partition.rs:150 — OverPartition::build_changes has cognitive complexity 49 (threshold 15). Drivers by points: if/else 13 (38 pts), loops 5 (9 pts), boolean chains 2 (nesting depth added 29). 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.
  • OverPartition::find_affected_ranges_readonly (cognitive 36) src/stream/src/executor/over_window/over_partition.rs:600 — OverPartition::find_affected_ranges_readonly has cognitive complexity 36 (threshold 15). Drivers by points: if/else 22 (28 pts), boolean chains 6, loops 2 (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.
  • OverPartition::clean_stale_rows (cognitive 28) src/stream/src/executor/over_window/over_partition.rs:364 — OverPartition::clean_stale_rows has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (22 pts), loops 2 (3 pts), boolean chains 2, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Planner · ×3
  • Planner::plan_select (cognitive 46) src/frontend/src/planner/select.rs:45 — Planner::plan_select has cognitive complexity 46 (threshold 15). Drivers by points: if/else 21 (32 pts), loops 3 (6 pts), boolean chains 4, match/switch 2 (4 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.
  • Planner::plan_iceberg_table (cognitive 37) src/frontend/src/planner/relation.rs:162 — Planner::plan_iceberg_table has cognitive complexity 37 (threshold 15). Drivers by points: if/else 20 (26 pts), match/switch 4 (6 pts), boolean chains 4, loops 1 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • Planner::plan_source (cognitive 24) src/frontend/src/planner/relation.rs:379 — Planner::plan_source has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SourceManagerCore · ×3
  • SourceManagerCore::reassign_splits (cognitive 44) src/meta/src/stream/source_manager/split_assignment.rs:344 — SourceManagerCore::reassign_splits has cognitive complexity 44 (threshold 15). Drivers by points: if/else 7 (25 pts), match/switch 4 (12 pts), loops 4 (7 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.
  • SourceManagerCore::drop_source_fragments (cognitive 31) src/meta/src/stream/source_manager.rs:280 — SourceManagerCore::drop_source_fragments has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 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.
  • SourceManagerCore::apply_source_change (cognitive 26) src/meta/src/stream/source_manager.rs:148 — SourceManagerCore::apply_source_change has cognitive complexity 26 (threshold 15). Drivers by points: loops 10 (14 pts), if/else 5 (11 pts), 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.
D2 · Cognitive Complexity · risingwave_common_proc_macro · ×3
  • risingwave_common_proc_macro::derive_estimate_size (cognitive 38) src/common/proc_macro/src/lib.rs:71 — risingwave_common_proc_macro::derive_estimate_size has cognitive complexity 38 (threshold 15). Drivers by points: loops 6 (20 pts), if/else 4 (12 pts), match/switch 3 (6 pts) (nesting depth added 25). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • risingwave_common_proc_macro::session_config::derive_config (cognitive 37) src/common/proc_macro/src/session_config.rs:31 — risingwave_common_proc_macro::session_config::derive_config has cognitive complexity 37 (threshold 15). Drivers by points: if/else 17 (32 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • risingwave_common_proc_macro::estimate_size::extract_ignored_generics (cognitive 36) src/common/proc_macro/src/estimate_size.rs:86 — risingwave_common_proc_macro::estimate_size::extract_ignored_generics has cognitive complexity 36 (threshold 15). Drivers by points: if/else 7 (26 pts), loops 2 (9 pts), boolean chains 1 (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · LogicalMultiJoin · ×3
  • LogicalMultiJoin::as_bushy_tree_join (cognitive 37) src/frontend/src/optimizer/plan_node/logical_multi_join.rs:512 — LogicalMultiJoin::as_bushy_tree_join has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (26 pts), loops 3 (6 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • LogicalMultiJoin::heuristic_ordering (cognitive 28) src/frontend/src/optimizer/plan_node/logical_multi_join.rs:423 — LogicalMultiJoin::heuristic_ordering has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 5 (8 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.
  • LogicalMultiJoin::eq_condition_derivation (cognitive 22) src/frontend/src/optimizer/plan_node/logical_multi_join.rs:703 — LogicalMultiJoin::eq_condition_derivation has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 6 (10 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.
D2 · Cognitive Complexity · DdlController · ×3
  • DdlController::replace_job (cognitive 34) src/meta/src/rpc/ddl_controller.rs:1565 — DdlController::replace_job has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (24 pts), loops 3 (7 pts), match/switch 2, boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • DdlController::create_streaming_job (cognitive 31) src/meta/src/rpc/ddl_controller.rs:1127 — DdlController::create_streaming_job has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (26 pts), match/switch 4, boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • DdlController::build_replace_job (cognitive 16) src/meta/src/rpc/ddl_controller.rs:2121 — DdlController::build_replace_job has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 2 (4 pts), match/switch 2 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · LocalBarrierWorker · ×3
  • LocalBarrierWorker::run (cognitive 34) src/stream/src/task/barrier_worker/mod.rs:429 — LocalBarrierWorker::run has cognitive complexity 34 (threshold 15). Drivers by points: match/switch 5 (17 pts), if/else 4 (12 pts), loops 2 (5 pts) (nesting depth added 23). 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.
  • LocalBarrierWorker::handle_actor_op (cognitive 20) src/stream/src/task/barrier_worker/mod.rs:567 — LocalBarrierWorker::handle_actor_op has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 4 (9 pts), if/else 3 (7 pts), loops 2 (4 pts) (nesting depth added 11). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • LocalBarrierWorker::add_partial_graph (cognitive 17) src/stream/src/task/barrier_worker/mod.rs:971 — LocalBarrierWorker::add_partial_graph has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 1 (3 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.
D2 · Cognitive Complexity · GlobalStreamManager · ×3
  • GlobalStreamManager::run (cognitive 33) src/meta/src/stream/scale.rs:1412 — GlobalStreamManager::run has cognitive complexity 33 (threshold 15). Drivers by points: match/switch 5 (16 pts), if/else 4 (15 pts), boolean chains 1, loops 1 (nesting depth added 22). 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.
  • GlobalStreamManager::run_create_streaming_job_command (cognitive 26) src/meta/src/stream/stream_manager.rs:627 — GlobalStreamManager::run_create_streaming_job_command has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • GlobalStreamManager::create_streaming_job (cognitive 17) src/meta/src/stream/stream_manager.rs:408 — GlobalStreamManager::create_streaming_job has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), match/switch 4 (7 pts), loops 1 (2 pts) (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · risingwave_hummock_sdk · ×3
  • risingwave_hummock_sdk::compaction_group::hummock_version_ext::validate_version (cognitive 32) src/storage/hummock_sdk/src/compaction_group/hummock_version_ext.rs:1520 — risingwave_hummock_sdk::compaction_group::hummock_version_ext::validate_version has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 4 (7 pts), boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • risingwave_hummock_sdk::compaction_group::group_split::split_sst_info_for_level_v2 (cognitive 29) src/storage/hummock_sdk/src/compaction_group/mod.rs:376 — risingwave_hummock_sdk::compaction_group::group_split::split_sst_info_for_level_v2 has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (25 pts), match/switch 2 (4 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.
  • risingwave_hummock_sdk::table_watermark::rewrite_range_with_watermark (cognitive 22) src/storage/hummock_sdk/src/table_watermark.rs:41 — risingwave_hummock_sdk::table_watermark::rewrite_range_with_watermark has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 5 (11 pts) (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · MonitorServiceImpl · ×3
  • MonitorServiceImpl::get_streaming_stats (cognitive 30) src/compute/src/rpc/service/monitor_service.rs:267 — MonitorServiceImpl::get_streaming_stats has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 7 (8 pts), match/switch 1 (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.
  • MonitorServiceImpl::tiered_cache_tracing (cognitive 18) src/compute/src/rpc/service/monitor_service.rs:413 — MonitorServiceImpl::tiered_cache_tracing has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14 (18 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.
  • MonitorServiceImpl::stack_trace (cognitive 17) src/compute/src/rpc/service/monitor_service.rs:86 — MonitorServiceImpl::stack_trace has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (14 pts), match/switch 2, boolean chains 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · SubscriptionCursor · ×3
  • SubscriptionCursor::next_row (cognitive 24) src/frontend/src/session/cursor_manager.rs:500 — SubscriptionCursor::next_row has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (18 pts), match/switch 2 (5 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SubscriptionCursor::next (cognitive 24) src/frontend/src/session/cursor_manager.rs:633 — SubscriptionCursor::next has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 2 (5 pts), boolean chains 2, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SubscriptionCursor::create_batch_plan_for_cursor (cognitive 24) src/frontend/src/session/cursor_manager.rs:924 — SubscriptionCursor::create_batch_plan_for_cursor has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (17 pts), match/switch 2 (3 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TopNCache · ×3
  • TopNCache::delete (cognitive 24) src/stream/src/executor/top_n/top_n_cache.rs:373 — TopNCache::delete has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TopNCache::insert (cognitive 22) src/stream/src/executor/top_n/top_n_cache.rs:486 — TopNCache::insert has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 1 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TopNCache::insert (cognitive 19) src/stream/src/executor/top_n/top_n_cache.rs:294 — TopNCache::insert has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (16 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.
D2 · Cognitive Complexity · IndexSelectionRule · ×3
  • IndexSelectionRule::gen_paths (cognitive 18) src/frontend/src/optimizer/rule/index_selection_rule.rs:383 — IndexSelectionRule::gen_paths has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • IndexSelectionRule::gen_index_path (cognitive 18) src/frontend/src/optimizer/rule/index_selection_rule.rs:541 — IndexSelectionRule::gen_index_path has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (3 pts), match/switch 1 (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.
  • IndexSelectionRule::apply (cognitive 16) src/frontend/src/optimizer/rule/index_selection_rule.rs:93 — IndexSelectionRule::apply has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Duplicated block (27 lines × 2) · ×3
  • Duplicated block (27 lines × 2) src/jni_core/src/lib.rs:706 — src/jni_core/src/lib.rs:706-739 | src/jni_core/src/lib.rs:934-960 — both copies are in the same file, so extract the 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 (27 lines × 2) src/stream/src/executor/backfill/cdc/upstream_table/snapshot.rs:229 — src/stream/src/executor/backfill/cdc/upstream_table/snapshot.rs:229-255 | src/stream/src/executor/backfill/cdc/upstream_table/snapshot.rs:313-339 — both copies are in the same file, so extract the 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 (27 lines × 2) src/stream/src/executor/gap_fill.rs:648 — src/stream/src/executor/gap_fill.rs:648-674 | src/stream/src/executor/gap_fill.rs:725-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.
D4 · Code Duplication · Duplicated block (21–24 lines × 2) · ×3
  • Duplicated block (21–24 lines × 2) src/batch/executors/src/executor/hop_window.rs:146 — src/batch/executors/src/executor/hop_window.rs:146-166 | src/stream/src/executor/hop_window.rs:77-100 — before extracting anything, compare `src/batch/executors/src/executor/hop_window.rs` and `src/stream/src/executor/hop_window.rs` as WHOLE FILES: this scan already matched 4 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.
  • Duplicated block (21–24 lines × 2) src/frontend/src/optimizer/plan_node/logical_join.rs:443 — src/frontend/src/optimizer/plan_node/logical_join.rs:443-463 | src/frontend/src/optimizer/plan_node/logical_join.rs:1214-1237 — both copies are in the same file, so extract the 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–24 lines × 2) src/stream/src/executor/asof_join.rs:606 — src/stream/src/executor/asof_join.rs:606-626 | src/stream/src/executor/asof_join.rs:792-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.
D4 · Code Duplication · Duplicated block (20–21 lines × 2) · ×3
  • Duplicated block (20–21 lines × 2) src/batch/executors/src/executor/hash_agg.rs:333 — src/batch/executors/src/executor/hash_agg.rs:333-353 | src/batch/executors/src/executor/join/hash_join.rs:287-306 — before extracting anything, compare `src/batch/executors/src/executor/hash_agg.rs` and `src/batch/executors/src/executor/join/hash_join.rs` as WHOLE FILES: this scan already matched 6 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.
  • Duplicated block (20–21 lines × 2) src/stream/src/executor/backfill/snapshot_backfill/consume_upstream/stream.rs:313 — src/stream/src/executor/backfill/snapshot_backfill/consume_upstream/stream.rs:313-332 | src/stream/src/executor/backfill/snapshot_backfill/consume_upstream/stream.rs:356-376 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (20–21 lines × 2) src/stream/src/from_proto/asof_join.rs:48 — src/stream/src/from_proto/asof_join.rs:48-68 | src/stream/src/from_proto/hash_join.rs:56-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.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×3
  • Duplicated block (21 lines × 2) src/frontend/src/optimizer/rule/apply_join_transpose_rule.rs:223 — src/frontend/src/optimizer/rule/apply_join_transpose_rule.rs:223-243 | src/frontend/src/optimizer/rule/apply_join_transpose_rule.rs:308-328 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (21 lines × 2) src/sqlparser/src/parser.rs:667 — src/sqlparser/src/parser.rs:667-687 | src/sqlparser/src/parser.rs:1422-1442 — both copies are in the same file, so extract the 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) src/stream/src/common/table/state_table.rs:2030 — src/stream/src/common/table/state_table.rs:2030-2050 | src/stream/src/common/table/state_table.rs:2115-2135 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (15–17 lines × 2) · ×3
  • Duplicated block (15–17 lines × 2) src/meta/src/barrier/rpc.rs:135 — src/meta/src/barrier/rpc.rs:135-149 | src/meta/src/stream/stream_graph/fragment.rs:1504-1520 — 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 (15–17 lines × 2) src/stream/src/executor/mview/cache.rs:204 — src/stream/src/executor/mview/cache.rs:204-220 | src/stream/src/executor/mview/cache.rs:260-274 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15–17 lines × 2) java/connector-node/risingwave-sink-jdbc/src/main/java/com/risingwave/connector/BatchAppendOnlyJDBCSink.java:88 — java/connector-node/risingwave-sink-jdbc/src/main/java/com/risingwave/connector/BatchAppendOnlyJDBCSink.java:88-104 | java/connector-node/risingwave-sink-jdbc/src/main/java/com/risingwave/connector/JDBCSink.java:89-103 — before extracting anything, compare `java/connector-node/risingwave-sink-jdbc/src/main/java/com/risingwave/connector/BatchAppendOnlyJDBCSink.java` and `java/connector-node/risingwave-sink-jdbc/src/main/java/com/risingwave/connector/JDBCSink.java` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 97 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (15–16 lines × 3) · ×3
  • Duplicated block (15–16 lines × 3) src/batch/executors/src/executor/join/hash_join.rs:975 — src/batch/executors/src/executor/join/hash_join.rs:975-990 | src/batch/executors/src/executor/join/hash_join.rs:1186-1200 | src/batch/executors/src/executor/join/hash_join.rs:1592-1606 — 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 (15–16 lines × 3) src/frontend/src/optimizer/plan_node/batch_hash_join.rs:107 — src/frontend/src/optimizer/plan_node/batch_hash_join.rs:107-121 | src/frontend/src/optimizer/plan_node/batch_lookup_join.rs:131-146 | src/frontend/src/optimizer/plan_node/stream_delta_join.rs:111-126 — 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 (15–16 lines × 3) REDACTED:48 — REDACTED:48-62 | REDACTED:67-81 | REDACTED:223-238 — 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.
D4 · Code Duplication · Duplicated block (13–15 lines × 2) · ×3
  • Duplicated block (13–15 lines × 2) src/connector/src/source/cdc/external/mysql.rs:902 — src/connector/src/source/cdc/external/mysql.rs:902-916 | src/connector/src/source/cdc/external/mysql.rs:919-931 — both copies are in the same file, so extract the 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–15 lines × 2) src/risedevtool/src/task/frontend_service.rs:68 — src/risedevtool/src/task/frontend_service.rs:68-82 | src/risedevtool/src/task/meta_node_service.rs:100-112 — before extracting anything, compare `src/risedevtool/src/task/frontend_service.rs` and `src/risedevtool/src/task/meta_node_service.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 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–15 lines × 2) src/stream/src/executor/backfill/cdc/cdc_backfill.rs:617 — src/stream/src/executor/backfill/cdc/cdc_backfill.rs:617-631 | src/stream/src/executor/backfill/cdc/cdc_backfill.rs:801-813 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (12 lines × 4) · ×3
  • Duplicated block (12 lines × 4) src/frontend/src/metrics_reader.rs:103 — src/frontend/src/metrics_reader.rs:103-114 | src/frontend/src/metrics_reader.rs:132-143 | src/meta/src/dashboard/mod.rs:881-892 | src/meta/src/dashboard/mod.rs:908-919 — before extracting anything, compare `src/frontend/src/metrics_reader.rs` and `src/meta/src/dashboard/mod.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 4) src/frontend/src/optimizer/plan_node/logical_dedup.rs:200 — src/frontend/src/optimizer/plan_node/logical_dedup.rs:200-211 | src/frontend/src/optimizer/plan_node/logical_gap_fill.rs:127-138 | src/frontend/src/optimizer/plan_node/logical_project_set.rs:283-294 | src/frontend/src/optimizer/plan_node/logical_topn.rs:269-280 — 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 (12 lines × 4) src/meta/src/manager/diagnose.rs:425 — src/meta/src/manager/diagnose.rs:425-436 | src/meta/src/manager/diagnose.rs:439-450 | src/meta/src/manager/diagnose.rs:453-464 | src/meta/src/manager/diagnose.rs:467-478 — 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.
D4 · Code Duplication · Duplicated block (10 lines × 5) · ×3
  • Duplicated block (10 lines × 5) src/batch/executors/src/executor/join/hash_join.rs:875 — src/batch/executors/src/executor/join/hash_join.rs:875-884 | src/batch/executors/src/executor/join/hash_join.rs:972-981 | src/batch/executors/src/executor/join/hash_join.rs:1183-1192 | src/batch/executors/src/executor/join/hash_join.rs:1510-1519 | src/batch/executors/src/executor/join/hash_join.rs:1589-1598 — 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 lines × 5) src/frontend/src/optimizer/plan_node/batch_hash_join.rs:108 — src/frontend/src/optimizer/plan_node/batch_hash_join.rs:108-117 | src/frontend/src/optimizer/plan_node/batch_lookup_join.rs:132-141 | src/frontend/src/optimizer/plan_node/stream_asof_join.rs:216-225 | src/frontend/src/optimizer/plan_node/stream_delta_join.rs:112-121 | src/frontend/src/optimizer/plan_node/stream_hash_join.rs:540-549 — before extracting anything, compare `src/frontend/src/optimizer/plan_node/stream_asof_join.rs` and `src/frontend/src/optimizer/plan_node/stream_hash_join.rs` as WHOLE FILES: this scan already matched 6 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. 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 × 5) src/meta/src/controller/streaming_job.rs:1340 — src/meta/src/controller/streaming_job.rs:1340-1349 | src/meta/src/controller/streaming_job.rs:1377-1386 | src/meta/src/controller/streaming_job.rs:1861-1870 | src/meta/src/controller/streaming_job.rs:1967-1976 | src/meta/src/controller/streaming_job.rs:2380-2389 — 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.
D4 · Code Duplication · Duplicated block (10 lines × 4) · ×3
  • Duplicated block (10 lines × 4) src/batch/executors/src/executor/hop_window.rs:154 — src/batch/executors/src/executor/hop_window.rs:154-163 | src/expr/core/src/expr/test_utils.rs:99-108 | src/frontend/src/optimizer/plan_node/generic/hop_window.rs:201-210 | src/stream/src/executor/hop_window.rs:86-95 — before extracting anything, compare `src/batch/executors/src/executor/hop_window.rs` and `src/stream/src/executor/hop_window.rs` as WHOLE FILES: this scan already matched 4 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.
  • Duplicated block (10 lines × 4) src/stream/src/executor/asof_join.rs:433 — src/stream/src/executor/asof_join.rs:433-442 | src/stream/src/executor/asof_join.rs:459-468 | src/stream/src/executor/hash_join.rs:699-708 | src/stream/src/executor/hash_join.rs:727-736 — before extracting anything, compare `src/stream/src/executor/asof_join.rs` and `src/stream/src/executor/hash_join.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 245 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) src/stream/src/executor/dml.rs:230 — src/stream/src/executor/dml.rs:230-239 | src/stream/src/executor/dml.rs:273-282 | src/stream/src/executor/dml.rs:298-307 | src/stream/src/executor/sink.rs:693-702 — there are 4 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 4 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (5 lines × 6) · ×3
  • Duplicated block (5 lines × 6) src/connector/src/source/cdc/source/reader.rs:216 — src/connector/src/source/cdc/source/reader.rs:216-220 | src/connector/src/source/google_pubsub/source/reader.rs:156-160 | src/connector/src/source/kinesis/source/reader.rs:168-172 | src/connector/src/source/mqtt/source/reader.rs:83-87 | src/connector/src/source/nats/source/reader.rs:116-120 | src/connector/src/source/pulsar/source/reader.rs:296-300 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 6 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 6 times.
  • Duplicated block (5 lines × 6) src/meta/src/controller/utils.rs:941 — src/meta/src/controller/utils.rs:941-948 | src/meta/src/controller/utils.rs:960-964 | src/meta/src/controller/utils.rs:976-980 | src/meta/src/controller/utils.rs:992-1000 | src/meta/src/controller/utils.rs:1013-1017 | src/meta/src/controller/utils.rs:1029-1033 — 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 (5 lines × 6) REDACTED:321 — REDACTED:321-325 | REDACTED:329-333 | REDACTED:352-356 | REDACTED:416-420 | REDACTED:425-429 | REDACTED:434-438 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:423` calls `execute_insert` and `REDACTED:328` 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.
AC2 · Forms & labels · <Select> field component without a label · ×2
  • <Select> field component without a label dashboard/pages/await_tree.tsx:120 — This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing it renders carries one either (a name prop is the form-submission key, not a label). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
  • <Select> field component without a label dashboard/pages/fragment_graph.tsx:411 — This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing it renders carries one either (a name prop is the form-submission key, not a label). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
D1 · Cyclomatic Complexity · Tokenizer · ×2
  • Tokenizer::next_token (cyclomatic 66) src/sqlparser/src/tokenizer.rs:396 — Tokenizer::next_token has cyclomatic complexity 66 (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.
  • Tokenizer::unescape_c_style (cyclomatic 24) src/sqlparser/src/tokenizer.rs:869 — Tokenizer::unescape_c_style has cyclomatic complexity 24 (threshold 15). Of this number, 13 points are the body's own statements and 11 belong to 2 function items inside it that branch. 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. This is NOT this file's highest cyclomatic complexity: Token::fmt (cyclomatic 38) 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 function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · IcebergCommon · ×2
  • IcebergCommon::build_jni_catalog_configs (cyclomatic 60) src/connector/src/connector_common/iceberg/mod.rs:865 — IcebergCommon::build_jni_catalog_configs has cyclomatic complexity 60 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • IcebergCommon::adls_file_io_props (cyclomatic 16) src/connector/src/connector_common/iceberg/mod.rs:754 — IcebergCommon::adls_file_io_props 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.
D1 · Cyclomatic Complexity · GlobalBarrierWorker · ×2
  • GlobalBarrierWorker::run_inner (cyclomatic 53) src/meta/src/barrier/worker.rs:513 — GlobalBarrierWorker::run_inner has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • GlobalBarrierWorker::recovery_inner (cyclomatic 33) src/meta/src/barrier/worker.rs:1154 — GlobalBarrierWorker::recovery_inner has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TestCase · ×2
  • TestCase::apply_query (cyclomatic 39) src/frontend/planner_test/src/lib.rs:670 — TestCase::apply_query has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • TestCase::run_sql (cyclomatic 20) src/frontend/planner_test/src/lib.rs:415 — TestCase::run_sql has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · risingwave_backup · ×2
  • risingwave_backup::meta_snapshot_v2::encode_metadata_to_writer (cyclomatic 38) src/storage/backup/src/meta_snapshot_v2.rs:102 — risingwave_backup::meta_snapshot_v2::encode_metadata_to_writer has cyclomatic complexity 38 (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. This shape REPEATS in the file: one other method here (risingwave_backup::meta_snapshot_v2::decode_metadata_from_reader) 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.
  • risingwave_backup::meta_snapshot_v2::decode_metadata_from_reader (cyclomatic 38) src/storage/backup/src/meta_snapshot_v2.rs:123 — risingwave_backup::meta_snapshot_v2::decode_metadata_from_reader has cyclomatic complexity 38 (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. This shape REPEATS in the file: one other method here (risingwave_backup::meta_snapshot_v2::encode_metadata_to_writer) 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.
D1 · Cyclomatic Complexity · risedev · ×2
  • risedev::bin::risedev-dev::task_main (cyclomatic 37) src/risedevtool/src/bin/risedev-dev.rs:67 — risedev::bin::risedev-dev::task_main 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.
  • risedev::risedev_env::generate_risedev_env (cyclomatic 30) src/risedevtool/src/risedev_env.rs:25 — risedev::risedev_env::generate_risedev_env has cyclomatic complexity 30 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · risingwave_connector_codec · ×2
  • risingwave_connector_codec::decoder::avro::schema::avro_type_mapping (cyclomatic 34) src/connector/codec/src/decoder/avro/schema.rs:101 — risingwave_connector_codec::decoder::avro::schema::avro_type_mapping 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.
  • risingwave_connector_codec::decoder::protobuf::parser::from_protobuf_value (cyclomatic 22) src/connector/codec/src/decoder/protobuf/parser.rs:106 — risingwave_connector_codec::decoder::protobuf::parser::from_protobuf_value has cyclomatic complexity 22 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · AsOfJoinExecutor · ×2
  • AsOfJoinExecutor::eq_join_right (cyclomatic 34) src/stream/src/executor/asof_join.rs:769 — AsOfJoinExecutor::eq_join_right 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.
  • AsOfJoinExecutor::eq_join_left (cyclomatic 24) src/stream/src/executor/asof_join.rs:579 — AsOfJoinExecutor::eq_join_left has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Planner · ×2
  • Planner::plan_select (cyclomatic 28) src/frontend/src/planner/select.rs:45 — Planner::plan_select 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.
  • Planner::plan_iceberg_table (cyclomatic 27) src/frontend/src/planner/relation.rs:162 — Planner::plan_iceberg_table has cyclomatic complexity 27 (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.
D1 · Cyclomatic Complexity · HummockVersionCommon · ×2
  • HummockVersionCommon::apply_version_delta (cyclomatic 28) src/storage/hummock_sdk/src/compaction_group/hummock_version_ext.rs:514 — HummockVersionCommon::apply_version_delta 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.
  • HummockVersionCommon::build_sst_delta_infos (cyclomatic 27) src/storage/hummock_sdk/src/compaction_group/hummock_version_ext.rs:390 — HummockVersionCommon::build_sst_delta_infos has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PgProtocol · ×2
  • PgProtocol::do_process_inner (cyclomatic 27) src/utils/pgwire/src/pg_protocol.rs:579 — PgProtocol::do_process_inner 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.
  • PgProtocol::do_process (cyclomatic 16) src/utils/pgwire/src/pg_protocol.rs:399 — PgProtocol::do_process has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HashAggExecutor · ×2
  • HashAggExecutor::do_execute (cyclomatic 26) src/batch/executors/src/executor/hash_agg.rs:495 — HashAggExecutor::do_execute has cyclomatic complexity 26 (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.
  • HashAggExecutor::execute_inner (cyclomatic 18) src/stream/src/executor/aggregate/hash_agg.rs:561 — HashAggExecutor::execute_inner has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · GapFillExecutor · ×2
  • GapFillExecutor::generate_filled_rows_between_static (cyclomatic 26) src/stream/src/executor/gap_fill.rs:268 — GapFillExecutor::generate_filled_rows_between_static 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.
  • GapFillExecutor::execute_inner (cyclomatic 26) src/stream/src/executor/gap_fill.rs:536 — GapFillExecutor::execute_inner has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OverPartition · ×2
  • OverPartition::find_affected_ranges_readonly (cyclomatic 26) src/stream/src/executor/over_window/over_partition.rs:600 — OverPartition::find_affected_ranges_readonly 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.
  • OverPartition::build_changes (cyclomatic 19) src/stream/src/executor/over_window/over_partition.rs:150 — OverPartition::build_changes has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DynamicFilterExecutor · ×2
  • DynamicFilterExecutor::execute_inner (cyclomatic 23) src/stream/src/executor/dynamic_filter.rs:265 — DynamicFilterExecutor::execute_inner 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.
  • DynamicFilterExecutor::apply_batch (cyclomatic 17) src/stream/src/executor/dynamic_filter.rs:89 — DynamicFilterExecutor::apply_batch has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ScalarAdapter · ×2
  • ScalarAdapter::into_scalar (cyclomatic 22) src/connector/src/parser/scalar_adapter.rs:302 — ScalarAdapter::into_scalar has cyclomatic complexity 22 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • ScalarAdapter::from_scalar (cyclomatic 18) src/connector/src/parser/scalar_adapter.rs:223 — ScalarAdapter::from_scalar has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · MatchRecognizeExecutor · ×2
  • MatchRecognizeExecutor::execute_inner (cyclomatic 22) src/stream/src/executor/match_recognize/executor.rs:1178 — MatchRecognizeExecutor::execute_inner 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.
  • MatchRecognizeExecutor::emit_ready (cyclomatic 16) src/stream/src/executor/match_recognize/executor.rs:741 — MatchRecognizeExecutor::emit_ready has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HummockVersionReader · ×2
  • HummockVersionReader::get (cyclomatic 21) src/storage/src/hummock/store/version.rs:635 — HummockVersionReader::get 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.
  • HummockVersionReader::iter_inner (cyclomatic 21) src/storage/src/hummock/store/version.rs:988 — HummockVersionReader::iter_inner has cyclomatic complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs to one function item 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.
D1 · Cyclomatic Complexity · DdlServiceImpl · ×2
  • DdlServiceImpl::auto_schema_change (cyclomatic 20) src/meta/service/src/ddl_service.rs:1331 — DdlServiceImpl::auto_schema_change 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.
  • DdlServiceImpl::create_iceberg_table (cyclomatic 16) src/meta/service/src/ddl_service.rs:1805 — DdlServiceImpl::create_iceberg_table has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SourceManagerCore · ×2
  • SourceManagerCore::apply_source_change (cyclomatic 20) src/meta/src/stream/source_manager.rs:148 — SourceManagerCore::apply_source_change has cyclomatic complexity 20 (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.
  • SourceManagerCore::reassign_splits (cyclomatic 16) src/meta/src/stream/source_manager/split_assignment.rs:344 — SourceManagerCore::reassign_splits has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · risingwave_common_proc_macro · ×2
  • risingwave_common_proc_macro::derive_estimate_size (cyclomatic 17) src/common/proc_macro/src/lib.rs:71 — risingwave_common_proc_macro::derive_estimate_size has cyclomatic complexity 17 (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.
  • risingwave_common_proc_macro::session_config::derive_config (cyclomatic 17) src/common/proc_macro/src/session_config.rs:31 — risingwave_common_proc_macro::session_config::derive_config has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ApplyJoinTransposeRule · ×2
  • ApplyJoinTransposeRule::apply (cyclomatic 17) src/frontend/src/optimizer/rule/apply_join_transpose_rule.rs:89 — ApplyJoinTransposeRule::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.
  • ApplyJoinTransposeRule::push_apply_both_side (cyclomatic 16) src/frontend/src/optimizer/rule/apply_join_transpose_rule.rs:420 — ApplyJoinTransposeRule::push_apply_both_side 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.
D1 · Cyclomatic Complexity · DdlController · ×2
  • DdlController::create_streaming_job (cyclomatic 17) src/meta/src/rpc/ddl_controller.rs:1127 — DdlController::create_streaming_job has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: DdlController::run_command (cyclomatic 32) 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 function is counted neither in this dimension's figures nor in its score.
  • DdlController::replace_job (cyclomatic 17) src/meta/src/rpc/ddl_controller.rs:1565 — DdlController::replace_job has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: DdlController::run_command (cyclomatic 32) 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 function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · LocalBarrierWorker · ×2
  • LocalBarrierWorker::run (cyclomatic 17) src/stream/src/task/barrier_worker/mod.rs:429 — LocalBarrierWorker::run has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • LocalBarrierWorker::handle_actor_op (cyclomatic 16) src/stream/src/task/barrier_worker/mod.rs:567 — LocalBarrierWorker::handle_actor_op 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.
D2 · Cognitive Complexity · CdcBackfillExecutor · ×2
  • CdcBackfillExecutor::execute_inner (cognitive 196) src/stream/src/executor/backfill/cdc/cdc_backfill.rs:488 — CdcBackfillExecutor::execute_inner has cognitive complexity 196 (threshold 15). Drivers by points: if/else 30 (108 pts), match/switch 10 (43 pts), loops 11 (38 pts), boolean chains 7 (nesting depth added 138). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • CdcBackfillExecutor::consume_upstream_chunk_buffer (cognitive 27) src/stream/src/executor/backfill/cdc/cdc_backfill.rs:360 — CdcBackfillExecutor::consume_upstream_chunk_buffer has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 2 (3 pts), match/switch 1 (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.
D2 · Cognitive Complexity · MaterializeExecutor · ×2
  • MaterializeExecutor::execute_inner (cognitive 182) src/stream/src/executor/mview/materialize.rs:373 — MaterializeExecutor::execute_inner has cognitive complexity 182 (threshold 15). Drivers by points: if/else 32 (117 pts), match/switch 10 (44 pts), loops 5 (13 pts), boolean chains 8 (nesting depth added 127). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • MaterializeExecutor::make_mergesort_stream (cognitive 28) src/stream/src/executor/mview/materialize.rs:894 — MaterializeExecutor::make_mergesort_stream has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 3 (6 pts), match/switch 1 (4 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.
D2 · Cognitive Complexity · LocalityProviderExecutor · ×2
  • LocalityProviderExecutor::execute_inner (cognitive 165) REDACTED:660 — LocalityProviderExecutor::execute_inner has cognitive complexity 165 (threshold 15). Drivers by points: if/else 28 (89 pts), loops 12 (42 pts), match/switch 8 (29 pts), boolean chains 5 (nesting depth added 112). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • LocalityProviderExecutor::make_sort_buffer_replay_stream (cognitive 17) REDACTED:585 — LocalityProviderExecutor::make_sort_buffer_replay_stream has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 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.
D2 · Cognitive Complexity · SourceBackfillExecutorInner · ×2
  • SourceBackfillExecutorInner::execute (cognitive 165) src/stream/src/executor/source/source_backfill_executor.rs:383 — SourceBackfillExecutorInner::execute has cognitive complexity 165 (threshold 15). Drivers by points: if/else 33 (126 pts), match/switch 7 (21 pts), loops 7 (15 pts), boolean chains 3 (nesting depth added 115). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SourceBackfillExecutorInner::update_state_if_changed_forward_stage (cognitive 16) src/stream/src/executor/source/source_backfill_executor.rs:1131 — SourceBackfillExecutorInner::update_state_if_changed_forward_stage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), match/switch 2 (7 pts), loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SourceExecutor · ×2
  • SourceExecutor::execute_inner (cognitive 148) src/stream/src/executor/source/source_executor.rs:616 — SourceExecutor::execute_inner has cognitive complexity 148 (threshold 15). Drivers by points: if/else 36 (120 pts), match/switch 4 (15 pts), loops 3 (9 pts), boolean chains 4 (nesting depth added 101). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SourceExecutor::persist_state_and_clear_cache (cognitive 22) src/stream/src/executor/source/source_executor.rs:485 — SourceExecutor::persist_state_and_clear_cache has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (17 pts), match/switch 1 (3 pts), loops 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.
D2 · Cognitive Complexity · GlobalBarrierWorker · ×2
  • GlobalBarrierWorker::run_inner (cognitive 142) src/meta/src/barrier/worker.rs:513 — GlobalBarrierWorker::run_inner has cognitive complexity 142 (threshold 15). Drivers by points: if/else 28 (103 pts), match/switch 10 (33 pts), loops 2 (6 pts) (nesting depth added 102). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • GlobalBarrierWorker::recovery_inner (cognitive 53) src/meta/src/barrier/worker.rs:1154 — GlobalBarrierWorker::recovery_inner has cognitive complexity 53 (threshold 15). Drivers by points: if/else 15 (31 pts), match/switch 5 (12 pts), loops 6 (8 pts), boolean chains 2 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GapFillExecutor · ×2
  • GapFillExecutor::execute_inner (cognitive 91) src/stream/src/executor/gap_fill.rs:536 — GapFillExecutor::execute_inner has cognitive complexity 91 (threshold 15). Drivers by points: if/else 16 (67 pts), loops 4 (14 pts), match/switch 2 (6 pts), boolean chains 4 (nesting depth added 65). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • GapFillExecutor::generate_filled_rows_between_static (cognitive 47) src/stream/src/executor/gap_fill.rs:268 — GapFillExecutor::generate_filled_rows_between_static has cognitive complexity 47 (threshold 15). Drivers by points: if/else 17 (27 pts), match/switch 6 (15 pts), loops 4 (5 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.
D2 · Cognitive Complexity · OverWindowExecutor · ×2
  • OverWindowExecutor::apply_chunk (cognitive 79) src/stream/src/executor/over_window/general.rs:374 — OverWindowExecutor::apply_chunk has cognitive complexity 79 (threshold 15). Drivers by points: if/else 24 (61 pts), match/switch 3 (10 pts), loops 4 (6 pts), boolean chains 2 (nesting depth added 46). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • OverWindowExecutor::executor_inner (cognitive 29) src/stream/src/executor/over_window/general.rs:689 — OverWindowExecutor::executor_inner has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (17 pts), loops 3 (8 pts), boolean chains 2, match/switch 1 (2 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.
D2 · Cognitive Complexity · FsFetchExecutor · ×2
  • FsFetchExecutor::into_stream (cognitive 74) src/stream/src/executor/source/fs_fetch_executor.rs:294 — FsFetchExecutor::into_stream has cognitive complexity 74 (threshold 15). Drivers by points: if/else 13 (47 pts), match/switch 6 (25 pts), boolean chains 1, 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.
  • FsFetchExecutor::replace_with_new_batch_reader (cognitive 20) src/stream/src/executor/source/fs_fetch_executor.rs:145 — FsFetchExecutor::replace_with_new_batch_reader has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (8 pts), match/switch 2 (7 pts), loops 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.
D2 · Cognitive Complexity · StreamSink · ×2
  • StreamSink::create (cognitive 73) src/frontend/src/optimizer/plan_node/stream_sink.rs:280 — StreamSink::create has cognitive complexity 73 (threshold 15). Drivers by points: if/else 34 (51 pts), boolean chains 18, match/switch 3 (4 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.
  • StreamSink::derive_sink_type (cognitive 19) src/frontend/src/optimizer/plan_node/stream_sink.rs:742 — StreamSink::derive_sink_type has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 4 (7 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.
D2 · Cognitive Complexity · DynamicFilterExecutor · ×2
  • DynamicFilterExecutor::execute_inner (cognitive 69) src/stream/src/executor/dynamic_filter.rs:265 — DynamicFilterExecutor::execute_inner has cognitive complexity 69 (threshold 15). Drivers by points: if/else 15 (55 pts), loops 3 (8 pts), match/switch 2 (6 pts) (nesting depth added 49). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • DynamicFilterExecutor::apply_batch (cognitive 35) src/stream/src/executor/dynamic_filter.rs:89 — DynamicFilterExecutor::apply_batch has cognitive complexity 35 (threshold 15). Drivers by points: if/else 16 (26 pts), match/switch 3 (8 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.
D2 · Cognitive Complexity · HopWindowExecutor · ×2
  • HopWindowExecutor::execute_inner (cognitive 67) src/stream/src/executor/hop_window.rs:72 — HopWindowExecutor::execute_inner has cognitive complexity 67 (threshold 15). Drivers by points: if/else 17 (50 pts), loops 4 (11 pts), match/switch 2 (6 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.
  • HopWindowExecutor::do_execute (cognitive 17) src/batch/executors/src/executor/hop_window.rs:144 — HopWindowExecutor::do_execute has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 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.
D2 · Cognitive Complexity · TestCase · ×2
  • TestCase::apply_query (cognitive 64) src/frontend/planner_test/src/lib.rs:670 — TestCase::apply_query has cognitive complexity 64 (threshold 15). Drivers by points: if/else 19 (31 pts), match/switch 13 (26 pts), boolean chains 6, 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.
  • TestCase::run_sql (cognitive 25) src/frontend/planner_test/src/lib.rs:415 — TestCase::run_sql has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (19 pts), match/switch 2 (5 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.
D2 · Cognitive Complexity · MatchRecognizeExecutor · ×2
  • MatchRecognizeExecutor::execute_inner (cognitive 62) src/stream/src/executor/match_recognize/executor.rs:1178 — MatchRecognizeExecutor::execute_inner has cognitive complexity 62 (threshold 15). Drivers by points: if/else 11 (40 pts), loops 6 (18 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • MatchRecognizeExecutor::emit_ready (cognitive 28) src/stream/src/executor/match_recognize/executor.rs:741 — MatchRecognizeExecutor::emit_ready has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KafkaSplitReader · ×2
  • KafkaSplitReader::into_data_event_stream (cognitive 58) src/connector/src/source/kafka/source/reader.rs:382 — KafkaSplitReader::into_data_event_stream has cognitive complexity 58 (threshold 15). Drivers by points: if/else 14 (38 pts), loops 6 (11 pts), match/switch 3 (7 pts), boolean chains 2 (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.
  • KafkaSplitReader::new (cognitive 16) src/connector/src/source/kafka/source/reader.rs:65 — KafkaSplitReader::new has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), match/switch 2, boolean chains 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HummockVersionReader · ×2
  • HummockVersionReader::get (cognitive 58) src/storage/src/hummock/store/version.rs:635 — HummockVersionReader::get has cognitive complexity 58 (threshold 15). Drivers by points: if/else 19 (50 pts), loops 4 (6 pts), match/switch 1 (2 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.
  • HummockVersionReader::iter_inner (cognitive 41) src/storage/src/hummock/store/version.rs:988 — HummockVersionReader::iter_inner has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (30 pts), loops 4 (6 pts), boolean chains 4, match/switch 1 (nesting depth added 18). Of this number, 40 points are the body's own statements and 1 belongs to one function item 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.
D2 · Cognitive Complexity · CheckpointControl · ×2
  • CheckpointControl::handle_new_barrier (cognitive 56) src/meta/src/barrier/checkpoint/control.rs:237 — CheckpointControl::handle_new_barrier has cognitive complexity 56 (threshold 15). Drivers by points: if/else 14 (40 pts), loops 2 (7 pts), match/switch 3 (7 pts), boolean chains 2 (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.
  • CheckpointControl::next_event (cognitive 24) src/meta/src/barrier/checkpoint/control.rs:660 — CheckpointControl::next_event has cognitive complexity 24 (threshold 15). Drivers by points: if/else 4 (12 pts), match/switch 2 (6 pts), loops 2 (5 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.
D2 · Cognitive Complexity · UploaderData · ×2
  • UploaderData::sync (cognitive 55) src/storage/src/hummock/event_handler/uploader/mod.rs:998 — UploaderData::sync has cognitive complexity 55 (threshold 15). Drivers by points: if/else 11 (37 pts), loops 6 (17 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.
  • UploaderData::may_notify_sync_task (cognitive 16) src/storage/src/hummock/event_handler/uploader/mod.rs:1597 — UploaderData::may_notify_sync_task has cognitive complexity 16 (threshold 15). Drivers by points: if/else 2 (9 pts), loops 3 (6 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.
D2 · Cognitive Complexity · DdlServiceImpl · ×2
  • DdlServiceImpl::auto_schema_change (cognitive 44) src/meta/service/src/ddl_service.rs:1331 — DdlServiceImpl::auto_schema_change has cognitive complexity 44 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 4 (8 pts), match/switch 2 (8 pts), boolean chains 4 (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.
  • DdlServiceImpl::create_iceberg_table (cognitive 26) src/meta/service/src/ddl_service.rs:1805 — DdlServiceImpl::create_iceberg_table has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 2 (3 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MaterializeCache · ×2
  • MaterializeCache::handle_inner (cognitive 42) src/stream/src/executor/mview/cache.rs:159 — MaterializeCache::handle_inner has cognitive complexity 42 (threshold 15). Drivers by points: if/else 12 (36 pts), match/switch 2 (5 pts), loops 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.
  • MaterializeCache::fetch_keys (cognitive 18) src/stream/src/executor/mview/cache.rs:349 — MaterializeCache::fetch_keys has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), match/switch 2 (4 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.
D2 · Cognitive Complexity · ConsumeUpstreamStream · ×2
  • ConsumeUpstreamStream::poll_next (cognitive 41) src/stream/src/executor/backfill/snapshot_backfill/consume_upstream/stream.rs:286 — ConsumeUpstreamStream::poll_next has cognitive complexity 41 (threshold 15). Drivers by points: loops 5 (17 pts), match/switch 6 (17 pts), if/else 2 (7 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.
  • ConsumeUpstreamStream::new (cognitive 22) src/stream/src/executor/backfill/snapshot_backfill/consume_upstream/stream.rs:467 — ConsumeUpstreamStream::new has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (10 pts), match/switch 3 (9 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.
D2 · Cognitive Complexity · DatagenEventGenerator · ×2
  • DatagenEventGenerator::into_native_stream (cognitive 37) src/connector/src/source/datagen/source/generator.rs:161 — DatagenEventGenerator::into_native_stream has cognitive complexity 37 (threshold 15). Drivers by points: if/else 4 (16 pts), match/switch 2 (11 pts), loops 4 (10 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.
  • DatagenEventGenerator::into_msg_stream (cognitive 34) src/connector/src/source/datagen/source/generator.rs:81 — DatagenEventGenerator::into_msg_stream has cognitive complexity 34 (threshold 15). Drivers by points: if/else 3 (13 pts), loops 4 (11 pts), match/switch 2 (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.
D2 · Cognitive Complexity · risingwave_backup · ×2
  • risingwave_backup::meta_snapshot_v2::encode_metadata_to_writer (cognitive 37) src/storage/backup/src/meta_snapshot_v2.rs:102 — risingwave_backup::meta_snapshot_v2::encode_metadata_to_writer has cognitive complexity 37 (threshold 15). Drivers by points: if/else 37. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (risingwave_backup::meta_snapshot_v2::decode_metadata_from_reader) 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.
  • risingwave_backup::meta_snapshot_v2::decode_metadata_from_reader (cognitive 37) src/storage/backup/src/meta_snapshot_v2.rs:123 — risingwave_backup::meta_snapshot_v2::decode_metadata_from_reader has cognitive complexity 37 (threshold 15). Drivers by points: if/else 37. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (risingwave_backup::meta_snapshot_v2::encode_metadata_to_writer) 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.
D2 · Cognitive Complexity · LogStoreRowOpStream · ×2
  • LogStoreRowOpStream::next_op (cognitive 37) src/stream/src/common/log_store_impl/kv_log_store/serde.rs:981 — LogStoreRowOpStream::next_op has cognitive complexity 37 (threshold 15). Drivers by points: if/else 7 (19 pts), match/switch 4 (11 pts), loops 3 (7 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.
  • LogStoreRowOpStream::into_vnode_log_store_item_stream (cognitive 21) src/stream/src/common/log_store_impl/kv_log_store/serde.rs:613 — LogStoreRowOpStream::into_vnode_log_store_item_stream has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (16 pts), match/switch 2 (4 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SortExecutor · ×2
  • SortExecutor::do_execute (cognitive 34) src/batch/executors/src/executor/order_by.rs:115 — SortExecutor::do_execute has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 7 (12 pts), boolean chains 2, match/switch 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.
  • SortExecutor::executor_inner (cognitive 16) src/stream/src/executor/eowc/sort.rs:70 — SortExecutor::executor_inner has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StageRunner · ×2
  • StageRunner::schedule_tasks (cognitive 32) src/frontend/src/scheduler/distributed/stage.rs:337 — StageRunner::schedule_tasks has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 5 (10 pts), match/switch 2 (5 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.
  • StageRunner::schedule_tasks_for_root (cognitive 19) src/frontend/src/scheduler/distributed/stage.rs:620 — StageRunner::schedule_tasks_for_root has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 1, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StreamReaderBuilder · ×2
  • StreamReaderBuilder::into_retry_stream (cognitive 31) src/stream/src/executor/source/reader_stream.rs:234 — StreamReaderBuilder::into_retry_stream has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (22 pts), match/switch 2 (6 pts), loops 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • StreamReaderBuilder::setup_auto_schema_change (cognitive 17) src/stream/src/executor/source/reader_stream.rs:103 — StreamReaderBuilder::setup_auto_schema_change has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 1 (4 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.
D2 · Cognitive Complexity · ScalarAdapter · ×2
  • ScalarAdapter::into_scalar (cognitive 30) src/connector/src/parser/scalar_adapter.rs:302 — ScalarAdapter::into_scalar has cognitive complexity 30 (threshold 15). Drivers by points: if/else 5 (12 pts), match/switch 4 (12 pts), loops 3 (6 pts) (nesting depth added 18). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • ScalarAdapter::from_scalar (cognitive 20) src/connector/src/parser/scalar_adapter.rs:223 — ScalarAdapter::from_scalar has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 4 (10 pts), loops 3 (8 pts), if/else 1 (2 pts) (nesting depth added 12). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · risingwave_rt · ×2
  • risingwave_rt::logger::init_risingwave_logger (cognitive 30) src/utils/runtime/src/logger.rs:235 — risingwave_rt::logger::init_risingwave_logger has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (20 pts), match/switch 4 (7 pts), loops 1 (2 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.
  • risingwave_rt::main_okk (cognitive 16) src/utils/runtime/src/lib.rs:69 — risingwave_rt::main_okk has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), match/switch 3 (5 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.
D2 · Cognitive Complexity · Command · ×2
  • Command::reschedule_to_mutation (cognitive 29) src/meta/src/barrier/command.rs:1214 — Command::reschedule_to_mutation has cognitive complexity 29 (threshold 15). Drivers by points: loops 10 (18 pts), if/else 4 (11 pts) (nesting depth added 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.
  • Command::collect_database_partial_graph_actor_upstreams (cognitive 27) src/meta/src/barrier/command.rs:1725 — Command::collect_database_partial_graph_actor_upstreams has cognitive complexity 27 (threshold 15). Drivers by points: loops 7 (20 pts), if/else 2 (6 pts), boolean chains 1 (nesting depth added 17). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · ScheduledBarriers · ×2
  • ScheduledBarriers::mark_ready (cognitive 26) src/meta/src/barrier/schedule.rs:635 — ScheduledBarriers::mark_ready has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 2 (4 pts), boolean chains 2, 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.
  • ScheduledBarriers::abort_and_mark_blocked (cognitive 21) src/meta/src/barrier/schedule.rs:575 — ScheduledBarriers::abort_and_mark_blocked has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 10). Of this number, 20 points are the body's own statements and 1 belongs to one function item 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.
D2 · Cognitive Complexity · WriterExecutor · ×2
  • WriterExecutor::execute_normal (cognitive 26) src/stream/src/executor/iceberg_with_pk_index/writer.rs:453 — WriterExecutor::execute_normal has cognitive complexity 26 (threshold 15). Drivers by points: match/switch 4 (11 pts), loops 4 (10 pts), if/else 2 (5 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.
  • WriterExecutor::process_chunks (cognitive 16) src/stream/src/executor/iceberg_with_pk_index/writer.rs:196 — WriterExecutor::process_chunks has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (6 pts), loops 3 (6 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.
D2 · Cognitive Complexity · EowcOverWindowExecutor · ×2
  • EowcOverWindowExecutor::executor_inner (cognitive 26) src/stream/src/executor/over_window/eowc.rs:568 — EowcOverWindowExecutor::executor_inner has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (20 pts), boolean chains 3, 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.
  • EowcOverWindowExecutor::apply_chunk (cognitive 21) src/stream/src/executor/over_window/eowc.rs:438 — EowcOverWindowExecutor::apply_chunk has cognitive complexity 21 (threshold 15). Drivers by points: loops 6 (13 pts), if/else 4 (7 pts), boolean chains 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.
D2 · Cognitive Complexity · DataChunkMutator · ×2
  • DataChunkMutator::remove_duplicate_rows_for_left_semi_anti_join (cognitive 25) src/batch/executors/src/executor/join/hash_join.rs:2133 — DataChunkMutator::remove_duplicate_rows_for_left_semi_anti_join has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 4, loops 3 (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.
  • DataChunkMutator::remove_duplicate_rows_for_full_outer_join (cognitive 17) src/batch/executors/src/executor/join/hash_join.rs:2225 — DataChunkMutator::remove_duplicate_rows_for_full_outer_join has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 4 (5 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.
D2 · Cognitive Complexity · risingwave_connector_codec · ×2
  • risingwave_connector_codec::decoder::protobuf::parser::from_protobuf_value (cognitive 24) src/connector/codec/src/decoder/protobuf/parser.rs:106 — risingwave_connector_codec::decoder::protobuf::parser::from_protobuf_value has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 3 (7 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.
  • risingwave_connector_codec::decoder::avro::schema::avro_type_mapping (cognitive 23) src/connector/codec/src/decoder/avro/schema.rs:101 — risingwave_connector_codec::decoder::avro::schema::avro_type_mapping has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 3 (5 pts), boolean chains 2 (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.
D2 · Cognitive Complexity · risingwave_cmd_all · ×2
  • risingwave_cmd_all::standalone::standalone (cognitive 23) src/cmd_all/src/standalone.rs:241 — risingwave_cmd_all::standalone::standalone has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (18 pts), loops 2 (4 pts), 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.
  • risingwave_cmd_all::single_node::map_single_node_opts_to_standalone_opts (cognitive 21) src/cmd_all/src/single_node.rs:124 — risingwave_cmd_all::single_node::map_single_node_opts_to_standalone_opts has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18 (20 pts), 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.
D2 · Cognitive Complexity · LakekeeperService · ×2
  • LakekeeperService::create_default_warehouse (cognitive 23) REDACTED:250 — LakekeeperService::create_default_warehouse has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (19 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • LakekeeperService::bootstrap_lakekeeper (cognitive 22) REDACTED:171 — LakekeeperService::bootstrap_lakekeeper has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 2, match/switch 1 (2 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.
D2 · Cognitive Complexity · DataCacheRefillTaskGenerator · ×2
  • DataCacheRefillTaskGenerator::filter_by_inheritance_filter (cognitive 21) src/storage/src/hummock/event_handler/refiller.rs:571 — DataCacheRefillTaskGenerator::filter_by_inheritance_filter has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (6 pts), match/switch 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.
  • DataCacheRefillTaskGenerator::generate_unfiltered_tasks (cognitive 20) src/storage/src/hummock/event_handler/refiller.rs:452 — DataCacheRefillTaskGenerator::generate_unfiltered_tasks has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LogicalScan · ×2
  • LogicalScan::try_better_locality (cognitive 20) src/frontend/src/optimizer/plan_node/logical_scan.rs:736 — LogicalScan::try_better_locality has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 3, 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.
  • LogicalScan::to_stream (cognitive 18) src/frontend/src/optimizer/plan_node/logical_scan.rs:621 — LogicalScan::to_stream has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 3 (nesting depth added 8). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PostgresExternalTableReader · ×2
  • PostgresExternalTableReader::as_uneven_splits (cognitive 19) src/connector/src/source/cdc/external/postgres.rs:710 — PostgresExternalTableReader::as_uneven_splits has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 1 (3 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.
  • PostgresExternalTableReader::split_filter_expression (cognitive 17) src/connector/src/source/cdc/external/postgres.rs:434 — PostgresExternalTableReader::split_filter_expression has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiagnoseCommand · ×2
  • DiagnoseCommand::write_worker_nodes (cognitive 18) src/meta/src/manager/diagnose.rs:262 — DiagnoseCommand::write_worker_nodes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 3, match/switch 1 (3 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.
  • DiagnoseCommand::write_storage (cognitive 17) src/meta/src/manager/diagnose.rs:530 — DiagnoseCommand::write_storage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), loops 5 (8 pts), boolean chains 1 (nesting depth added 5). Of this number, 13 points are the body's own statements and 4 belong to 2 function items 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.
D2 · Cognitive Complexity · StateTableRowStore · ×2
  • StateTableRowStore::iter_kv (cognitive 18) src/stream/src/common/table/state_table.rs:2023 — StateTableRowStore::iter_kv has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3, 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. This shape REPEATS in the file: one other method here (StateTableRowStore::rev_iter_kv) 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.
  • StateTableRowStore::rev_iter_kv (cognitive 18) src/stream/src/common/table/state_table.rs:2108 — StateTableRowStore::rev_iter_kv has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3, 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. This shape REPEATS in the file: one other method here (StateTableRowStore::iter_kv) 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.
D2 · Cognitive Complexity · MemTable · ×2
  • MemTable::delete (cognitive 16) src/storage/src/mem_table.rs:204 — MemTable::delete has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • MemTable::update (cognitive 16) src/storage/src/mem_table.rs:285 — MemTable::update has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D35 · Change Coupling · Change coupling clique · ×2
  • Change coupling clique: batch_delete.rs, batch_insert.rs, batch_update.rs src/frontend/src/optimizer/plan_node/batch_delete.rs — 3 files — `src/frontend/src/optimizer/plan_node/batch_delete.rs`, `src/frontend/src/optimizer/plan_node/batch_insert.rs`, `src/frontend/src/optimizer/plan_node/batch_update.rs` — all change together with no explicit dependency: a fully-connected co-change clique, not 3 separate couplings. They share one concern (thin parallel siblings over a common abstraction), so extract the shared part into ONE unit and the whole clique's coupling clears at once — you do not need to break each pair individually.
  • Change coupling clique: compactor_service.rs, compute_node_service.rs, frontend_service.rs, meta_node_service.rs src/risedevtool/src/task/compactor_service.rs — 4 files — `src/risedevtool/src/task/compactor_service.rs`, `src/risedevtool/src/task/compute_node_service.rs`, `src/risedevtool/src/task/frontend_service.rs`, `src/risedevtool/src/task/meta_node_service.rs` — all change together with no explicit dependency: a fully-connected co-change clique, not 6 separate couplings. They share one concern (thin parallel siblings over a common abstraction), so extract the shared part into ONE unit and the whole clique's coupling clears at once — you do not need to break each pair individually.
D4 · Code Duplication · Near-duplicate member pair (28 shared lines) · ×2
  • Near-duplicate member pair (28 shared lines) src/meta/src/controller/streaming_job.rs:3169 — src/meta/src/controller/streaming_job.rs:3169-3230 | src/meta/src/controller/streaming_job.rs:3239-3353 — These two members are variants of one another: 28 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 (28 shared lines) src/frontend/src/optimizer/plan_node/generic/join.rs:219 — src/frontend/src/optimizer/plan_node/generic/join.rs:219-277 | src/frontend/src/optimizer/plan_node/stream_hash_join.rs:341-444 — These two members are variants of one another: 28 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 · Members sharing a duplicated core (6 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (6 members, 50+ identical tokens) src/frontend/src/optimizer/plan_node/generic/file_scan.rs:110 — src/frontend/src/optimizer/plan_node/generic/file_scan.rs:110-119 | src/frontend/src/optimizer/plan_node/generic/file_scan.rs:157-166 | src/frontend/src/optimizer/plan_node/generic/file_scan.rs:170-179 | src/frontend/src/optimizer/plan_node/generic/mssql_query.rs:82-91 | src/frontend/src/optimizer/plan_node/generic/mysql_query.rs:57-66 | src/frontend/src/optimizer/plan_node/generic/postgres_query.rs:59-68 — 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) src/stream/src/executor/source/batch_source/batch_adbc_snowflake_list.rs:91 — src/stream/src/executor/source/batch_source/batch_adbc_snowflake_list.rs:91-201 | src/stream/src/executor/source/batch_source/batch_iceberg_list.rs:74-226 | src/stream/src/executor/source/batch_source/batch_opendal_fs_list.rs:163-271 | src/stream/src/executor/source/batch_source/batch_posix_fs_list.rs:207-311 | src/stream/src/executor/source/fs_list_executor.rs:105-173 | src/stream/src/executor/source/iceberg_list_executor.rs:92-259 — 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.
D4 · Code Duplication · Duplicated block (29 lines × 2) · ×2
  • Duplicated block (29 lines × 2) src/batch/executors/src/executor/join/hash_join.rs:2479 — src/batch/executors/src/executor/join/hash_join.rs:2479-2507 | src/batch/executors/src/executor/join/nested_loop_join.rs:208-236 — 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 (29 lines × 2) src/connector/src/source/cdc/external/postgres.rs:540 — src/connector/src/source/cdc/external/postgres.rs:540-568 | src/connector/src/source/cdc/external/postgres.rs:584-612 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (26 lines × 2) · ×2
  • Duplicated block (26 lines × 2) src/connector/src/sink/redis.rs:114 — src/connector/src/sink/redis.rs:114-139 | src/connector/src/sink/redis.rs:141-166 — both copies are in the same file, so extract the 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 (26 lines × 2) src/frontend/src/webhook/websocket.rs:497 — src/frontend/src/webhook/websocket.rs:497-522 | src/frontend/src/webhook/websocket.rs:548-573 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (24 lines × 2) · ×2
  • Duplicated block (24 lines × 2) src/frontend/src/scheduler/local.rs:363 — src/frontend/src/scheduler/local.rs:363-386 | src/frontend/src/scheduler/local.rs:401-424 — both copies are in the same file, so extract the 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 (24 lines × 2) src/meta/src/dashboard/prometheus.rs:85 — src/meta/src/dashboard/prometheus.rs:85-108 | src/meta/src/dashboard/prometheus.rs:111-134 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (21 lines × 3) · ×2
  • Duplicated block (21 lines × 3) src/stream/src/executor/backfill/cdc/cdc_backill_v2.rs:322 — src/stream/src/executor/backfill/cdc/cdc_backill_v2.rs:322-342 | src/stream/src/executor/backfill/cdc/cdc_backill_v2.rs:546-566 | src/stream/src/executor/backfill/cdc/cdc_backill_v2.rs:704-724 — 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 (21 lines × 3) src/jni_core/src/lib.rs:706 — src/jni_core/src/lib.rs:706-739 | src/jni_core/src/lib.rs:811-831 | src/jni_core/src/lib.rs:934-960 — 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.
D4 · Code Duplication · Duplicated block (19–21 lines × 2) · ×2
  • Duplicated block (19–21 lines × 2) src/compute/src/server.rs:518 — src/compute/src/server.rs:518-538 | src/storage/compactor/src/server.rs:371-389 — 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 (19–21 lines × 2) src/meta/src/barrier/checkpoint/state.rs:673 — src/meta/src/barrier/checkpoint/state.rs:673-691 | src/meta/src/barrier/checkpoint/state.rs:973-993 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (19 lines × 3) · ×2
  • Duplicated block (19 lines × 3) src/frontend/src/catalog/system_catalog/rw_catalog/rw_iceberg_all_files.rs:65 — src/frontend/src/catalog/system_catalog/rw_catalog/rw_iceberg_all_files.rs:65-83 | src/frontend/src/catalog/system_catalog/rw_catalog/rw_iceberg_files.rs:64-82 | src/frontend/src/catalog/system_catalog/rw_catalog/rw_iceberg_snapshots.rs:43-61 — before extracting anything, compare `src/frontend/src/catalog/system_catalog/rw_catalog/rw_iceberg_all_files.rs` and `src/frontend/src/catalog/system_catalog/rw_catalog/rw_iceberg_files.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 (19 lines × 3) e2e_test/s3/file_sink.py:130 — e2e_test/s3/file_sink.py:130-148 | e2e_test/s3/file_source.py:395-413 | e2e_test/s3/file_source.py:502-520 — 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.
D4 · Code Duplication · Duplicated block (17–19 lines × 2) · ×2
  • Duplicated block (17–19 lines × 2) src/batch/executors/src/executor/delete.rs:179 — src/batch/executors/src/executor/delete.rs:179-195 | src/batch/executors/src/executor/update.rs:212-230 — 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–19 lines × 2) src/storage/compactor/src/server.rs:364 — src/storage/compactor/src/server.rs:364-380 | src/storage/compactor/src/server.rs:472-490 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (14–16 lines × 2) · ×2
  • Duplicated block (14–16 lines × 2) src/storage/src/memory.rs:177 — src/storage/src/memory.rs:177-190 | src/storage/src/memory.rs:212-227 — both copies are in the same file, so extract the 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–16 lines × 2) e2e_test/check_slt_coverage.py:505 — e2e_test/check_slt_coverage.py:505-518 | e2e_test/check_slt_coverage.py:520-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. Read the line range as the matched WINDOW rather than a finished unit: at `e2e_test/check_slt_coverage.py:505` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15 lines × 3) · ×2
  • Duplicated block (15 lines × 3) src/stream/src/executor/source/batch_source/batch_adbc_snowflake_list.rs:169 — src/stream/src/executor/source/batch_source/batch_adbc_snowflake_list.rs:169-183 | src/stream/src/executor/source/batch_source/batch_iceberg_list.rs:193-207 | src/stream/src/executor/source/batch_source/batch_opendal_fs_list.rs:251-265 — before extracting anything, compare `src/stream/src/executor/source/batch_source/batch_adbc_snowflake_list.rs` and `src/stream/src/executor/source/batch_source/batch_iceberg_list.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 89 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) src/stream/src/executor/source/mod.rs:137 — src/stream/src/executor/source/mod.rs:137-151 | src/stream/src/executor/source/mod.rs:162-176 | src/stream/src/executor/source/mod.rs:228-242 — 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.
D4 · Code Duplication · Duplicated block (12–14 lines × 3) · ×2
  • Duplicated block (12–14 lines × 3) src/frontend/src/optimizer/plan_node/logical_dedup.rs:197 — src/frontend/src/optimizer/plan_node/logical_dedup.rs:197-208 | src/frontend/src/optimizer/plan_node/logical_gap_fill.rs:122-135 | src/frontend/src/optimizer/plan_node/logical_topn.rs:264-277 — 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 (12–14 lines × 3) src/stream/src/common/table/state_table.rs:1588 — src/stream/src/common/table/state_table.rs:1588-1600 | src/stream/src/common/table/state_table.rs:1612-1623 | src/stream/src/common/table/state_table.rs:1636-1649 — 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.
D4 · Code Duplication · Duplicated block (11–12 lines × 3) · ×2
  • Duplicated block (11–12 lines × 3) src/frontend/src/handler/show.rs:996 — src/frontend/src/handler/show.rs:996-1007 | src/frontend/src/handler/show.rs:1070-1080 | src/frontend/src/handler/show.rs:1140-1150 — 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–12 lines × 3) src/stream/src/executor/over_window/over_partition.rs:1012 — src/stream/src/executor/over_window/over_partition.rs:1012-1022 | src/stream/src/executor/over_window/over_partition.rs:1044-1055 | src/stream/src/executor/over_window/over_partition.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.
D4 · Code Duplication · Duplicated block (10–11 lines × 3) · ×2
  • Duplicated block (10–11 lines × 3) src/expr/core/src/aggregate/user_defined.rs:157 — src/expr/core/src/aggregate/user_defined.rs:157-166 | src/expr/core/src/expr/expr_udf.rs:175-185 | src/expr/core/src/table_function/user_defined.rs:129-138 — 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 (10–11 lines × 3) src/meta/src/hummock/compaction/selector/space_reclaim_selector.rs:57 — src/meta/src/hummock/compaction/selector/space_reclaim_selector.rs:57-67 | src/meta/src/hummock/compaction/selector/tombstone_compaction_selector.rs:58-68 | src/meta/src/hummock/compaction/selector/ttl_selector.rs:54-63 — 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.
D4 · Code Duplication · Duplicated block (8–10 lines × 2) · ×2
  • Duplicated block (8–10 lines × 2) src/stream/src/executor/source/batch_source/batch_iceberg_list.rs:89 — src/stream/src/executor/source/batch_source/batch_iceberg_list.rs:89-96 | src/stream/src/executor/source/iceberg_list_executor.rs:108-117 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8–10 lines × 2) REDACTED:316 — REDACTED:316-323 | REDACTED:345-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. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:345` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8–9 lines × 2) · ×2
  • Duplicated block (8–9 lines × 2) src/frontend/src/catalog/system_catalog/rw_catalog/rw_iceberg_all_files.rs:115 — src/frontend/src/catalog/system_catalog/rw_catalog/rw_iceberg_all_files.rs:115-122 | src/frontend/src/catalog/system_catalog/rw_catalog/rw_iceberg_files.rs:107-115 — before extracting anything, compare `src/frontend/src/catalog/system_catalog/rw_catalog/rw_iceberg_all_files.rs` and `src/frontend/src/catalog/system_catalog/rw_catalog/rw_iceberg_files.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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–9 lines × 2) src/frontend/src/handler/alter_rename.rs:173 — src/frontend/src/handler/alter_rename.rs:173-181 | src/frontend/src/handler/alter_subscription_retention.rs:92-99 — 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.
D4 · Code Duplication · Duplicated block (6–8 lines × 4) · ×2
  • Duplicated block (6–8 lines × 4) src/frontend/src/catalog/system_catalog/rw_catalog/rw_columns.rs:75 — src/frontend/src/catalog/system_catalog/rw_catalog/rw_columns.rs:75-80 | src/frontend/src/catalog/system_catalog/rw_catalog/rw_columns.rs:98-103 | src/frontend/src/catalog/system_catalog/rw_catalog/rw_columns.rs:120-127 | src/frontend/src/catalog/system_catalog/rw_catalog/rw_columns.rs:152-159 — 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 (6–8 lines × 4) src/frontend/src/optimizer/plan_node/logical_agg.rs:632 — src/frontend/src/optimizer/plan_node/logical_agg.rs:632-639 | src/frontend/src/optimizer/plan_node/logical_agg.rs:684-691 | src/frontend/src/optimizer/plan_node/logical_agg.rs:694-701 | src/frontend/src/optimizer/plan_node/logical_agg.rs:703-708 — 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.
D4 · Code Duplication · Duplicated block (7–8 lines × 3) · ×2
  • Duplicated block (7–8 lines × 3) src/connector/src/connector_common/iceberg/mod.rs:720 — src/connector/src/connector_common/iceberg/mod.rs:720-726 | src/connector/src/connector_common/iceberg/mod.rs:1063-1070 | src/connector/src/connector_common/iceberg/mod.rs:1092-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 (7–8 lines × 3) REDACTED:318 — REDACTED:318-324 | REDACTED:349-355 | REDACTED:412-419 — 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 `REDACTED:412` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:347` calls `execute_insert` and `REDACTED:412` 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.
D4 · Code Duplication · Duplicated block (6–7 lines × 4) · ×2
  • Duplicated block (6–7 lines × 4) src/connector/src/sink/iceberg/writer.rs:391 — src/connector/src/sink/iceberg/writer.rs:391-396 | src/connector/src/sink/iceberg/writer.rs:526-531 | src/connector/src/sink/iceberg/writer.rs:556-562 | src/connector/src/sink/iceberg/writer.rs:585-591 — 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 (6–7 lines × 4) integration_tests/iceberg-cdc/python/script/init.py:92 — integration_tests/iceberg-cdc/python/script/init.py:92-98 | integration_tests/iceberg-sink2/python/main.py:107-112 | integration_tests/iceberg-source/python/main.py:82-87 | integration_tests/iceberg-source/python/main.py:99-105 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `integration_tests/iceberg-cdc/python/script/init.py: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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `integration_tests/iceberg-sink2/python/main.py:107` calls `connect` and `integration_tests/iceberg-cdc/python/script/init.py:92` 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.
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×2
  • Duplicated block (7 lines × 4) src/storage/src/hummock/compactor/iceberg_compaction/iceberg_compactor_runner.rs:786 — src/storage/src/hummock/compactor/iceberg_compaction/iceberg_compactor_runner.rs:786-792 | src/storage/src/hummock/compactor/iceberg_compaction/iceberg_compactor_runner.rs:829-835 | src/storage/src/hummock/compactor/iceberg_compaction/iceberg_compactor_runner.rs:854-860 | src/storage/src/hummock/compactor/iceberg_compaction/iceberg_compactor_runner.rs:873-879 — 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 (7 lines × 4) REDACTED:458 — REDACTED:458-464 | REDACTED:469-475 | REDACTED:492-498 | REDACTED:503-509 — 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.
D4 · Code Duplication · Duplicated block (6 lines × 4) · ×2
  • Duplicated block (6 lines × 4) src/frontend/src/catalog/system_catalog/rw_catalog/rw_columns.rs:75 — src/frontend/src/catalog/system_catalog/rw_catalog/rw_columns.rs:75-80 | src/frontend/src/catalog/system_catalog/rw_catalog/rw_columns.rs:98-103 | src/frontend/src/catalog/system_catalog/rw_catalog/rw_columns.rs:120-125 | src/frontend/src/catalog/system_catalog/rw_catalog/rw_columns.rs:177-182 — 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 (6 lines × 4) REDACTED:653 — REDACTED:653-658 | src/connector/src/sink/doris.rs:307-312 | src/connector/src/sink/postgres.rs:217-222 | src/connector/src/sink/sqlserver.rs:166-171 — before extracting anything, compare `src/connector/src/sink/doris.rs` and `src/connector/src/sink/sqlserver.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 36 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.
D4 · Code Duplication · Duplicated block (5–6 lines × 2) · ×2
  • Duplicated block (5–6 lines × 2) src/frontend/src/planner/relation.rs:691 — src/frontend/src/planner/relation.rs:691-695 | src/frontend/src/planner/relation.rs:717-722 — both copies are in the same file, so extract the 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–6 lines × 2) src/stream/src/executor/source/batch_source/batch_opendal_fs_fetch.rs:188 — src/stream/src/executor/source/batch_source/batch_opendal_fs_fetch.rs:188-193 | src/stream/src/executor/source/batch_source/batch_posix_fs_fetch.rs:236-240 — 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.
D4 · Code Duplication · Duplicated block (5 lines × 11) · ×2
  • Duplicated block (5 lines × 11) src/frontend/src/handler/alter_connection_props.rs:27 — src/frontend/src/handler/alter_connection_props.rs:27-32 | src/frontend/src/handler/alter_set_schema.rs:37-41 | src/frontend/src/handler/alter_source_props.rs:33-38 | src/frontend/src/handler/alter_source_props.rs:137-142 | src/frontend/src/handler/alter_subscription_retention.rs:87-92 | src/frontend/src/handler/alter_swap_rename.rs:53-58 | src/frontend/src/handler/drop_connection.rs:32-37 | src/frontend/src/handler/drop_index.rs:36-40 | src/frontend/src/handler/drop_mv.rs:33-37 | src/frontend/src/handler/drop_subscription.rs:30-35 | src/frontend/src/handler/drop_view.rs:30-34 — there are 11 copies across 10 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 11 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (5 lines × 11) src/frontend/src/optimizer/plan_node/batch_filter.rs:101 — src/frontend/src/optimizer/plan_node/batch_filter.rs:101-105 | src/frontend/src/optimizer/plan_node/batch_hash_agg.rs:164-168 | src/frontend/src/optimizer/plan_node/batch_nested_loop_join.rs:140-144 | src/frontend/src/optimizer/plan_node/batch_project.rs:115-119 | src/frontend/src/optimizer/plan_node/batch_project_set.rs:98-102 | src/frontend/src/optimizer/plan_node/batch_simple_agg.rs:153-157 | src/frontend/src/optimizer/plan_node/batch_table_function.rs:77-81 | src/frontend/src/optimizer/plan_node/batch_values.rs:101-105 | src/frontend/src/optimizer/plan_node/stream_filter.rs:118-122 | src/frontend/src/optimizer/plan_node/stream_project_set.rs:149-153 | src/frontend/src/optimizer/plan_node/stream_values.rs:89-93 — 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 11 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (5 lines × 5) · ×2
  • Duplicated block (5 lines × 5) src/meta/src/controller/catalog/mod.rs:1111 — src/meta/src/controller/catalog/mod.rs:1111-1119 | src/meta/src/controller/catalog/mod.rs:1271-1275 | src/meta/src/controller/catalog/mod.rs:1303-1311 | src/meta/src/controller/catalog/mod.rs:1315-1322 | src/meta/src/controller/catalog/mod.rs:1326-1334 — 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 (5 lines × 5) src/frontend/src/optimizer/plan_node/logical_changelog.rs:259 — src/frontend/src/optimizer/plan_node/logical_changelog.rs:259-263 | src/frontend/src/optimizer/plan_node/logical_expand.rs:190-194 | src/frontend/src/optimizer/plan_node/logical_filter.rs:220-224 | src/frontend/src/optimizer/plan_node/logical_locality_provider.rs:155-159 | src/frontend/src/optimizer/plan_node/logical_max_one_row.rs:118-122 — 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.
D4 · Code Duplication · Duplicated block (6 lines × 5) · ×2
  • Duplicated block (6 lines × 5) src/connector/src/sink/elasticsearch_opensearch/elasticsearch_opensearch_config.rs:173 — src/connector/src/sink/elasticsearch_opensearch/elasticsearch_opensearch_config.rs:173-178 | src/connector/src/sink/kafka.rs:272-277 | src/connector/src/sink/kinesis.rs:158-163 | src/connector/src/sink/pulsar.rs:200-205 | src/connector/src/sink/redis.rs:263-268 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times.
  • Duplicated block (6 lines × 5) REDACTED:319 — REDACTED:319-324 | REDACTED:350-355 | REDACTED:414-419 | REDACTED:423-428 | REDACTED:432-437 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:347` calls `execute_insert` and `REDACTED:412` 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.
R10 · Code Duplication · Duplicated block (10 lines × 2 locations) · ×2
  • Duplicated block (10 lines × 2 locations) dashboard/components/FragmentGraph.tsx:148 — dashboard/components/FragmentGraph.tsx:148 · dashboard/components/RelationGraph.tsx:92 — 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) dashboard/components/utils/backPressure.tsx:19 — dashboard/components/utils/backPressure.tsx:19 · dashboard/components/utils/backPressure.tsx:73 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (9 lines × 2 locations) · ×2
  • Duplicated block (9 lines × 2 locations) dashboard/components/FragmentGraph.tsx:509 — dashboard/components/FragmentGraph.tsx:509 · dashboard/components/RelationGraph.tsx:203 — 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) dashboard/pages/fragment_graph.tsx:403 — dashboard/pages/fragment_graph.tsx:403 · dashboard/pages/fragment_graph.tsx:414 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
AC2 · Forms & labels · <NumberInput> field component without a label · ×1
  • <NumberInput> field component without a label dashboard/pages/cpu_profiling.tsx:199 — This UI-library field component has no label / aria-label / aria-labelledby / id — and neither does anything it renders (a name prop is the form-submission key, not a label) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
AC2 · Forms & labels · <Textarea> field component without a label · ×1
  • <Textarea> field component without a label dashboard/pages/explain_distsql.tsx:39 — This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
AC6 · Visual & motion safety · Animation without a prefers-reduced-motion guard · ×1
  • Animation without a prefers-reduced-motion guard dashboard/components/Relations.tsx:382 — <span> moves — its inline style sets `animation: loading` — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
AC7 · A11y enforcement · Accessibility enforcement below the top rung · ×1
  • Accessibility enforcement below the top rung — No accessibility enforcement found — no a11y linter (eslint-plugin-jsx-a11y) and no axe/pa11y/Lighthouse in tests or CI. Start with the linter to catch issues at author time. What was searched, so you can tell an absence from a miss: the 24 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
D1 · Cyclomatic Complexity · Statement · ×1
  • Statement::fmt_unchecked (cyclomatic 149) src/sqlparser/src/ast/mod.rs:1827 — Statement::fmt_unchecked 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.
D1 · Cyclomatic Complexity · ParallelizedCdcBackfillExecutor · ×1
  • ParallelizedCdcBackfillExecutor::execute_inner (cyclomatic 90) src/stream/src/executor/backfill/cdc/cdc_backill_v2.rs:111 — ParallelizedCdcBackfillExecutor::execute_inner has cyclomatic complexity 90 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · JsonParseOptions · ×1
  • JsonParseOptions::parse (cyclomatic 74) src/connector/src/parser/unified/json.rs:277 — JsonParseOptions::parse has cyclomatic complexity 74 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · FrontendObserverNode · ×1
  • FrontendObserverNode::handle_catalog_notification (cyclomatic 70) src/frontend/src/observer/observer_manager.rs:251 — FrontendObserverNode::handle_catalog_notification has cyclomatic complexity 70 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · Expr · ×1
  • Expr::fmt (cyclomatic 69) src/sqlparser/src/ast/mod.rs:562 — Expr::fmt has cyclomatic complexity 69 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · CdcBackfillExecutor · ×1
  • CdcBackfillExecutor::execute_inner (cyclomatic 66) src/stream/src/executor/backfill/cdc/cdc_backfill.rs:488 — CdcBackfillExecutor::execute_inner has cyclomatic complexity 66 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MaterializeExecutor · ×1
  • MaterializeExecutor::execute_inner (cyclomatic 60) src/stream/src/executor/mview/materialize.rs:373 — MaterializeExecutor::execute_inner has cyclomatic complexity 60 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SourceBackfillExecutorInner · ×1
  • SourceBackfillExecutorInner::execute (cyclomatic 59) src/stream/src/executor/source/source_backfill_executor.rs:383 — SourceBackfillExecutorInner::execute has cyclomatic complexity 59 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · StatementType · ×1
  • StatementType::infer_from_statement (cyclomatic 59) src/utils/pgwire/src/pg_response.rs:255 — StatementType::infer_from_statement has cyclomatic complexity 59 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · LocalityProviderExecutor · ×1
  • LocalityProviderExecutor::execute_inner (cyclomatic 58) REDACTED:660 — LocalityProviderExecutor::execute_inner has cyclomatic complexity 58 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SourceExecutor · ×1
  • SourceExecutor::execute_inner (cyclomatic 53) src/stream/src/executor/source/source_executor.rs:616 — SourceExecutor::execute_inner has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AvroParseOptionsInner · ×1
  • AvroParseOptionsInner::convert_to_datum (cyclomatic 49) src/connector/codec/src/decoder/avro/mod.rs:88 — AvroParseOptionsInner::convert_to_datum 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.
D1 · Cyclomatic Complexity · StreamSink · ×1
  • StreamSink::create (cyclomatic 49) src/frontend/src/optimizer/plan_node/stream_sink.rs:280 — StreamSink::create 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.
D1 · Cyclomatic Complexity · BeMessage · ×1
  • BeMessage::write (cyclomatic 49) src/utils/pgwire/src/pg_message.rs:496 — BeMessage::write has cyclomatic complexity 49 (threshold 15). Of this number, 43 points are the body's own statements and 6 belong to one function item 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.
D1 · Cyclomatic Complexity · ArrangementBackfillExecutor · ×1
  • ArrangementBackfillExecutor::execute_inner (cyclomatic 46) src/stream/src/executor/backfill/arrangement_backfill.rs:109 — ArrangementBackfillExecutor::execute_inner has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SqlServerStreamingChangeEventSource.executeIteration (cyclomatic 46) · ×1
  • SqlServerStreamingChangeEventSource.executeIteration (cyclomatic 46) java/connector-node/risingwave-source-cdc/src/main/java/io/debezium/connector/sqlserver/SqlServerStreamingChangeEventSource.java:280 — SqlServerStreamingChangeEventSource.executeIteration has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · StreamChunkDeserializer.buildValueGetter (cyclomatic 46) · ×1
  • StreamChunkDeserializer.buildValueGetter (cyclomatic 46) java/connector-node/risingwave-connector-service/src/main/java/com/risingwave/connector/deserializer/StreamChunkDeserializer.java:44 — StreamChunkDeserializer.buildValueGetter has cyclomatic complexity 46 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · MonotonicityAnalyzer · ×1
  • MonotonicityAnalyzer::visit_function_call (cyclomatic 44) src/frontend/src/optimizer/property/monotonicity.rs:177 — MonotonicityAnalyzer::visit_function_call has cyclomatic complexity 44 (threshold 15). Of this number, 41 points are the body's own statements and 3 belong to one function item 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.
D1 · Cyclomatic Complexity · DmlExecutor · ×1
  • DmlExecutor::execute_inner (cyclomatic 41) src/stream/src/executor/dml.rs:109 — DmlExecutor::execute_inner has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DbzConnectorConfig.<init> (cyclomatic 41) · ×1
  • DbzConnectorConfig.<init> (cyclomatic 41) java/connector-node/risingwave-connector-service/src/main/java/com/risingwave/connector/source/common/DbzConnectorConfig.java:158 — DbzConnectorConfig.<init> has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NavExtractor · ×1
  • NavExtractor::rewrite (cyclomatic 38) src/frontend/src/binder/relation/match_recognize.rs:1217 — NavExtractor::rewrite has cyclomatic complexity 38 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · WatermarkFilterExecutorInner · ×1
  • WatermarkFilterExecutorInner::execute_inner (cyclomatic 37) src/stream/src/executor/watermark_filter.rs:92 — WatermarkFilterExecutorInner::execute_inner has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ClickHouseFieldWithNull · ×1
  • ClickHouseFieldWithNull::from_scalar_ref (cyclomatic 36) src/connector/src/sink/clickhouse.rs:968 — ClickHouseFieldWithNull::from_scalar_ref has cyclomatic complexity 36 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · ListValue · ×1
  • ListValue::from_str (cyclomatic 33) src/common/src/array/list_array.rs:747 — ListValue::from_str has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PostgresValidator.validatePublicationConfig (cyclomatic 33) · ×1
  • PostgresValidator.validatePublicationConfig (cyclomatic 33) java/connector-node/risingwave-connector-service/src/main/java/com/risingwave/connector/source/common/PostgresValidator.java:411 — PostgresValidator.validatePublicationConfig has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FragmentGraph.FragmentGraph (cyclomatic 33) · ×1
  • FragmentGraph.FragmentGraph (cyclomatic 33) dashboard/components/FragmentGraph.tsx:92 — FragmentGraph.FragmentGraph has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 4 of the 33 points are its own statements and the rest belongs to 15 function literals inside it that branch (lines 242, 384, 477, …). 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.
D1 · Cyclomatic Complexity · ReplayWorker · ×1
  • ReplayWorker::handle_record (cyclomatic 31) src/storage/hummock_trace/src/replay/worker.rs:161 — ReplayWorker::handle_record has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CorrelatedTopNToVectorSearchRule · ×1
  • CorrelatedTopNToVectorSearchRule::apply (cyclomatic 30) src/frontend/src/optimizer/rule/correlated_topn_to_vector_search.rs:42 — CorrelatedTopNToVectorSearchRule::apply 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.
D1 · Cyclomatic Complexity · LocalQueryExecution · ×1
  • LocalQueryExecution::convert_plan_node (cyclomatic 30) src/frontend/src/scheduler/local.rs:260 — LocalQueryExecution::convert_plan_node has cyclomatic complexity 30 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · IcebergConnection · ×1
  • IcebergConnection::validate_connection (cyclomatic 29) src/connector/src/connector_common/connection.rs:179 — IcebergConnection::validate_connection has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SessionTimezone · ×1
  • SessionTimezone::with_timezone (cyclomatic 29) src/frontend/src/expr/session_timezone.rs:76 — SessionTimezone::with_timezone has cyclomatic complexity 29 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · TableFunction · ×1
  • TableFunction::new_file_scan (cyclomatic 29) src/frontend/src/expr/table_function.rs:87 — TableFunction::new_file_scan has cyclomatic complexity 29 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · OverWindowExecutor · ×1
  • OverWindowExecutor::apply_chunk (cyclomatic 29) src/stream/src/executor/over_window/general.rs:374 — OverWindowExecutor::apply_chunk has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · IcebergConfig · ×1
  • IcebergConfig::from_btreemap (cyclomatic 28) src/connector/src/sink/iceberg/config.rs:605 — IcebergConfig::from_btreemap 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.
D1 · Cyclomatic Complexity · SnowflakeV2Config · ×1
  • SnowflakeV2Config::from_btreemap (cyclomatic 28) src/connector/src/sink/snowflake_redshift/snowflake.rs:230 — SnowflakeV2Config::from_btreemap has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · IcebergCompactionManager · ×1
  • IcebergCompactionManager::apply_sink_update (cyclomatic 28) src/meta/src/manager/iceberg_compaction/schedule.rs:1327 — IcebergCompactionManager::apply_sink_update has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ExecutorInner · ×1
  • ExecutorInner::generate_filled_rows (cyclomatic 28) src/stream/src/executor/eowc/eowc_gap_fill.rs:84 — ExecutorInner::generate_filled_rows has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · extract.process_file (cyclomatic 28) · ×1
  • extract.process_file (cyclomatic 28) docs/metrics/extract.py:399 — extract.process_file has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · KafkaConnectionProps · ×1
  • KafkaConnectionProps::set_security_properties (cyclomatic 27) src/connector/src/connector_common/common.rs:518 — KafkaConnectionProps::set_security_properties has cyclomatic complexity 27 (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.
D1 · Cyclomatic Complexity · SpecificParserConfig · ×1
  • SpecificParserConfig::new (cyclomatic 27) src/connector/src/parser/config.rs:125 — SpecificParserConfig::new 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.
D1 · Cyclomatic Complexity · KafkaSplitReader · ×1
  • KafkaSplitReader::into_data_event_stream (cyclomatic 27) src/connector/src/source/kafka/source/reader.rs:382 — KafkaSplitReader::into_data_event_stream has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PostCollectCommand · ×1
  • PostCollectCommand::post_collect (cyclomatic 27) src/meta/src/barrier/context/context_impl.rs:636 — PostCollectCommand::post_collect has cyclomatic complexity 27 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · RedisSink · ×1
  • RedisSink::validate (cyclomatic 26) src/connector/src/sink/redis.rs:334 — RedisSink::validate has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NonOverlapSubLevelPicker · ×1
  • NonOverlapSubLevelPicker::pick_sub_level (cyclomatic 26) src/meta/src/hummock/compaction/picker/non_overlap_sub_level_picker.rs:159 — NonOverlapSubLevelPicker::pick_sub_level has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · extract.split_top_args (cyclomatic 26) · ×1
  • extract.split_top_args (cyclomatic 26) docs/metrics/extract.py:96 — extract.split_top_args has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SourceStreamChunkRowWriter · ×1
  • SourceStreamChunkRowWriter::do_action (cyclomatic 25) src/connector/src/parser/chunk_builder.rs:272 — SourceStreamChunkRowWriter::do_action 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.
D1 · Cyclomatic Complexity · WaitCheckpointTask · ×1
  • WaitCheckpointTask::run_with_on_commit_success (cyclomatic 25) src/connector/src/source/mod.rs:160 — WaitCheckpointTask::run_with_on_commit_success has cyclomatic complexity 25 (threshold 15). Of this number, 20 points are the body's own statements and 5 belong to one function item 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.
D1 · Cyclomatic Complexity · CoordinatedLogSinker · ×1
  • CoordinatedLogSinker::consume_log_and_sink (cyclomatic 24) src/connector/src/sink/coordinate.rs:69 — CoordinatedLogSinker::consume_log_and_sink has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Unit · ×1
  • Unit::from_str (cyclomatic 24) src/expr/impl/src/scalar/extract.rs:263 — Unit::from_str 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.
D1 · Cyclomatic Complexity · NowExecutor · ×1
  • NowExecutor::execute_inner (cyclomatic 24) src/stream/src/executor/now.rs:97 — NowExecutor::execute_inner has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PartitionCache · ×1
  • PartitionCache::shrink (cyclomatic 24) src/stream/src/executor/over_window/range_cache.rs:185 — PartitionCache::shrink has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RelationGraph.RelationGraph (cyclomatic 24) · ×1
  • RelationGraph.RelationGraph (cyclomatic 24) dashboard/components/RelationGraph.tsx:73 — RelationGraph.RelationGraph has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 1 of the 24 points is its own statement and the rest belongs to 10 function literals inside it that branch (lines 255, 283, 206, …). 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.
D1 · Cyclomatic Complexity · PartialGraphRecoverer · ×1
  • PartialGraphRecoverer::inject_database_initial_barrier (cyclomatic 23) src/meta/src/barrier/rpc.rs:622 — PartialGraphRecoverer::inject_database_initial_barrier has cyclomatic complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function item 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.
D1 · Cyclomatic Complexity · BuildingFragment · ×1
  • BuildingFragment::fill_job (cyclomatic 23) src/meta/src/stream/stream_graph/fragment.rs:140 — BuildingFragment::fill_job has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BatchOpendalFsFetchExecutor · ×1
  • BatchOpendalFsFetchExecutor::into_stream (cyclomatic 23) src/stream/src/executor/source/batch_source/batch_opendal_fs_fetch.rs:186 — BatchOpendalFsFetchExecutor::into_stream has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BatchPosixFsFetchExecutor · ×1
  • BatchPosixFsFetchExecutor::into_stream (cyclomatic 23) src/stream/src/executor/source/batch_source/batch_posix_fs_fetch.rs:234 — BatchPosixFsFetchExecutor::into_stream has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FsFetchExecutor · ×1
  • FsFetchExecutor::into_stream (cyclomatic 23) src/stream/src/executor/source/fs_fetch_executor.rs:294 — FsFetchExecutor::into_stream has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ResultCache · ×1
  • ResultCache::consume (cyclomatic 23) src/utils/pgwire/src/pg_extended.rs:47 — ResultCache::consume has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · fragment_graph.Streaming (cyclomatic 23) · ×1
  • fragment_graph.Streaming (cyclomatic 23) dashboard/pages/fragment_graph.tsx:227 — fragment_graph.Streaming has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 7 of the 23 points are its own statements and the rest belongs to 7 function items inside it that branch (handleSearchFragment, handleSearchActor, a function literal at line 262, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · LookupJoinBase · ×1
  • LookupJoinBase::do_execute (cyclomatic 22) src/batch/executors/src/executor/join/lookup_join_base.rs:77 — LookupJoinBase::do_execute has cyclomatic complexity 22 (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.
D1 · Cyclomatic Complexity · risingwave_expr · ×1
  • risingwave_expr::scalar::like::match_text_inner (cyclomatic 22) src/expr/core/src/scalar/like.rs:123 — risingwave_expr::scalar::like::match_text_inner has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BooleanConstantFolding · ×1
  • BooleanConstantFolding::rewrite_function_call (cyclomatic 22) src/frontend/src/expr/utils.rs:172 — BooleanConstantFolding::rewrite_function_call has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PullUpHopRule · ×1
  • PullUpHopRule::apply (cyclomatic 22) src/frontend/src/optimizer/rule/pull_up_hop_rule.rs:25 — PullUpHopRule::apply 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.
D1 · Cyclomatic Complexity · Scheduler · ×1
  • Scheduler::schedule (cyclomatic 22) src/meta/src/stream/stream_graph/schedule.rs:164 — Scheduler::schedule has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SnapshotBackfillExecutor · ×1
  • SnapshotBackfillExecutor::execute_inner (cyclomatic 22) src/stream/src/executor/backfill/snapshot_backfill/executor.rs:158 — SnapshotBackfillExecutor::execute_inner has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HopWindowExecutor · ×1
  • HopWindowExecutor::execute_inner (cyclomatic 22) src/stream/src/executor/hop_window.rs:72 — HopWindowExecutor::execute_inner has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · extract.find_matching_paren (cyclomatic 22) · ×1
  • extract.find_matching_paren (cyclomatic 22) docs/metrics/extract.py:43 — extract.find_matching_paren has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · heap_profiling.HeapProfiling (cyclomatic 22) · ×1
  • heap_profiling.HeapProfiling (cyclomatic 22) dashboard/pages/heap_profiling.tsx:75 — heap_profiling.HeapProfiling has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 5 of the 22 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 93, analyzeHeapFile, a function literal at line 87, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · DataChunk · ×1
  • DataChunk::from_pretty (cyclomatic 21) src/common/src/array/data_chunk.rs:719 — DataChunk::from_pretty has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 7 of the 21 points are its own statements and the rest belongs to one function item inside it that branches (parse_type). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · ScanRange · ×1
  • ScanRange::range_overlap_check (cyclomatic 20) src/common/src/util/scan_range.rs:139 — ScanRange::range_overlap_check has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MySqlExternalTableReader · ×1
  • MySqlExternalTableReader::snapshot_read_inner (cyclomatic 20) src/connector/src/source/cdc/external/mysql.rs:815 — MySqlExternalTableReader::snapshot_read_inner 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. This is NOT this file's highest cyclomatic complexity: risingwave_connector::source::cdc::external::mysql::type_name_to_mysql_type (cyclomatic 49) 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 function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · NatsPropertiesConsumer · ×1
  • NatsPropertiesConsumer::set_config (cyclomatic 20) src/connector/src/source/nats/mod.rs:224 — NatsPropertiesConsumer::set_config 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.
D1 · Cyclomatic Complexity · IcebergIntermediateScanRule · ×1
  • IcebergIntermediateScanRule::apply (cyclomatic 20) src/frontend/src/optimizer/rule/iceberg_intermediate_scan_rule.rs:60 — IcebergIntermediateScanRule::apply 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.
D1 · Cyclomatic Complexity · StageRunner · ×1
  • StageRunner::schedule_tasks (cyclomatic 20) src/frontend/src/scheduler/distributed/stage.rs:337 — StageRunner::schedule_tasks has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CheckpointControl · ×1
  • CheckpointControl::handle_new_barrier (cyclomatic 20) src/meta/src/barrier/checkpoint/control.rs:237 — CheckpointControl::handle_new_barrier has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InflightDatabaseInfo · ×1
  • InflightDatabaseInfo::apply_collected_command (cyclomatic 20) src/meta/src/barrier/info.rs:612 — InflightDatabaseInfo::apply_collected_command has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PartialGraphManager · ×1
  • PartialGraphManager::next_event_inner (cyclomatic 20) src/meta/src/barrier/partial_graph.rs:723 — PartialGraphManager::next_event_inner has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CoordinatorWorker · ×1
  • CoordinatorWorker::run_coordination (cyclomatic 20) src/meta/src/manager/sink_coordination/coordinator_worker.rs:670 — CoordinatorWorker::run_coordination has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · UserOptions · ×1
  • UserOptions::parse_to (cyclomatic 20) src/sqlparser/src/ast/statement.rs:1120 — UserOptions::parse_to has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · UpstreamTableExecutor · ×1
  • UpstreamTableExecutor::into_stream (cyclomatic 20) src/stream/src/executor/backfill/snapshot_backfill/consume_upstream/executor.rs:115 — UpstreamTableExecutor::into_stream has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TemporalJoinExecutor · ×1
  • TemporalJoinExecutor::into_stream (cyclomatic 20) src/stream/src/executor/temporal_join.rs:666 — TemporalJoinExecutor::into_stream has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cpu_profiling.CpuProfiling (cyclomatic 20) · ×1
  • cpu_profiling.CpuProfiling (cyclomatic 20) dashboard/pages/cpu_profiling.tsx:68 — cpu_profiling.CpuProfiling has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 5 of the 20 points are its own statements and the rest belongs to 5 function items inside it that branch (dumpProfile, a function literal at line 78, a function literal at line 179, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · QueryRewriter · ×1
  • QueryRewriter::visit_expr (cyclomatic 19) src/meta/src/controller/rename.rs:331 — QueryRewriter::visit_expr 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.
D1 · Cyclomatic Complexity · SpaceReclaimCompactionPicker · ×1
  • SpaceReclaimCompactionPicker::pick_compaction (cyclomatic 19) src/meta/src/hummock/compaction/picker/space_reclaim_compaction_picker.rs:59 — SpaceReclaimCompactionPicker::pick_compaction has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Matches · ×1
  • Matches::try_match (cyclomatic 19) src/meta/src/stream/stream_graph/state_match.rs:240 — Matches::try_match has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TableFactor · ×1
  • TableFactor::fmt (cyclomatic 19) src/sqlparser/src/ast/query.rs:706 — TableFactor::fmt has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SstableBuilder · ×1
  • SstableBuilder::add_impl (cyclomatic 19) src/storage/src/hummock/sstable/builder.rs:351 — SstableBuilder::add_impl has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConsumeUpstreamStream · ×1
  • ConsumeUpstreamStream::poll_next (cyclomatic 19) src/stream/src/executor/backfill/snapshot_backfill/consume_upstream/stream.rs:286 — ConsumeUpstreamStream::poll_next 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.
D1 · Cyclomatic Complexity · IncrementalMatcher · ×1
  • IncrementalMatcher::rescan (cyclomatic 19) src/stream/src/executor/match_recognize/incremental.rs:425 — IncrementalMatcher::rescan has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · IcebergFetchExecutor · ×1
  • IcebergFetchExecutor::into_stream (cyclomatic 19) src/stream/src/executor/source/iceberg_fetch_executor.rs:278 — IcebergFetchExecutor::into_stream has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · risingwave_rt · ×1
  • risingwave_rt::logger::init_risingwave_logger (cyclomatic 19) src/utils/runtime/src/logger.rs:235 — risingwave_rt::logger::init_risingwave_logger has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · extract.scan_direct_constructions (cyclomatic 19) · ×1
  • extract.scan_direct_constructions (cyclomatic 19) docs/metrics/extract.py:533 — extract.scan_direct_constructions has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · extract.main (cyclomatic 19) · ×1
  • extract.main (cyclomatic 19) docs/metrics/extract.py:719 — extract.main has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FormatError · ×1
  • FormatError::check_expr (cyclomatic 18) lints/src/format_error.rs:104 — FormatError::check_expr has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SortExecutor · ×1
  • SortExecutor::do_execute (cyclomatic 18) src/batch/executors/src/executor/order_by.rs:115 — SortExecutor::do_execute has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · StackTraceResponseOutput · ×1
  • StackTraceResponseOutput::fmt (cyclomatic 18) src/common/src/util/prost.rs:44 — StackTraceResponseOutput::fmt has cyclomatic complexity 18 (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.
D1 · Cyclomatic Complexity · DeltaJoinSolver · ×1
  • DeltaJoinSolver::find_lookup_path (cyclomatic 18) src/frontend/src/optimizer/delta_join_solver.rs:295 — DeltaJoinSolver::find_lookup_path has cyclomatic complexity 18 (threshold 15). Of this number, 14 points are the body's own statements and 4 belong to one function item 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.
D1 · Cyclomatic Complexity · Agg · ×1
  • Agg::infer_stream_agg_state (cyclomatic 18) src/frontend/src/optimizer/plan_node/generic/agg.rs:394 — Agg::infer_stream_agg_state has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · LogicalMultiJoin · ×1
  • LogicalMultiJoin::as_bushy_tree_join (cyclomatic 18) src/frontend/src/optimizer/plan_node/logical_multi_join.rs:512 — LogicalMultiJoin::as_bushy_tree_join has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · IndexDeltaJoinRule · ×1
  • IndexDeltaJoinRule::apply (cyclomatic 18) src/frontend/src/optimizer/rule/index_delta_join_rule.rs:25 — IndexDeltaJoinRule::apply has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 6 of the 18 points are its own statements and the rest belongs to 2 function items inside it that branch (match_indexes, match_through_exchange). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · PullUpCorrelatedPredicateAggRule · ×1
  • PullUpCorrelatedPredicateAggRule::apply (cyclomatic 18) src/frontend/src/optimizer/rule/pull_up_correlated_predicate_agg_rule.rs:65 — PullUpCorrelatedPredicateAggRule::apply 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.
D1 · Cyclomatic Complexity · GlobalStreamManager · ×1
  • GlobalStreamManager::run (cyclomatic 18) src/meta/src/stream/scale.rs:1412 — GlobalStreamManager::run has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · CompactTaskExecutor · ×1
  • CompactTaskExecutor::run (cyclomatic 18) src/storage/src/hummock/compactor/fast_compactor_runner.rs:698 — CompactTaskExecutor::run has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SstableStore · ×1
  • SstableStore::prefetch_blocks (cyclomatic 18) src/storage/src/hummock/sstable_store.rs:341 — SstableStore::prefetch_blocks has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BatchAdbcSnowflakeFetchExecutor · ×1
  • BatchAdbcSnowflakeFetchExecutor::into_stream (cyclomatic 18) src/stream/src/executor/source/batch_source/batch_adbc_snowflake_fetch.rs:75 — BatchAdbcSnowflakeFetchExecutor::into_stream has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ManagedTopNState · ×1
  • ManagedTopNState::init_topn_cache_inner (cyclomatic 18) src/stream/src/executor/top_n/top_n_state.rs:201 — ManagedTopNState::init_topn_cache_inner has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SqlServerValidator.validateTableSchema (cyclomatic 18) · ×1
  • SqlServerValidator.validateTableSchema (cyclomatic 18) java/connector-node/risingwave-connector-service/src/main/java/com/risingwave/connector/source/common/SqlServerValidator.java:182 — SqlServerValidator.validateTableSchema has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · doc_issue_tracker.find_tracking_issues (cyclomatic 18) · ×1
  • doc_issue_tracker.find_tracking_issues (cyclomatic 18) .github/scripts/doc_issue_tracker.py:242 — doc_issue_tracker.find_tracking_issues has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · streamingStats.createStreamingStatsRefresh (cyclomatic 18) · ×1
  • streamingStats.createStreamingStatsRefresh (cyclomatic 18) dashboard/lib/api/streamingStats.ts:48 — streamingStats.createStreamingStatsRefresh has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 69, 104, 54). 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.
D1 · Cyclomatic Complexity · risingwave_cmd_all · ×1
  • risingwave_cmd_all::single_node::map_single_node_opts_to_standalone_opts (cyclomatic 17) src/cmd_all/src/single_node.rs:124 — risingwave_cmd_all::single_node::map_single_node_opts_to_standalone_opts 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.
D1 · Cyclomatic Complexity · ObserverManager · ×1
  • ObserverManager::wait_init_notification (cyclomatic 17) src/common/common_service/src/observer_manager.rs:86 — ObserverManager::wait_init_notification has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · TemplateEncoder · ×1
  • TemplateEncoder::build (cyclomatic 17) src/connector/src/sink/formatter/mod.rs:313 — TemplateEncoder::build has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: SinkFormatterImpl::new (cyclomatic 27) 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 function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · RemoteLogSinker · ×1
  • RemoteLogSinker::consume_log_and_sink (cyclomatic 17) src/connector/src/sink/remote.rs:328 — RemoteLogSinker::consume_log_and_sink has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body's own statements and 4 belong to one function item 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.
D1 · Cyclomatic Complexity · KinesisSplitReader · ×1
  • KinesisSplitReader::into_data_stream (cyclomatic 17) src/connector/src/source/kinesis/source/reader.rs:177 — KinesisSplitReader::into_data_stream has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ClusterControllerInner · ×1
  • ClusterControllerInner::add_worker (cyclomatic 17) src/meta/src/controller/cluster.rs:613 — ClusterControllerInner::add_worker has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MinOverlappingPicker · ×1
  • MinOverlappingPicker::pick_tables (cyclomatic 17) src/meta/src/hummock/compaction/picker/min_overlap_compaction_picker.rs:50 — MinOverlappingPicker::pick_tables has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ManualCompactionSelector · ×1
  • ManualCompactionSelector::pick_compaction (cyclomatic 17) src/meta/src/hummock/compaction/selector/manual_selector.rs:93 — ManualCompactionSelector::pick_compaction 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.
D1 · Cyclomatic Complexity · risingwave_object_store · ×1
  • risingwave_object_store::object::build_remote_object_store (cyclomatic 17) src/object_store/src/object/mod.rs:879 — risingwave_object_store::object::build_remote_object_store has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · TableWatermarks · ×1
  • TableWatermarks::clear_stale_epoch_watermark (cyclomatic 17) src/storage/hummock_sdk/src/table_watermark.rs:571 — TableWatermarks::clear_stale_epoch_watermark has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · UploaderData · ×1
  • UploaderData::sync (cyclomatic 17) src/storage/src/hummock/event_handler/uploader/mod.rs:998 — UploaderData::sync has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Nfa · ×1
  • Nfa::walk (cyclomatic 17) src/stream/src/executor/match_recognize/nfa.rs:1072 — Nfa::walk has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · IcebergListExecutor · ×1
  • IcebergListExecutor::into_stream (cyclomatic 17) src/stream/src/executor/source/iceberg_list_executor.rs:92 — IcebergListExecutor::into_stream has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RowSeqScanExecutor · ×1
  • RowSeqScanExecutor::do_execute (cyclomatic 16) src/batch/executors/src/executor/row_seq_scan.rs:160 — RowSeqScanExecutor::do_execute has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TableScanIoEstimator · ×1
  • TableScanIoEstimator::match_index_column (cyclomatic 16) src/frontend/src/optimizer/rule/index_selection_rule.rs:866 — TableScanIoEstimator::match_index_column 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: TableScanIoEstimator::estimate_data_type_size (cyclomatic 22) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · TopNToVectorSearchRule · ×1
  • TopNToVectorSearchRule::resolve_vector_search (cyclomatic 16) src/frontend/src/optimizer/rule/top_n_to_vector_search_rule.rs:51 — TopNToVectorSearchRule::resolve_vector_search has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · UnifyFirstLastValueRule · ×1
  • UnifyFirstLastValueRule::apply (cyclomatic 16) src/frontend/src/optimizer/rule/unify_first_last_value_rule.rs:87 — UnifyFirstLastValueRule::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.
D1 · Cyclomatic Complexity · BatchPlanFragmenter · ×1
  • BatchPlanFragmenter::new_stage (cyclomatic 16) src/frontend/src/scheduler/plan_fragmenter.rs:1027 — BatchPlanFragmenter::new_stage has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SessionManagerImpl · ×1
  • SessionManagerImpl::connect_inner (cyclomatic 16) src/frontend/src/session.rs:1654 — SessionManagerImpl::connect_inner 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.
D1 · Cyclomatic Complexity · risedev_config · ×1
  • risedev_config::main (cyclomatic 16) src/risedevtool/config/src/main.rs:338 — risedev_config::main 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: Components::from_env (cyclomatic 22) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · risingwave_hummock_sdk · ×1
  • risingwave_hummock_sdk::compaction_group::hummock_version_ext::validate_version (cyclomatic 16) src/storage/hummock_sdk/src/compaction_group/hummock_version_ext.rs:1520 — risingwave_hummock_sdk::compaction_group::hummock_version_ext::validate_version has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SyncLogStoreDispatchExecutor · ×1
  • SyncLogStoreDispatchExecutor::execute (cyclomatic 16) src/stream/src/executor/dispatch/dispatch_sync_log_store.rs:283 — SyncLogStoreDispatchExecutor::execute has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NestedLoopTemporalJoinExecutor · ×1
  • NestedLoopTemporalJoinExecutor::into_stream (cyclomatic 16) src/stream/src/executor/nested_loop_temporal_join.rs:150 — NestedLoopTemporalJoinExecutor::into_stream has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SourceExecutorBuilder · ×1
  • SourceExecutorBuilder::new_boxed_executor (cyclomatic 16) src/stream/src/from_proto/source/trad_source.rs:139 — SourceExecutorBuilder::new_boxed_executor has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PartialGraphState · ×1
  • PartialGraphState::poll_next_event (cyclomatic 16) src/stream/src/task/barrier_worker/managed_state.rs:904 — PartialGraphState::poll_next_event 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.
D1 · Cyclomatic Complexity · BinlogHistoryRecordComparator.isPositionAtOrBefore (cyclomatic 16) · ×1
  • BinlogHistoryRecordComparator.isPositionAtOrBefore (cyclomatic 16) java/connector-node/risingwave-source-cdc/src/main/java/io/debezium/connector/binlog/history/BinlogHistoryRecordComparator.java:77 — BinlogHistoryRecordComparator.isPositionAtOrBefore 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.
D10 · Test Quality · No assertions · ×1
  • No assertions: CreateAndReadFromTable integration_tests/client-library/csharp/NpgsqlTest.cs:12 — 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.
D12 · Dependency Hygiene · Deprecated module · ×1
  • Deprecated module: github.com/aws/aws-sdk-go — `github.com/aws/aws-sdk-go` is required at v1.44.126 in integration_tests/datagen/go.mod, and its author has DEPRECATED the module: "aws-sdk-go is deprecated. Use aws-sdk-go-v2. See https://aws.amazon.com/blogs/developer/announcing-end-of-support-for-aws-sdk-for-go-v1-on-july-31-2025/." A deprecation is declared by the author in the module's own go.mod and applies to the whole module, not to one release, so moving to a newer version of it does not clear this. Follow the replacement the notice names.
D17 · Explicit Debt · TodoComment · ×1
  • TodoComment integration_tests/client-library/csharp/NpgsqlTest.cs:84 — // TODO: reading nested arrays is not supported yet. See https://github.com/risingwavelabs/risingwave/pull/15614
D17 · Explicit Debt · CommentedOutCode · ×1
  • CommentedOutCode REDACTED:35 — commented-out configuration block `RemoteIceberg` (10 lines)
D2 · Cognitive Complexity · ParallelizedCdcBackfillExecutor · ×1
  • ParallelizedCdcBackfillExecutor::execute_inner (cognitive 389) src/stream/src/executor/backfill/cdc/cdc_backill_v2.rs:111 — ParallelizedCdcBackfillExecutor::execute_inner has cognitive complexity 389 (threshold 15). Drivers by points: if/else 43 (244 pts), match/switch 13 (80 pts), loops 13 (59 pts), boolean chains 6 (nesting depth added 314). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DmlExecutor · ×1
  • DmlExecutor::execute_inner (cognitive 172) src/stream/src/executor/dml.rs:109 — DmlExecutor::execute_inner has cognitive complexity 172 (threshold 15). Drivers by points: if/else 22 (103 pts), loops 10 (54 pts), match/switch 4 (14 pts), boolean chains 1 (nesting depth added 135). 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.
D2 · Cognitive Complexity · ArrangementBackfillExecutor · ×1
  • ArrangementBackfillExecutor::execute_inner (cognitive 145) src/stream/src/executor/backfill/arrangement_backfill.rs:109 — ArrangementBackfillExecutor::execute_inner has cognitive complexity 145 (threshold 15). Drivers by points: if/else 22 (78 pts), loops 11 (38 pts), match/switch 6 (26 pts), boolean chains 3 (nesting depth added 103). 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.
D2 · Cognitive Complexity · Statement · ×1
  • Statement::fmt_unchecked (cognitive 137) src/sqlparser/src/ast/mod.rs:1827 — Statement::fmt_unchecked has cognitive complexity 137 (threshold 15). Drivers by points: if/else 64 (116 pts), match/switch 8 (15 pts), loops 1 (4 pts), boolean chains 2 (nesting depth added 62). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SqlServerStreamingChangeEventSource.executeIteration (cognitive 102) · ×1
  • SqlServerStreamingChangeEventSource.executeIteration (cognitive 102) java/connector-node/risingwave-source-cdc/src/main/java/io/debezium/connector/sqlserver/SqlServerStreamingChangeEventSource.java:280 — SqlServerStreamingChangeEventSource.executeIteration has cognitive complexity 102 (threshold 15). Drivers by points: if/else 25 (68 pts), loops 5 (12 pts), boolean chains 10, error handling 3 (7 pts), ternaries 2 (5 pts) (nesting depth added 57). 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.
D2 · Cognitive Complexity · WatermarkFilterExecutorInner · ×1
  • WatermarkFilterExecutorInner::execute_inner (cognitive 94) src/stream/src/executor/watermark_filter.rs:92 — WatermarkFilterExecutorInner::execute_inner has cognitive complexity 94 (threshold 15). Drivers by points: if/else 24 (68 pts), match/switch 5 (14 pts), boolean chains 6, loops 2 (6 pts) (nesting depth added 57). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · extract.process_file (cognitive 73) · ×1
  • extract.process_file (cognitive 73) docs/metrics/extract.py:399 — extract.process_file has cognitive complexity 73 (threshold 15). Drivers by points: if/else 19 (63 pts), boolean chains 8, loops 2 (nesting depth added 44). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · CoordinatedLogSinker · ×1
  • CoordinatedLogSinker::consume_log_and_sink (cognitive 72) src/connector/src/sink/coordinate.rs:69 — CoordinatedLogSinker::consume_log_and_sink has cognitive complexity 72 (threshold 15). Drivers by points: if/else 19 (56 pts), match/switch 4 (11 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 46). 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.
D2 · Cognitive Complexity · UpstreamTableExecutor · ×1
  • UpstreamTableExecutor::into_stream (cognitive 67) src/stream/src/executor/backfill/snapshot_backfill/consume_upstream/executor.rs:115 — UpstreamTableExecutor::into_stream has cognitive complexity 67 (threshold 15). Drivers by points: if/else 16 (52 pts), loops 4 (10 pts), match/switch 1 (4 pts), boolean chains 1 (nesting depth added 45). 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.
D2 · Cognitive Complexity · DbzConnectorConfig.<init> (cognitive 63) · ×1
  • DbzConnectorConfig.<init> (cognitive 63) java/connector-node/risingwave-connector-service/src/main/java/com/risingwave/connector/source/common/DbzConnectorConfig.java:158 — DbzConnectorConfig.<init> has cognitive complexity 63 (threshold 15). Drivers by points: if/else 29 (49 pts), boolean chains 9, match/switch 1 (3 pts), loops 1, ternaries 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.
D2 · Cognitive Complexity · TemporalJoinExecutor · ×1
  • TemporalJoinExecutor::into_stream (cognitive 62) src/stream/src/executor/temporal_join.rs:666 — TemporalJoinExecutor::into_stream has cognitive complexity 62 (threshold 15). Drivers by points: if/else 16 (41 pts), loops 5 (18 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PostgresValidator.validatePublicationConfig (cognitive 62) · ×1
  • PostgresValidator.validatePublicationConfig (cognitive 62) java/connector-node/risingwave-connector-service/src/main/java/com/risingwave/connector/source/common/PostgresValidator.java:411 — PostgresValidator.validatePublicationConfig has cognitive complexity 62 (threshold 15). Drivers by points: if/else 21 (40 pts), loops 10 (18 pts), boolean chains 3, error handling 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.
D2 · Cognitive Complexity · SnapshotBackfillExecutor · ×1
  • SnapshotBackfillExecutor::execute_inner (cognitive 60) src/stream/src/executor/backfill/snapshot_backfill/executor.rs:158 — SnapshotBackfillExecutor::execute_inner has cognitive complexity 60 (threshold 15). Drivers by points: if/else 23 (48 pts), loops 4 (10 pts), match/switch 1 (2 pts) (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NowExecutor · ×1
  • NowExecutor::execute_inner (cognitive 59) src/stream/src/executor/now.rs:97 — NowExecutor::execute_inner has cognitive complexity 59 (threshold 15). Drivers by points: if/else 17 (45 pts), loops 3 (6 pts), match/switch 3 (6 pts), boolean chains 2 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BatchOpendalFsFetchExecutor · ×1
  • BatchOpendalFsFetchExecutor::into_stream (cognitive 58) src/stream/src/executor/source/batch_source/batch_opendal_fs_fetch.rs:186 — BatchOpendalFsFetchExecutor::into_stream has cognitive complexity 58 (threshold 15). Drivers by points: if/else 7 (30 pts), match/switch 5 (19 pts), loops 2 (6 pts), boolean chains 3 (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FragmentGraph.FragmentGraph (cognitive 56) · ×1
  • FragmentGraph.FragmentGraph (cognitive 56) dashboard/components/FragmentGraph.tsx:92 — FragmentGraph.FragmentGraph has cognitive complexity 56 (threshold 15). Drivers by points: if/else 15 (32 pts), ternaries 9 (18 pts), boolean chains 5, loops 1 (nesting depth added 26). Most of this is not in the body itself: 2 of the 56 points are its own statements and the rest belongs to 15 function literals inside it that branch (lines 242, 477, 492, …). 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.
D2 · Cognitive Complexity · PartitionCache · ×1
  • PartitionCache::shrink (cognitive 55) src/stream/src/executor/over_window/range_cache.rs:185 — PartitionCache::shrink has cognitive complexity 55 (threshold 15). Drivers by points: if/else 16 (37 pts), loops 6 (16 pts), boolean chains 1, match/switch 1 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PartialGraphManager · ×1
  • PartialGraphManager::next_event_inner (cognitive 54) src/meta/src/barrier/partial_graph.rs:723 — PartialGraphManager::next_event_inner has cognitive complexity 54 (threshold 15). Drivers by points: if/else 7 (27 pts), match/switch 7 (25 pts), loops 2 (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · risingwave_expr · ×1
  • risingwave_expr::scalar::like::match_text_inner (cognitive 52) src/expr/core/src/scalar/like.rs:123 — risingwave_expr::scalar::like::match_text_inner has cognitive complexity 52 (threshold 15). Drivers by points: if/else 14 (38 pts), loops 4 (8 pts), match/switch 2 (6 pts) (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WaitCheckpointTask · ×1
  • WaitCheckpointTask::run_with_on_commit_success (cognitive 50) src/connector/src/source/mod.rs:160 — WaitCheckpointTask::run_with_on_commit_success has cognitive complexity 50 (threshold 15). Drivers by points: if/else 10 (28 pts), loops 5 (12 pts), match/switch 5 (10 pts) (nesting depth added 30). Of this number, 44 points are the body's own statements and 6 belong to one function item inside it that branches. 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.
D2 · Cognitive Complexity · NestedLoopTemporalJoinExecutor · ×1
  • NestedLoopTemporalJoinExecutor::into_stream (cognitive 50) src/stream/src/executor/nested_loop_temporal_join.rs:150 — NestedLoopTemporalJoinExecutor::into_stream has cognitive complexity 50 (threshold 15). Drivers by points: if/else 9 (26 pts), loops 6 (21 pts), match/switch 1 (2 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.
D2 · Cognitive Complexity · IcebergFetchExecutor · ×1
  • IcebergFetchExecutor::into_stream (cognitive 50) src/stream/src/executor/source/iceberg_fetch_executor.rs:278 — IcebergFetchExecutor::into_stream has cognitive complexity 50 (threshold 15). Drivers by points: if/else 6 (27 pts), match/switch 5 (16 pts), loops 2 (5 pts), boolean chains 2 (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.
D2 · Cognitive Complexity · BatchPosixFsFetchExecutor · ×1
  • BatchPosixFsFetchExecutor::into_stream (cognitive 49) src/stream/src/executor/source/batch_source/batch_posix_fs_fetch.rs:234 — BatchPosixFsFetchExecutor::into_stream has cognitive complexity 49 (threshold 15). Drivers by points: if/else 6 (24 pts), match/switch 4 (15 pts), loops 2 (6 pts), boolean chains 4 (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.
D2 · Cognitive Complexity · ListValue · ×1
  • ListValue::from_str (cognitive 48) src/common/src/array/list_array.rs:747 — ListValue::from_str has cognitive complexity 48 (threshold 15). Drivers by points: if/else 19 (32 pts), match/switch 6 (10 pts), loops 5, boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IcebergCompactionManager · ×1
  • IcebergCompactionManager::apply_sink_update (cognitive 48) src/meta/src/manager/iceberg_compaction/schedule.rs:1327 — IcebergCompactionManager::apply_sink_update has cognitive complexity 48 (threshold 15). Drivers by points: if/else 21 (37 pts), boolean chains 10, 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.
D2 · Cognitive Complexity · IcebergListExecutor · ×1
  • IcebergListExecutor::into_stream (cognitive 48) src/stream/src/executor/source/iceberg_list_executor.rs:92 — IcebergListExecutor::into_stream has cognitive complexity 48 (threshold 15). Drivers by points: if/else 9 (28 pts), match/switch 5 (16 pts), loops 2 (4 pts) (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · extract.split_top_args (cognitive 48) · ×1
  • extract.split_top_args (cognitive 48) docs/metrics/extract.py:96 — extract.split_top_args has cognitive complexity 48 (threshold 15). Drivers by points: if/else 12 (31 pts), ternaries 2 (8 pts), boolean chains 5, loops 2 (4 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.
D2 · Cognitive Complexity · MonotonicityAnalyzer · ×1
  • MonotonicityAnalyzer::visit_function_call (cognitive 47) src/frontend/src/optimizer/property/monotonicity.rs:177 — MonotonicityAnalyzer::visit_function_call has cognitive complexity 47 (threshold 15). Drivers by points: match/switch 14 (30 pts), if/else 7 (13 pts), boolean chains 4 (nesting depth added 22). Of this number, 45 points are the body's own statements and 2 belong to one function item 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. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · LocalQueryExecution · ×1
  • LocalQueryExecution::convert_plan_node (cognitive 47) src/frontend/src/scheduler/local.rs:260 — LocalQueryExecution::convert_plan_node has cognitive complexity 47 (threshold 15). Drivers by points: if/else 10 (22 pts), match/switch 8 (15 pts), loops 3 (9 pts), boolean chains 1 (nesting depth added 25). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · NonOverlapSubLevelPicker · ×1
  • NonOverlapSubLevelPicker::pick_sub_level (cognitive 47) src/meta/src/hummock/compaction/picker/non_overlap_sub_level_picker.rs:159 — NonOverlapSubLevelPicker::pick_sub_level has cognitive complexity 47 (threshold 15). Drivers by points: if/else 16 (31 pts), loops 6 (11 pts), boolean chains 5 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CoordinatorWorker · ×1
  • CoordinatorWorker::run_coordination (cognitive 47) src/meta/src/manager/sink_coordination/coordinator_worker.rs:670 — CoordinatorWorker::run_coordination has cognitive complexity 47 (threshold 15). Drivers by points: if/else 8 (28 pts), match/switch 6 (15 pts), loops 2 (4 pts) (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JsonParseOptions · ×1
  • JsonParseOptions::parse (cognitive 46) src/connector/src/parser/unified/json.rs:277 — JsonParseOptions::parse has cognitive complexity 46 (threshold 15). Drivers by points: match/switch 11 (22 pts), if/else 7 (16 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 23). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · ExecutorInner · ×1
  • ExecutorInner::generate_filled_rows (cognitive 46) src/stream/src/executor/eowc/eowc_gap_fill.rs:84 — ExecutorInner::generate_filled_rows has cognitive complexity 46 (threshold 15). Drivers by points: if/else 14 (23 pts), match/switch 9 (18 pts), loops 4 (5 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · extract.find_matching_paren (cognitive 46) · ×1
  • extract.find_matching_paren (cognitive 46) docs/metrics/extract.py:43 — extract.find_matching_paren has cognitive complexity 46 (threshold 15). Drivers by points: if/else 11 (30 pts), ternaries 2 (8 pts), boolean chains 4, loops 2 (4 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.
D2 · Cognitive Complexity · ProjectSetExecutor · ×1
  • ProjectSetExecutor::do_execute (cognitive 45) src/batch/executors/src/executor/project_set.rs:58 — ProjectSetExecutor::do_execute has cognitive complexity 45 (threshold 15). Drivers by points: if/else 6 (22 pts), loops 6 (16 pts), match/switch 1 (5 pts), boolean chains 2 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SpaceReclaimCompactionPicker · ×1
  • SpaceReclaimCompactionPicker::pick_compaction (cognitive 44) src/meta/src/hummock/compaction/picker/space_reclaim_compaction_picker.rs:59 — SpaceReclaimCompactionPicker::pick_compaction has cognitive complexity 44 (threshold 15). Drivers by points: if/else 12 (34 pts), loops 4 (8 pts), boolean chains 2 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SyncLogStoreDispatchExecutor · ×1
  • SyncLogStoreDispatchExecutor::execute (cognitive 44) src/stream/src/executor/dispatch/dispatch_sync_log_store.rs:283 — SyncLogStoreDispatchExecutor::execute has cognitive complexity 44 (threshold 15). Drivers by points: if/else 9 (24 pts), match/switch 4 (12 pts), loops 3 (7 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.
D2 · Cognitive Complexity · ResultCache · ×1
  • ResultCache::consume (cognitive 44) src/utils/pgwire/src/pg_extended.rs:47 — ResultCache::consume has cognitive complexity 44 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 5 (12 pts), match/switch 3 (8 pts), boolean chains 4 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReplayWorker · ×1
  • ReplayWorker::handle_record (cognitive 42) src/storage/hummock_trace/src/replay/worker.rs:161 — ReplayWorker::handle_record has cognitive complexity 42 (threshold 15). Drivers by points: if/else 23 (37 pts), match/switch 3 (5 pts) (nesting depth added 16). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · ChangeLogExecutor · ×1
  • ChangeLogExecutor::execute_keyed (cognitive 42) src/stream/src/executor/changelog.rs:134 — ChangeLogExecutor::execute_keyed has cognitive complexity 42 (threshold 15). Drivers by points: if/else 7 (29 pts), loops 4 (11 pts), match/switch 1 (2 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LookupJoinBase · ×1
  • LookupJoinBase::do_execute (cognitive 40) src/batch/executors/src/executor/join/lookup_join_base.rs:77 — LookupJoinBase::do_execute has cognitive complexity 40 (threshold 15). Drivers by points: loops 8 (20 pts), if/else 5 (13 pts), match/switch 2 (6 pts), boolean chains 1 (nesting depth added 24). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · RedisSink · ×1
  • RedisSink::validate (cognitive 40) src/connector/src/sink/redis.rs:334 — RedisSink::validate has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 13, 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.
D2 · Cognitive Complexity · CorrelatedTopNToVectorSearchRule · ×1
  • CorrelatedTopNToVectorSearchRule::apply (cognitive 40) src/frontend/src/optimizer/rule/correlated_topn_to_vector_search.rs:42 — CorrelatedTopNToVectorSearchRule::apply has cognitive complexity 40 (threshold 15). Drivers by points: if/else 25 (32 pts), boolean chains 3, match/switch 2 (3 pts), loops 2 (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.
D2 · Cognitive Complexity · PartialGraphManagedBarrierState · ×1
  • PartialGraphManagedBarrierState::fmt (cognitive 40) src/stream/src/task/barrier_worker/managed_state.rs:114 — PartialGraphManagedBarrierState::fmt has cognitive complexity 40 (threshold 15). Drivers by points: if/else 7 (23 pts), loops 5 (15 pts), match/switch 1 (2 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.
D2 · Cognitive Complexity · PartialGraphRecoverer · ×1
  • PartialGraphRecoverer::inject_database_initial_barrier (cognitive 39) src/meta/src/barrier/rpc.rs:622 — PartialGraphRecoverer::inject_database_initial_barrier has cognitive complexity 39 (threshold 15). Drivers by points: if/else 14 (22 pts), loops 12 (16 pts), match/switch 1 (nesting depth added 12). Of this number, 38 points are the body's own statements and 1 belongs to one function item 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.
D2 · Cognitive Complexity · Expr · ×1
  • Expr::fmt (cognitive 39) src/sqlparser/src/ast/mod.rs:562 — Expr::fmt has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (22 pts), match/switch 6 (9 pts), loops 4 (8 pts) (nesting depth added 18). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · TableWatermarks · ×1
  • TableWatermarks::clear_stale_epoch_watermark (cognitive 39) src/storage/hummock_sdk/src/table_watermark.rs:571 — TableWatermarks::clear_stale_epoch_watermark has cognitive complexity 39 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 7 (18 pts), boolean chains 2, match/switch 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ColumnDeduplicater · ×1
  • ColumnDeduplicater::dedup (cognitive 39) src/stream/src/executor/aggregate/distinct.rs:67 — ColumnDeduplicater::dedup has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (29 pts), loops 4 (8 pts), 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.
D2 · Cognitive Complexity · BatchAdbcSnowflakeFetchExecutor · ×1
  • BatchAdbcSnowflakeFetchExecutor::into_stream (cognitive 39) src/stream/src/executor/source/batch_source/batch_adbc_snowflake_fetch.rs:75 — BatchAdbcSnowflakeFetchExecutor::into_stream has cognitive complexity 39 (threshold 15). Drivers by points: if/else 4 (19 pts), match/switch 4 (15 pts), boolean chains 4, loops 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IcebergConnection · ×1
  • IcebergConnection::validate_connection (cognitive 38) src/connector/src/connector_common/connection.rs:179 — IcebergConnection::validate_connection has cognitive complexity 38 (threshold 15). Drivers by points: if/else 23 (32 pts), boolean chains 3, match/switch 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KinesisSinkPayloadWriter · ×1
  • KinesisSinkPayloadWriter::finish (cognitive 38) src/connector/src/sink/kinesis.rs:233 — KinesisSinkPayloadWriter::finish has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (32 pts), loops 2 (3 pts), match/switch 1 (2 pts), boolean chains 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.
D2 · Cognitive Complexity · DeltaJoinSolver · ×1
  • DeltaJoinSolver::find_lookup_path (cognitive 38) src/frontend/src/optimizer/delta_join_solver.rs:295 — DeltaJoinSolver::find_lookup_path has cognitive complexity 38 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 8 (16 pts), boolean chains 2 (nesting depth added 20). Of this number, 33 points are the body's own statements and 5 belong to one function item 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.
D2 · Cognitive Complexity · InflightDatabaseInfo · ×1
  • InflightDatabaseInfo::apply_collected_command (cognitive 38) src/meta/src/barrier/info.rs:612 — InflightDatabaseInfo::apply_collected_command has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (28 pts), loops 4 (5 pts), match/switch 2 (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.
D2 · Cognitive Complexity · CursorWithDelta · ×1
  • CursorWithDelta::move_impl (cognitive 38) src/utils/delta_btree_map/src/lib.rs:181 — CursorWithDelta::move_impl has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (28 pts), match/switch 3 (9 pts), 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.
D2 · Cognitive Complexity · TableFunction · ×1
  • TableFunction::new_file_scan (cognitive 37) src/frontend/src/expr/table_function.rs:87 — TableFunction::new_file_scan has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (17 pts), match/switch 6 (11 pts), boolean chains 5, loops 3 (4 pts) (nesting depth added 10). 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.
D2 · Cognitive Complexity · FrontendObserverNode · ×1
  • FrontendObserverNode::handle_catalog_notification (cognitive 37) src/frontend/src/observer/observer_manager.rs:251 — FrontendObserverNode::handle_catalog_notification has cognitive complexity 37 (threshold 15). Drivers by points: match/switch 18 (24 pts), if/else 4 (11 pts), loops 1 (2 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.
D2 · Cognitive Complexity · BeMessage · ×1
  • BeMessage::write (cognitive 37) src/utils/pgwire/src/pg_message.rs:496 — BeMessage::write has cognitive complexity 37 (threshold 15). Drivers by points: match/switch 7 (14 pts), loops 6 (13 pts), if/else 5 (10 pts) (nesting depth added 19). Of this number, 30 points are the body's own statements and 7 belong to one function item inside it that branches. 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.
D2 · Cognitive Complexity · fragment_graph.Streaming (cognitive 37) · ×1
  • fragment_graph.Streaming (cognitive 37) dashboard/pages/fragment_graph.tsx:227 — fragment_graph.Streaming has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 5 (12 pts), boolean chains 5 (nesting depth added 16). Most of this is not in the body itself: 5 of the 37 points are its own statements and the rest belongs to 7 function items inside it that branch (handleSearchFragment, handleSearchActor, a function literal at line 262, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · AvroParseOptionsInner · ×1
  • AvroParseOptionsInner::convert_to_datum (cognitive 36) src/connector/codec/src/decoder/avro/mod.rs:88 — AvroParseOptionsInner::convert_to_datum has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (23 pts), match/switch 4 (7 pts), loops 3 (6 pts) (nesting depth added 17). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · PostCollectCommand · ×1
  • PostCollectCommand::post_collect (cognitive 36) src/meta/src/barrier/context/context_impl.rs:636 — PostCollectCommand::post_collect has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 3 (8 pts), match/switch 3 (5 pts), boolean chains 3 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Matches · ×1
  • Matches::try_match (cognitive 36) src/meta/src/stream/stream_graph/state_match.rs:240 — Matches::try_match has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (26 pts), loops 4 (7 pts), boolean chains 3 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BatchPosixFsListExecutor · ×1
  • BatchPosixFsListExecutor::into_stream (cognitive 35) src/stream/src/executor/source/batch_source/batch_posix_fs_list.rs:207 — BatchPosixFsListExecutor::into_stream has cognitive complexity 35 (threshold 15). Drivers by points: match/switch 5 (22 pts), if/else 3 (11 pts), boolean chains 1, loops 1 (nesting depth added 25). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · ManagedTopNState · ×1
  • ManagedTopNState::init_topn_cache_inner (cognitive 35) src/stream/src/executor/top_n/top_n_state.rs:201 — ManagedTopNState::init_topn_cache_inner has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 5 (10 pts), boolean chains 3 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · extract.scan_direct_constructions (cognitive 35) · ×1
  • extract.scan_direct_constructions (cognitive 35) docs/metrics/extract.py:533 — extract.scan_direct_constructions has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (30 pts), loops 3, boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FormatError · ×1
  • FormatError::check_expr (cognitive 34) lints/src/format_error.rs:104 — FormatError::check_expr has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (25 pts), boolean chains 5, loops 2 (4 pts) (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ParquetParser · ×1
  • ParquetParser::convert_record_batch_to_stream_chunk (cognitive 34) src/connector/src/parser/parquet_parser.rs:105 — ParquetParser::convert_record_batch_to_stream_chunk has cognitive complexity 34 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 2 (7 pts), match/switch 2 (7 pts), boolean chains 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.
D2 · Cognitive Complexity · SessionTimezone · ×1
  • SessionTimezone::with_timezone (cognitive 34) src/frontend/src/expr/session_timezone.rs:76 — SessionTimezone::with_timezone has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 9, match/switch 3 (6 pts), loops 1 (2 pts) (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.
D2 · Cognitive Complexity · ActiveStreamingWorkerNodes · ×1
  • ActiveStreamingWorkerNodes::changed (cognitive 34) src/meta/src/manager/metadata.rs:116 — ActiveStreamingWorkerNodes::changed has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (30 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 20). Of this number, 33 points are the body's own statements and 1 belongs to one function item 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.
D2 · Cognitive Complexity · extract.unescape_rust_string (cognitive 34) · ×1
  • extract.unescape_rust_string (cognitive 34) docs/metrics/extract.py:168 — extract.unescape_rust_string has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (27 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RemoteLogSinker · ×1
  • RemoteLogSinker::consume_log_and_sink (cognitive 33) src/connector/src/sink/remote.rs:328 — RemoteLogSinker::consume_log_and_sink has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (19 pts), match/switch 4 (10 pts), loops 3, boolean chains 1 (nesting depth added 18). Of this number, 29 points are the body's own statements and 4 belong to one function item 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.
D2 · Cognitive Complexity · NavExtractor · ×1
  • NavExtractor::rewrite (cognitive 33) src/frontend/src/binder/relation/match_recognize.rs:1217 — NavExtractor::rewrite has cognitive complexity 33 (threshold 15). Drivers by points: loops 11 (23 pts), if/else 3 (5 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 16). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · ControlStreamManager · ×1
  • ControlStreamManager::poll_next_event (cognitive 33) src/meta/src/barrier/rpc.rs:433 — ControlStreamManager::poll_next_event has cognitive complexity 33 (threshold 15). Drivers by points: if/else 6 (18 pts), match/switch 5 (13 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.
D2 · Cognitive Complexity · CompleteStreamFragmentGraph · ×1
  • CompleteStreamFragmentGraph::build_helper (cognitive 33) src/meta/src/stream/stream_graph/fragment.rs:1782 — CompleteStreamFragmentGraph::build_helper has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 3 (11 pts), loops 3 (7 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.
D2 · Cognitive Complexity · LookupExecutor · ×1
  • LookupExecutor::execute_inner (cognitive 33) src/stream/src/executor/lookup/impl_.rs:226 — LookupExecutor::execute_inner has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 5 (14 pts), match/switch 1 (2 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.
D2 · Cognitive Complexity · Nfa · ×1
  • Nfa::walk (cognitive 33) src/stream/src/executor/match_recognize/nfa.rs:1072 — Nfa::walk has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (27 pts), match/switch 2 (5 pts), 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.
D2 · Cognitive Complexity · SyncedKvLogStoreExecutor · ×1
  • SyncedKvLogStoreExecutor::execute_inner (cognitive 33) src/stream/src/executor/sync_kv_log_store.rs:755 — SyncedKvLogStoreExecutor::execute_inner has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (20 pts), match/switch 3 (9 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · doc_issue_tracker.find_tracking_issues (cognitive 33) · ×1
  • doc_issue_tracker.find_tracking_issues (cognitive 33) .github/scripts/doc_issue_tracker.py:242 — doc_issue_tracker.find_tracking_issues has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 5 (9 pts), boolean chains 4, error handling 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConnectorSourceWorker · ×1
  • ConnectorSourceWorker::run (cognitive 32) src/meta/src/stream/source_manager/worker.rs:383 — ConnectorSourceWorker::run has cognitive complexity 32 (threshold 15). Drivers by points: if/else 6 (24 pts), match/switch 2 (6 pts), boolean chains 1, 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.
D2 · Cognitive Complexity · EowcGapFillExecutor · ×1
  • EowcGapFillExecutor::execute_inner (cognitive 32) src/stream/src/executor/eowc/eowc_gap_fill.rs:348 — EowcGapFillExecutor::execute_inner has cognitive complexity 32 (threshold 15). Drivers by points: if/else 6 (21 pts), loops 3 (9 pts), match/switch 1 (2 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LookupUnionExecutor · ×1
  • LookupUnionExecutor::execute_inner (cognitive 32) src/stream/src/executor/lookup_union.rs:56 — LookupUnionExecutor::execute_inner has cognitive complexity 32 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 5 (9 pts), match/switch 2 (8 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.
D2 · Cognitive Complexity · PullUpHopRule · ×1
  • PullUpHopRule::apply (cognitive 31) src/frontend/src/optimizer/rule/pull_up_hop_rule.rs:25 — PullUpHopRule::apply has cognitive complexity 31 (threshold 15). Drivers by points: if/else 20 (22 pts), boolean chains 9 (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.
D2 · Cognitive Complexity · Scheduler · ×1
  • Scheduler::schedule (cognitive 31) src/meta/src/stream/stream_graph/schedule.rs:164 — Scheduler::schedule has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (17 pts), match/switch 4 (9 pts), loops 5 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BufferChunks · ×1
  • BufferChunks::poll_next (cognitive 31) src/stream/src/executor/merge.rs:441 — BufferChunks::poll_next has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 2 (5 pts), match/switch 1 (2 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.
D2 · Cognitive Complexity · DynamicReceivers · ×1
  • DynamicReceivers::poll_next (cognitive 31) src/stream/src/executor/mod.rs:1587 — DynamicReceivers::poll_next has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (25 pts), match/switch 2 (5 pts), 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.
D2 · Cognitive Complexity · BatchIcebergListExecutor · ×1
  • BatchIcebergListExecutor::into_stream (cognitive 31) src/stream/src/executor/source/batch_source/batch_iceberg_list.rs:74 — BatchIcebergListExecutor::into_stream has cognitive complexity 31 (threshold 15). Drivers by points: match/switch 4 (15 pts), if/else 4 (14 pts), boolean chains 1, loops 1 (nesting depth added 21). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · JDBCSink.write (cognitive 31) · ×1
  • JDBCSink.write (cognitive 31) java/connector-node/risingwave-sink-jdbc/src/main/java/com/risingwave/connector/JDBCSink.java:148 — JDBCSink.write has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (23 pts), error handling 2 (5 pts), loops 2 (3 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.
D2 · Cognitive Complexity · ClickHouseFieldWithNull · ×1
  • ClickHouseFieldWithNull::from_scalar_ref (cognitive 30) src/connector/src/sink/clickhouse.rs:968 — ClickHouseFieldWithNull::from_scalar_ref has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (22 pts), loops 2 (4 pts), match/switch 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.
D2 · Cognitive Complexity · IcebergConfig · ×1
  • IcebergConfig::from_btreemap (cognitive 30) src/connector/src/sink/iceberg/config.rs:605 — IcebergConfig::from_btreemap has cognitive complexity 30 (threshold 15). Drivers by points: if/else 22 (25 pts), boolean chains 5 (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.
D2 · Cognitive Complexity · IcebergIntermediateScanRule · ×1
  • IcebergIntermediateScanRule::apply (cognitive 30) src/frontend/src/optimizer/rule/iceberg_intermediate_scan_rule.rs:60 — IcebergIntermediateScanRule::apply has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (18 pts), match/switch 3 (6 pts), loops 2 (4 pts), boolean chains 2 (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.
D2 · Cognitive Complexity · FilterArithmeticRewriter · ×1
  • FilterArithmeticRewriter::simplify_arithmetic_comparison (cognitive 30) src/frontend/src/optimizer/rule/over_window_to_topn_rule.rs:226 — FilterArithmeticRewriter::simplify_arithmetic_comparison has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (22 pts), match/switch 2 (5 pts), boolean chains 3 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · LevelCompactionPicker · ×1
  • LevelCompactionPicker::pick_multi_level_to_base (cognitive 30) src/meta/src/hummock/compaction/picker/base_level_compaction_picker.rs:159 — LevelCompactionPicker::pick_multi_level_to_base has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 5 (9 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.
D2 · Cognitive Complexity · MinOverlappingPicker · ×1
  • MinOverlappingPicker::pick_tables (cognitive 30) src/meta/src/hummock/compaction/picker/min_overlap_compaction_picker.rs:50 — MinOverlappingPicker::pick_tables has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 6 (11 pts), boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SqlBackendElectionClient · ×1
  • SqlBackendElectionClient::run_once (cognitive 30) src/meta/src/rpc/election/sql.rs:651 — SqlBackendElectionClient::run_once has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (23 pts), match/switch 2 (4 pts), loops 2, boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SstableStore · ×1
  • SstableStore::prefetch_blocks (cognitive 30) src/storage/src/hummock/sstable_store.rs:341 — SstableStore::prefetch_blocks has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 3, loops 2 (3 pts), match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HummockReadVersion · ×1
  • HummockReadVersion::update (cognitive 30) src/storage/src/hummock/store/version.rs:371 — HummockReadVersion::update has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (24 pts), match/switch 2 (4 pts), loops 1 (2 pts) (nesting depth added 16). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · pgwire · ×1
  • pgwire::pg_protocol::parse_options (cognitive 30) src/utils/pgwire/src/pg_protocol.rs:1632 — pgwire::pg_protocol::parse_options has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (28 pts), loops 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PullUpCorrelatedPredicateAggRule · ×1
  • PullUpCorrelatedPredicateAggRule::apply (cognitive 29) src/frontend/src/optimizer/rule/pull_up_correlated_predicate_agg_rule.rs:65 — PullUpCorrelatedPredicateAggRule::apply has cognitive complexity 29 (threshold 15). Drivers by points: if/else 20 (24 pts), loops 3, boolean chains 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.
D2 · Cognitive Complexity · BatchTableInnerIterInner · ×1
  • BatchTableInnerIterInner::into_stream (cognitive 29) src/storage/src/table/batch_table/mod.rs:1383 — BatchTableInnerIterInner::into_stream has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (8 pts), match/switch 3 (8 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.
D2 · Cognitive Complexity · LocalApproxPercentileExecutor · ×1
  • LocalApproxPercentileExecutor::execute_inner (cognitive 29) src/stream/src/executor/approx_percentile/local.rs:49 — LocalApproxPercentileExecutor::execute_inner has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 4 (9 pts), loops 3 (7 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.
D2 · Cognitive Complexity · IncrementalMatcher · ×1
  • IncrementalMatcher::rescan (cognitive 29) src/stream/src/executor/match_recognize/incremental.rs:425 — IncrementalMatcher::rescan has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 4 (6 pts), boolean chains 4 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ScanRange · ×1
  • ScanRange::range_overlap_check (cognitive 28) src/common/src/util/scan_range.rs:139 — ScanRange::range_overlap_check has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (19 pts), match/switch 5 (6 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.
D2 · Cognitive Complexity · TombstoneReclaimCompactionPicker · ×1
  • TombstoneReclaimCompactionPicker::pick_compaction (cognitive 28) src/meta/src/hummock/compaction/picker/tombstone_reclaim_compaction_picker.rs:47 — TombstoneReclaimCompactionPicker::pick_compaction has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BuildingFragment · ×1
  • BuildingFragment::fill_job (cognitive 28) src/meta/src/stream/stream_graph/fragment.rs:140 — BuildingFragment::fill_job has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (23 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 16). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · S3ObjectStore · ×1
  • S3ObjectStore::configure_bucket_lifecycle (cognitive 28) src/object_store/src/object/s3.rs:849 — S3ObjectStore::configure_bucket_lifecycle has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (20 pts), match/switch 1 (4 pts), boolean chains 2, loops 1 (2 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.
D2 · Cognitive Complexity · risedev_config · ×1
  • risedev_config::main (cognitive 28) src/risedevtool/config/src/main.rs:338 — risedev_config::main has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (16 pts), match/switch 4 (7 pts), loops 3 (4 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.
D2 · Cognitive Complexity · TableWatermarksIndex · ×1
  • TableWatermarksIndex::filter_regress_watermarks (cognitive 28) src/storage/hummock_sdk/src/table_watermark.rs:181 — TableWatermarksIndex::filter_regress_watermarks has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (18 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.
D2 · Cognitive Complexity · BatchTableInner · ×1
  • BatchTableInner::get_row (cognitive 28) src/storage/src/table/batch_table/mod.rs:569 — BatchTableInner::get_row has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (7 pts), match/switch 3 (6 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.
D2 · Cognitive Complexity · BatchAdbcSnowflakeListExecutor · ×1
  • BatchAdbcSnowflakeListExecutor::into_stream (cognitive 28) src/stream/src/executor/source/batch_source/batch_adbc_snowflake_list.rs:91 — BatchAdbcSnowflakeListExecutor::into_stream has cognitive complexity 28 (threshold 15). Drivers by points: match/switch 4 (15 pts), if/else 3 (11 pts), boolean chains 1, loops 1 (nesting depth added 19). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · Decimal · ×1
  • Decimal::checked_powd (cognitive 27) src/common/src/types/decimal.rs:657 — Decimal::checked_powd has cognitive complexity 27 (threshold 15). Drivers by points: match/switch 10 (21 pts), if/else 2 (4 pts), boolean chains 2 (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.
D2 · Cognitive Complexity · SnowflakeV2Config · ×1
  • SnowflakeV2Config::from_btreemap (cognitive 27) src/connector/src/sink/snowflake_redshift/snowflake.rs:230 — SnowflakeV2Config::from_btreemap has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 7, 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.
D2 · Cognitive Complexity · ClusterControllerInner · ×1
  • ClusterControllerInner::add_worker (cognitive 27) src/meta/src/controller/cluster.rs:613 — ClusterControllerInner::add_worker has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (20 pts), match/switch 2 (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.
D2 · Cognitive Complexity · IntraCompactionPicker · ×1
  • IntraCompactionPicker::pick_l0_intra (cognitive 27) src/meta/src/hummock/compaction/picker/intra_compaction_picker.rs:127 — IntraCompactionPicker::pick_l0_intra has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 4 (7 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.
D2 · Cognitive Complexity · CompactionEventLoop · ×1
  • CompactionEventLoop::run (cognitive 27) src/meta/src/hummock/manager/compaction/compaction_event_loop.rs:432 — CompactionEventLoop::run has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (21 pts), match/switch 2 (5 pts), 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.
D2 · Cognitive Complexity · BackwardUserIterator · ×1
  • BackwardUserIterator::next (cognitive 27) src/storage/src/hummock/iterator/backward_user.rs:109 — BackwardUserIterator::next has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (22 pts), match/switch 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · BatchOpendalFsListExecutor · ×1
  • BatchOpendalFsListExecutor::into_stream (cognitive 27) src/stream/src/executor/source/batch_source/batch_opendal_fs_list.rs:163 — BatchOpendalFsListExecutor::into_stream has cognitive complexity 27 (threshold 15). Drivers by points: match/switch 4 (15 pts), if/else 2 (10 pts), boolean chains 1, loops 1 (nesting depth added 19). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · SourceExecutorBuilder · ×1
  • SourceExecutorBuilder::new_boxed_executor (cognitive 27) src/stream/src/from_proto/source/trad_source.rs:139 — SourceExecutorBuilder::new_boxed_executor has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17 (24 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BinlogHistoryRecordComparator.isPositionAtOrBefore (cognitive 27) · ×1
  • BinlogHistoryRecordComparator.isPositionAtOrBefore (cognitive 27) java/connector-node/risingwave-source-cdc/src/main/java/io/debezium/connector/binlog/history/BinlogHistoryRecordComparator.java:77 — BinlogHistoryRecordComparator.isPositionAtOrBefore has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (25 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.
D2 · Cognitive Complexity · RelationGraph.RelationGraph (cognitive 27) · ×1
  • RelationGraph.RelationGraph (cognitive 27) dashboard/components/RelationGraph.tsx:73 — RelationGraph.RelationGraph has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (16 pts), ternaries 8, boolean chains 3 (nesting depth added 3). None of this is in the body itself: all 27 points belong to 10 function literals inside it that branch (lines 283, 255, 175, …). 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.
D2 · Cognitive Complexity · BatchTaskExecution · ×1
  • BatchTaskExecution::run (cognitive 26) src/batch/src/task/task_execution.rs:517 — BatchTaskExecution::run has cognitive complexity 26 (threshold 15). Drivers by points: match/switch 6 (19 pts), if/else 3 (6 pts), loops 1 (nesting depth added 16). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · KafkaConnectionProps · ×1
  • KafkaConnectionProps::set_security_properties (cognitive 26) src/connector/src/connector_common/common.rs:518 — KafkaConnectionProps::set_security_properties has cognitive complexity 26 (threshold 15). Drivers by points: if/else 26. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · LogicalOptimizer · ×1
  • LogicalOptimizer::register_batch_mview_candidates (cognitive 26) src/frontend/src/optimizer/logical_optimization.rs:980 — LogicalOptimizer::register_batch_mview_candidates has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (22 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.
D2 · Cognitive Complexity · GlobalBarrierWorkerContextImpl · ×1
  • GlobalBarrierWorkerContextImpl::resolve_hummock_version_epochs (cognitive 26) src/meta/src/barrier/context/recovery.rs:783 — GlobalBarrierWorkerContextImpl::resolve_hummock_version_epochs has cognitive complexity 26 (threshold 15). Drivers by points: if/else 4 (10 pts), match/switch 3 (10 pts), loops 3 (5 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.
D2 · Cognitive Complexity · CompactorRunner · ×1
  • CompactorRunner::merge_inputs (cognitive 26) src/storage/src/hummock/compactor/fast_compactor_runner.rs:462 — CompactorRunner::merge_inputs has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PgCompositeToStringConverter.parsePgTextArray (cognitive 26) · ×1
  • PgCompositeToStringConverter.parsePgTextArray (cognitive 26) java/connector-node/risingwave-source-cdc/src/main/java/com/risingwave/connector/cdc/debezium/converters/PgCompositeToStringConverter.java:182 — PgCompositeToStringConverter.parsePgTextArray has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (7 pts), boolean chains 5, ternaries 1 (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.
D2 · Cognitive Complexity · SqlServerValidator.validateTableSchema (cognitive 26) · ×1
  • SqlServerValidator.validateTableSchema (cognitive 26) java/connector-node/risingwave-connector-service/src/main/java/com/risingwave/connector/source/common/SqlServerValidator.java:182 — SqlServerValidator.validateTableSchema has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 6, ternaries 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.
D2 · Cognitive Complexity · extract.validate_actor_id_relabeling (cognitive 26) · ×1
  • extract.validate_actor_id_relabeling (cognitive 26) docs/metrics/extract.py:666 — extract.validate_actor_id_relabeling has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 2 (4 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StackTraceResponseOutput · ×1
  • StackTraceResponseOutput::fmt (cognitive 25) src/common/src/util/prost.rs:44 — StackTraceResponseOutput::fmt has cognitive complexity 25 (threshold 15). Drivers by points: loops 9 (17 pts), if/else 8 (nesting depth added 8). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · BooleanConstantFolding · ×1
  • BooleanConstantFolding::rewrite_function_call (cognitive 25) src/frontend/src/expr/utils.rs:172 — BooleanConstantFolding::rewrite_function_call has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (24 pts), match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Join · ×1
  • Join::stream_key (cognitive 25) src/frontend/src/optimizer/plan_node/generic/join.rs:305 — Join::stream_key has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (18 pts), boolean chains 4, 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.
D2 · Cognitive Complexity · BatchPlanFragmenter · ×1
  • BatchPlanFragmenter::new_stage (cognitive 25) src/frontend/src/scheduler/plan_fragmenter.rs:1027 — BatchPlanFragmenter::new_stage has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16 (23 pts), boolean chains 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.
D2 · Cognitive Complexity · WholeLevelCompactionPicker · ×1
  • WholeLevelCompactionPicker::pick_whole_level (cognitive 25) src/meta/src/hummock/compaction/picker/intra_compaction_picker.rs:339 — WholeLevelCompactionPicker::pick_whole_level has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 4, 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.
D2 · Cognitive Complexity · HummockCompactorDedicatedEventLoop · ×1
  • HummockCompactorDedicatedEventLoop::compact_task_dedicated_event_handler (cognitive 25) src/meta/src/hummock/manager/compaction/compaction_event_loop.rs:595 — HummockCompactorDedicatedEventLoop::compact_task_dedicated_event_handler has cognitive complexity 25 (threshold 15). Drivers by points: if/else 4 (15 pts), match/switch 3 (6 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.
D2 · Cognitive Complexity · IcebergPkIndexSinkCoordinator · ×1
  • IcebergPkIndexSinkCoordinator::resolve_compaction_overwrite_files (cognitive 25) src/meta/src/manager/iceberg_pk_index_sink/coordinator.rs:381 — IcebergPkIndexSinkCoordinator::resolve_compaction_overwrite_files has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DollarExpander · ×1
  • DollarExpander::visit (cognitive 25) src/risedevtool/src/config/dollar_expander.rs:43 — DollarExpander::visit has cognitive complexity 25 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 3 (8 pts), match/switch 2 (6 pts) (nesting depth added 16). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · TableFactor · ×1
  • TableFactor::fmt (cognitive 25) src/sqlparser/src/ast/query.rs:706 — TableFactor::fmt has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (24 pts), match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CompactTaskExecutor · ×1
  • CompactTaskExecutor::run (cognitive 25) src/storage/src/hummock/compactor/fast_compactor_runner.rs:698 — CompactTaskExecutor::run has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 7, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LocalHummockStorage · ×1
  • LocalHummockStorage::flush (cognitive 25) src/storage/src/hummock/store/local_hummock_storage.rs:431 — LocalHummockStorage::flush has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (22 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.
D2 · Cognitive Complexity · TroublemakerExecutor · ×1
  • TroublemakerExecutor::execute_inner (cognitive 25) src/stream/src/executor/troublemaker.rs:55 — TroublemakerExecutor::execute_inner has cognitive complexity 25 (threshold 15). Drivers by points: if/else 3 (12 pts), loops 4 (9 pts), match/switch 2 (4 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.
D2 · Cognitive Complexity · UpdateExecutor · ×1
  • UpdateExecutor::do_execute (cognitive 24) src/batch/executors/src/executor/update.rs:117 — UpdateExecutor::do_execute has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 4 (7 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.
D2 · Cognitive Complexity · DataChunk · ×1
  • DataChunk::serialize (cognitive 24) src/common/src/array/data_chunk.rs:533 — DataChunk::serialize has cognitive complexity 24 (threshold 15). Drivers by points: loops 6 (14 pts), if/else 5 (10 pts) (nesting depth added 13). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · ApproxPercentile · ×1
  • ApproxPercentile::add_datum (cognitive 24) src/expr/impl/src/aggregate/approx_percentile.rs:84 — ApproxPercentile::add_datum has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (22 pts), match/switch 1 (2 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.
D2 · Cognitive Complexity · SessionWindow · ×1
  • SessionWindow::recalculate_left_right (cognitive 24) src/expr/impl/src/window_function/buffer.rs:529 — SessionWindow::recalculate_left_right has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (23 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.
D2 · Cognitive Complexity · IcebergScanInner · ×1
  • IcebergScanInner::execute_inner (cognitive 24) src/frontend/src/datafusion/iceberg_executor.rs:244 — IcebergScanInner::execute_inner has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 2 (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.
D2 · Cognitive Complexity · LogicalProject · ×1
  • LogicalProject::to_stream_with_dist_required (cognitive 24) src/frontend/src/optimizer/plan_node/logical_project.rs:239 — LogicalProject::to_stream_with_dist_required has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (17 pts), match/switch 3 (6 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.
D2 · Cognitive Complexity · QueryRewriter · ×1
  • QueryRewriter::visit_set_expr (cognitive 24) src/meta/src/controller/rename.rs:241 — QueryRewriter::visit_set_expr has cognitive complexity 24 (threshold 15). Drivers by points: loops 7 (17 pts), if/else 3 (6 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.
D2 · Cognitive Complexity · SstableBuilder · ×1
  • SstableBuilder::add_impl (cognitive 24) src/storage/src/hummock/sstable/builder.rs:351 — SstableBuilder::add_impl has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 7, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CapacitySplitTableBuilder · ×1
  • CapacitySplitTableBuilder::check_switch_builder (cognitive 24) src/storage/src/hummock/sstable/multi_builder.rs:244 — CapacitySplitTableBuilder::check_switch_builder has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HummockStorageReadSnapshot · ×1
  • HummockStorageReadSnapshot::build_read_version_tuple_from_all (cognitive 24) src/storage/src/hummock/store/hummock_storage.rs:474 — HummockStorageReadSnapshot::build_read_version_tuple_from_all has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (22 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.
D2 · Cognitive Complexity · DbzChangeEventConsumer.handleBatch (cognitive 24) · ×1
  • DbzChangeEventConsumer.handleBatch (cognitive 24) java/connector-node/risingwave-connector-service/src/main/java/com/risingwave/connector/source/core/DbzChangeEventConsumer.java:163 — DbzChangeEventConsumer.handleBatch has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 2 (6 pts), error handling 1 (2 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.
D2 · Cognitive Complexity · SourceStreamChunkRowWriter · ×1
  • SourceStreamChunkRowWriter::do_action (cognitive 23) src/connector/src/parser/chunk_builder.rs:272 — SourceStreamChunkRowWriter::do_action has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 5 (8 pts), loops 2 (4 pts), boolean chains 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.
D2 · Cognitive Complexity · Unit · ×1
  • Unit::from_str (cognitive 23) src/expr/impl/src/scalar/extract.rs:263 — Unit::from_str has cognitive complexity 23 (threshold 15). Drivers by points: if/else 23. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · MetricsReaderImpl · ×1
  • MetricsReaderImpl::get_channel_delta_stats (cognitive 23) src/frontend/src/metrics_reader.rs:47 — MetricsReaderImpl::get_channel_delta_stats has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HummockCompactionEventHandler · ×1
  • HummockCompactionEventHandler::try_dispatch_tasks (cognitive 23) src/meta/src/hummock/manager/compaction/compaction_event_loop.rs:300 — HummockCompactionEventHandler::try_dispatch_tasks has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (5 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IdExpander · ×1
  • IdExpander::visit (cognitive 23) src/risedevtool/src/config/id_expander.rs:52 — IdExpander::visit has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 2 (7 pts), 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.
D2 · Cognitive Complexity · KvLogStoreReader · ×1
  • KvLogStoreReader::next_item (cognitive 23) src/stream/src/common/log_store_impl/kv_log_store/reader.rs:354 — KvLogStoreReader::next_item has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 4 (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.
D2 · Cognitive Complexity · AppendOnlyDedupExecutor · ×1
  • AppendOnlyDedupExecutor::executor_inner (cognitive 23) src/stream/src/executor/dedup/append_only_dedup.rs:59 — AppendOnlyDedupExecutor::executor_inner has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (12 pts), match/switch 2 (6 pts), loops 2 (4 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.
D2 · Cognitive Complexity · ConsumerFuture · ×1
  • ConsumerFuture::next_event (cognitive 23) src/stream/src/executor/dispatch/dispatch_sync_log_store.rs:212 — ConsumerFuture::next_event has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (20 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StreamChunkDeserializer.buildValueGetter (cognitive 23) · ×1
  • StreamChunkDeserializer.buildValueGetter (cognitive 23) java/connector-node/risingwave-connector-service/src/main/java/com/risingwave/connector/deserializer/StreamChunkDeserializer.java:44 — StreamChunkDeserializer.buildValueGetter has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16, match/switch 3 (6 pts), loops 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · RowSeqScanExecutor · ×1
  • RowSeqScanExecutor::do_execute (cognitive 22) src/batch/executors/src/executor/row_seq_scan.rs:160 — RowSeqScanExecutor::do_execute has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 5, loops 3 (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.
D2 · Cognitive Complexity · IcebergSplitEnumerator · ×1
  • IcebergSplitEnumerator::list_scan_tasks_inner (cognitive 22) src/connector/src/source/iceberg/mod.rs:359 — IcebergSplitEnumerator::list_scan_tasks_inner has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (15 pts), match/switch 2 (4 pts), loops 2 (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.
D2 · Cognitive Complexity · LogicalAgg · ×1
  • LogicalAgg::to_stream_with_stream_input (cognitive 22) src/frontend/src/optimizer/plan_node/logical_agg.rs:1518 — LogicalAgg::to_stream_with_stream_input has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16 (22 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.
D2 · Cognitive Complexity · LogicalChangeLog · ×1
  • LogicalChangeLog::prune_col (cognitive 22) src/frontend/src/optimizer/plan_node/logical_changelog.rs:120 — LogicalChangeLog::prune_col has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (18 pts), loops 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.
D2 · Cognitive Complexity · LogicalVectorSearch · ×1
  • LogicalVectorSearch::resolve_vector_index_lookup (cognitive 22) src/frontend/src/optimizer/plan_node/logical_vector_search.rs:364 — LogicalVectorSearch::resolve_vector_index_lookup has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (5 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.
D2 · Cognitive Complexity · TrivialMovePicker · ×1
  • TrivialMovePicker::pick_multi_trivial_move_ssts (cognitive 22) src/meta/src/hummock/compaction/picker/trivial_move_compaction_picker.rs:53 — TrivialMovePicker::pick_multi_trivial_move_ssts has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (21 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.
D2 · Cognitive Complexity · ManualCompactionSelector · ×1
  • ManualCompactionSelector::pick_compaction (cognitive 22) src/meta/src/hummock/compaction/selector/manual_selector.rs:93 — ManualCompactionSelector::pick_compaction has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 4 (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.
D2 · Cognitive Complexity · risingwave_object_store · ×1
  • risingwave_object_store::object::s3::set_error_should_retry (cognitive 22) src/object_store/src/object/s3.rs:1070 — risingwave_object_store::object::s3::set_error_should_retry has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 3 (6 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BackfillExecutor · ×1
  • BackfillExecutor::execute_inner (cognitive 22) src/stream/src/executor/backfill/no_shuffle_backfill.rs:98 — BackfillExecutor::execute_inner has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FilterExecutorInner · ×1
  • FilterExecutorInner::filter (cognitive 22) src/stream/src/executor/filter.rs:58 — FilterExecutorInner::filter has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 3 (10 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.
D2 · Cognitive Complexity · BatchIcebergFetchExecutor · ×1
  • BatchIcebergFetchExecutor::into_stream (cognitive 22) src/stream/src/executor/source/batch_source/batch_iceberg_fetch.rs:242 — BatchIcebergFetchExecutor::into_stream has cognitive complexity 22 (threshold 15). Drivers by points: if/else 3 (11 pts), match/switch 3 (6 pts), loops 2 (4 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.
D2 · Cognitive Complexity · FsListExecutor · ×1
  • FsListExecutor::into_stream (cognitive 22) src/stream/src/executor/source/fs_list_executor.rs:105 — FsListExecutor::into_stream has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 4 (15 pts), if/else 2 (6 pts), loops 1 (nesting depth added 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · ValuesExecutor · ×1
  • ValuesExecutor::execute_inner (cognitive 22) src/stream/src/executor/values.rs:59 — ValuesExecutor::execute_inner has cognitive complexity 22 (threshold 15). Drivers by points: loops 5 (13 pts), if/else 4 (9 pts) (nesting depth added 13). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · OracleValidator.tryInitializeHeartbeatTable (cognitive 22) · ×1
  • OracleValidator.tryInitializeHeartbeatTable (cognitive 22) java/connector-node/risingwave-connector-service/src/main/java/com/risingwave/connector/source/common/OracleValidator.java:334 — OracleValidator.tryInitializeHeartbeatTable has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (14 pts), error handling 3 (8 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.
D2 · Cognitive Complexity · extract.main (cognitive 22) · ×1
  • extract.main (cognitive 22) docs/metrics/extract.py:719 — extract.main has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 8 (9 pts), boolean chains 1, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LimitExecutor · ×1
  • LimitExecutor::do_execute (cognitive 21) src/batch/executors/src/executor/limit.rs:64 — LimitExecutor::do_execute has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 2 (4 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.
D2 · Cognitive Complexity · TopNHeap · ×1
  • TopNHeap::push (cognitive 21) src/batch/executors/src/executor/top_n.rs:157 — TopNHeap::push has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 1 (4 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SpecificParserConfig · ×1
  • SpecificParserConfig::new (cognitive 21) src/connector/src/parser/config.rs:125 — SpecificParserConfig::new has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (19 pts), match/switch 2 (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.
D2 · Cognitive Complexity · DecoupleCheckpointLogSinkerOf · ×1
  • DecoupleCheckpointLogSinkerOf::consume_log_and_sink (cognitive 21) src/connector/src/sink/decouple_checkpoint_log_sink.rs:73 — DecoupleCheckpointLogSinkerOf::consume_log_and_sink has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (12 pts), match/switch 3 (7 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.
D2 · Cognitive Complexity · ElasticSearchOpenSearchFormatter · ×1
  • ElasticSearchOpenSearchFormatter::convert_chunk (cognitive 21) src/connector/src/sink/elasticsearch_opensearch/elasticsearch_opensearch_formatter.rs:118 — ElasticSearchOpenSearchFormatter::convert_chunk has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (18 pts), match/switch 1 (2 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.
D2 · Cognitive Complexity · KinesisSplitReader · ×1
  • KinesisSplitReader::into_data_stream (cognitive 21) src/connector/src/source/kinesis/source/reader.rs:177 — KinesisSplitReader::into_data_stream has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 2, match/switch 1 (2 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.
D2 · Cognitive Complexity · TableScanIoEstimator · ×1
  • TableScanIoEstimator::match_index_column (cognitive 21) src/frontend/src/optimizer/rule/index_selection_rule.rs:866 — TableScanIoEstimator::match_index_column has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 5, loops 3, match/switch 1 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UnifyFirstLastValueRule · ×1
  • UnifyFirstLastValueRule::apply (cognitive 21) src/frontend/src/optimizer/rule/unify_first_last_value_rule.rs:87 — UnifyFirstLastValueRule::apply has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 9 (10 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.
D2 · Cognitive Complexity · JavaLoggerLevelOverrides.parse (cognitive 21) · ×1
  • JavaLoggerLevelOverrides.parse (cognitive 21) java/connector-node/tracing/src/main/java/com/risingwave/tracing/TracingSlf4jImpl.java:163 — JavaLoggerLevelOverrides.parse has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 1, loops 1 (nesting depth added 9). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · heap_profiling.HeapProfiling (cognitive 21) · ×1
  • heap_profiling.HeapProfiling (cognitive 21) dashboard/pages/heap_profiling.tsx:75 — heap_profiling.HeapProfiling has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9, boolean chains 6, error handling 3 (4 pts), loops 1, ternaries 1 (nesting depth added 1). Most of this is not in the body itself: 4 of the 21 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 93, a function literal at line 130, analyzeHeapFile, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · StreamChunk · ×1
  • StreamChunk::eliminate_adjacent_noop_update (cognitive 20) src/common/src/array/stream_chunk.rs:332 — StreamChunk::eliminate_adjacent_noop_update has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 7, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TemplateEncoder · ×1
  • TemplateEncoder::build (cognitive 20) src/connector/src/sink/formatter/mod.rs:313 — TemplateEncoder::build has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 5 (8 pts), boolean chains 6, if/else 2 (6 pts) (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · MySqlExternalTableReader · ×1
  • MySqlExternalTableReader::snapshot_read_inner (cognitive 20) src/connector/src/source/cdc/external/mysql.rs:815 — MySqlExternalTableReader::snapshot_read_inner has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 2 (4 pts), match/switch 1 (3 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.
D2 · Cognitive Complexity · OpendalReader · ×1
  • OpendalReader::stream_read_lines (cognitive 20) src/connector/src/source/filesystem/opendal_source/opendal_reader.rs:159 — OpendalReader::stream_read_lines has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 5, match/switch 3, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SomeAllExpression · ×1
  • SomeAllExpression::resolve_bools (cognitive 20) src/expr/core/src/expr/expr_some_all.rs:52 — SomeAllExpression::resolve_bools has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (4 pts), match/switch 2 (4 pts) (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · Agg · ×1
  • Agg::infer_stream_agg_state (cognitive 20) src/frontend/src/optimizer/plan_node/generic/agg.rs:394 — Agg::infer_stream_agg_state has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 3 (5 pts), loops 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StreamKeyChecker · ×1
  • StreamKeyChecker::visit_logical_agg (cognitive 20) src/frontend/src/optimizer/plan_visitor/jsonb_stream_key_checker.rs:119 — StreamKeyChecker::visit_logical_agg has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 4 (9 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.
D2 · Cognitive Complexity · ApplyJoinTransposeRule · ×1
  • ApplyJoinTransposeRule::apply (cognitive 20) src/frontend/src/optimizer/rule/apply_join_transpose_rule.rs:89 — ApplyJoinTransposeRule::apply has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 3, 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.
D2 · Cognitive Complexity · GroupingSetsToExpandRule · ×1
  • GroupingSetsToExpandRule::apply (cognitive 20) src/frontend/src/optimizer/rule/grouping_sets_to_expand_rule.rs:72 — GroupingSetsToExpandRule::apply has cognitive complexity 20 (threshold 15). Drivers by points: loops 4 (11 pts), if/else 4 (9 pts) (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.
D2 · Cognitive Complexity · OverwriteOptions · ×1
  • OverwriteOptions::new (cognitive 20) src/frontend/src/utils/overwrite_options.rs:33 — OverwriteOptions::new has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16 (20 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.
D2 · Cognitive Complexity · BarrierWorkerRuntimeInfoSnapshot · ×1
  • BarrierWorkerRuntimeInfoSnapshot::validate_database_info (cognitive 20) src/meta/src/barrier/mod.rs:154 — BarrierWorkerRuntimeInfoSnapshot::validate_database_info has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 5 (8 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.
D2 · Cognitive Complexity · MetaMemberManagement · ×1
  • MetaMemberManagement::refresh_members (cognitive 20) src/rpc_client/src/meta_client.rs:2429 — MetaMemberManagement::refresh_members has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (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.
D2 · Cognitive Complexity · LogStoreBufferReceiver · ×1
  • LogStoreBufferReceiver::truncate_buffer (cognitive 20) src/stream/src/common/log_store_impl/kv_log_store/buffer.rs:517 — LogStoreBufferReceiver::truncate_buffer has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (17 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.
D2 · Cognitive Complexity · PositionDeleteMergerExecutor · ×1
  • PositionDeleteMergerExecutor::execute_inner (cognitive 20) src/stream/src/executor/iceberg_with_pk_index/position_delete_merger.rs:98 — PositionDeleteMergerExecutor::execute_inner has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (4 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PostgresStreamingChangeEventSource.commitOffset (cognitive 20) · ×1
  • PostgresStreamingChangeEventSource.commitOffset (cognitive 20) java/connector-node/risingwave-source-cdc/src/main/java/io/debezium/connector/postgresql/PostgresStreamingChangeEventSource.java:825 — PostgresStreamingChangeEventSource.commitOffset has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (11 pts), error handling 4 (7 pts), boolean chains 1, ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JDBCSqlRunner.executeSqlWithProps (cognitive 20) · ×1
  • JDBCSqlRunner.executeSqlWithProps (cognitive 20) java/connector-node/risingwave-jdbc-runner/src/main/java/com/risingwave/runner/JDBCSqlRunner.java:31 — JDBCSqlRunner.executeSqlWithProps has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (9 pts), error handling 3 (6 pts), loops 2 (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.
D2 · Cognitive Complexity · PostgresValidator.validatePublicationPrivileges (cognitive 20) · ×1
  • PostgresValidator.validatePublicationPrivileges (cognitive 20) java/connector-node/risingwave-connector-service/src/main/java/com/risingwave/connector/source/common/PostgresValidator.java:654 — PostgresValidator.validatePublicationPrivileges has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PostgresValidator.validateTableSchema (cognitive 20) · ×1
  • PostgresValidator.validateTableSchema (cognitive 20) java/connector-node/risingwave-connector-service/src/main/java/com/risingwave/connector/source/common/PostgresValidator.java:204 — PostgresValidator.validateTableSchema has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 4, ternaries 2 (4 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeleteExecutor · ×1
  • DeleteExecutor::do_execute (cognitive 19) src/batch/executors/src/executor/delete.rs:111 — DeleteExecutor::do_execute has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 3 (6 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SortAggExecutor · ×1
  • SortAggExecutor::do_execute (cognitive 19) src/batch/executors/src/executor/sort_agg.rs:109 — SortAggExecutor::do_execute has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (5 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.
D2 · Cognitive Complexity · SortOverWindowExecutor · ×1
  • SortOverWindowExecutor::do_execute (cognitive 19) src/batch/executors/src/executor/sort_over_window.rs:140 — SortOverWindowExecutor::do_execute has cognitive complexity 19 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 4 (9 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.
D2 · Cognitive Complexity · JsonRef · ×1
  • JsonRef::deref (cognitive 19) src/connector/codec/src/decoder/json/mod.rs:113 — JsonRef::deref has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 2, loops 1 (2 pts), match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MockSinkCoordinationRpcClient · ×1
  • MockSinkCoordinationRpcClient::coordinate (cognitive 19) src/connector/src/sink/mock_coordination_client.rs:112 — MockSinkCoordinationRpcClient::coordinate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (12 pts), match/switch 3 (6 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MongodbSink · ×1
  • MongodbSink::validate (cognitive 19) src/connector/src/sink/mongodb.rs:271 — MongodbSink::validate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (15 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.
D2 · Cognitive Complexity · TurbopufferLogSinker · ×1
  • TurbopufferLogSinker::consume_log_and_sink (cognitive 19) src/connector/src/sink/turbopuffer.rs:347 — TurbopufferLogSinker::consume_log_and_sink has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 3 (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.
D2 · Cognitive Complexity · NatsPropertiesConsumer · ×1
  • NatsPropertiesConsumer::set_config (cognitive 19) src/connector/src/source/nats/mod.rs:224 — NatsPropertiesConsumer::set_config has cognitive complexity 19 (threshold 15). Drivers by points: if/else 19. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · OpenAiEmbedding · ×1
  • OpenAiEmbedding::eval (cognitive 19) src/expr/impl/src/scalar/ai_model.rs:273 — OpenAiEmbedding::eval has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 2, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ColumnIdGenerator · ×1
  • ColumnIdGenerator::generate (cognitive 19) src/frontend/src/handler/create_table/col_id_gen.rs:155 — ColumnIdGenerator::generate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), match/switch 3 (5 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 6). Most of this is not in the body itself: 7 of the 19 points are its own statements and the rest belongs to one function item inside it that branches (handle). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · LogicalOverWindow · ×1
  • LogicalOverWindow::convert_window_function (cognitive 19) src/frontend/src/optimizer/plan_node/logical_over_window.rs:301 — LogicalOverWindow::convert_window_function has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (18 pts), match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · AggGroupBySimplifyRule · ×1
  • AggGroupBySimplifyRule::apply (cognitive 19) src/frontend/src/optimizer/rule/agg_group_by_simplify_rule.rs:30 — AggGroupBySimplifyRule::apply has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 3 (6 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.
D2 · Cognitive Complexity · ExpressionSimplifyRewriter · ×1
  • ExpressionSimplifyRewriter::rewrite_expr (cognitive 19) src/frontend/src/optimizer/rule/logical_filter_expression_simplify_rule.rs:206 — ExpressionSimplifyRewriter::rewrite_expr has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (16 pts), match/switch 1 (2 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.
D2 · Cognitive Complexity · QueryRunner · ×1
  • QueryRunner::run (cognitive 19) src/frontend/src/scheduler/distributed/query.rs:294 — QueryRunner::run has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 3 (5 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BackfillOrderState · ×1
  • BackfillOrderState::finish_fragment (cognitive 19) src/meta/src/barrier/backfill_order_control.rs:243 — BackfillOrderState::finish_fragment has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (17 pts), 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.
D2 · Cognitive Complexity · StreamFragmentGraph · ×1
  • StreamFragmentGraph::collect_snapshot_backfill_info_impl (cognitive 19) src/meta/src/stream/stream_graph/fragment.rs:1262 — StreamFragmentGraph::collect_snapshot_backfill_info_impl has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 3 (10 pts), if/else 4 (8 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.
D2 · Cognitive Complexity · UnsyncData · ×1
  • UnsyncData::clear_tables (cognitive 19) src/storage/src/hummock/event_handler/uploader/mod.rs:946 — UnsyncData::clear_tables has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (7 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PkPrefixSkipWatermarkState · ×1
  • PkPrefixSkipWatermarkState::advance_watermark (cognitive 19) src/storage/src/hummock/iterator/skip_watermark.rs:229 — PkPrefixSkipWatermarkState::advance_watermark has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 4 (13 pts), if/else 1 (5 pts), 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.
D2 · Cognitive Complexity · RangeKvStateStoreRevIter · ×1
  • RangeKvStateStoreRevIter::next_inner (cognitive 19) src/storage/src/memory.rs:1386 — RangeKvStateStoreRevIter::next_inner has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 2, 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.
D2 · Cognitive Complexity · VectorIndexSnapshot · ×1
  • VectorIndexSnapshot::query_expand_chunk (cognitive 19) src/storage/src/table/batch_table/vector_index_reader.rs:146 — VectorIndexSnapshot::query_expand_chunk has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DispatchOutputMapping · ×1
  • DispatchOutputMapping::apply (cognitive 19) src/stream/src/executor/dispatch/output_mapping.rs:60 — DispatchOutputMapping::apply has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (6 pts), match/switch 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.
D2 · Cognitive Complexity · IcebergScanExecutor · ×1
  • IcebergScanExecutor::do_execute (cognitive 18) src/batch/executors/src/executor/iceberg_scan.rs:94 — IcebergScanExecutor::do_execute has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 2 (3 pts), match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NestedLoopJoinExecutor · ×1
  • NestedLoopJoinExecutor::do_full_outer_join (cognitive 18) src/batch/executors/src/executor/join/nested_loop_join.rs:453 — NestedLoopJoinExecutor::do_full_outer_join has cognitive complexity 18 (threshold 15). Drivers by points: loops 5 (10 pts), if/else 3 (8 pts) (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.
D2 · Cognitive Complexity · ClickHouseSinkWriter · ×1
  • ClickHouseSinkWriter::write (cognitive 18) src/connector/src/sink/clickhouse.rs:746 — ClickHouseSinkWriter::write has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (3 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.
D2 · Cognitive Complexity · DynamoDbPayloadWriter · ×1
  • DynamoDbPayloadWriter::write_chunk (cognitive 18) src/connector/src/sink/dynamodb.rs:525 — DynamoDbPayloadWriter::write_chunk 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.
D2 · Cognitive Complexity · KafkaPayloadWriter · ×1
  • KafkaPayloadWriter::send_result (cognitive 18) src/connector/src/sink/kafka.rs:516 — KafkaPayloadWriter::send_result has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (12 pts), match/switch 2 (5 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.
D2 · Cognitive Complexity · ExecutorStats · ×1
  • ExecutorStats::get_delta (cognitive 18) src/frontend/src/handler/explain_analyze_stream_job.rs:376 — ExecutorStats::get_delta has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SessionManagerImpl · ×1
  • SessionManagerImpl::connect_inner (cognitive 18) src/frontend/src/session.rs:1654 — SessionManagerImpl::connect_inner has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 4 (9 pts), if/else 5 (8 pts), boolean chains 1 (nesting depth added 8). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · CreatingStreamingJobControl · ×1
  • CreatingStreamingJobControl::resolve_since_timestamp_upstream_log_epochs (cognitive 18) src/meta/src/barrier/checkpoint/independent_job/creating_job/mod.rs:457 — CreatingStreamingJobControl::resolve_since_timestamp_upstream_log_epochs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 3 (5 pts) (nesting depth added 6). Of this number, 16 points are the body's own statements and 2 belong to one function item 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.
D2 · Cognitive Complexity · RescheduleContext · ×1
  • RescheduleContext::into_database_contexts (cognitive 18) src/meta/src/barrier/command.rs:211 — RescheduleContext::into_database_contexts has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 7 (9 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.
D2 · Cognitive Complexity · ClusterController · ×1
  • ClusterController::start_heartbeat_checker (cognitive 18) src/meta/src/controller/cluster.rs:227 — ClusterController::start_heartbeat_checker has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 4 (11 pts), loops 3 (5 pts), if/else 1 (2 pts) (nesting depth added 10). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · GrpcMetaClient · ×1
  • GrpcMetaClient::start_meta_member_monitor (cognitive 18) src/rpc_client/src/meta_client.rs:2536 — GrpcMetaClient::start_meta_member_monitor has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 1 (3 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.
D2 · Cognitive Complexity · VnodeStream · ×1
  • VnodeStream::poll_next (cognitive 18) src/stream/src/executor/backfill/snapshot_backfill/vnode_stream.rs:217 — VnodeStream::poll_next has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), match/switch 2 (5 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.
D2 · Cognitive Complexity · MergeExecutorInner · ×1
  • MergeExecutorInner::execute_inner (cognitive 18) src/stream/src/executor/merge.rs:301 — MergeExecutorInner::execute_inner 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.
D2 · Cognitive Complexity · RowMergeExecutor · ×1
  • RowMergeExecutor::build_chunk (cognitive 18) src/stream/src/executor/row_merge.rs:142 — RowMergeExecutor::build_chunk has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 5 (7 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.
D2 · Cognitive Complexity · LdapConfig · ×1
  • LdapConfig::from_ldap_url (cognitive 18) src/utils/pgwire/src/ldap_auth.rs:260 — LdapConfig::from_ldap_url has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 4, 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.
D2 · Cognitive Complexity · PostgresValidator.validatePrivileges (cognitive 18) · ×1
  • PostgresValidator.validatePrivileges (cognitive 18) java/connector-node/risingwave-connector-service/src/main/java/com/risingwave/connector/source/common/PostgresValidator.java:330 — PostgresValidator.validatePrivileges has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (7 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.
D2 · Cognitive Complexity · MergeSortExecutor · ×1
  • MergeSortExecutor::do_execute (cognitive 17) src/batch/executors/src/executor/merge_sort.rs:60 — MergeSortExecutor::do_execute has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (7 pts), if/else 2 (6 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.
D2 · Cognitive Complexity · RateLimitedLogReader · ×1
  • RateLimitedLogReader::truncate (cognitive 17) src/connector/src/sink/log_store.rs:624 — RateLimitedLogReader::truncate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 3 (5 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.
D2 · Cognitive Complexity · DeliveryFutureManager · ×1
  • DeliveryFutureManager::next_truncate_offset (cognitive 17) src/connector/src/sink/log_store.rs:903 — DeliveryFutureManager::next_truncate_offset has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 3 (11 pts), loops 2 (4 pts), if/else 2 (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.
D2 · Cognitive Complexity · Formatter · ×1
  • Formatter::from_str (cognitive 17) src/expr/impl/src/scalar/format.rs:132 — Formatter::from_str has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 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.
D2 · Cognitive Complexity · risingwave_expr_macro · ×1
  • risingwave_expr_macro::context::generate_captured_function (cognitive 17) src/expr/macro/src/context.rs:136 — risingwave_expr_macro::context::generate_captured_function has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · IndexDeltaJoinRule · ×1
  • IndexDeltaJoinRule::apply::match_indexes (cognitive 17) src/frontend/src/optimizer/rule/index_delta_join_rule.rs:59 — IndexDeltaJoinRule::apply::match_indexes has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 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.
D2 · Cognitive Complexity · MvSelectionRule · ×1
  • MvSelectionRule::inner_join_rewrite (cognitive 17) src/frontend/src/optimizer/rule/mv_selection_rule.rs:261 — MvSelectionRule::inner_join_rewrite has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (16 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.
D2 · Cognitive Complexity · ManualCompactionPicker · ×1
  • ManualCompactionPicker::pick_compaction (cognitive 17) src/meta/src/hummock/compaction/picker/manual_compaction_picker.rs:214 — ManualCompactionPicker::pick_compaction has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 2, 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, 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.
D2 · Cognitive Complexity · GlobalRefreshManager · ×1
  • GlobalRefreshManager::tick (cognitive 17) src/meta/src/stream/refresh_manager.rs:483 — GlobalRefreshManager::tick has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 2, 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.
D2 · Cognitive Complexity · SourceManager · ×1
  • SourceManager::validate_inject_source_offsets (cognitive 17) src/meta/src/stream/source_manager.rs:618 — SourceManager::validate_inject_source_offsets has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (9 pts), if/else 6 (8 pts) (nesting depth added 7). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · ValueSkipWatermarkState · ×1
  • ValueSkipWatermarkState::should_delete (cognitive 17) src/storage/src/hummock/iterator/skip_watermark.rs:510 — ValueSkipWatermarkState::should_delete has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (15 pts), match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GlobalApproxPercentileState · ×1
  • GlobalApproxPercentileState::apply_row (cognitive 17) src/stream/src/executor/approx_percentile/global_state.rs:145 — GlobalApproxPercentileState::apply_row has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (15 pts), 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.
D2 · Cognitive Complexity · RowIdGenExecutor · ×1
  • RowIdGenExecutor::gen_row_id_column_by_op (cognitive 17) src/stream/src/executor/row_id_gen.rs:62 — RowIdGenExecutor::gen_row_id_column_by_op has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), match/switch 2 (7 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.
D2 · Cognitive Complexity · WaitCheckpointWorker · ×1
  • WaitCheckpointWorker::run (cognitive 17) src/stream/src/executor/source/source_executor.rs:1267 — WaitCheckpointWorker::run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (11 pts), match/switch 2 (5 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.
D2 · Cognitive Complexity · cpu_profiling.CpuProfiling (cognitive 17) · ×1
  • cpu_profiling.CpuProfiling (cognitive 17) dashboard/pages/cpu_profiling.tsx:68 — cpu_profiling.CpuProfiling has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 3 (5 pts), boolean chains 4, if/else 4, error handling 2 (3 pts), loops 1 (nesting depth added 3). Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to 5 function items inside it that branch (dumpProfile, a function literal at line 78, a function literal at line 179, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · Interval · ×1
  • Interval::fmt (cognitive 16) src/common/src/types/interval.rs:1098 — Interval::fmt has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DataChunkBuilder · ×1
  • DataChunkBuilder::append_chunk_inner (cognitive 16) src/common/src/util/chunk_coalesce.rs:78 — DataChunkBuilder::append_chunk_inner has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 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.
D2 · Cognitive Complexity · ConfigServiceImpl · ×1
  • ConfigServiceImpl::resize_cache (cognitive 16) src/compute/src/rpc/service/config_service.rs:56 — ConfigServiceImpl::resize_cache has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), match/switch 2 (6 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CsvParser · ×1
  • CsvParser::parse_inner (cognitive 16) src/connector/src/parser/csv_parser.rs:111 — CsvParser::parse_inner has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (16 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExprError · ×1
  • ExprError::function (cognitive 16) src/expr/core/src/error.rs:143 — ExprError::function has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 2 (4 pts), match/switch 1 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EitherOnConflict · ×1
  • EitherOnConflict::to_behavior (cognitive 16) src/frontend/src/handler/create_table.rs:678 — EitherOnConflict::to_behavior has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · PushCalculationOfJoinRule · ×1
  • PushCalculationOfJoinRule::find_comparison_exprs (cognitive 16) src/frontend/src/optimizer/rule/push_calculation_of_join_rule.rs:137 — PushCalculationOfJoinRule::find_comparison_exprs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 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.
D2 · Cognitive Complexity · TableFunctionToFileScanRule · ×1
  • TableFunctionToFileScanRule::apply (cognitive 16) src/frontend/src/optimizer/rule/table_function_to_file_scan_rule.rs:28 — TableFunctionToFileScanRule::apply has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), match/switch 2 (6 pts), loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · TopNToVectorSearchRule · ×1
  • TopNToVectorSearchRule::resolve_vector_search (cognitive 16) src/frontend/src/optimizer/rule/top_n_to_vector_search_rule.rs:51 — TopNToVectorSearchRule::resolve_vector_search has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 2, boolean chains 1, match/switch 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WithOptions · ×1
  • WithOptions::try_from (cognitive 16) src/frontend/src/utils/with_options.rs:539 — WithOptions::try_from has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), match/switch 2 (4 pts), boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LoadedFragmentContext · ×1
  • LoadedFragmentContext::into_database_contexts (cognitive 16) src/meta/src/controller/scale.rs:335 — LoadedFragmentContext::into_database_contexts has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (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.
D2 · Cognitive Complexity · TierCompactionPicker · ×1
  • TierCompactionPicker::pick_overlapping_level (cognitive 16) src/meta/src/hummock/compaction/picker/tier_compaction_picker.rs:50 — TierCompactionPicker::pick_overlapping_level has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 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.
D2 · Cognitive Complexity · DynamicLevelSelectorCore · ×1
  • DynamicLevelSelectorCore::compact_pending_bytes_needed_with_ctx (cognitive 16) src/meta/src/hummock/compaction/selector/level_selector.rs:360 — DynamicLevelSelectorCore::compact_pending_bytes_needed_with_ctx has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 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.
D2 · Cognitive Complexity · MockHummockMetaClient · ×1
  • MockHummockMetaClient::subscribe_compaction_event (cognitive 16) src/meta/src/hummock/mock_hummock_meta_client.rs:249 — MockHummockMetaClient::subscribe_compaction_event has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), match/switch 2 (5 pts), loops 2, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TwoPhaseCommitHandler · ×1
  • TwoPhaseCommitHandler::next_to_commit (cognitive 16) src/meta/src/manager/sink_coordination/coordinator_worker.rs:165 — TwoPhaseCommitHandler::next_to_commit has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HummockVersionStateTableInfo · ×1
  • HummockVersionStateTableInfo::apply_delta (cognitive 16) src/storage/hummock_sdk/src/version.rs:101 — HummockVersionStateTableInfo::apply_delta has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2, match/switch 1 (2 pts) (nesting depth added 7). Of this number, 15 points are the body's own statements and 1 belongs to one function item 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.
D2 · Cognitive Complexity · CacheRefillTask · ×1
  • CacheRefillTask::data_cache_refill (cognitive 16) src/storage/src/hummock/event_handler/refiller.rs:768 — CacheRefillTask::data_cache_refill has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (6 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.
D2 · Cognitive Complexity · LogStoreRowSerde · ×1
  • LogStoreRowSerde::deserialize_stream_chunk (cognitive 16) src/stream/src/common/log_store_impl/kv_log_store/serde.rs:432 — LogStoreRowSerde::deserialize_stream_chunk has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 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.
D2 · Cognitive Complexity · StateTableBuilder · ×1
  • StateTableBuilder::build_inner (cognitive 16) src/stream/src/common/table/state_table.rs:906 — StateTableBuilder::build_inner has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), match/switch 3, boolean chains 2, 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, 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.
D2 · Cognitive Complexity · NoSnapshotUpstreamHandler · ×1
  • NoSnapshotUpstreamHandler::handle_upstream (cognitive 16) src/stream/src/executor/backfill/cdc/cdc_backfill.rs:110 — NoSnapshotUpstreamHandler::handle_upstream has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), match/switch 2 (4 pts) (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · HashDataDispatcher · ×1
  • HashDataDispatcher::dispatch_data (cognitive 16) src/stream/src/executor/dispatch.rs:949 — HashDataDispatcher::dispatch_data has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 2 (3 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.
D2 · Cognitive Complexity · ReadFuture · ×1
  • ReadFuture::next_message (cognitive 16) src/stream/src/executor/sync_kv_log_store.rs:964 — ReadFuture::next_message has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 5 (9 pts), loops 2 (4 pts), if/else 1 (3 pts) (nesting depth added 8). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · TopNExecutorWrapper · ×1
  • TopNExecutorWrapper::top_n_executor_execute (cognitive 16) src/stream/src/executor/top_n/utils.rs:82 — TopNExecutorWrapper::top_n_executor_execute has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (13 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.
D2 · Cognitive Complexity · PostgresStreamingChangeEventSource.processReplicationMessages (cognitive 16) · ×1
  • PostgresStreamingChangeEventSource.processReplicationMessages (cognitive 16) java/connector-node/risingwave-source-cdc/src/main/java/io/debezium/connector/postgresql/PostgresStreamingChangeEventSource.java:448 — PostgresStreamingChangeEventSource.processReplicationMessages has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (16 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MongoDbValidator.validateUserPrivilege (cognitive 16) · ×1
  • MongoDbValidator.validateUserPrivilege (cognitive 16) java/connector-node/risingwave-connector-service/src/main/java/com/risingwave/connector/source/common/MongoDbValidator.java:166 — MongoDbValidator.validateUserPrivilege has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (14 pts), error handling 1 (2 pts) (nesting depth added 9). 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.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member family (4 members, 15 shared lines) · ×1
  • Near-duplicate member family (4 members, 15 shared lines) src/frontend/src/handler/alter_rename.rs:76 — src/frontend/src/handler/alter_rename.rs:76-101 | src/frontend/src/handler/alter_rename.rs:107-130 | src/frontend/src/handler/alter_rename.rs:136-160 | src/frontend/src/handler/alter_rename.rs:166-191 — These 4 members are variants of one another: a block of 15 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 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.
D4 · Code Duplication · Near-duplicate member family (3 members, 29 shared lines) · ×1
  • Near-duplicate member family (3 members, 29 shared lines) src/storage/src/mem_table.rs:150 — src/storage/src/mem_table.rs:150-202 | src/storage/src/mem_table.rs:204-283 | src/storage/src/mem_table.rs:290-370 — These 3 members are variants of one another: a block of 29 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.
D4 · Code Duplication · Near-duplicate member family (3 members, 13 shared lines) · ×1
  • Near-duplicate member family (3 members, 13 shared lines) src/frontend/src/handler/create_aggregate.rs:35 — src/frontend/src/handler/create_aggregate.rs:35-159 | src/frontend/src/handler/create_function.rs:52-216 | src/frontend/src/handler/create_sql_function.rs:34-186 — These 3 members are variants of one another: a block of 13 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.
D4 · Code Duplication · Near-duplicate member family (3 members, 10 shared lines) · ×1
  • Near-duplicate member family (3 members, 10 shared lines) src/frontend/src/optimizer/rule/apply_join_transpose_rule.rs:217 — src/frontend/src/optimizer/rule/apply_join_transpose_rule.rs:217-292 | src/frontend/src/optimizer/rule/apply_join_transpose_rule.rs:302-418 | src/frontend/src/optimizer/rule/apply_join_transpose_rule.rs:428-602 — These 3 members are variants of one another: a block of 10 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.
D4 · Code Duplication · Near-duplicate member pair (149 shared lines) · ×1
  • Near-duplicate member pair (149 shared lines) src/stream/src/executor/asof_join.rs:323 — src/stream/src/executor/asof_join.rs:323-505 | src/stream/src/executor/hash_join.rs:584-776 — These two members are variants of one another: 149 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 · Near-duplicate member pair (101 shared lines) · ×1
  • Near-duplicate member pair (101 shared lines) src/stream/src/executor/nested_loop_temporal_join.rs:150 — src/stream/src/executor/nested_loop_temporal_join.rs:150-293 | src/stream/src/executor/temporal_join.rs:666-877 — These two members are variants of one another: 101 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 · Near-duplicate member pair (85 shared lines) · ×1
  • Near-duplicate member pair (85 shared lines) src/storage/hummock_sdk/src/compaction_group/hummock_version_ext.rs:293 — src/storage/hummock_sdk/src/compaction_group/hummock_version_ext.rs:293-388 | src/storage/hummock_sdk/src/compaction_group/hummock_version_ext.rs:876-991 — These two members are variants of one another: 85 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 · Near-duplicate member pair (71 shared lines) · ×1
  • Near-duplicate member pair (71 shared lines) src/connector/src/sink/iceberg/writer.rs:330 — src/connector/src/sink/iceberg/writer.rs:330-449 | src/connector/src/sink/iceberg/writer.rs:456-663 — These two members are variants of one another: 71 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 · Near-duplicate member pair (67 shared lines) · ×1
  • Near-duplicate member pair (67 shared lines) src/stream/src/executor/eowc/eowc_gap_fill.rs:92 — src/stream/src/executor/eowc/eowc_gap_fill.rs:92-266 | src/stream/src/executor/gap_fill.rs:279-471 — These two members are variants of one another: 67 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 · Near-duplicate member pair (64 shared lines) · ×1
  • Near-duplicate member pair (64 shared lines) src/stream/src/common/table/state_table.rs:2029 — src/stream/src/common/table/state_table.rs:2029-2106 | src/stream/src/common/table/state_table.rs:2114-2192 — These two members are variants of one another: 64 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 · Near-duplicate member pair (46 shared lines) · ×1
  • Near-duplicate member pair (46 shared lines) src/frontend/src/metrics_reader.rs:51 — src/frontend/src/metrics_reader.rs:51-188 | src/meta/src/dashboard/mod.rs:786-977 — These two members are variants of one another: 46 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 · Near-duplicate member pair (40 shared lines) · ×1
  • Near-duplicate member pair (40 shared lines) src/frontend/src/catalog/system_catalog/rw_catalog/rw_iceberg_all_files.rs:64 — src/frontend/src/catalog/system_catalog/rw_catalog/rw_iceberg_all_files.rs:64-128 | src/frontend/src/catalog/system_catalog/rw_catalog/rw_iceberg_files.rs:63-121 — These two members are variants of one another: 40 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 · Near-duplicate member pair (37 shared lines) · ×1
  • Near-duplicate member pair (37 shared lines) src/stream/src/executor/source/batch_source/batch_adbc_snowflake_fetch.rs:75 — src/stream/src/executor/source/batch_source/batch_adbc_snowflake_fetch.rs:75-232 | src/stream/src/executor/source/batch_source/batch_opendal_fs_fetch.rs:186-370 — 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 · Near-duplicate member pair (32 shared lines) · ×1
  • Near-duplicate member pair (32 shared lines) src/stream/src/executor/top_n/group_top_n.rs:175 — src/stream/src/executor/top_n/group_top_n.rs:175-245 | src/stream/src/executor/top_n/group_top_n_appendonly.rs:156-215 — These two members are variants of one another: 32 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 · Near-duplicate member pair (27 shared lines) · ×1
  • Near-duplicate member pair (27 shared lines) src/sqlparser/src/parser.rs:3549 — src/sqlparser/src/parser.rs:3549-3632 | src/sqlparser/src/parser.rs:3753-3859 — These two members are variants of one another: 27 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 (34 corresponding lines) · ×1
  • Edited copy of a member (34 corresponding lines) src/frontend/src/optimizer/rule/min_max_on_index_rule.rs:89 — src/frontend/src/optimizer/rule/min_max_on_index_rule.rs:89-133 | src/frontend/src/optimizer/rule/min_max_on_index_rule.rs:140-202 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (20 corresponding lines) · ×1
  • Edited copy of a member (20 corresponding lines) src/batch/executors/src/executor/aggregation/orderby.rs:128 — src/batch/executors/src/executor/aggregation/orderby.rs:128-147 | src/frontend/src/datafusion/aggregate/orderby.rs:129-148 — 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 · Edited copy of a member (31 corresponding lines) · ×1
  • Edited copy of a member (31 corresponding lines) src/stream/src/executor/dynamic_filter.rs:94 — src/stream/src/executor/dynamic_filter.rs:94-211 | src/stream/src/executor/filter.rs:61-154 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (19 corresponding lines) · ×1
  • Edited copy of a member (19 corresponding lines) src/frontend/src/optimizer/plan_node/batch_delete.rs:61 — src/frontend/src/optimizer/plan_node/batch_delete.rs:61-79 | src/frontend/src/optimizer/plan_node/batch_insert.rs:73-91 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (29 corresponding lines) · ×1
  • Edited copy of a member (29 corresponding lines) src/batch/executors/src/executor/join/hash_join.rs:2476 — src/batch/executors/src/executor/join/hash_join.rs:2476-2517 | src/batch/executors/src/executor/join/nested_loop_join.rs:206-238 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (13 corresponding lines) · ×1
  • Edited copy of a member (13 corresponding lines) src/connector/src/connector_common/iceberg/mod.rs:679 — src/connector/src/connector_common/iceberg/mod.rs:679-752 | src/connector/src/connector_common/iceberg/mod.rs:816-862 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (23 corresponding lines) · ×1
  • Edited copy of a member (23 corresponding lines) src/batch/executors/src/executor/hash_agg.rs:332 — src/batch/executors/src/executor/hash_agg.rs:332-356 | src/batch/executors/src/executor/join/hash_join.rs:286-308 — These two members are one piece of code written twice and then edited apart: 23 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) REDACTED:283 — REDACTED:283-296 | src/connector/src/sink/clickhouse.rs:380-393 | src/connector/src/sink/doris.rs:113-126 | src/connector/src/sink/file_sink/azblob.rs:110-123 | src/connector/src/sink/file_sink/fs.rs:80-92 | src/connector/src/sink/file_sink/gcs.rs:96-108 | src/connector/src/sink/file_sink/s3.rs:140-152 | src/connector/src/sink/file_sink/webhdfs.rs:84-97 | src/connector/src/sink/mongodb.rs:166-179 | src/connector/src/sink/postgres.rs:151-164 | src/connector/src/sink/snowflake_redshift/snowflake.rs:230-352 | src/connector/src/sink/sqlserver.rs:83-96 | src/connector/src/sink/starrocks.rs:156-179 — 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 (8 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (8 members, 50+ identical tokens) src/batch/executors/src/executor/hash_agg.rs:383 — src/batch/executors/src/executor/hash_agg.rs:383-396 | src/batch/executors/src/executor/hash_agg.rs:398-420 | src/batch/executors/src/executor/hash_agg.rs:422-454 | src/batch/executors/src/executor/join/hash_join.rs:341-363 | src/batch/executors/src/executor/join/hash_join.rs:369-391 | src/batch/executors/src/executor/join/hash_join.rs:393-425 | src/batch/executors/src/executor/order_by.rs:380-396 | src/batch/executors/src/executor/order_by.rs:398-416 — These 8 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 8 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 8 times.
D4 · Code Duplication · Duplicated block (101–104 lines × 2) · ×1
  • Duplicated block (101–104 lines × 2) src/stream/src/executor/asof_join.rs:324 — src/stream/src/executor/asof_join.rs:324-424 | src/stream/src/executor/hash_join.rs:585-688 — before extracting anything, compare `src/stream/src/executor/asof_join.rs` and `src/stream/src/executor/hash_join.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 245 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.
D4 · Code Duplication · Duplicated block (74–75 lines × 2) · ×1
  • Duplicated block (74–75 lines × 2) src/batch/executors/src/executor/join/distributed_lookup_join.rs:92 — src/batch/executors/src/executor/join/distributed_lookup_join.rs:92-166 | src/batch/executors/src/executor/join/local_lookup_join.rs:294-367 — 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.
D4 · Code Duplication · Duplicated block (53 lines × 2) · ×1
  • Duplicated block (53 lines × 2) src/connector/src/sink/coordinate.rs:154 — src/connector/src/sink/coordinate.rs:154-206 | src/connector/src/sink/decouple_checkpoint_log_sink.rs:97-149 — 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.
D4 · Code Duplication · Duplicated block (47 lines × 2) · ×1
  • Duplicated block (47 lines × 2) src/storage/hummock_sdk/src/compact_task.rs:297 — src/storage/hummock_sdk/src/compact_task.rs:297-343 | src/storage/hummock_sdk/src/compact_task.rs:369-415 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (39 lines × 2) · ×1
  • Duplicated block (39 lines × 2) src/stream/src/executor/nested_loop_temporal_join.rs:220 — src/stream/src/executor/nested_loop_temporal_join.rs:220-258 | src/stream/src/executor/temporal_join.rs:773-811 — before extracting anything, compare `src/stream/src/executor/nested_loop_temporal_join.rs` and `src/stream/src/executor/temporal_join.rs` as WHOLE FILES: this scan already matched 6 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. 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.
D4 · Code Duplication · Duplicated block (38 lines × 2) · ×1
  • Duplicated block (38 lines × 2) src/expr/impl/src/scalar/trigonometric.rs:258 — src/expr/impl/src/scalar/trigonometric.rs:258-295 | src/expr/impl/src/scalar/trigonometric.rs:312-349 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (31–33 lines × 3) · ×1
  • Duplicated block (31–33 lines × 3) src/connector/src/source/kafka/stats.rs:582 — src/connector/src/source/kafka/stats.rs:582-613 | src/meta/src/rpc/metrics.rs:1017-1049 | src/storage/src/monitor/compactor_metrics.rs:275-305 — 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.
D4 · Code Duplication · Duplicated block (30–32 lines × 2) · ×1
  • Duplicated block (30–32 lines × 2) src/connector/src/sink/iceberg/writer.rs:331 — src/connector/src/sink/iceberg/writer.rs:331-360 | src/connector/src/sink/iceberg/writer.rs:457-488 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (31 lines × 3) · ×1
  • Duplicated block (31 lines × 3) src/storage/src/hummock/store/version.rs:707 — src/storage/src/hummock/store/version.rs:707-737 | src/storage/src/hummock/store/version.rs:766-796 | src/storage/src/hummock/store/version.rs:832-862 — 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.
D4 · Code Duplication · Duplicated block (31 lines × 2) · ×1
  • Duplicated block (31 lines × 2) src/meta/src/rpc/metrics.rs:1087 — src/meta/src/rpc/metrics.rs:1087-1117 | src/stream/src/executor/monitor/streaming_stats.rs:1606-1636 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (29–30 lines × 2) · ×1
  • Duplicated block (29–30 lines × 2) src/frontend/src/catalog/system_catalog/pg_catalog/pg_constraint.rs:61 — src/frontend/src/catalog/system_catalog/pg_catalog/pg_constraint.rs:61-89 | src/frontend/src/catalog/system_catalog/pg_catalog/pg_constraint.rs:97-126 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (26–30 lines × 2) · ×1
  • Duplicated block (26–30 lines × 2) src/frontend/src/optimizer/plan_node/logical_join.rs:395 — src/frontend/src/optimizer/plan_node/logical_join.rs:395-424 | src/frontend/src/optimizer/plan_node/logical_join.rs:1276-1301 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (28–29 lines × 2) · ×1
  • Duplicated block (28–29 lines × 2) src/frontend/src/handler/alter_owner.rs:196 — src/frontend/src/handler/alter_owner.rs:196-223 | src/frontend/src/handler/alter_set_schema.rs:140-168 — 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.
D4 · Code Duplication · Duplicated block (27–28 lines × 2) · ×1
  • Duplicated block (27–28 lines × 2) src/connector/src/parser/unified/debezium.rs:1242 — src/connector/src/parser/unified/debezium.rs:1242-1268 | src/connector/src/parser/unified/debezium.rs:1315-1342 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (26–28 lines × 2) · ×1
  • Duplicated block (26–28 lines × 2) src/frontend/src/handler/create_aggregate.rs:93 — src/frontend/src/handler/create_aggregate.rs:93-118 | src/frontend/src/handler/create_function.rs:143-170 — before extracting anything, compare `src/frontend/src/handler/create_aggregate.rs` and `src/frontend/src/handler/create_function.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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.
D4 · Code Duplication · Duplicated block (28 lines × 2) · ×1
  • Duplicated block (28 lines × 2) src/stream/src/executor/eowc/eowc_gap_fill.rs:160 — src/stream/src/executor/eowc/eowc_gap_fill.rs:160-187 | src/stream/src/executor/gap_fill.rs:343-370 — before extracting anything, compare `src/stream/src/executor/eowc/eowc_gap_fill.rs` and `src/stream/src/executor/gap_fill.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 78 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.
D4 · Code Duplication · Duplicated block (24–26 lines × 2) · ×1
  • Duplicated block (24–26 lines × 2) src/frontend/src/optimizer/rule/apply_project_set_transpose_rule.rs:55 — src/frontend/src/optimizer/rule/apply_project_set_transpose_rule.rs:55-80 | src/frontend/src/optimizer/rule/apply_project_transpose_rule.rs:51-74 — 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.
D4 · Code Duplication · Duplicated block (23–26 lines × 2) · ×1
  • Duplicated block (23–26 lines × 2) src/stream/src/executor/eowc/eowc_gap_fill.rs:208 — src/stream/src/executor/eowc/eowc_gap_fill.rs:208-230 | src/stream/src/executor/gap_fill.rs:399-424 — before extracting anything, compare `src/stream/src/executor/eowc/eowc_gap_fill.rs` and `src/stream/src/executor/gap_fill.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 78 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.
D4 · Code Duplication · Duplicated block (24–25 lines × 2) · ×1
  • Duplicated block (24–25 lines × 2) src/stream/src/executor/top_n/top_n_cache.rs:508 — src/stream/src/executor/top_n/top_n_cache.rs:508-531 | src/stream/src/executor/top_n/top_n_cache.rs:773-797 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (23–24 lines × 2) · ×1
  • Duplicated block (23–24 lines × 2) src/meta/model/migration/src/m20240701_060504_hummock_time_travel.rs:72 — src/meta/model/migration/src/m20240701_060504_hummock_time_travel.rs:72-95 | src/meta/model/migration/src/m20240820_081248_add_time_travel_per_table_epoch.rs:161-183 — 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.
D4 · Code Duplication · Duplicated block (17–23 lines × 2) · ×1
  • Duplicated block (17–23 lines × 2) src/frontend/src/optimizer/plan_node/batch_hash_join.rs:70 — src/frontend/src/optimizer/plan_node/batch_hash_join.rs:70-86 | src/frontend/src/optimizer/plan_node/stream_join_common.rs:58-80 — 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.
D4 · Code Duplication · Duplicated block (21–22 lines × 2) · ×1
  • Duplicated block (21–22 lines × 2) src/frontend/src/optimizer/rule/min_max_on_index_rule.rs:93 — src/frontend/src/optimizer/rule/min_max_on_index_rule.rs:93-114 | src/frontend/src/optimizer/rule/min_max_on_index_rule.rs:164-184 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (20–22 lines × 2) · ×1
  • Duplicated block (20–22 lines × 2) src/storage/src/hummock/iterator/skip_watermark.rs:361 — src/storage/src/hummock/iterator/skip_watermark.rs:361-380 | src/storage/src/hummock/iterator/skip_watermark.rs:431-452 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (20–21 lines × 3) · ×1
  • Duplicated block (20–21 lines × 3) src/batch/executors/src/executor/azblob_file_scan.rs:93 — src/batch/executors/src/executor/azblob_file_scan.rs:93-113 | src/batch/executors/src/executor/gcs_file_scan.rs:82-101 | src/batch/executors/src/executor/s3_file_scan.rs:96-116 — 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.
D4 · Code Duplication · Duplicated block (16–21 lines × 2) · ×1
  • Duplicated block (16–21 lines × 2) src/storage/src/hummock/store/version.rs:1104 — src/storage/src/hummock/store/version.rs:1104-1124 | src/storage/src/hummock/store/version.rs:1141-1156 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (20 lines × 3) · ×1
  • Duplicated block (20 lines × 3) src/stream/src/executor/source/batch_source/batch_adbc_snowflake_list.rs:126 — src/stream/src/executor/source/batch_source/batch_adbc_snowflake_list.rs:126-145 | src/stream/src/executor/source/batch_source/batch_iceberg_list.rs:148-167 | src/stream/src/executor/source/batch_source/batch_opendal_fs_list.rs:206-225 — before extracting anything, compare `src/stream/src/executor/source/batch_source/batch_adbc_snowflake_list.rs` and `src/stream/src/executor/source/batch_source/batch_iceberg_list.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 89 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.
D4 · Code Duplication · Duplicated block (19–20 lines × 2) · ×1
  • Duplicated block (19–20 lines × 2) src/batch/executors/src/executor/join/hash_join.rs:819 — src/batch/executors/src/executor/join/hash_join.rs:819-838 | src/batch/executors/src/executor/join/hash_join.rs:911-929 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (18–20 lines × 2) · ×1
  • Duplicated block (18–20 lines × 2) src/storage/src/hummock/local_version/pinned_version.rs:115 — src/storage/src/hummock/local_version/pinned_version.rs:115-132 | src/storage/src/hummock/local_version/pinned_version.rs:137-156 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (10–19 lines × 2) · ×1
  • Duplicated block (10–19 lines × 2) src/stream/src/executor/source/source_backfill_executor.rs:237 — src/stream/src/executor/source/source_backfill_executor.rs:237-255 | src/stream/src/executor/source/source_backfill_executor.rs:276-285 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (16–18 lines × 2) · ×1
  • Duplicated block (16–18 lines × 2) src/meta/src/barrier/checkpoint/independent_job/batch_refresh_job/mod.rs:439 — src/meta/src/barrier/checkpoint/independent_job/batch_refresh_job/mod.rs:439-454 | src/meta/src/barrier/checkpoint/state.rs:230-247 — before extracting anything, compare `src/meta/src/barrier/checkpoint/independent_job/batch_refresh_job/mod.rs` and `src/meta/src/barrier/checkpoint/state.rs` as WHOLE FILES: this scan already matched 3 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.
D4 · Code Duplication · Duplicated block (15–18 lines × 2) · ×1
  • Duplicated block (15–18 lines × 2) src/stream/src/executor/backfill/cdc/cdc_backill_v2.rs:489 — src/stream/src/executor/backfill/cdc/cdc_backill_v2.rs:489-506 | src/stream/src/executor/backfill/cdc/cdc_backill_v2.rs:685-699 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (12–17 lines × 3) · ×1
  • Duplicated block (12–17 lines × 3) src/connector/src/connector_common/iceberg/mod.rs:700 — src/connector/src/connector_common/iceberg/mod.rs:700-711 | src/connector/src/connector_common/iceberg/mod.rs:829-840 | src/connector/src/connector_common/iceberg/mod.rs:885-901 — 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.
D4 · Code Duplication · Duplicated block (17 lines × 3) · ×1
  • Duplicated block (17 lines × 3) src/meta/src/barrier/checkpoint/state.rs:597 — src/meta/src/barrier/checkpoint/state.rs:597-613 | src/meta/src/barrier/checkpoint/state.rs:730-746 | src/meta/src/barrier/checkpoint/state.rs:861-877 — 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.
D4 · Code Duplication · Duplicated block (11–17 lines × 2) · ×1
  • Duplicated block (11–17 lines × 2) src/cmd_all/src/standalone.rs:131 — src/cmd_all/src/standalone.rs:131-141 | src/cmd_all/src/standalone.rs:145-161 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (14–16 lines × 3) · ×1
  • Duplicated block (14–16 lines × 3) src/storage/hummock_sdk/src/compaction_group/hummock_version_ext.rs:356 — src/storage/hummock_sdk/src/compaction_group/hummock_version_ext.rs:356-369 | src/storage/hummock_sdk/src/compaction_group/hummock_version_ext.rs:959-972 | src/storage/hummock_sdk/src/compaction_group/mod.rs:323-338 — 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.
D4 · Code Duplication · Duplicated block (13–16 lines × 2) · ×1
  • Duplicated block (13–16 lines × 2) src/frontend/src/optimizer/rule/pull_up_hop_rule.rs:72 — src/frontend/src/optimizer/rule/pull_up_hop_rule.rs:72-84 | src/frontend/src/optimizer/rule/pull_up_hop_rule.rs:109-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.
D4 · Code Duplication · Duplicated block (15 lines × 4) · ×1
  • Duplicated block (15 lines × 4) src/stream/src/executor/source/batch_source/batch_adbc_snowflake_list.rs:130 — src/stream/src/executor/source/batch_source/batch_adbc_snowflake_list.rs:130-144 | src/stream/src/executor/source/batch_source/batch_iceberg_list.rs:152-166 | src/stream/src/executor/source/batch_source/batch_opendal_fs_list.rs:210-224 | src/stream/src/executor/source/batch_source/batch_posix_fs_list.rs:249-263 — before extracting anything, compare `src/stream/src/executor/source/batch_source/batch_adbc_snowflake_list.rs` and `src/stream/src/executor/source/batch_source/batch_iceberg_list.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 89 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.
D4 · Code Duplication · Duplicated block (11–15 lines × 2) · ×1
  • Duplicated block (11–15 lines × 2) src/meta/src/controller/streaming_job.rs:4130 — src/meta/src/controller/streaming_job.rs:4130-4140 | src/meta/src/controller/streaming_job.rs:4196-4210 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (13–14 lines × 3) · ×1
  • Duplicated block (13–14 lines × 3) src/stream/src/executor/source/batch_source/batch_adbc_snowflake_list.rs:112 — src/stream/src/executor/source/batch_source/batch_adbc_snowflake_list.rs:112-124 | src/stream/src/executor/source/batch_source/batch_iceberg_list.rs:109-121 | src/stream/src/executor/source/batch_source/batch_opendal_fs_list.rs:188-201 — before extracting anything, compare `src/stream/src/executor/source/batch_source/batch_adbc_snowflake_list.rs` and `src/stream/src/executor/source/batch_source/batch_iceberg_list.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 89 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.
D4 · Code Duplication · Duplicated block (10–14 lines × 2) · ×1
  • Duplicated block (10–14 lines × 2) src/common/src/field_generator/numeric.rs:75 — src/common/src/field_generator/numeric.rs:75-84 | src/common/src/field_generator/numeric.rs:117-130 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (8–14 lines × 2) · ×1
  • Duplicated block (8–14 lines × 2) src/frontend/src/datafusion/aggregate/two_phase.rs:276 — src/frontend/src/datafusion/aggregate/two_phase.rs:276-283 | src/frontend/src/datafusion/aggregate/two_phase.rs:323-336 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (12–14 lines × 2) · ×1
  • Duplicated block (12–14 lines × 2) src/meta/src/controller/streaming_job.rs:2882 — src/meta/src/controller/streaming_job.rs:2882-2893 | src/meta/src/controller/streaming_job.rs:3847-3860 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (12–13 lines × 3) · ×1
  • Duplicated block (12–13 lines × 3) src/frontend/src/session.rs:1056 — src/frontend/src/session.rs:1056-1068 | src/frontend/src/session.rs:1113-1124 | src/frontend/src/session.rs:1133-1145 — 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.
D4 · Code Duplication · Duplicated block (10–13 lines × 3) · ×1
  • Duplicated block (10–13 lines × 3) src/meta/src/controller/catalog/alter_op.rs:51 — src/meta/src/controller/catalog/alter_op.rs:51-60 | src/meta/src/controller/catalog/alter_op.rs:851-860 | src/meta/src/controller/catalog/alter_op.rs:883-895 — 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.
D4 · Code Duplication · Duplicated block (9–13 lines × 2) · ×1
  • Duplicated block (9–13 lines × 2) src/stream/src/executor/join/asof_join.rs:602 — src/stream/src/executor/join/asof_join.rs:602-610 | src/stream/src/executor/join/asof_join.rs:632-644 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (12 lines × 6) · ×1
  • Duplicated block (12 lines × 6) src/stream/src/executor/source/batch_source/batch_adbc_snowflake_list.rs:92 — src/stream/src/executor/source/batch_source/batch_adbc_snowflake_list.rs:92-103 | src/stream/src/executor/source/batch_source/batch_iceberg_list.rs:75-86 | src/stream/src/executor/source/batch_source/batch_opendal_fs_list.rs:164-175 | src/stream/src/executor/source/batch_source/batch_posix_fs_list.rs:208-219 | src/stream/src/executor/source/fs_list_executor.rs:106-117 | src/stream/src/executor/source/iceberg_list_executor.rs:93-104 — before extracting anything, compare `src/stream/src/executor/source/batch_source/batch_adbc_snowflake_list.rs` and `src/stream/src/executor/source/batch_source/batch_iceberg_list.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 89 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.
D4 · Code Duplication · Duplicated block (12 lines × 5) · ×1
  • Duplicated block (12 lines × 5) src/frontend/src/catalog/system_catalog/rw_catalog/rw_connections.rs:38 — src/frontend/src/catalog/system_catalog/rw_catalog/rw_connections.rs:38-49 | src/frontend/src/catalog/system_catalog/rw_catalog/rw_functions.rs:42-53 | src/frontend/src/catalog/system_catalog/rw_catalog/rw_materialized_views.rs:44-55 | src/frontend/src/catalog/system_catalog/rw_catalog/rw_secrets.rs:34-45 | src/frontend/src/catalog/system_catalog/rw_catalog/rw_tables.rs:41-52 — 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.
D4 · Code Duplication · Duplicated block (11–12 lines × 5) · ×1
  • Duplicated block (11–12 lines × 5) src/frontend/src/catalog/system_catalog/rw_catalog/rw_internal_tables.rs:40 — src/frontend/src/catalog/system_catalog/rw_catalog/rw_internal_tables.rs:40-51 | src/frontend/src/catalog/system_catalog/rw_catalog/rw_sinks.rs:53-63 | src/frontend/src/catalog/system_catalog/rw_catalog/rw_sources.rs:55-65 | src/frontend/src/catalog/system_catalog/rw_catalog/rw_subscriptions.rs:41-52 | src/frontend/src/catalog/system_catalog/rw_catalog/rw_views.rs:37-47 — 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.
D4 · Code Duplication · Duplicated block (6–12 lines × 4) · ×1
  • Duplicated block (6–12 lines × 4) src/frontend/src/optimizer/plan_node/stream_dml.rs:36 — src/frontend/src/optimizer/plan_node/stream_dml.rs:36-41 | src/frontend/src/optimizer/plan_node/stream_iceberg_with_pk_index_position_delete_merger.rs:50-55 | src/frontend/src/optimizer/plan_node/stream_sink.rs:216-227 | src/frontend/src/optimizer/plan_node/stream_sync_log_store.rs:40-45 — 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.
D4 · Code Duplication · Duplicated block (4–12 lines × 3) · ×1
  • Duplicated block (4–12 lines × 3) src/frontend/src/optimizer/plan_node/generic/filter.rs:70 — src/frontend/src/optimizer/plan_node/generic/filter.rs:70-73 | src/frontend/src/optimizer/plan_node/generic/join.rs:405-416 | src/frontend/src/optimizer/plan_node/logical_multi_join.rs:274-285 — 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.
D4 · Code Duplication · Duplicated block (11 lines × 11) · ×1
  • Duplicated block (11 lines × 11) REDACTED:286 — REDACTED:286-296 | src/connector/src/sink/clickhouse.rs:383-393 | src/connector/src/sink/doris.rs:116-126 | src/connector/src/sink/file_sink/azblob.rs:113-123 | src/connector/src/sink/file_sink/fs.rs:82-92 | src/connector/src/sink/file_sink/gcs.rs:98-108 | src/connector/src/sink/file_sink/s3.rs:142-152 | src/connector/src/sink/file_sink/webhdfs.rs:87-97 | src/connector/src/sink/mongodb.rs:169-179 | src/connector/src/sink/postgres.rs:154-164 | src/connector/src/sink/sqlserver.rs:86-96 — before extracting anything, compare `src/connector/src/sink/doris.rs` and `src/connector/src/sink/sqlserver.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 36 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.
D4 · Code Duplication · Duplicated block (9–11 lines × 3) · ×1
  • Duplicated block (9–11 lines × 3) src/stream/src/executor/backfill/arrangement_backfill.rs:341 — src/stream/src/executor/backfill/arrangement_backfill.rs:341-349 | src/stream/src/executor/backfill/arrangement_backfill.rs:395-403 | REDACTED:860-870 — 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.
D4 · Code Duplication · Duplicated block (7–11 lines × 2) · ×1
  • Duplicated block (7–11 lines × 2) src/stream/src/executor/source/batch_source/batch_opendal_fs_fetch.rs:161 — src/stream/src/executor/source/batch_source/batch_opendal_fs_fetch.rs:161-167 | src/stream/src/executor/source/fs_fetch_executor.rs:210-220 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (8–10 lines × 5) · ×1
  • Duplicated block (8–10 lines × 5) src/meta/src/hummock/mod.rs:102 — src/meta/src/hummock/mod.rs:102-109 | src/meta/src/hummock/mod.rs:136-145 | src/meta/src/hummock/mod.rs:163-172 | src/meta/src/hummock/mod.rs:200-209 | src/meta/src/rpc/metrics.rs:1152-1161 — 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.
D4 · Code Duplication · Duplicated block (9 lines × 13) · ×1
  • Duplicated block (9 lines × 13) REDACTED:286 — REDACTED:286-294 | src/connector/src/sink/clickhouse.rs:383-391 | src/connector/src/sink/doris.rs:116-124 | src/connector/src/sink/file_sink/azblob.rs:113-121 | src/connector/src/sink/file_sink/fs.rs:82-90 | src/connector/src/sink/file_sink/gcs.rs:98-106 | src/connector/src/sink/file_sink/s3.rs:142-150 | src/connector/src/sink/file_sink/webhdfs.rs:87-95 | src/connector/src/sink/mongodb.rs:169-177 | src/connector/src/sink/postgres.rs:154-162 | src/connector/src/sink/snowflake_redshift/snowflake.rs:233-241 | src/connector/src/sink/sqlserver.rs:86-94 | src/connector/src/sink/starrocks.rs:159-167 — before extracting anything, compare `src/connector/src/sink/doris.rs` and `src/connector/src/sink/sqlserver.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 36 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.
D4 · Code Duplication · Duplicated block (9 lines × 11) · ×1
  • Duplicated block (9 lines × 11) src/batch/executors/src/executor/join/hash_join.rs:794 — src/batch/executors/src/executor/join/hash_join.rs:794-802 | src/batch/executors/src/executor/join/hash_join.rs:875-883 | src/batch/executors/src/executor/join/hash_join.rs:972-980 | src/batch/executors/src/executor/join/hash_join.rs:1050-1058 | src/batch/executors/src/executor/join/hash_join.rs:1110-1118 | src/batch/executors/src/executor/join/hash_join.rs:1183-1191 | src/batch/executors/src/executor/join/hash_join.rs:1261-1269 | src/batch/executors/src/executor/join/hash_join.rs:1323-1331 | src/batch/executors/src/executor/join/hash_join.rs:1440-1448 | src/batch/executors/src/executor/join/hash_join.rs:1510-1518 | src/batch/executors/src/executor/join/hash_join.rs:1589-1597 — all 11 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.
D4 · Code Duplication · Duplicated block (9 lines × 6) · ×1
  • Duplicated block (9 lines × 6) src/frontend/src/optimizer/plan_node/generic/file_scan.rs:111 — src/frontend/src/optimizer/plan_node/generic/file_scan.rs:111-119 | src/frontend/src/optimizer/plan_node/generic/file_scan.rs:158-166 | src/frontend/src/optimizer/plan_node/generic/file_scan.rs:171-179 | src/frontend/src/optimizer/plan_node/generic/mssql_query.rs:83-91 | src/frontend/src/optimizer/plan_node/generic/mysql_query.rs:58-66 | src/frontend/src/optimizer/plan_node/generic/postgres_query.rs:60-68 — there are 6 copies across 4 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 6 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (8–9 lines × 5) · ×1
  • Duplicated block (8–9 lines × 5) src/frontend/src/handler/alter_owner.rs:92 — src/frontend/src/handler/alter_owner.rs:92-100 | src/frontend/src/handler/alter_owner.rs:107-114 | src/frontend/src/handler/alter_owner.rs:121-128 | src/frontend/src/handler/alter_owner.rs:137-145 | src/frontend/src/handler/alter_owner.rs:154-162 — 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.
D4 · Code Duplication · Duplicated block (9 lines × 4) · ×1
  • Duplicated block (9 lines × 4) src/frontend/src/optimizer/rule/table_function_to_file_scan_rule.rs:34 — src/frontend/src/optimizer/rule/table_function_to_file_scan_rule.rs:34-42 | src/frontend/src/optimizer/rule/table_function_to_mssql_query_rule.rs:62-70 | src/frontend/src/optimizer/rule/table_function_to_mysql_query_rule.rs:33-41 | src/frontend/src/optimizer/rule/table_function_to_postgres_query_rule.rs:34-42 — before extracting anything, compare `src/frontend/src/optimizer/rule/table_function_to_mysql_query_rule.rs` and `src/frontend/src/optimizer/rule/table_function_to_postgres_query_rule.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 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.
D4 · Code Duplication · Duplicated block (8 lines × 9) · ×1
  • Duplicated block (8 lines × 9) src/frontend/src/handler/handle_privilege.rs:79 — src/frontend/src/handler/handle_privilege.rs:79-86 | src/frontend/src/handler/handle_privilege.rs:103-110 | src/frontend/src/handler/handle_privilege.rs:140-147 | src/frontend/src/handler/handle_privilege.rs:154-161 | src/frontend/src/handler/handle_privilege.rs:169-176 | src/frontend/src/handler/handle_privilege.rs:183-190 | src/frontend/src/handler/handle_privilege.rs:197-204 | src/frontend/src/handler/handle_privilege.rs:210-217 | src/frontend/src/handler/handle_privilege.rs:255-262 — all 9 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.
D4 · Code Duplication · Duplicated block (1–8 lines × 3) · ×1
  • Duplicated block (1–8 lines × 3) src/common/src/array/arrow/arrow_impl.rs:260 — src/common/src/array/arrow/arrow_impl.rs:260-267 | src/common/src/array/arrow/arrow_impl.rs:285-292 | src/common/src/array/arrow/arrow_impl.rs:336-336 — 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.
D4 · Code Duplication · Duplicated block (7–8 lines × 2) · ×1
  • Duplicated block (7–8 lines × 2) src/meta/src/controller/catalog/alter_op.rs:116 — src/meta/src/controller/catalog/alter_op.rs:116-122 | src/meta/src/controller/catalog/drop_op.rs:32-39 — 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.
D4 · Code Duplication · Duplicated block (6–7 lines × 14) · ×1
  • Duplicated block (6–7 lines × 14) src/frontend/src/handler/alter_connection_props.rs:31 — src/frontend/src/handler/alter_connection_props.rs:31-36 | src/frontend/src/handler/alter_mv.rs:41-47 | src/frontend/src/handler/alter_rename.rs:38-44 | src/frontend/src/handler/alter_rename.rs:82-88 | src/frontend/src/handler/alter_rename.rs:112-118 | src/frontend/src/handler/alter_rename.rs:141-147 | src/frontend/src/handler/alter_rename.rs:172-178 | src/frontend/src/handler/alter_rename.rs:203-209 | src/frontend/src/handler/alter_source_props.rs:37-42 | src/frontend/src/handler/alter_source_props.rs:141-146 | src/frontend/src/handler/alter_subscription_retention.rs:91-96 | src/frontend/src/handler/drop_index.rs:39-44 | src/frontend/src/handler/drop_mv.rs:36-42 | src/frontend/src/handler/drop_view.rs:33-39 — there are 14 copies across 8 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 14 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (6 lines × 10) · ×1
  • Duplicated block (6 lines × 10) src/batch/executors/src/executor/hash_agg.rs:386 — src/batch/executors/src/executor/hash_agg.rs:386-391 | src/batch/executors/src/executor/hash_agg.rs:409-414 | src/batch/executors/src/executor/hash_agg.rs:425-430 | src/batch/executors/src/executor/hash_agg.rs:436-441 | src/batch/executors/src/executor/join/hash_join.rs:352-357 | src/batch/executors/src/executor/join/hash_join.rs:380-385 | src/batch/executors/src/executor/join/hash_join.rs:396-401 | src/batch/executors/src/executor/join/hash_join.rs:407-412 | src/batch/executors/src/executor/order_by.rs:384-389 | src/batch/executors/src/executor/order_by.rs:401-406 — before extracting anything, compare `src/batch/executors/src/executor/hash_agg.rs` and `src/batch/executors/src/executor/join/hash_join.rs` as WHOLE FILES: this scan already matched 6 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.
D4 · Code Duplication · Duplicated block (5 lines × 9) · ×1
  • Duplicated block (5 lines × 9) src/frontend/src/handler/alter_connection_props.rs:30 — src/frontend/src/handler/alter_connection_props.rs:30-35 | src/frontend/src/handler/alter_source_props.rs:36-41 | src/frontend/src/handler/alter_source_props.rs:140-145 | src/frontend/src/handler/alter_subscription_retention.rs:90-95 | src/frontend/src/handler/drop_index.rs:39-43 | src/frontend/src/handler/drop_mv.rs:36-41 | src/frontend/src/handler/drop_sink.rs:35-39 | src/frontend/src/handler/drop_subscription.rs:33-38 | src/frontend/src/handler/drop_view.rs:33-38 — there are 9 copies across 8 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 9 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (4–5 lines × 6) · ×1
  • Duplicated block (4–5 lines × 6) src/frontend/src/handler/alter_mv.rs:40 — src/frontend/src/handler/alter_mv.rs:40-44 | src/frontend/src/handler/alter_source_with_sr.rs:105-109 | src/frontend/src/handler/alter_table_column.rs:326-331 | src/frontend/src/handler/alter_utils.rs:63-66 | src/frontend/src/handler/drop_secret.rs:65-69 | src/frontend/src/handler/util.rs:331-336 — 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.
D4 · Code Duplication · Duplicated block (4–5 lines × 3) · ×1
  • Duplicated block (4–5 lines × 3) src/common/src/array/arrow/arrow_iceberg.rs:146 — src/common/src/array/arrow/arrow_iceberg.rs:146-150 | src/common/src/array/arrow/arrow_iceberg.rs:518-521 | src/common/src/array/arrow/arrow_impl.rs:382-386 — 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.
D4 · Code Duplication · Duplicated block (9 lines × 9) · ×1
  • Duplicated block (9 lines × 9) src/frontend/src/optimizer/plan_node/logical_agg.rs:1231 — src/frontend/src/optimizer/plan_node/logical_agg.rs:1231-1239 | src/frontend/src/optimizer/plan_node/logical_filter.rs:168-176 | src/frontend/src/optimizer/plan_node/logical_join.rs:720-728 | src/frontend/src/optimizer/plan_node/logical_project.rs:179-187 | src/frontend/src/optimizer/plan_node/logical_project_set.rs:302-310 | src/frontend/src/optimizer/plan_node/logical_scan.rs:457-465 | src/frontend/src/optimizer/plan_node/stream_eowc_gap_fill.rs:195-203 | src/frontend/src/optimizer/plan_node/stream_gap_fill.rs:193-201 | src/frontend/src/optimizer/plan_node/stream_match_recognize.rs:278-286 — before extracting anything, compare `src/frontend/src/optimizer/plan_node/logical_project.rs` and `src/frontend/src/optimizer/plan_node/logical_project_set.rs` as WHOLE FILES: this scan already matched 5 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. 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.
D4 · Code Duplication · Duplicated block (14 lines × 4) · ×1
  • Duplicated block (14 lines × 4) src/risedevtool/src/task/compactor_service.rs:89 — src/risedevtool/src/task/compactor_service.rs:89-102 | src/risedevtool/src/task/compute_node_service.rs:111-124 | src/risedevtool/src/task/frontend_service.rs:102-115 | src/risedevtool/src/task/meta_node_service.rs:274-287 — before extracting anything, compare `src/risedevtool/src/task/compactor_service.rs` and `src/risedevtool/src/task/compute_node_service.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 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.
D4 · Code Duplication · Duplicated block (11 lines × 5) · ×1
  • Duplicated block (11 lines × 5) src/meta/src/manager/diagnose.rs:412 — src/meta/src/manager/diagnose.rs:412-422 | src/meta/src/manager/diagnose.rs:426-436 | src/meta/src/manager/diagnose.rs:440-450 | src/meta/src/manager/diagnose.rs:454-464 | src/meta/src/manager/diagnose.rs:468-478 — 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.
D4 · Code Duplication · Duplicated block (7 lines × 5) · ×1
  • Duplicated block (7 lines × 5) src/meta/src/controller/utils.rs:941 — src/meta/src/controller/utils.rs:941-950 | src/meta/src/controller/utils.rs:960-966 | src/meta/src/controller/utils.rs:976-982 | src/meta/src/controller/utils.rs:1013-1019 | src/meta/src/controller/utils.rs:1029-1035 — 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.
D4 · Code Duplication · Duplicated block (7 lines × 12) · ×1
  • Duplicated block (7 lines × 12) src/sqlparser/src/parser.rs:3394 — src/sqlparser/src/parser.rs:3394-3402 | src/sqlparser/src/parser.rs:3409-3417 | src/sqlparser/src/parser.rs:3560-3568 | src/sqlparser/src/parser.rs:3575-3583 | src/sqlparser/src/parser.rs:3590-3596 | src/sqlparser/src/parser.rs:3670-3678 | src/sqlparser/src/parser.rs:3702-3709 | src/sqlparser/src/parser.rs:3778-3785 | src/sqlparser/src/parser.rs:3792-3799 | src/sqlparser/src/parser.rs:3806-3812 | src/sqlparser/src/parser.rs:3935-3942 | src/sqlparser/src/parser.rs:3949-3956 — all 12 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.
D4 · Code Duplication · Duplicated block (5 lines × 7) · ×1
  • Duplicated block (5 lines × 7) src/risedevtool/src/bin/risedev-dev.rs:188 — src/risedevtool/src/bin/risedev-dev.rs:188-193 | src/risedevtool/src/bin/risedev-dev.rs:208-213 | src/risedevtool/src/bin/risedev-dev.rs:217-222 | src/risedevtool/src/bin/risedev-dev.rs:253-258 | src/risedevtool/src/bin/risedev-dev.rs:397-402 | src/risedevtool/src/bin/risedev-dev.rs:405-410 | src/risedevtool/src/bin/risedev-dev.rs:423-427 — all 7 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.
D4 · Code Duplication · Duplicated block (24–30 lines × 2) · ×1
  • Duplicated block (24–30 lines × 2) java/connector-node/risingwave-connector-service/src/main/java/com/risingwave/connector/source/common/DbzConnectorConfig.java:200 — java/connector-node/risingwave-connector-service/src/main/java/com/risingwave/connector/source/common/DbzConnectorConfig.java:200-229 | java/connector-node/risingwave-connector-service/src/main/java/com/risingwave/connector/source/common/DbzConnectorConfig.java:364-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. Read the line range as the matched WINDOW rather than a finished unit: at `java/connector-node/risingwave-connector-service/src/main/java/com/risingwave/connector/source/common/DbzConnectorConfig.java:200` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (22–23 lines × 2) · ×1
  • Duplicated block (22–23 lines × 2) java/connector-node/risingwave-source-cdc/src/main/java/io/debezium/connector/postgresql/connection/PostgresConnection.java:238 — java/connector-node/risingwave-source-cdc/src/main/java/io/debezium/connector/postgresql/connection/PostgresConnection.java:238-260 | java/connector-node/risingwave-source-cdc/src/main/java/io/debezium/connector/postgresql/connection/PostgresConnection.java:285-306 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (8–10 lines × 3) · ×1
  • Duplicated block (8–10 lines × 3) java/connector-node/risingwave-connector-service/src/main/java/com/risingwave/connector/source/common/MySqlValidator.java:112 — java/connector-node/risingwave-connector-service/src/main/java/com/risingwave/connector/source/common/MySqlValidator.java:112-121 | java/connector-node/risingwave-connector-service/src/main/java/com/risingwave/connector/source/common/MySqlValidator.java:123-132 | java/connector-node/risingwave-connector-service/src/main/java/com/risingwave/connector/source/common/MySqlValidator.java:133-140 — 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 `java/connector-node/risingwave-connector-service/src/main/java/com/risingwave/connector/source/common/MySqlValidator.java:112` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `java/connector-node/risingwave-connector-service/src/main/java/com/risingwave/connector/source/common/MySqlValidator.java:108` calls `validateBinlogConfig` and `java/connector-node/risingwave-connector-service/src/main/java/com/risingwave/connector/source/common/MySqlValidator.java:118` 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.
D4 · Code Duplication · Near-duplicate member family (3 members, 66 shared lines) · ×1
  • Near-duplicate member family (3 members, 66 shared lines) integration_tests/feature-store/server/src/model.rs:250 — integration_tests/feature-store/server/src/model.rs:250-354 | integration_tests/feature-store/server/src/server_pb.rs:429-673 | integration_tests/feature-store/simulator/src/server_pb.rs:429-673 — These 3 members are variants of one another: a block of 66 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.
D4 · Code Duplication · Edited copy of a member (32 corresponding lines) · ×1
  • Edited copy of a member (32 corresponding lines) REDACTED:449 — REDACTED:449-480 | REDACTED:483-514 — These two members are one piece of code written twice and then edited apart: 32 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 (12 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (12 members, 50+ identical tokens) integration_tests/feature-store/server/src/model.rs:112 — integration_tests/feature-store/server/src/model.rs:112-127 | integration_tests/feature-store/server/src/model.rs:134-149 | integration_tests/feature-store/server/src/server_pb.rs:189-207 | integration_tests/feature-store/server/src/server_pb.rs:214-232 | integration_tests/feature-store/server/src/server_pb.rs:239-257 | integration_tests/feature-store/server/src/server_pb.rs:264-282 | integration_tests/feature-store/server/src/server_pb.rs:289-307 | integration_tests/feature-store/simulator/src/server_pb.rs:189-207 | integration_tests/feature-store/simulator/src/server_pb.rs:214-232 | integration_tests/feature-store/simulator/src/server_pb.rs:239-257 | integration_tests/feature-store/simulator/src/server_pb.rs:264-282 | integration_tests/feature-store/simulator/src/server_pb.rs:289-307 — These 12 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 12 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 12 times.
D4 · Code Duplication · Duplicated block (225 lines × 2) · ×1
  • Duplicated block (225 lines × 2) integration_tests/feature-store/server/src/server_pb.rs:430 — integration_tests/feature-store/server/src/server_pb.rs:430-654 | integration_tests/feature-store/simulator/src/server_pb.rs:430-654 — before extracting anything, compare `integration_tests/feature-store/server/src/server_pb.rs` and `integration_tests/feature-store/simulator/src/server_pb.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 380 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.
D4 · Code Duplication · Duplicated block (28 lines × 3) · ×1
  • Duplicated block (28 lines × 3) integration_tests/feature-store/server/src/model.rs:327 — integration_tests/feature-store/server/src/model.rs:327-354 | integration_tests/feature-store/server/src/server_pb.rs:646-673 | integration_tests/feature-store/simulator/src/server_pb.rs:646-673 — before extracting anything, compare `integration_tests/feature-store/server/src/model.rs` and `integration_tests/feature-store/server/src/server_pb.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 85 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.
D4 · Code Duplication · Duplicated block (15 lines × 12) · ×1
  • Duplicated block (15 lines × 12) integration_tests/feature-store/server/src/model.rs:282 — integration_tests/feature-store/server/src/model.rs:282-296 | integration_tests/feature-store/server/src/model.rs:326-340 | integration_tests/feature-store/server/src/server_pb.rs:461-475 | integration_tests/feature-store/server/src/server_pb.rs:507-521 | integration_tests/feature-store/server/src/server_pb.rs:553-567 | integration_tests/feature-store/server/src/server_pb.rs:599-613 | integration_tests/feature-store/server/src/server_pb.rs:645-659 | integration_tests/feature-store/simulator/src/server_pb.rs:461-475 | integration_tests/feature-store/simulator/src/server_pb.rs:507-521 | integration_tests/feature-store/simulator/src/server_pb.rs:553-567 | integration_tests/feature-store/simulator/src/server_pb.rs:599-613 | integration_tests/feature-store/simulator/src/server_pb.rs:645-659 — before extracting anything, compare `integration_tests/feature-store/server/src/model.rs` and `integration_tests/feature-store/server/src/server_pb.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 85 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.
D4 · Code Duplication · Duplicated block (10–11 lines × 12) · ×1
  • Duplicated block (10–11 lines × 12) integration_tests/feature-store/server/src/model.rs:113 — integration_tests/feature-store/server/src/model.rs:113-122 | integration_tests/feature-store/server/src/model.rs:135-144 | integration_tests/feature-store/server/src/server_pb.rs:190-200 | integration_tests/feature-store/server/src/server_pb.rs:215-225 | integration_tests/feature-store/server/src/server_pb.rs:240-250 | integration_tests/feature-store/server/src/server_pb.rs:265-275 | integration_tests/feature-store/server/src/server_pb.rs:290-300 | integration_tests/feature-store/simulator/src/server_pb.rs:190-200 | integration_tests/feature-store/simulator/src/server_pb.rs:215-225 | integration_tests/feature-store/simulator/src/server_pb.rs:240-250 | integration_tests/feature-store/simulator/src/server_pb.rs:265-275 | integration_tests/feature-store/simulator/src/server_pb.rs:290-300 — before extracting anything, compare `integration_tests/feature-store/server/src/model.rs` and `integration_tests/feature-store/server/src/server_pb.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 85 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.
D4 · Code Duplication · Duplicated block (11 lines × 12) · ×1
  • Duplicated block (11 lines × 12) integration_tests/feature-store/server/src/model.rs:270 — integration_tests/feature-store/server/src/model.rs:270-280 | integration_tests/feature-store/server/src/model.rs:314-324 | integration_tests/feature-store/server/src/server_pb.rs:449-459 | integration_tests/feature-store/server/src/server_pb.rs:495-505 | integration_tests/feature-store/server/src/server_pb.rs:541-551 | integration_tests/feature-store/server/src/server_pb.rs:587-597 | integration_tests/feature-store/server/src/server_pb.rs:633-643 | integration_tests/feature-store/simulator/src/server_pb.rs:449-459 | integration_tests/feature-store/simulator/src/server_pb.rs:495-505 | integration_tests/feature-store/simulator/src/server_pb.rs:541-551 | integration_tests/feature-store/simulator/src/server_pb.rs:587-597 | integration_tests/feature-store/simulator/src/server_pb.rs:633-643 — before extracting anything, compare `integration_tests/feature-store/server/src/model.rs` and `integration_tests/feature-store/server/src/server_pb.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 85 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.
D4 · Code Duplication · Duplicated block (90 lines × 2) · ×1
  • Duplicated block (90 lines × 2) e2e_test/s3/file_sink.py:173 — e2e_test/s3/file_sink.py:173-262 | e2e_test/s3/file_sink.py:266-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. Read the line range as the matched WINDOW rather than a finished unit: at `e2e_test/s3/file_sink.py:173` 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.
D4 · Code Duplication · Duplicated block (38–42 lines × 2) · ×1
  • Duplicated block (38–42 lines × 2) e2e_test/s3/file_source.py:70 — e2e_test/s3/file_source.py:70-111 | e2e_test/s3/file_source.py:249-286 — both copies are in the same file, so extract the 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.
D4 · Code Duplication · Duplicated block (34–40 lines × 3) · ×1
  • Duplicated block (34–40 lines × 3) e2e_test/s3/file_source.py:59 — e2e_test/s3/file_source.py:59-94 | e2e_test/s3/file_source.py:160-199 | e2e_test/s3/file_source.py:239-272 — 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 `e2e_test/s3/file_source.py:239` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (10–30 lines × 4) · ×1
  • Duplicated block (10–30 lines × 4) e2e_test/webhook/websocket_sender.py:456 — e2e_test/webhook/websocket_sender.py:456-465 | e2e_test/webhook/websocket_sender.py:481-510 | e2e_test/webhook/websocket_sender.py:514-543 | e2e_test/webhook/websocket_sender.py:547-574 — 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 `e2e_test/webhook/websocket_sender.py:456` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (18–23 lines × 2) · ×1
  • Duplicated block (18–23 lines × 2) e2e_test/s3/file_source.py:20 — e2e_test/s3/file_source.py:20-37 | e2e_test/s3/file_source.py:124-146 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (11–22 lines × 3) · ×1
  • Duplicated block (11–22 lines × 3) integration_tests/iceberg-sink2/python/main.py:39 — integration_tests/iceberg-sink2/python/main.py:39-60 | integration_tests/iceberg-sink2/python/main.py:116-126 | integration_tests/iceberg-source/python/main.py:41-62 — 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.
D4 · Code Duplication · Duplicated block (14–15 lines × 4) · ×1
  • Duplicated block (14–15 lines × 4) REDACTED:96 — REDACTED:96-110 | REDACTED:174-188 | REDACTED:296-310 | REDACTED:548-561 — 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.
D4 · Code Duplication · Duplicated block (13–14 lines × 8) · ×1
  • Duplicated block (13–14 lines × 8) REDACTED:95 — REDACTED:95-108 | REDACTED:123-136 | REDACTED:148-161 | REDACTED:173-186 | REDACTED:295-308 | REDACTED:338-351 | REDACTED:360-372 | REDACTED:547-559 — all 8 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, `REDACTED:137` calls `sleep` and `REDACTED:109` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (11–14 lines × 3) · ×1
  • Duplicated block (11–14 lines × 3) REDACTED:81 — REDACTED:81-91 | REDACTED:107-119 | REDACTED:238-251 — 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.
D5 · Coupling · Unstable project risingwave_cmd · ×1
  • Unstable project risingwave_cmd — risingwave_cmd has instability 0.92 with 1 dependents.
D5 · Coupling · Unstable project risingwave_compute · ×1
  • Unstable project risingwave_compute — risingwave_compute has instability 0.88 with 2 dependents.
D5 · Coupling · Unstable project risingwave_ctl · ×1
  • Unstable project risingwave_ctl — risingwave_ctl has instability 0.86 with 2 dependents.
D5 · Coupling · Unstable project risingwave_frontend · ×1
  • Unstable project risingwave_frontend — risingwave_frontend has instability 0.86 with 3 dependents.
D5 · Coupling · Unstable project risingwave_meta · ×1
  • Unstable project risingwave_meta — risingwave_meta has instability 0.84 with 3 dependents.
D5 · Coupling · Unstable project risingwave_meta_node · ×1
  • Unstable project risingwave_meta_node — risingwave_meta_node has instability 0.82 with 2 dependents.
D5 · Coupling · Unstable project risingwave_meta_service · ×1
  • Unstable project risingwave_meta_service — risingwave_meta_service has instability 0.90 with 1 dependents.
D5 · Coupling · Unstable project risingwave_stream · ×1
  • Unstable project risingwave_stream — risingwave_stream has instability 0.87 with 2 dependents.
D8 · Code Coverage · Coverage not measured · ×1
  • Coverage not measured — .NET and JavaScript/TypeScript suite — 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 could not be measured — the jest suite in src/utils/pgwire/tests/js/ ran and not one test passed (FAIL test/pgwire.test.ts), so the coverage would describe the failed run, not the code. 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. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan. Alternatively, commit the lcov/Cobertura report your CI produces and it is read without a re-run.
DM7 · Repository granularity · Repository for a non-root entity · ×1
  • Repository for a non-root entity: SpringTestRepository → SpringTest integration_tests/client-library/spring-boot/src/main/java/com/risingwave/SpringTestRepository.java:8 — `SpringTestRepository` is a repository over `SpringTest`, which is an entity but not an aggregate root. Repositories should be per aggregate ROOT — loading/saving a child entity independently lets callers bypass the root's invariants. Access `SpringTest` through its owning aggregate instead.
M1 · Documentation (README) · README may be stale · ×1
  • README may be stale — 1270 code files changed in the last 6 months but the README was not touched — it may no longer reflect the system.
P3 · Security & performance tooling · SAST runs, but gates no merge · ×1
  • SAST runs, but gates no merge — `REDACTED` run(s) a static-analysis scan, but no workflow that runs one is triggered by a pull request (or a merge queue, or an unfiltered push) — the scan fires on a schedule or a manual dispatch only. A vulnerable change therefore merges clean and is reported on the next scheduled run, by which time it is on the default branch and the only remedy is a follow-up fix. Add the pull-request trigger to the workflow that runs the scan so the finding arrives before the merge rather than after it.
R10 · Code Duplication · Duplicated block with local edits (105 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (105 matched lines × 2 locations) dashboard/pages/cpu_profiling.tsx:41 — dashboard/pages/cpu_profiling.tsx:41 · dashboard/pages/heap_profiling.tsx:48 — the two spans are one implementation copied and then locally edited — 621 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.
R10 · Code Duplication · Duplicated block with local edits (76 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (76 matched lines × 2 locations) dashboard/pages/fragment_graph.tsx:337 — dashboard/pages/fragment_graph.tsx:337 · dashboard/pages/relation_graph.tsx:93 — the two spans are one implementation copied and then locally edited — 329 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.
R10 · Code Duplication · Duplicated block (42 lines × 2 locations) · ×1
  • Duplicated block (42 lines × 2 locations) dashboard/pages/await_tree.tsx:133 — dashboard/pages/await_tree.tsx:133 · dashboard/pages/heap_profiling.tsx:277 — 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 (29 lines × 2 locations) · ×1
  • Duplicated block (29 lines × 2 locations) dashboard/components/FragmentGraph.tsx:529 — dashboard/components/FragmentGraph.tsx:529 · dashboard/components/RelationGraph.tsx:221 — 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.
R10 · Code Duplication · Duplicated block (22 lines × 4 locations) · ×1
  • Duplicated block (22 lines × 4 locations) dashboard/components/FragmentGraph.tsx:328 — dashboard/components/FragmentGraph.tsx:328 · dashboard/components/FragmentGraph.tsx:533 · dashboard/components/RelationGraph.tsx:223 · dashboard/components/RelationGraph.tsx:380 — 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.
R10 · Code Duplication · Duplicated block (20 lines × 2 locations) · ×1
  • Duplicated block (20 lines × 2 locations) dashboard/lib/api/streamingStats.ts:83 — dashboard/lib/api/streamingStats.ts:83 · dashboard/lib/api/streamingStats.ts:118 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (18 lines × 2 locations) · ×1
  • Duplicated block (18 lines × 2 locations) dashboard/components/utils/stroke-icons.tsx:124 — dashboard/components/utils/stroke-icons.tsx:124 · dashboard/components/utils/stroke-icons.tsx:233 — 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.
R10 · Code Duplication · Duplicated block (16 lines × 2 locations) · ×1
  • Duplicated block (16 lines × 2 locations) dashboard/pages/cluster.tsx:293 — dashboard/pages/cluster.tsx:293 · dashboard/pages/cluster.tsx:309 — 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.
R10 · Code Duplication · Duplicated block with local edits (14 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (14 matched lines × 2 locations) dashboard/lib/algo.ts:31 — dashboard/lib/algo.ts:31 · dashboard/lib/algo.ts:52 — the two spans are one implementation copied and then locally edited — 63 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.
R10 · Code Duplication · Duplicated block (13 lines × 2 locations) · ×1
  • Duplicated block (13 lines × 2 locations) dashboard/components/FragmentGraph.tsx:246 — dashboard/components/FragmentGraph.tsx:246 · dashboard/components/FragmentGraph.tsx:262 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (13 lines × 3 locations) · ×1
  • Duplicated block (13 lines × 3 locations) dashboard/pages/await_tree.tsx:103 — dashboard/pages/await_tree.tsx:103 · dashboard/pages/fragment_graph.tsx:372 · dashboard/pages/heap_profiling.tsx:204 — 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.
R10 · Code Duplication · Duplicated block (12 lines × 2 locations) · ×1
  • Duplicated block (12 lines × 2 locations) dashboard/components/FragmentDependencyGraph.tsx:159 — dashboard/components/FragmentDependencyGraph.tsx:159 · dashboard/components/FragmentDependencyGraph.tsx:171 — 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.
R10 · Code Duplication · Duplicated block (11 lines × 2 locations) · ×1
  • Duplicated block (11 lines × 2 locations) dashboard/components/FragmentGraph.tsx:188 — dashboard/components/FragmentGraph.tsx:188 · dashboard/components/RelationGraph.tsx:127 — 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 (8 lines × 3 locations) · ×1
  • Duplicated block (8 lines × 3 locations) dashboard/pages/await_tree.tsx:71 — dashboard/pages/await_tree.tsx:71 · dashboard/pages/await_tree.tsx:80 · dashboard/pages/await_tree.tsx:88 — all 3 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.
R10 · Code Duplication · Duplicated block (8 lines × 2 locations) · ×1
  • Duplicated block (8 lines × 2 locations) dashboard/pages/fragment_graph.tsx:454 — dashboard/pages/fragment_graph.tsx:454 · dashboard/pages/fragment_graph.tsx:462 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R3 · Large Files · dashboard/components/FragmentGraph.tsx · ×1
  • dashboard/components/FragmentGraph.tsx: 531 lines of code dashboard/components/FragmentGraph.tsx:1 — dashboard/components/FragmentGraph.tsx has 531 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 · dashboard/pages/fragment_graph.tsx · ×1
  • dashboard/pages/fragment_graph.tsx: 477 lines of code dashboard/pages/fragment_graph.tsx:1 — dashboard/pages/fragment_graph.tsx has 477 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 · dashboard/components/Relations.tsx · ×1
  • dashboard/components/Relations.tsx: 436 lines of code dashboard/components/Relations.tsx:1 — dashboard/components/Relations.tsx has 436 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R8 · Dependency Hygiene · Unused dependency '16' · ×1
  • Unused dependency '16' — Declared in dashboard/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.
R8 · Dependency Hygiene · Unused dependency '@testing-library/react' · ×1
  • Unused dependency '@testing-library/react' — Declared in dashboard/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.
R8 · Dependency Hygiene · Unused dependency 'd3-axis' · ×1
  • Unused dependency 'd3-axis' — Declared in dashboard/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.
SC1 · Supply-chain hygiene · NuGet dependencies are not locked · ×1
  • NuGet dependencies are not locked — No packages.lock.json and no central package management — restores aren't reproducible or pinned (SSDF PW.4.4). Enable <RestorePackagesWithLockFile>true</RestorePackagesWithLockFile> (commit the lockfile) or adopt Directory.Packages.props. Advisory — never scored.
Minor — 772 finding(s)
D34 · Knowledge Freshness · Orphaned file · ×706
  • Orphaned file dashboard/components/FragmentGraph.tsx:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/frontend/src/optimizer/plan_node/logical_filter.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/expr/impl/src/scalar/extract.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/connector/src/source/datagen/source/reader.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/frontend/src/optimizer/plan_node/generic/project.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/common/src/types/num256.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file java/connector-node/risingwave-source-cdc/src/main/java/io/debezium/connector/postgresql/PostgresSchema.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/common/src/lru.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/frontend/src/optimizer/plan_node/logical_hop_window.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/expr/impl/src/scalar/regexp.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/storage/src/row_serde/value_serde.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file java/connector-node/risingwave-sink-jdbc/src/main/java/com/risingwave/connector/JDBCSink.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/cmd_all/src/standalone.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file java/connector-node/risingwave-sink-iceberg/src/main/java/org/apache/iceberg/common/DynMethods.java:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/common/src/util/chunk_coalesce.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/storage/src/hummock/sstable/block_iterator.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/expr/core/src/sig/mod.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file dashboard/pages/fragment_graph.tsx:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/expr/impl/src/aggregate/general.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/storage/hummock_trace/src/collector.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/frontend/src/optimizer/plan_node/logical_union.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/batch/executors/src/executor/hop_window.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/expr/core/src/window_function/range.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/dml/src/table.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file src/common/src/field_generator/mod.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • + 681 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×25
  • Duplicated predicate java/connector-node/risingwave-sink-es-7/src/main/java/com/risingwave/connector/ElasticRestHighLevelClientAdapter.java:45 — `config.getPassword() != null && config.getUsername() != null` appears character-identically in 2 files — java/connector-node/risingwave-sink-es-7/src/main/java/com/risingwave/connector/ElasticRestHighLevelClientAdapter.java, java/connector-node/risingwave-sink-es-7/src/main/java/com/risingwave/connector/OpensearchRestHighLevelClientAdapter.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 java/connector-node/risingwave-sink-cassandra/src/main/java/com/risingwave/connector/CassandraFactory.java:66 — `config.getUsername() != null && config.getPassword() != null` appears character-identically in 2 files — java/connector-node/risingwave-sink-cassandra/src/main/java/com/risingwave/connector/CassandraFactory.java, java/connector-node/risingwave-sink-cassandra/src/main/java/com/risingwave/connector/CassandraSink.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 java/connector-node/risingwave-source-cdc/src/main/java/io/debezium/connector/mysql/MySqlStreamingChangeEventSource.java:99 — `connectedSignaled.compareAndSet(false, true) && onConnectedCallback != null` appears character-identically in 2 files — java/connector-node/risingwave-source-cdc/src/main/java/io/debezium/connector/mysql/MySqlStreamingChangeEventSource.java, java/connector-node/risingwave-source-cdc/src/main/java/io/debezium/connector/sqlserver/SqlServerStreamingChangeEventSource.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 java/connector-node/risingwave-sink-jdbc/src/main/java/com/risingwave/connector/BatchAppendOnlyJDBCSink.java:126 — `dt == Types.TIMESTAMP && (typeName.equalsIgnoreCase("timestamptz") || typeName.equalsIgnoreCase("timestamp with time zone"))` appears character-identically in 2 files — java/connector-node/risingwave-sink-jdbc/src/main/java/com/risingwave/connector/BatchAppendOnlyJDBCSink.java, java/connector-node/risingwave-sink-jdbc/src/main/java/com/risingwave/connector/JDBCSink.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 java/connector-node/risingwave-source-cdc/src/main/java/io/debezium/connector/postgresql/PostgresSchema.java:274 — `tableId.schema() != null && tableId.schema().length() > 0` appears character-identically in 2 files — java/connector-node/risingwave-source-cdc/src/main/java/io/debezium/connector/postgresql/PostgresSchema.java, java/connector-node/risingwave-source-cdc/src/main/java/io/debezium/connector/postgresql/connection/PostgresConnection.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 dashboard/components/FragmentDependencyGraph.tsx:69 — `isSelected(d.source) || isSelected(d.target)` appears character-identically in 3 files — dashboard/components/FragmentDependencyGraph.tsx, dashboard/components/FragmentGraph.tsx, dashboard/components/RelationGraph.tsx. 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 dashboard/pages/cpu_profiling.tsx:79 — `workerNodes && !workerNodeId && workerNodes.length > 0` appears character-identically in 2 files — dashboard/pages/cpu_profiling.tsx, dashboard/pages/heap_profiling.tsx. 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 src/frontend/src/optimizer/plan_node/generic/join.rs:236 — `!pk_indices.contains(input_pk_idx) && !deduped_input_pk_indices.contains(input_pk_idx)` appears character-identically in 3 files — src/frontend/src/optimizer/plan_node/generic/join.rs, src/frontend/src/optimizer/plan_node/stream_asof_join.rs, src/frontend/src/optimizer/plan_node/stream_hash_join.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 src/frontend/src/binder/delete.rs:90 — `!returning_items.is_empty() && table_catalog.has_generated_column()` appears character-identically in 2 files — src/frontend/src/binder/delete.rs, src/frontend/src/binder/update.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 src/frontend/src/handler/create_table.rs:573 — `!secret_refs.is_empty() || !connection_refs.is_empty()` appears character-identically in 3 files — src/frontend/src/handler/create_table.rs, src/frontend/src/handler/create_table_as.rs, src/frontend/src/handler/create_view.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 REDACTED:560 — `!self.is_append_only && self.pk_indices.is_empty()` appears character-identically in 6 files — REDACTED, src/connector/src/sink/clickhouse.rs, src/connector/src/sink/doris.rs, src/connector/src/sink/postgres.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 src/connector/src/sink/formatter/mod.rs:363 — `(channel.is_none() && channel_column.is_none()) || (channel.is_some() && channel_column.is_some())` appears character-identically in 2 files — src/connector/src/sink/formatter/mod.rs, src/connector/src/sink/redis.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 src/connector/src/sink/formatter/mod.rs:392 — `(stream.is_none() && stream_column.is_none()) || (stream.is_some() && stream_column.is_some())` appears character-identically in 2 files — src/connector/src/sink/formatter/mod.rs, src/connector/src/sink/redis.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 src/batch/executors/src/executor/hash_agg.rs:544 — `check_memory && !mem_context.check_memory_usage()` appears character-identically in 2 files — src/batch/executors/src/executor/hash_agg.rs, src/batch/executors/src/executor/order_by.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 src/stream/src/executor/dispatch/dispatch_sync_log_store.rs:421 — `clean_state && barrier.kind.is_checkpoint() && !buffer.is_empty()` appears character-identically in 2 files — src/stream/src/executor/dispatch/dispatch_sync_log_store.rs, src/stream/src/executor/sync_kv_log_store.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 REDACTED:287 — `config.r#type != SINK_TYPE_APPEND_ONLY && config.r#type != SINK_TYPE_UPSERT` appears character-identically in 14 files — REDACTED, src/connector/src/sink/clickhouse.rs, src/connector/src/sink/doris.rs, src/connector/src/sink/file_sink/azblob.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 src/compute/src/server.rs:459 — `config.server.telemetry_enabled && telemetry_env_enabled()` appears character-identically in 3 files — src/compute/src/server.rs, src/frontend/src/session.rs, src/storage/compactor/src/server.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 src/connector/src/sink/coordinate.rs:199 — `current_checkpoint >= commit_checkpoint_interval.get() || should_force_commit_on_checkpoint_barrier( new_vnode_bitmap.is_some(), is_stop, sc…` appears character-identically in 2 files — src/connector/src/sink/coordinate.rs, src/connector/src/sink/decouple_checkpoint_log_sink.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 src/meta/src/manager/iceberg_pk_index_sink/coordinator.rs:419 — `data_file.referenced_data_file() && input_paths.contains(referenced.as_str())` appears character-identically in 2 files — src/meta/src/manager/iceberg_pk_index_sink/coordinator.rs, src/stream/src/executor/iceberg_with_pk_index/compaction_resolver.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 src/connector/src/source/kafka/source/message.rs:59 — `data_type && data_type.type_name == PbTypeName::Varchar as i32` appears character-identically in 3 files — src/connector/src/source/kafka/source/message.rs, src/connector/src/source/nats/source/message.rs, src/connector/src/source/pulsar/source/message.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 src/stream/src/executor/source/batch_source/batch_opendal_fs_fetch.rs:281 — `files_in_progress == 0 && file_queue.is_empty() && list_finished && is_refreshing && barrier.is_checkpoint()` appears character-identically in 2 files — src/stream/src/executor/source/batch_source/batch_opendal_fs_fetch.rs, src/stream/src/executor/source/batch_source/batch_posix_fs_fetch.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 src/frontend/src/expr/utils.rs:121 — `func_type == ExprType::IsNull || func_type == ExprType::IsNotNull || func_type == ExprType::IsTrue || func_type == ExprType::IsFalse || func…` appears character-identically in 2 files — src/frontend/src/expr/utils.rs, src/frontend/src/optimizer/rule/logical_filter_expression_simplify_rule.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 src/expr/impl/src/scalar/jsonb_delete.rs:399 — `index < -(len as i32) || index >= (len as i32)` appears character-identically in 2 files — src/expr/impl/src/scalar/jsonb_delete.rs, src/expr/impl/src/scalar/jsonb_set.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 src/batch/executors/src/executor/join/distributed_lookup_join.rs:127 — `join_type == JoinType::LeftSemi || join_type == JoinType::LeftAnti` appears character-identically in 4 files — src/batch/executors/src/executor/join/distributed_lookup_join.rs, src/batch/executors/src/executor/join/local_lookup_join.rs, src/frontend/src/optimizer/rule/pull_up_hop_rule.rs, src/stream/src/executor/join/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 src/frontend/src/optimizer/rule/pull_up_hop_rule.rs:144 — `join_type == JoinType::RightSemi || join_type == JoinType::RightAnti` appears character-identically in 2 files — src/frontend/src/optimizer/rule/pull_up_hop_rule.rs, src/stream/src/executor/join/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.
D16 · Bus Factor · Off-boarding risk · ×9
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 22 significant file(s) lose their only recent owner: src/meta/src/barrier/edge_builder.rs, src/stream/src/executor/backfill/snapshot_backfill/consume_upstream/stream.rs, src/meta/src/barrier/checkpoint/independent_job/mod.rs, src/storage/src/hummock/vector/file.rs, src/meta/src/hummock/manager/table_change_log.rs, src/storage/src/hummock/event_handler/uploader/spiller.rs, src/stream/src/executor/backfill/snapshot_backfill/vnode_stream.rs, src/stream/src/executor/backfill/snapshot_backfill/state.rs (+14 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 11 significant file(s) lose their only recent owner: src/meta/src/hummock/compaction/picker/non_overlap_sub_level_picker.rs, src/meta/src/hummock/manager/compaction/compaction_group_schedule/topology.rs, src/storage/src/storage_failpoints/test_iterator.rs, src/meta/src/hummock/manager/compaction/compaction_group_schedule/normalize.rs, src/storage/src/hummock/block_stream.rs, src/meta/src/hummock/manager/compaction/compaction_group_schedule/merge_policy.rs, src/storage/src/hummock/compactor/block_stream.rs, src/storage/hummock_sdk/src/filter_utils.rs (+3 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 11 significant file(s) lose their only recent owner: src/frontend/src/optimizer/plan_visitor/datafusion_plan_converter.rs, src/frontend/src/datafusion/convert.rs, src/meta/src/manager/iceberg_pk_index_sink/mod.rs, REDACTED, src/stream/src/executor/iceberg_with_pk_index/position_delete_staging.rs, src/frontend/src/datafusion/iceberg_table_provider.rs, src/expr/impl/src/scalar/array_positions.rs, src/frontend/src/optimizer/plan_node/stream_iceberg_with_pk_index_position_delete_merger.rs (+3 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #4 — If anonymized user #4 becomes unavailable, 6 significant file(s) lose their only recent owner: java/connector-node/risingwave-source-cdc/src/main/java/io/debezium/connector/postgresql/connection/PostgresConnection.java, src/connector/src/source/google_pubsub/mod.rs, java/connector-node/risingwave-source-cdc/src/main/java/io/debezium/openlineage/DebeziumOpenLineageEmitter.java, dashboard/pages/cpu_profiling.tsx, java/connector-node/risingwave-source-cdc/src/main/java/io/debezium/connector/postgresql/connection/ServerInfo.java, src/storage/src/hummock/store/table_change_log_manager.rs. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #5 — If anonymized user #5 becomes unavailable, 6 significant file(s) lose their only recent owner: src/frontend/src/optimizer/rule/mv_selection_rule.rs, src/stream/src/executor/source/iceberg_list_executor.rs, src/connector/src/sink/iceberg/metadata.rs, src/frontend/src/optimizer/plan_node/logical_gap_fill.rs, src/frontend/src/handler/vacuum.rs, src/frontend/src/catalog/system_catalog/rw_catalog/rw_iceberg_compaction_schedules.rs. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #6 — If anonymized user #6 becomes unavailable, 5 significant file(s) lose their only recent owner: src/common/src/config/merge.rs, src/frontend/src/catalog/purify.rs, src/license/src/key.rs, src/license/src/rwu.rs, src/meta/src/rpc/await_tree.rs. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #7 — If anonymized user #7 becomes unavailable, 3 significant file(s) lose their only recent owner: src/stream/src/executor/match_recognize/incremental.rs, src/stream/src/executor/match_recognize/nfa.rs, src/stream/src/executor/match_recognize/executor.rs. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #8 — If anonymized user #8 becomes unavailable, 3 significant file(s) lose their only recent owner: java/connector-node/risingwave-source-cdc/src/main/java/io/debezium/connector/postgresql/PostgresStreamingChangeEventSource.java, java/connector-node/risingwave-source-cdc/src/main/java/com/risingwave/connector/cdc/debezium/internal/OpendalSchemaHistory.java, src/jni_core/src/opendal_schema_history.rs. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #9 — If anonymized user #9 becomes unavailable, 3 significant file(s) lose their only recent owner: src/connector/src/source/pulsar/mod.rs, src/stream/src/executor/source/batch_source/mod.rs, e2e_test/source_inline/cdc/mysql/cron_only/extract_direct_cdc_current_offset.py. Pair on, review, or document these before any departure.
D29 · Static Analysis (SAST) · REDACTED · ×6
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
X7 · Silent fallback defaults · Silent fallback default on Err · ×5
  • Silent fallback default on Err src/common/heap_profiling/src/profile_service.rs:136 — `list_heap_profiling` turns every `Err` into `true` — 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 src/common/metrics/src/monitor/process.rs:91 — `collect` turns every `Err` into `Vec::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 src/common/metrics/src/monitor/process.rs:148 — `collect` turns every `Err` into `Vec::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 src/frontend/src/handler/create_mv.rs:64 — `extract_streaming_job_resource_options` turns every `Err` into `false` — 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 src/risedevtool/src/util.rs:101 — `risedev_cmd` turns every `Err` into `"./risedev".to_owned()` — 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.
D29 · Static Analysis (SAST) · REDACTED · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 6 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (78 single-owned of 2027 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 2027 of the 2900 production source files in this repository met that bar). They are anonymized user #10 (2 file(s)), anonymized user #11 (2 file(s)), anonymized user #12 (1 file(s)), anonymized user #13 (1 file(s)), anonymized user #14 (1 file(s)), anonymized user #15 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: java/connector-node/risingwave-connector-service/src/main/java/com/risingwave/connector/source/common/OracleValidator.java, java/connector-node/risingwave-connector-service/src/main/java/com/risingwave/connector/source/common/OracleHeartbeatTable.java, src/stream/src/executor/watermark/mod.rs, src/meta/model/migration/src/m20260624_000000_pending_sink_state_object_fk.rs, dashboard/pages/index.tsx, e2e_test/source_inline/vault/vault_approle_setup.py, src/frontend/src/catalog/system_catalog/rw_catalog/rw_fragment_backfill_progress.rs, src/common/src/session_config/statement_timeout.rs.
D28 · Secrets (history) · Rotate the exposed credentials · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Low CVE · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Low vulnerability · ×1
  • REDACTED
D31 · IaC & Container Security · Low IaC · ×1
  • REDACTED
D34 · Knowledge Freshness · Further orphaned files (smaller) · ×1
  • Further orphaned files (smaller) — 706 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: src/expr/impl/src/aggregate/general.rs, src/expr/impl/src/aggregate/approx_count_distinct/mod.rs, dashboard/components/FragmentGraph.tsx, src/frontend/src/optimizer/plan_node/logical_filter.rs, src/expr/impl/src/scalar/extract.rs, src/connector/src/source/datagen/source/reader.rs, src/frontend/src/optimizer/plan_node/generic/project.rs, src/common/src/types/num256.rs (and 698 more) (749 orphaned of 2027 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 2027 of the 2900 production source files in this repository met that bar). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M2 · Architecture documentation · No ADRs · ×1
  • No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 55/80 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `.`, `dashboard`, `develop/sql_bench`, `e2e_test/iceberg` and 20 more.
R7 · Dead Code · Unused export 'RelationType' · ×1
  • Unused export 'RelationType' dashboard/lib/api/streaming.ts:125 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'FragmentBoxPosition' · ×1
  • Unused export 'FragmentBoxPosition' dashboard/lib/layout.ts:59 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'RelationBoxPosition' · ×1
  • Unused export 'RelationBoxPosition' dashboard/lib/layout.ts:61 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'formatUnixEpoch' · ×1
  • Unused export 'formatUnixEpoch' dashboard/lib/utils/timeUtils.ts:106 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused module-local declaration 'findMergeNodes' · ×1
  • Unused module-local declaration 'findMergeNodes' dashboard/pages/fragment_graph.tsx:137 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'FileList' · ×1
  • Unused module-local declaration 'FileList' dashboard/pages/heap_profiling.tsx:43 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
S1 · Web-Security Posture · No security response headers detected · ×1
  • No security response headers detected integration_tests/iceberg-sink/Dockerfile:1 — None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is configured — defense in depth, even when a reverse proxy could set them. This is reported because `REDACTED` builds the web-server image that serves this application, so the configuration that would carry these headers is in this repository and was read in full. (−2.0 on this card.)
Minor — 15 finding(s)
D12 · Dependency Hygiene · Outdated · ×13
  • Outdated: github.com/Shopify/sarama — `github.com/Shopify/sarama` is required at v1.37.2 in integration_tests/datagen/go.mod, but v1.61.1 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/Shopify/sarama@v1.61.1 && go mod tidy` and commit the updated go.mod and go.sum.
  • Outdated: github.com/apache/pulsar-client-go — `github.com/apache/pulsar-client-go` is required at v0.8.1 in integration_tests/datagen/go.mod, but v0.21.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/apache/pulsar-client-go@v0.21.0 && go mod tidy` and commit the updated go.mod and go.sum.
  • Outdated: github.com/brianvoe/gofakeit/v6 — `github.com/brianvoe/gofakeit/v6` is required at v6.16.0 in integration_tests/datagen/go.mod, but v6.28.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/brianvoe/gofakeit/v6@v6.28.0 && go mod tidy` and commit the updated go.mod and go.sum.
  • Outdated: github.com/go-sql-driver/mysql — `github.com/go-sql-driver/mysql` is required at v1.7.0 in integration_tests/datagen/go.mod, but v1.10.1 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/go-sql-driver/mysql@v1.10.1 && go mod tidy` and commit the updated go.mod and go.sum.
  • Outdated: github.com/jackc/pgx/v5 — `github.com/jackc/pgx/v5` is required at v5.9.2 in integration_tests/client-library/go/go.mod, but v5.11.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/jackc/pgx/v5@v5.11.0 && go mod tidy` and commit the updated go.mod and go.sum.
  • Outdated: github.com/lib/pq — `github.com/lib/pq` is required at v1.10.7 in integration_tests/datagen/go.mod, but v1.12.3 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/lib/pq@v1.12.3 && go mod tidy` and commit the updated go.mod and go.sum.
  • Outdated: github.com/linkedin/goavro/v2 — `github.com/linkedin/goavro/v2` is required at v2.9.8 in integration_tests/datagen/go.mod, but v2.15.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/linkedin/goavro/v2@v2.15.0 && go mod tidy` and commit the updated go.mod and go.sum.
  • Outdated: github.com/nats-io/nats.go — `github.com/nats-io/nats.go` is required at v1.33.1 in integration_tests/datagen/go.mod, but v1.55.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/nats-io/nats.go@v1.55.0 && go mod tidy` and commit the updated go.mod and go.sum.
  • Outdated: github.com/stretchr/testify — `github.com/stretchr/testify` is required at v1.11.1 in integration_tests/client-library/go/go.mod, but v1.12.1 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/stretchr/testify@v1.12.1 && go mod tidy` and commit the updated go.mod and go.sum.
  • Outdated: github.com/urfave/cli — `github.com/urfave/cli` is required at v1.22.10 in integration_tests/datagen/go.mod, but v1.22.17 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/urfave/cli@v1.22.17 && go mod tidy` and commit the updated go.mod and go.sum.
  • Outdated: go.uber.org/ratelimit — `go.uber.org/ratelimit` is required at v0.2.0 in integration_tests/datagen/go.mod, but v0.3.1 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get go.uber.org/ratelimit@v0.3.1 && go mod tidy` and commit the updated go.mod and go.sum.
  • Outdated: gonum.org/v1/gonum — `gonum.org/v1/gonum` is required at v0.12.0 in integration_tests/datagen/go.mod, but v0.17.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get gonum.org/v1/gonum@v0.17.0 && go mod tidy` and commit the updated go.mod and go.sum.
  • Outdated: google.golang.org/protobuf — `google.golang.org/protobuf` is required at v1.33.0 in integration_tests/datagen/go.mod, but v1.36.12 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get google.golang.org/protobuf@v1.36.12 && go mod tidy` and commit the updated go.mod and go.sum.
D5 · Coupling · Off the main sequence · ×2
  • Off the main sequence: risingwave_common_log — risingwave_common_log: abstractness 0.00, instability 0.00, distance 1.00 — 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.
  • Off the main sequence: common-utils — common-utils: abstractness 0.00, instability 0.25, distance 0.75 — 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.

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-3b7c5530be054d87add0e3db228065e0/history.json --exit-code 0 --source .2artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-3b7c5530be054d87add0e3db228065e0/tree.json --exit-code 0 --source .2artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/watchdog-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt --exclude docs/dev/src/images/consistent-hash --exclude docs/dev/src/images/state-store-overview --exclude e2e_test/over_window/generated --exclude e2e_test/source_legacy/basic/scripts/test_data --exclude integration_tests/datagen/livestream/proto --exclude integration_tests/datagen/twitter/proto --exclude src/tests/regress/data .131artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** . --skip-db-update78artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .112artifacts/raw/trivy-config.json
D32 · Data Compliance (PII/GDPR)semgrep—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.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** . --skip-db-update0artifacts/raw/trivy-fs.json

Run 01a17c01-fcf7-700a-9dd1-f4e7d859064b · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

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.

⬇ Findings, MITRE CWE-tagged .sarif⬇ Health changelog .md