Public report of matter-labs/zksync, published 28 October 2026. It has the same score, grades and number of findings as the full report. The details of security findings (where they are in the code, which known vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive report Measured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.4). 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, 14 November 2026, 19:31 UTC · Survey ID cd_1d610f20d80e427c8a8628797036862c

matter-labs/zksync

Measured 28 October 2026, 07:31 UTC, at code version ebf0651

Regression: 1 dimension fell 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: JavaScript/TypeScript suite (CouldNotMeasureNoCollector).

CAI score 48out of 100 At risk No change 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 medium codebase: 98,445 lines of product code in 48 projects, tests not counted · Estimated rebuild effort: about 0.9 person-years · Weakest lens: Production Readiness, 41

Findings by how serious they are

239 critical 663 serious 293 minor

11 dimensions are left out of the score. For each one, Watchdog either couldn't measure it in this code, or found no evidence of the safeguard it looks for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.

This survey was produced by

Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
28 October 2026, 07:31 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 ▸

84of 84 dimensions measured by tools.
1132of 1195 findings point to an exact file and line, so you can open each one in the code. The other 63 concern the repository as a whole, such as missing documentation.
84dimensions across 7 lenses, read from 98,445 lines of product code in 48 projects.
Chapters

Executive summary

matter-labs/zksync is rated At risk because critical security findings are open. Its score is held back in part because it has uses of packages that aren't listed. It scores 48 out of 100, which the At risk rating leaves unchanged.

Production Readiness, at 41, is the weakest lens and counts most in the score. The best first step is replacing the two exposed passwords or keys and switching the old ones off, worth about 6 points. Tidying the declared packages would lift Production Readiness itself, worth about 4 points. Raising Production Readiness to 70 would lift the score to about 54.

Eighty-six known security holes in the packages the code depends on can be used by attackers. Sixty-one passwords or keys in the code's history and two in the code are open to anyone who can read the repository, and forty-three settings leave the servers or containers unsafe. Updating the vulnerable packages, replacing each exposed password or key and correcting the unsafe settings would close these risks. Limiting each secret to its own step would fix the 15 secrets exposed to more of the pipeline than needed, and pinning each tool to an exact version would deal with the 12 pipeline tools referenced by a changeable name. The six uses of packages that aren't listed need adding to the project's list of dependencies.

The product code is 98,445 lines, about €120,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.
Production Readiness 41 · counts for 46%Security and Compliance 45 · counts for 25%Maturity 59 · counts for 14%Code Health 61 · counts for 8%Architecture 64 · counts for 4%Performance 71 · counts for 2%Domain Modelling 78 · counts for 1%

If Production Readiness rose from 41 to 70, the lowest score rated Strong, the score would rise from 48 to about 54.

Code composition: what the lines of code are
Product code 72%Tests 28%
New since the last survey: 83 findings

These 83 critical or serious findings weren't in the previous survey, on 14 October 2026.

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: 47 findings

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

  • Churn × Complexity Hotspots · Hotspot: core/bin/zksync_api/src/api_server/tx_sender.rs core/bin/zksync_api/src/api_server/tx_sender.rs
  • Dependency Vulnerabilities · Critical CVE: REDACTED REDACTED
  • Dependency Vulnerabilities · High CVE: REDACTED REDACTED
  • Dependency Vulnerabilities · High CVE: REDACTED REDACTED
  • Dependency Vulnerabilities · High CVE: [GHSA redacted] REDACTED
  • Dependency Vulnerabilities · High CVE: REDACTED REDACTED
  • Dependency Vulnerabilities · High CVE: REDACTED REDACTED
  • 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 · High vulnerability: REDACTED REDACTED
  • Dependency Vulnerabilities · High vulnerability: REDACTED REDACTED
  • Dependency Vulnerabilities · Medium CVE: [GHSA redacted] REDACTED
  • Dependency Vulnerabilities · Medium vulnerability: [GHSA redacted] REDACTED
  • Supply-chain Provenance & Signing REDACTED
  • Code Duplication · Duplicated block (9 lines × 2 locations) infrastructure/zk/src/fmt.ts
  • Code Duplication · Duplicated block (9 lines × 2 locations) sdk/zksync.js/src/operations.ts
  • Code Duplication · Duplicated block (8 lines × 4 locations) contracts/scripts/deploy-testkit.ts
  • Code Duplication · Duplicated block (8 lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block (8 lines × 2 locations) sdk/zksync.js/src/utils.ts
  • Code Duplication · Duplicated block (7 lines × 3 locations) contracts/scripts/deploy.ts
  • Code Duplication · Duplicated block with local edits (7 matched lines × 2 locations) contracts/scripts/governance-add-erc20.ts
  • Code Duplication · Duplicated block (7 lines × 4 locations) contracts/src.ts/deploy.ts
  • Code Duplication · Duplicated block (7 lines × 7 locations) sdk/zksync.js/src/utils.ts
  • Code Duplication · Duplicated block (6 lines × 3 locations) sdk/zksync.js/src/utils.ts
  • Code Duplication · Duplicated block with local edits (5 matched lines × 2 locations) REDACTED
  • Code Duplication · Duplicated block with local edits (5 matched lines × 2 locations) contracts/scripts/query-contract.ts
  • Async & latency hygiene · Sync-over-async blocking core/tests/ts-tests/tests/api.ts
  • Async & latency hygiene · Sync-over-async blocking infrastructure/api-docs/src/compile.ts
  • Async & latency hygiene · Sync-over-async blocking infrastructure/api-docs/src/compile.ts
  • Async & latency hygiene · Sync-over-async blocking infrastructure/api-docs/src/compile.ts
  • Async & latency hygiene · Sync-over-async blocking infrastructure/zk/src/config.ts
  • Async & latency hygiene · Sync-over-async blocking infrastructure/zk/src/config.ts
  • Async & latency hygiene · Sync-over-async blocking infrastructure/zk/src/env.ts
  • Async & latency hygiene · Sync-over-async blocking infrastructure/zk/src/env.ts
  • Async & latency hygiene · Sync-over-async blocking infrastructure/zk/src/run/verify-keys.ts
  • Async & latency hygiene · Sync-over-async blocking infrastructure/zk/src/run/verify-keys.ts
  • Async & latency hygiene · Sync-over-async blocking infrastructure/zk/src/run/verify-keys.ts
  • Async & latency hygiene · Sync-over-async blocking infrastructure/zk/src/run/run.ts
  • Async & latency hygiene · Sync-over-async blocking infrastructure/zk/src/run/run.ts
  • Async & latency hygiene · Sync-over-async blocking infrastructure/zk/src/run/run.ts
  • Async & latency hygiene · Sync-over-async blocking infrastructure/zk/src/contract.ts
  • Async & latency hygiene · Sync-over-async blocking infrastructure/zk/src/server.ts
  • Async & latency hygiene · Sync-over-async blocking infrastructure/zk/src/test/integration.ts
  • Async & latency hygiene · Sync-over-async blocking infrastructure/zk/src/test/integration.ts
  • Async & latency hygiene · Sync-over-async blocking infrastructure/zk/src/test/integration.ts
Rebuild cost: about €120,000 · Estimate
Cost to rebuild€41,000 to €210,000, for 691 to 2,194 hours of work, about 0.9 person-years for 1 to 2 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.7 at a score of 48. 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.
SizeMedium: 98,445 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
Resolve the 2 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (2).
Raises the score by about 6 points · Low effort · REDACTED Scanning
2
Resolve the 1 Malicious package finding(s) in Malicious Dependencies — start with REDACTED.
Raises the score by about 3 points · Low effort · Malicious Dependencies
3
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
Raises the score by about 4 points · Medium effort · Dependency Hygiene

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 €120,000 to build again, about 0.9 person-years of work. Its weakest lens is Production Readiness, at 41 (Weak). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Resolve the 2 Leaked secret finding(s) in REDACTED Scanning. Of all the actions in this report, it raises the score most for the work it takes: about 6 points for low effort, because it clears the 2 REDACTED Scanning findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort

Architecture — module dependency graph

Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.

arch vlog vlog zksync_api zksync_api zksync_api->vlog zksync_config zksync_config zksync_api->zksync_config zksync_contracts zksync_contracts zksync_api->zksync_contracts zksync_crypto zksync_crypto zksync_api->zksync_crypto zksync_eth_client zksync_eth_client zksync_api->zksync_eth_client zksync_gateway_watcher zksync_gateway_watcher zksync_api->zksync_gateway_watcher zksync_prometheus_exporter zksync_prometheus_exporter zksync_api->zksync_prometheus_exporter zksync_storage zksync_storage zksync_api->zksync_storage zksync_types zksync_types zksync_api->zksync_types zksync_utils zksync_utils zksync_api->zksync_utils zksync_circuit zksync_circuit zksync_circuit->vlog zksync_circuit->zksync_crypto zksync_state zksync_state zksync_circuit->zksync_state zksync_circuit->zksync_types zksync_config->zksync_crypto zksync_config->zksync_types zksync_config->zksync_utils zksync_core zksync_core zksync_core->vlog zksync_core->zksync_config zksync_core->zksync_contracts zksync_core->zksync_crypto zksync_core->zksync_eth_client zksync_core->zksync_gateway_watcher zksync_core->zksync_prometheus_exporter zksync_core->zksync_state zksync_core->zksync_storage zksync_core->zksync_types zksync_core->zksync_utils zksync_data_restore zksync_data_restore zksync_data_restore->vlog zksync_data_restore->zksync_config zksync_data_restore->zksync_contracts zksync_data_restore->zksync_crypto zksync_data_restore->zksync_state zksync_data_restore->zksync_storage zksync_data_restore->zksync_types zksync_data_restore->zksync_utils zksync_eth_client->vlog zksync_eth_client->zksync_config zksync_eth_client->zksync_contracts zksync_eth_client->zksync_types zksync_eth_sender zksync_eth_sender zksync_eth_sender->vlog zksync_eth_sender->zksync_config zksync_eth_sender->zksync_contracts zksync_eth_sender->zksync_eth_client zksync_eth_sender->zksync_gateway_watcher zksync_eth_sender->zksync_prometheus_exporter zksync_eth_sender->zksync_storage zksync_eth_sender->zksync_types zksync_forced_exit_requests zksync_forced_exit_requests zksync_forced_exit_requests->vlog zksync_forced_exit_requests->zksync_api zksync_forced_exit_requests->zksync_config zksync_forced_exit_requests->zksync_contracts zksync_forced_exit_requests->zksync_core zksync_forced_exit_requests->zksync_crypto zksync_forced_exit_requests->zksync_storage zksync_forced_exit_requests->zksync_types zksync_gateway_watcher->vlog zksync_gateway_watcher->zksync_config zksync_gateway_watcher->zksync_eth_client zksync_gateway_watcher->zksync_utils zksync_prometheus_exporter->vlog zksync_prometheus_exporter->zksync_storage zksync_prometheus_exporter->zksync_types zksync_prover zksync_prover zksync_prover->vlog zksync_prover->zksync_circuit zksync_prover->zksync_config zksync_prover->zksync_crypto zksync_prover->zksync_prometheus_exporter zksync_prover->zksync_state zksync_prover->zksync_types zksync_prover->zksync_utils zksync_server zksync_server zksync_server->vlog zksync_server->zksync_api zksync_server->zksync_config zksync_server->zksync_core zksync_server->zksync_eth_client zksync_server->zksync_eth_sender zksync_server->zksync_forced_exit_requests zksync_server->zksync_gateway_watcher zksync_server->zksync_prometheus_exporter zksync_server->zksync_storage zksync_server->zksync_types zksync_server->zksync_utils zksync_witness_generator zksync_witness_generator zksync_server->zksync_witness_generator zksync_state->vlog zksync_state->zksync_crypto zksync_state->zksync_types zksync_state->zksync_utils zksync_storage->vlog zksync_storage->zksync_crypto zksync_storage->zksync_types zksync_storage->zksync_utils zksync_types->vlog zksync_types->zksync_crypto zksync_types->zksync_utils zksync_witness_generator->vlog zksync_witness_generator->zksync_circuit zksync_witness_generator->zksync_config zksync_witness_generator->zksync_crypto zksync_witness_generator->zksync_prometheus_exporter zksync_witness_generator->zksync_state zksync_witness_generator->zksync_storage zksync_witness_generator->zksync_types zksync_witness_generator->zksync_utils __more__ +28 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.

422 modules, with 1030 dependencies between them. 5 loops run through 85 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 382 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 sdk.zksync_js.src.types2 zksync.wallet3 zksync_api.bin.dev-ticker-server4 zksync_circuit.operation5 zksync_config.configs.chain6 zksync_config.configs.eth_sender7 zksync_storage.connection8 zksync_types.account.pubkey_hash9 zksync_types.operations10 zksync_types.tx.primitives.eth_signature11 zksync_types.tx.primitives.signature12 zksync_types.tx.primitives.tx_hash13 sdk.zksync_js.src.signer14 zksync_circuit.witness15 zksync_crypto.proof16 zksync_storage.chain17 zksync_types.priority_ops18 zksync_types.tokens19 zksync_types.tx.zksync_tx20 zksync_api.fee_ticker21 zksync_api_types.v02.transaction22 zksync_types.block23 zksync_api.api_server.rpc_server.rpc_trait24 zksync_api.api_server.web3.types25 zksync_config26 zksync_types.aggregated_operations27 zksync_api.api_server.event_notify.operation_notifier28 zksync_api_types.v02.pagination29 zksync_circuit.witness.utils30 zksync_eth_client.ethereum_gateway31 zksync_l1_event_listener.events_state32 zksync_api_types.v02.account33 zksync_data_restore.storage_interactor34 zksync_storage35 zksync_state.state36 zksync_token_db_cache37 zksync_api.api_server.tx_sender38 zksync_api.api_server.rest.v02.error39 zksync_api.api_server.rpc_server40 zksync_api_client.rest.client
1 sdk.zksync_js.src.types
2 zksync.wallet
3 zksync_api.bin.dev-ticker-server
4 zksync_circuit.operation
5 zksync_config.configs.chain
6 zksync_config.configs.eth_sender
7 zksync_storage.connection
8 zksync_types.account.pubkey_hash
9 zksync_types.operations
10 zksync_types.tx.primitives.eth_signature
11 zksync_types.tx.primitives.signature
12 zksync_types.tx.primitives.tx_hash
13 sdk.zksync_js.src.signer9
14 zksync_circuit.witness1
15 zksync_crypto.proof1
16 zksync_storage.chain1
17 zksync_types.priority_ops1
18 zksync_types.tokens1
19 zksync_types.tx.zksync_tx1111
20 zksync_api.fee_ticker1221
21 zksync_api_types.v02.transaction111813
22 zksync_types.block3112
23 zksync_api.api_server.rpc_server.rpc_trait11111
24 zksync_api.api_server.web3.types11
25 zksync_config111
26 zksync_types.aggregated_operations415
27 zksync_api.api_server.event_notify.operation_notifier11111
28 zksync_api_types.v02.pagination11
29 zksync_circuit.witness.utils211
30 zksync_eth_client.ethereum_gateway11
31 zksync_l1_event_listener.events_state111
32 zksync_api_types.v02.account1111
33 zksync_data_restore.storage_interactor11221
34 zksync_storage111
35 zksync_state.state3311
36 zksync_token_db_cache111
37 zksync_api.api_server.tx_sender12131211111
38 zksync_api.api_server.rest.v02.error1
39 zksync_api.api_server.rpc_server2211112111
40 zksync_api_client.rest.client111111
Uses a module listed above itPart of a loopThe module itself
1 sdk.zksync_js.src.types2 zksync.wallet3 zksync_api.bin.dev-ticker-server4 zksync_circuit.operation5 zksync_config.configs.chain6 zksync_config.configs.eth_sender7 zksync_storage.connection8 zksync_types.account.pubkey_hash9 zksync_types.operations10 zksync_types.tx.primitives.eth_signature11 zksync_types.tx.primitives.signature12 zksync_types.tx.primitives.tx_hash13 sdk.zksync_js.src.signer14 zksync_circuit.witness15 zksync_crypto.proof16 zksync_storage.chain17 zksync_types.priority_ops18 zksync_types.tokens19 zksync_types.tx.zksync_tx20 zksync_api.fee_ticker21 zksync_api_types.v02.transaction22 zksync_types.block23 zksync_api.api_server.rpc_server.rpc_trait24 zksync_api.api_server.web3.types25 zksync_config26 zksync_types.aggregated_operations27 zksync_api.api_server.event_notify.operation_notifier28 zksync_api_types.v02.pagination29 zksync_circuit.witness.utils30 zksync_eth_client.ethereum_gateway31 zksync_l1_event_listener.events_state32 zksync_api_types.v02.account33 zksync_data_restore.storage_interactor34 zksync_storage35 zksync_state.state36 zksync_token_db_cache37 zksync_api.api_server.tx_sender38 zksync_api.api_server.rest.v02.error39 zksync_api.api_server.rpc_server40 zksync_api_client.rest.clientsdk.zksync_js.src.types1zksync.wallet2zksync_api.bin.dev-ticker-server3zksync_circuit.operation4zksync_config.configs.chain5zksync_config.configs.eth_sender6zksync_storage.connection7zksync_types.account.pubkey_hash8zksync_types.operations9zksync_types.tx.primitives.eth_signature10zksync_types.tx.primitives.signature11zksync_types.tx.primitives.tx_hash12sdk.zksync_js.src.signer13zksync_circuit.witness14zksync_crypto.proof15zksync_storage.chain16zksync_types.priority_ops17zksync_types.tokens18zksync_types.tx.zksync_tx19zksync_api.fee_ticker20zksync_api_types.v02.transaction21zksync_types.block22zksync_api.api_server.rpc_server.rpc_trait23zksync_api.api_server.web3.types24zksync_config25zksync_types.aggregated_operations26zksync_api.api_server.event_notify.operation_notifier27zksync_api_types.v02.pagination28zksync_circuit.witness.utils29zksync_eth_client.ethereum_gateway30zksync_l1_event_listener.events_state31zksync_api_types.v02.account32zksync_data_restore.storage_interactor33zksync_storage34zksync_state.state35zksync_token_db_cache36zksync_api.api_server.tx_sender37zksync_api.api_server.rest.v02.error38zksync_api.api_server.rpc_server39zksync_api_client.rest.client40911111111112211118133112111111111141511111112111111111111122111133111111213121111112211112111111111+382 more modules (most-connected shown)

At a glance — Code Health · 61% · Adequate ·

At a glance — Architecture · 64% · Adequate ·

At a glance — Maturity · 59% · Adequate · gated by D34, M2 ·

At a glance — Readiness · 41% · Weak · gated by R8, P7 ·

At a glance — Security · 45% · Weak · gated by D28, D29, D30, D31, D36, D43 ·

At a glance — Domain Modelling · 78% · Strong ·

At a glance — Performance · 71% · 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
A03:2025 — Software Supply Chain Failures224High / Critical
A02:2025 — Security Misconfiguration85High / Critical
A07:2025 — Authentication Failures64High / Critical
A05:2025 — Injection39High / Critical
A08:2025 — Software or Data Integrity Failures1Medium

Roadmap

Immediately address security risks by resolving the two active secret leaks in REDACTED and the single malicious dependency identified in REDACTED. Next, improve code integrity by removing unused dependencies, explicitly declaring imports, and moving test-only packages to devDependencies. Finally, strengthen reliability by fixing the 28 test cases lacking assertions, prioritizing operations.spec.ts, and rotating the 60 historical secrets found in configuration files like REDACTED.

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

Do thisHelpsEffortDimension
Resolve the 2 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (2).+6.2 ptsLowREDACTED Scanning
Resolve the 1 Malicious package finding(s) in Malicious Dependencies — start with REDACTED.+3.1 ptsLowMalicious Dependencies
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.+4.5 ptsMediumDependency Hygiene
Resolve the 28 No assertions finding(s) in Test Quality — start with operations.spec.ts (7), zksync.spec.ts (6), api.test.ts (5).+4.3 ptsMediumTest Quality
Resolve the 60 REDACTED finding(s) in Secrets (history) — start with REDACTED (10), REDACTED (10), REDACTED (6).+3.0 ptsMediumSecrets (history)
Secure the server's transport: serve TLS itself (`HttpServer::bind_rustls_0_23(addr, config)` in actix-web, `axum_server::bind_rustls(addr, RustlsConfig::from_pem_file(…))`, tonic's `Server::builder().tls_config(ServerTlsConfig::new().identity(…))`, Rocket's `[default.tls]`), or run it behind a TLS-terminating proxy and check `X-Forwarded-Proto`; send `Strict-Transport-Security` once it is HTTPS-only.+2.6 ptsMediumWeb-Security Posture
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.+2.6 ptsMediumOutbound HTTP resilience
Resolve the 6 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED, REDACTED.+1.3 ptsLowSupply-chain Provenance & Signing

File quality

Per-file score 0–10 — a quality signature. Of 149 files carrying findings, judged against the Production bar: 13% slop · 60% mixed · 27% near-clean.

FileScoreBandWorst signal
REDACTED0.0SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED0.1SlopIaC & Container Security: High IaC: REDACTED
REDACTED0.2SlopDependency Vulnerabilities: Critical vulnerability: REDACTED
REDACTED0.2SlopIaC & Container Security: High IaC: REDACTED
REDACTED0.8SlopIaC & Container Security: High IaC: REDACTED
REDACTED0.9SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED1.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED1.4SlopIaC & Container Security: High IaC: REDACTED
REDACTED1.4SlopIaC & Container Security: High IaC: REDACTED
REDACTED1.4SlopIaC & Container Security: High IaC: REDACTED
REDACTED2.0SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.0SlopIaC & Container Security: High IaC: REDACTED
REDACTED2.3SlopSecrets (history): REDACTED: REDACTED
REDACTED2.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.5SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.7SlopIaC & Container Security: High IaC: REDACTED
REDACTED2.7SlopIaC & Container Security: High IaC: REDACTED
REDACTED2.8SlopIaC & Container Security: High IaC: REDACTED
REDACTED3.7SlopIaC & Container Security: High IaC: REDACTED

How the grades work

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

Critical — 239

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

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

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

Could not be resolved — 11

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

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

What we checked — 84 dimensions across the health lenses
D1D2D3D4D5D6D9D10D12D13D14D15D16D17D19D20D26D28D29D30D31D34D35D36D37D43D44AX10AX3AX4AX6AX8AX9C2DM4DM5DM6M1M2M3M4P1P10P2P3P4P6P7P8PF1PF3R1R10R11R2R3R4R5R6R7R8R9S1X1X12X13X14X15X16X17X18X19X2X21X22X23X24X25X27X28X29X3X30X5

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, 1132 of 1195 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 01a1816c-0d7a-793c-b351-f5f4ad1cb352.

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 157 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 130 test source file(s) (.rs) that it cannot: it reads JavaScript/TypeScript test declarations off disk, so a 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 MEASURED: the JavaScript/TypeScript suite could not be re-run in the analyzer sandbox — the mocha run in core/tests/ts-tests/ produced no per-test report (> ts-tests@1.0.0 test). This is OUR limitation, not a defect in the repo — it is excluded from the score.
  • 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 for the mocha suite in core/tests/ts-tests/ was NOT MEASURED: the mocha run in core/tests/ts-tests/ produced no per-test report (> ts-tests@1.0.0 test). This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
  • 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 REDACTED, but the licence verdict published here was taken over its crate 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.
  • 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.
  • 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. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
  • 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.
  • AXR1 Runtime accessibility — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via DockerCompose (REDACTED). compose up failed (exit 18 — an image could not be pulled) — dev-liquidity-token-watcher Pulling dev-ticker Pulling postgres Pulling geth Pulling geth Error Get "https://registry-1.docker.io/v2/": Forbidden dev-liquidity-token-watcher Error context canceled postgres Error context canceled dev-ticker Error context canceled Error response from daemon: Get "https://registry-1.docker.io/v2/": Forbidden; the earlier `compose pull` step reported: dev-liquidity-token-watcher Pulling dev-liquidity-token-watcher Error Get "https://registry-1.docker.io/v2/": Forbidden postgres Error Get "https://registry-1.docker.io/v2/": Forbidden dev-ticker Error Get "https://registry-1.docker.io/v2/": Forbidden geth 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.
  • ED5 Idempotency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check decides whether a handler's mutation is safe to re-run by recognising its persistence writes (a database save, a repository write, an event publish) and its guards. Those markers are .NET member names, so in this repository's language a write such as `repository.save(order)` is not recognised and a same-named call on an unrelated library type could be. The handlers were found; their idempotency was neither confirmed nor ruled out.
  • 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 Rust, solidity 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.
  • IC1 Incompleteness & stubs — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and this repository's Rust, solidity 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), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • R10 Code Duplication — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 12 further occurrence(s) are not listed individually; the score already reflects all 52.
  • 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 reads C# syntax, and Java, Kotlin, Scala, Go, Swift, Python and Ruby source only, and no C# was loaded, no Java, Kotlin, Scala, Go, Swift, Python or Ruby was found, and this repository's Solidity 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.

Repo exclusion declarations: 10 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.
  • D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
  • 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.
  • 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".
  • 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 Complexity8.7 / 10Strong✓ 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 8.7 / 10 · rule-coverage 100% · ceiling Prevented

8 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was TxSender::submit_txs_batch at 28.

TxSender::submit_txs_batch (cyclomatic 28)core/bin/zksync_api/src/api_server/tx_sender.rs:649
CallsHelper::execute (cyclomatic 28)core/bin/zksync_api/src/api_server/web3/calls.rs:96
deploy.main (cyclomatic 26)contracts/scripts/deploy.ts:13
upgrade-testnet.main (cyclomatic 20)contracts/scripts/upgrade-testnet.ts:13
provider.getDefaultProvider (cyclomatic 20)sdk/zksync.js/src/provider.ts:33

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

What to do

  1. Bring the 8 bodies over 15 down to 15 or less in Cyclomatic Complexity — start with TxSender::submit_txs_batch (cyclomatic 28), CallsHelper::execute (cyclomatic 28), deploy.main (cyclomatic 26). — 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 8 together lifts Cyclomatic Complexity from 8.7 to about 10.0/10, projected with the scoring formula itself and assuming each lands exactly at 15.
  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 Complexity6.7 / 10Adequate✓ Tool-verified

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

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

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

29 method(s) exceeded the cognitive complexity threshold of 15; the worst was CallsHelper::execute at 52.

OperationsExtSchema::get_account_transactions_history_from (cognitive 26) · ×3core/lib/storage/src/chain/operations_ext/mod.rs:863
TxSender::submit_txs_batch (cognitive 48) · ×2core/bin/zksync_api/src/api_server/tx_sender.rs:649
zksync_api::api_server::tx_sender::verify_txs_batch_signature (cognitive 38) · ×2core/bin/zksync_api/src/api_server/tx_sender.rs:1126
ZkSyncPriorityOp::legacy_parse_from_priority_queue_logs (cognitive 29) · ×2core/lib/types/src/priority_ops/mod.rs:110
CallsHelper::execute (cognitive 52)core/bin/zksync_api/src/api_server/web3/calls.rs:96

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

What to do

  1. Bring the 5 bodies over 30 down to 30 or less in Cognitive Complexity — start with CallsHelper::execute (cognitive 52), TxSender::submit_txs_batch (cognitive 48), DataRestoreDriver::run_state_update (cognitive 39). — 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 5 together lifts Cognitive Complexity from 6.7 to about 7.3/10, projected with the scoring formula itself and assuming each lands exactly at 30; a cleaner split scores higher.
  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 Classes8.7 / 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 8.7 / 10 · rule-coverage 100% · ceiling Prevented

58 god class(es) detected.

MethodTooLong: ZkSyncCircuit.swap · ×28core/lib/circuit/src/circuit.rs:3145
ClassTooLong: ZkSyncCircuit · ×13core/lib/circuit/src/circuit.rs:49
FileTooLong: src/circuit.rs · ×9core/lib/circuit/src/circuit.rs
TooManyMethods: RestProvider · ×6sdk/zksync.js/src/rest-provider.ts:64
FunctionTooLong: zksync_circuit::witness::utils::build_block_witness · ×2core/lib/circuit/src/witness/utils.rs:739

What to do

  1. Resolve the 28 MethodTooLong finding(s) in God Classes — start with circuit.rs (12), mod.rs (6), mint_nft.rs (2). — One of this dimension's main actionable groups (28 warning-level).
  2. Resolve the 13 ClassTooLong finding(s) in God Classes — start with mod.rs (8), circuit.rs, wallet.ts. — One of this dimension's main actionable groups (13 warning-level).
  3. Resolve the 9 FileTooLong finding(s) in God Classes — start with mod.rs (5), circuit.rs, wallet.ts. — One of this dimension's main actionable groups (9 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.1 / 10Stronggated by 183 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.1 / 10 · rule-coverage 100% · ceiling Verified

175 duplicated block group(s) detected. A further 8 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted.

Duplicated block (9 lines × 2) · ×16core/lib/circuit/src/circuit.rs:607
Duplicated block (12 lines × 2) · ×14core/lib/circuit/src/circuit.rs:544
Duplicated block (10 lines × 2) · ×10core/lib/circuit/src/circuit.rs:1572
Duplicated block (7 lines × 2) · ×10core/lib/circuit/src/circuit.rs:1311
Duplicated block (11 lines × 2) · ×8core/lib/circuit/src/circuit.rs:413

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

What to do

  1. Resolve the 16 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with circuit.rs (5), mint_nft.rs (2), transfer.rs (2). — One of this dimension's main actionable groups (16 warning-level).
  2. Resolve the 14 Duplicated block (12 lines × 2) finding(s) in Code Duplication — start with circuit.rs (6), transfer.rs (3), transactions_handler.rs. — One of this dimension's main actionable groups (14 warning-level).
  3. Resolve the 10 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with circuit.rs (3), mint_nft.rs (2), utils.rs. — One of this dimension's main actionable groups (10 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.6 / 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.6 / 10 · rule-coverage 100% · ceiling Prevented

48 production modules (Cargo+npm), 0 dependency cycle(s), 2 unstable depended-on module(s). Read from the build's own module declarations; 6 module(s) off the main sequence, with abstractness counted on 40 of the 48 (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: vlog · ×6
Unstable project zksync_api
Unstable project zksync_core

What to do

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

2 of 203 classes have LCOM4 above 3.

Low cohesion: Database (LCOM4 20) · ×2core/bin/zksync_witness_generator/src/database.rs:25

What to do

  1. Resolve the 2 Low cohesion finding(s) in Cohesion (LCOM4) — start with database.rs (2). — One of this dimension's main actionable groups (2 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

621 test methods: 591 unit, 29 integration, 0 BDD, 1 e2e. The JavaScript/TypeScript suite contributes 157 `it`/`test` case(s) across 24 test file(s) declaring at least one; its tier split is read from package names and paths only. The Rust suite contributes 464 `#[test]` function(s) across 129 file(s) declaring at least one; its unit/integration split is Cargo's own — 3 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.

✓ On the Gold path — maintain.

Detailed fixes: d9_recommendation.md.

D10 · Test Quality7.3 / 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 7.3 / 10 · rule-coverage 100% · ceiling Prevented

0 skipped, 28 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 157 tests. Measured on the JavaScript/TypeScript suite only — at least 130 test source file(s) (.rs) went unread, so its test quality is unmeasured and is not in these counts.

No assertions: should check status response type · ×28core/tests/ts-tests/tests/api.test.ts:41

What to do

  1. Resolve the 28 No assertions finding(s) in Test Quality — start with operations.spec.ts (7), zksync.spec.ts (6), api.test.ts (5). — One of this dimension's main actionable groups (28 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 8.5 / 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.5 / 10 · rule-coverage 96% · ceiling Verified

24 outdated, 0 yanked direct Cargo dependencies. 75 of 78 direct crates were graded against crates.io (0 not published there, 3 not resolved by a committed REDACTED). Only DIRECT edges are graded: a transitive crate cannot be moved past what its parent's requirement admits, so reporting one would be advice its owner cannot take. A newer release is reported only where this repository's OWN requirement already admits it, so the remedy is `cargo update` and never a manifest edit — which means a release outside the declared range is deliberately NOT charged, because a written-down constraint is a decision rather than a defect. Note that a bare requirement is a CARET, and for a 0.x crate its ceiling is the minor. Whether any crate is UNMAINTAINED is not graded — crates.io publishes no maintenance status, and release age does not stand in for one. Known CVEs in this dependency graph are D30's question, read from REDACTED there.

Outdated: actix-rt · ×24

What to do

  1. Enforce Dependency Hygiene in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

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

D13 · REDACTED Scanning5.0 / 10Adequate✓ 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 5.0 / 10 · rule-coverage 100% · ceiling Prevented

1 secret(s) detected.

REDACTED

What to do

  1. Resolve the 2 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (2). — One of this dimension's main actionable groups (2 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 704 shipped crate(s) use a banned license. Licences were resolved from crates.io over the crates a consumer compiles — this repository's REDACTED closed over its manifests' `[dependencies]` and `[build-dependencies]`. Crates it asks for ONLY under `[dev-dependencies]` are excluded: they are not compiled by anything that depends on this repository. A further 6 crate(s) in the closure resolve from git, a path or a private registry and publish no licence this pass can read; they are outside this verdict. ★ COVERAGE OF THIS VERDICT: it grades this repository's crate dependencies and nothing else. The repository also declares REDACTED, and the licences of those dependencies 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 Hotspots10.0 / 10Exemplary✓ Tool-verified

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

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

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

No churn × complexity hotspots in the window.

✓ On the Gold path — maintain.

Detailed fixes: d15_recommendation.md.

D16 · Bus Factor9.9 / 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.9 / 10 · rule-coverage 100% · ceiling Documented

3 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is core/lib/crypto/src/merkle_tree/parallel_smt.rs. Counted over 221 of the 361 production source files in this repository: 139 are under the ~2,400-byte size floor this dimension measures over, and the remaining 1 have no attributable history left to measure.

Off-boarding risk: anonymized user #1
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.9 / 10Stronggated by 34 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.9 / 10 · rule-coverage 100% · ceiling Prevented

34 deducted task-comment markers across 98445 LoC (0.0/KLoC) → score 9.9. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.

TodoComment · ×33sdk/zksync.js/src/remote-wallet.ts:475
HackCommentcore/lib/types/src/gas_counter.rs:10

What to do

  1. Resolve the 33 TodoComment finding(s) in Explicit Debt — start with mod.rs (11), gas_counter.rs (4), allocated_structures.rs (3). — One of this dimension's main actionable groups (33 warning-level).
  2. Resolve the 1 HackComment finding(s) in Explicit Debt — start with gas_counter.rs. — 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. 23 document(s) read across 1 unit(s).

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

D20 · ADR Quality0.0 / 10Critical✓ Tool-verified

What it measures: Whether architecture decisions are recorded well (context, decision, consequences).

Method: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.

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

No architecture decision records were found.

No ADRs found

What to do

  1. Resolve the 1 No ADRs found finding(s) in ADR Quality. — One of this dimension's main actionable groups (1 recommendation-level).

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

D26 · Project Cohesion8.8 / 10Strong✓ 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 8.8 / 10 · rule-coverage 100% · ceiling Documented

3 of 48 build units (Cargo, npm) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion

What to do

  1. Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).

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

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

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

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

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

REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 60 REDACTED finding(s) in Secrets (history) — start with REDACTED (10), REDACTED (10), REDACTED (6). — One of this dimension's main actionable groups (60 issue-level).
  2. Resolve the 1 High secret finding(s) in Secrets (history) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  3. 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.1 / 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.1 / 10 · rule-coverage 100% · ceiling Documented

39 finding(s): 0 critical, 35 high, 4 medium, 0 low. 9 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. Separately, one or more rules could not re-parse an embedded snippet in 6 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

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

What to do

  1. Resolve the 10 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (6), REDACTED (2), REDACTED (2). — One of this dimension's main actionable groups (10 issue-level).
  2. Resolve the 4 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (4 issue-level).
  3. No action in Static Analysis (SAST) — all 5 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 (5 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

209 finding(s): 15 critical, 71 high, 105 medium, 18 low.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

  1. Resolve the 66 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (60), REDACTED (4), REDACTED. — One of this dimension's main actionable groups (66 issue-level).
  2. Resolve the 12 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (11), REDACTED. — One of this dimension's main actionable groups (12 issue-level).
  3. Resolve the 5 High vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED (3), REDACTED (2). — One of this dimension's main actionable groups (5 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

85 finding(s): 0 critical, 43 high, 36 medium, 6 low.

REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 43 High IaC finding(s) in IaC & Container Security — start with REDACTED (36), REDACTED (4), REDACTED (3). — One of this dimension's main actionable groups (43 issue-level).
  2. Resolve the 36 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (33), REDACTED (2), REDACTED. — One of this dimension's main actionable groups (36 warning-level).
  3. Resolve the 6 Low IaC finding(s) in IaC & Container Security — start with REDACTED (6). — One of this dimension's main actionable groups (6 recommendation-level).

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

D34 · Knowledge Freshness0.1 / 10Critical✓ 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 0.1 / 10 · rule-coverage 100% · ceiling Documented

219 of 222 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is core/lib/circuit/src/circuit.rs. Counted over 222 of the 361 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned file · ×216sdk/zksync.js/src/wallet.ts:1
Most significant orphaned file · ×3core/lib/circuit/src/circuit.rs:1
Concentrated knowledge decay

What to do

  1. Resolve the 216 Orphaned file finding(s) in Knowledge Freshness — start with mod.rs (21), lib.rs (10), utils.rs (6). — One of this dimension's main actionable groups (216 recommendation-level).
  2. Resolve the 3 Most significant orphaned file finding(s) in Knowledge Freshness — start with mod.rs (2), circuit.rs. — One of this dimension's main actionable groups (3 recommendation-level).
  3. Resolve the 1 Concentrated knowledge decay 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 Coupling10.0 / 10Exemplary✓ Tool-verified

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

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

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

No strong hidden change-coupling between production files.

✓ On the Gold path — maintain.

Detailed fixes: d35_recommendation.md.

D36 · Supply-chain Provenance & Signing0.0 / 10Critical✓ 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 0.0 / 10 · rule-coverage 100% · ceiling Documented

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

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 6 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (6 warning-level).
  2. Resolve the 2 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED (2). — One of this dimension's main actionable groups (2 warning-level).
  3. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).

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

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

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

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

Maturity: 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 Dependencies0.0 / 10Critical✓ 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 0.0 / 10 · rule-coverage 100% · ceiling Documented

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

REDACTED

What to do

  1. Resolve the 1 Malicious package finding(s) in Malicious Dependencies — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).

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

D44 · Platform End-of-Life6.0 / 10Adequate✓ 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 6.0 / 10 · rule-coverage 100% · ceiling Documented

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

End-of-life runtime: Rust 1.91rust-toolchain:1

What to do

  1. Resolve the 1 End-of-life runtime finding(s) in Platform End-of-Life — start with rust-toolchain. — One of this dimension's main actionable groups (1 warning-level).

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

Frontend & cross-cutting dimensions

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

AX10 · Code composition9.2 / 10Exemplary✓ 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. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.

Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.

Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.

What to do

  • The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
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 direction7.1 / 10Strong✓ 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.

  • `zksync_core` is a Domain project but references `zksync_api_types`, a Web project. The clean-architecture rule is that dependencies point INWARD — the domain/application core must not depend on outer layers (infrastructure/web). Invert it: define the abstraction in the inner layer and implement it in the outer one.

What to do

  • Keep dependencies pointing inward: domain/application define interfaces, infrastructure/web implement them (Dependency Inversion).
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 isolation7.5 / 10Strong✓ 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.

  • `zksync_forced_exit_requests` (production) references the test project `zksync_test_account`. Production must never depend on test code — it pulls a unit-test framework and test fixtures into the shipped product and inverts the only correct direction (tests depend on production, never the reverse). Move any shared helper into a production support library, or invert the reference.

What to do

  • Remove every production → test project reference: extract any shared test helper into a production support library (which the tests reference), or invert the dependency so the test project depends on production — not the reverse.
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 Controls7.0 / 10Strong✓ Tool-verified

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.

  • Authorization IS enforced here (by route guards, auth middleware or checks that refuse a caller) — this is NOT a claim that endpoints are unprotected. What's missing is a NAMED rule set: who may do what is encoded inline where it is checked, so the rules can't be listed, reviewed or tested apart from the code that applies them. Recommendation, not a defect.

What to do

  • Name the access rules — roles and permissions declared once (an enum Role/Permission, actix-web-grants #[protect(…)], axum-login's permission_required!, a casbin or oso policy) and consulted where access is checked, so the rule set is reviewable and testable on its own.
DM4 · Rich vs anemic domain model10.0 / 10Exemplary✓ 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.

DM5 · Encapsulated state5.0 / 10Adequate✓ 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.

  • `ETHOperation` implements a hand-rolled `Hash`/`PartialEq` (identity semantics) over a `pub` mutable id/hash field — mutating it after the value is placed in a set/map silently corrupts the collection. Make the identity field private + immutable (set once in the constructor). — core/lib/types/src/ethereum.rs:14

What to do

  • Make the id/hash field private and immutable — value identity must be stable for the lifetime of the value.
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.

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

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

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

What to do

  • Add a 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 an 'Architecture' / 'How it works' section to the root README — the high-level shape.
  • Add a README to the 24 of 32 project(s) that lack one — worth up to 1.5 pts.
M2 · Architecture documentation2.0 / 10Critical✓ 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 & versioning6.0 / 10Adequate✓ Tool-verified

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.

  • 497/576 types (86%) declared in the published library are public. For a library, every public type is a stability contract — keep implementation types off the surface and expose only the intended API.

What to do

  • Keep implementation types off the public surface (Rust: `pub(crate)`, or keep the module private) so internals can change without breaking consumers.
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 22/31 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `core/bin/add_seq_no`, `core/bin/block_revert`, `core/bin/exit_tree_generator`, `core/bin/parse_pub_data`, `core/bin/remove_proofs` and 4 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 tooling7.0 / 10Strong✓ Tool-verified

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

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

What to do

  • Your ecosystem's static analyzer is declared as a dependency but is not wired into CI — run it as a required step on push/PR (e.g. `composer phpstan` / `mix sobelow` / `bundle exec brakeman` / the spotbugs Gradle task / `sbt scalafixAll --check` / `golangci-lint run` / `rebar3 lint`) so a regression fails the build instead of relying on someone running it locally.
  • Enable Dependabot/Renovate or a dependency-review gate.
P4 · Deployment & Rollback7.0 / 10Strong✓ Tool-verified

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

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

  • Deployment is orchestrated by compose, but no service declares a `healthcheck:` and nothing pins a previous image to fall back to — the runtime can tell that the container is up, not that it is serving, so a bad release is harder to detect and reverse.

What to do

  • Add a `healthcheck:` to the served compose service — probing the endpoint it already answers on where it has one — with `depends_on: condition: service_healthy` on whatever waits for it, and keep the deployed image tag immutable and recorded so rolling back is re-pointing at the previous tag rather than rebuilding.
P6 · Release Hygiene8.0 / 10Strong✓ 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.

  • The changelog this check read carries 0 versioned entries, against a bar of 3. Counted as either the distinct `x.y.z` versions it names (a link's target is not counted) or its version-shaped section headings (`## [1.2.0]`, `## V14.x.x`, `## Updates in 8.0.x`), whichever is the larger — so a log sectioned by minor series counts its sections, not its individual patch numbers. Entries recorded somewhere this check does not read — release notes generated at tag time from a generator config it did not recognise, or a log kept outside the repository — are not counted here, and this row is about what is re-findable in the tree rather than about how often you release.

What to do

  • Keep the changelog current — add a versioned entry (Keep-a-Changelog ## [x.y.z]) for each release so the history isn't a stub.
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.

  • `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. (×6) — core/bin/zksync_api/src/api_server/rest/network_status.rs:32, core/lib/api_client/src/rest/client.rs:46, core/lib/eth_signer/src/json_rpc_signer.rs:164, …
  • `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. — core/bin/zksync_api/src/fee_ticker/ticker_api/coingecko.rs:44
  • `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. — core/lib/notifier/src/matter_most_notifier.rs:12

What to do

  • 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.
P8 · Schema migrations10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — Whether database schema changes go through versioned migrations rather than being auto-created from the model at startup.

Method: Roslyn scan: EF Core DbContext for a versioned migrations directory versus bare EnsureCreated usage; off .NET, a file scan of dependency manifests, migration histories (Flyway, Liquibase, Alembic, Django, Rails, Prisma, TypeORM, Knex/Sequelize, golang-migrate, goose, Laravel, Doctrine, Diesel/sqlx) and schema auto-create in production source or config. Exhaustive, deterministic.

PF1 · Benchmark discipline8.5 / 10Strong✓ 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.

PF3 · Async & latency hygiene6.0 / 10Adequate✓ 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.

  • `run_state_update` is async and calls thread::sleep — a blocking call inside async code stalls the executor thread, and every task scheduled on it for as long as it runs. — core/bin/data_restore/src/data_restore_driver.rs:337
  • `run_server` is async and calls block_on — a blocking call inside async code stalls the executor thread, and every task scheduled on it for as long as it runs. — core/bin/server/src/main.rs:154
  • `fs.readFileSync` in `validateTypeJSON` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — core/tests/ts-tests/tests/api.ts:30
  • `fs.writeFileSync` in `validateTypeJSON` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — core/tests/ts-tests/tests/api.ts:31
  • `fs.unlinkSync` in `validateTypeJSON` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — core/tests/ts-tests/tests/api.ts:35
  • `fs.readFileSync` in `setupWallet` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — infrastructure/api-docs/src/compile.ts:45
  • `fs.writeFileSync` in `compileApibForDocumentation` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — infrastructure/api-docs/src/compile.ts:167
  • `fs.writeFileSync` in `compileApibForTest` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — infrastructure/api-docs/src/compile.ts:179
  • `fs.existsSync` in `getEnvironment` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — infrastructure/zk/src/config.ts:32
  • `fs.existsSync` in `checkConfigExistence` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — infrastructure/zk/src/config.ts:67
  • `fs.mkdirSync` in `checkConfigExistence` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — infrastructure/zk/src/config.ts:74
  • `fs.readFileSync` in `deploy` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — infrastructure/zk/src/contract.ts:43
  • `fs.writeFileSync` in `deploy` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — infrastructure/zk/src/contract.ts:79
  • `fs.unlinkSync` in `basicSetup` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — infrastructure/zk/src/db/db.ts:59
  • `fs.existsSync` in `gitHooks` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — infrastructure/zk/src/env.ts:24
  • `fs.existsSync` in `load` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×6) — infrastructure/zk/src/env.ts:75, infrastructure/zk/src/env.ts:81, infrastructure/zk/src/env.ts:82, …
  • `fs.readFileSync` in `load` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — infrastructure/zk/src/env.ts:75
  • `fs.rmSync` in `load` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — infrastructure/zk/src/env.ts:83
  • `fs.mkdirSync` in `plonkSetup` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — infrastructure/zk/src/run/run.ts:82
  • `fs.existsSync` in `plonkSetup` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — infrastructure/zk/src/run/run.ts:85
  • `fs.readFileSync` in `callback to utils.allowFailSync` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — infrastructure/zk/src/run/run.ts:107, infrastructure/zk/src/run/run.ts:108
  • `fs.readFileSync` in `testAccounts` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — infrastructure/zk/src/run/run.ts:117
  • `fs.utimesSync` in `gen` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — infrastructure/zk/src/run/verify-keys.ts:21
  • `fs.mkdirSync` in `gen` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — infrastructure/zk/src/run/verify-keys.ts:22
  • `fs.copyFileSync` in `gen` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — infrastructure/zk/src/run/verify-keys.ts:31
  • `fs.existsSync` in `unpack` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — infrastructure/zk/src/run/verify-keys.ts:36
  • `fs.mkdirSync` in `pack` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — infrastructure/zk/src/run/verify-keys.ts:45
  • `fs.readFileSync` in `genesis` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — infrastructure/zk/src/server.ts:41
  • `fs.mkdirSync` in `genesis` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — infrastructure/zk/src/server.ts:52
  • `fs.copyFileSync` in `genesis` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — infrastructure/zk/src/server.ts:53
  • `fs.existsSync` in `ensureZkSyncSdkBuilt` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — infrastructure/zk/src/test/integration.ts:16
  • `fs.existsSync` in `callback to mochaCandidates.find` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — infrastructure/zk/src/test/integration.ts:34
  • `fs.openSync` in `withServer` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — infrastructure/zk/src/test/integration.ts:50, infrastructure/zk/src/test/integration.ts:57

What to do

  • Rust: `.await` the future instead of `block_on` (on a Tokio runtime thread it panics outright) and use `tokio::time::sleep(..).await` instead of `std::thread::sleep`; where synchronous code must run, move it to `tokio::task::spawn_blocking` or `block_in_place`.
  • TypeScript/JavaScript: use the promise APIs (fs/promises, a promisified child_process.execFile, the async zlib/crypto functions) and await them instead of the *Sync variants.
R1 · Type Safety8.8 / 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 Duplication7.8 / 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.

  • sdk/zksync.js/src/remote-wallet.ts:219 · sdk/zksync.js/src/wallet.ts:531 — the two spans are one implementation copied and then locally edited — 692 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. — sdk/zksync.js/src/remote-wallet.ts:219
  • contracts/scripts/deploy-eip1271.ts:13 · contracts/scripts/deploy-withdrawal-helpers.ts:12 — the two spans are one implementation copied and then locally edited — 259 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. — contracts/scripts/deploy-eip1271.ts:13
  • sdk/zksync.js/src/remote-wallet.ts:163 · sdk/zksync.js/src/remote-wallet.ts:280 — 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. — sdk/zksync.js/src/remote-wallet.ts:163
  • sdk/zksync.js/src/rest-provider.ts:234 · sdk/zksync.js/src/rest-provider.ts:277 — 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. — sdk/zksync.js/src/rest-provider.ts:234
  • sdk/zksync.js/src/eth-message-signer.ts:121 · sdk/zksync.js/src/eth-message-signer.ts:150 — 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. — sdk/zksync.js/src/eth-message-signer.ts:121
  • sdk/zksync.js/src/rest-provider.ts:184 · sdk/zksync.js/src/rest-provider.ts:325 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — sdk/zksync.js/src/rest-provider.ts:184
  • sdk/zksync.js/src/utils.ts:717 · sdk/zksync.js/src/utils.ts: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. — sdk/zksync.js/src/utils.ts:717
  • sdk/zksync.js/src/signer.ts:362 · sdk/zksync.js/src/signer.ts:400 — 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. — sdk/zksync.js/src/signer.ts:362
  • contracts/src.ts/deploy.ts:170 · contracts/src.ts/deploy.ts:195 · contracts/src.ts/deploy.ts:221 · contracts/src.ts/deploy.ts:409 — all 4 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. — contracts/src.ts/deploy.ts:170
  • contracts/scripts/deploy-erc20.ts:51 · contracts/scripts/server-add-erc20.ts:33 — 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. — contracts/scripts/deploy-erc20.ts:51
  • sdk/zksync.js/src/utils.ts:155 · sdk/zksync.js/src/utils.ts:198 — 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. — sdk/zksync.js/src/utils.ts:155
  • sdk/zksync.js/src/utils.ts:675 · sdk/zksync.js/src/utils.ts:792 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — sdk/zksync.js/src/utils.ts:675
  • contracts/src.ts/deploy.ts:136 · contracts/src.ts/deploy.ts:309 · contracts/src.ts/deploy.ts:347 · contracts/src.ts/deploy.ts:383 · +1 more site(s) not listed — all 5 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — contracts/src.ts/deploy.ts:136
  • sdk/zksync.js/src/eth-message-signer.ts:31 · sdk/zksync.js/src/eth-message-signer.ts:182 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — sdk/zksync.js/src/eth-message-signer.ts:31
  • sdk/zksync.js/src/provider.ts:211 · sdk/zksync.js/src/provider.ts:242 — 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. — sdk/zksync.js/src/provider.ts:211
  • sdk/zksync.js/src/wallet.ts:78 · sdk/zksync.js/src/wallet.ts: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. — sdk/zksync.js/src/wallet.ts:78
  • sdk/zksync.js/src/wallet.ts:833 · sdk/zksync.js/src/wallet.ts:903 · sdk/zksync.js/src/wallet.ts:1008 — 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. — sdk/zksync.js/src/wallet.ts:833
  • contracts/scripts/deploy-testkit.ts:10 · REDACTED:12 — 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. — contracts/scripts/deploy-testkit.ts:10
  • sdk/zksync.js/src/operations.ts:74 · sdk/zksync.js/src/operations.ts:117 — 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. — sdk/zksync.js/src/operations.ts:74
  • sdk/zksync.js/src/transport.ts:56 · sdk/zksync.js/src/transport.ts:155 — 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. — sdk/zksync.js/src/transport.ts:56
  • sdk/zksync.js/src/rest-provider.ts:376 · sdk/zksync.js/src/rest-provider.ts:416 — 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. — sdk/zksync.js/src/rest-provider.ts:376
  • sdk/zksync.js/src/wallet.ts:420 · sdk/zksync.js/src/wallet.ts:673 — 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. — sdk/zksync.js/src/wallet.ts:420
  • contracts/scripts/deploy.ts:9 · contracts/scripts/upgrade-testnet.ts:9 — 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. — contracts/scripts/deploy.ts:9
  • contracts/scripts/governance-add-erc20.ts:56 · infrastructure/token-lists-manager/index.ts:74 — 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. — contracts/scripts/governance-add-erc20.ts:56
  • contracts/src.ts/deploy.ts:305 · contracts/src.ts/deploy.ts:343 · contracts/src.ts/deploy.ts:436 — 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. — contracts/src.ts/deploy.ts:305
  • infrastructure/api-docs/src/compile.ts:158 · infrastructure/api-docs/src/compile.ts: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. — infrastructure/api-docs/src/compile.ts:158
  • infrastructure/token-lists-manager/index.ts:38 · REDACTED:56 — the two spans are one implementation copied and then locally edited — 61 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. — infrastructure/token-lists-manager/index.ts:38
  • sdk/zksync.js/src/abstract-wallet.ts:431 · sdk/zksync.js/src/abstract-wallet.ts:647 — 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. — sdk/zksync.js/src/abstract-wallet.ts:431
  • sdk/zksync.js/src/abstract-wallet.ts:579 · sdk/zksync.js/src/abstract-wallet.ts:602 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — sdk/zksync.js/src/abstract-wallet.ts:579
  • sdk/zksync.js/src/provider.ts:41 · sdk/zksync.js/src/provider.ts:53 · sdk/zksync.js/src/provider.ts:73 — 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. — sdk/zksync.js/src/provider.ts:41
  • sdk/zksync.js/src/rest-provider.ts:220 · sdk/zksync.js/src/rest-provider.ts:313 — 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. — sdk/zksync.js/src/rest-provider.ts:220
  • sdk/zksync.js/src/utils.ts:278 · sdk/zksync.js/src/utils.ts:297 — 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. — sdk/zksync.js/src/utils.ts:278
  • contracts/scripts/upgrade-testnet.ts:93 · contracts/scripts/upgrade-testnet.ts: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. — contracts/scripts/upgrade-testnet.ts:93
  • contracts/scripts/upgrade-testnet.ts:107 · contracts/scripts/upgrade-testnet.ts:118 — 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. — contracts/scripts/upgrade-testnet.ts:107
  • infrastructure/api-docs/src/utils.ts:5 · REDACTED:37 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — infrastructure/api-docs/src/utils.ts:5
  • infrastructure/zk/src/fmt.ts:49 · infrastructure/zk/src/lint.ts:52 — 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. — infrastructure/zk/src/fmt.ts:49
  • sdk/zksync.js/src/provider.ts:104 · sdk/zksync.js/src/provider.ts:123 — 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. — sdk/zksync.js/src/provider.ts:104
  • sdk/zksync.js/src/utils.ts:118 · sdk/zksync.js/src/utils.ts:128 — 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. — sdk/zksync.js/src/utils.ts:118
  • contracts/scripts/deploy-erc20.ts:88 · contracts/scripts/governance-add-erc20.ts:58 · contracts/scripts/read-variable.ts:359 · contracts/scripts/server-add-erc20.ts:56 · +3 more site(s) not listed — the 7 copies are spread across 7 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. — contracts/scripts/deploy-erc20.ts:88
  • contracts/scripts/deploy.ts:26 · contracts/scripts/upgrade-testnet.ts:37 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — contracts/scripts/deploy.ts:26

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.
R11 · Import Boundaries4.2 / 10Weak✓ Tool-verified

React / JS · Architecture — Conformance to the detected frontend architecture layout (feature-sliced / layered src) plus cross-package deep-import rules (D-386).

Method: Conformance to the detected frontend layout (feature-sliced / layered src) plus cross-package deep-import rules, over the module graph. Deterministic.

  • contracts/scripts/deploy-erc20.ts:5 imports ethers/lib/utils, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — contracts/scripts/deploy-erc20.ts:5
  • contracts/scripts/deploy.ts:4 imports ethers/lib/utils, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — contracts/scripts/deploy.ts:4
  • contracts/scripts/revert-reason.ts:3 imports ethers/lib/utils, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — contracts/scripts/revert-reason.ts:3
  • contracts/scripts/upgrade-testnet.ts:4 imports ethers/lib/utils, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — contracts/scripts/upgrade-testnet.ts:4
  • contracts/src.ts/deploy.ts:3 imports ethers/lib/utils, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — contracts/src.ts/deploy.ts:3
  • infrastructure/api-docs/src/compile.ts:4 imports zksync, a package this repository publishes, but this package's own REDACTED does not list it in dependencies (or peer/optional dependencies) — it resolves only through the workspace link, so an installed copy of this package is missing it. Add it to this package's dependencies. — infrastructure/api-docs/src/compile.ts:4
  • infrastructure/token-lists-manager/index.ts:3 imports reading-tool, a package this repository publishes, but this package's own REDACTED does not list it in dependencies (or peer/optional dependencies) — it resolves only through the workspace link, so an installed copy of this package is missing it. Add it to this package's dependencies. — infrastructure/token-lists-manager/index.ts:3

What to do

  • Fix the listed violations: import through the target package's declared public entry rather than a deep path into its internals or a relative path into its directory (5 rows); declare the workspace packages these files import in the importing package's own REDACTED dependencies (2 rows) — those imports are already bare package specifiers, so the import statements do not change, only the manifest.
R2 · Cyclomatic Complexity9.9 / 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.

  • main has cyclomatic complexity 26 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — contracts/scripts/deploy.ts:13
  • main has cyclomatic complexity 20 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — contracts/scripts/upgrade-testnet.ts:13
  • getDefaultProvider has cyclomatic complexity 20 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — sdk/zksync.js/src/provider.ts:33
  • parseName has cyclomatic complexity 15 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — contracts/scripts/read-variable.ts:255
  • reason has cyclomatic complexity 14 and cognitive complexity 34; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — contracts/scripts/revert-reason.ts:22
  • processBatchBuilderTransactions has cyclomatic complexity 13 and cognitive complexity 11; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — sdk/zksync.js/src/wallet.ts:162
  • depositToSyncFromEthereum has cyclomatic complexity 11 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — sdk/zksync.js/src/abstract-wallet.ts:456
  • bitsIntoBytesInBEOrder has cyclomatic complexity 11 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — sdk/zksync.js/src/utils.ts:109
  • getPartialOrder has cyclomatic complexity 11 and cognitive complexity 10; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — sdk/zksync.js/src/wallet.ts:1164

What to do

  • Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
R3 · Large Files6.4 / 10Adequate✓ 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.

  • sdk/zksync.js/src/wallet.ts has 1081 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — sdk/zksync.js/src/wallet.ts:1
  • sdk/zksync.js/src/utils.ts has 855 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — sdk/zksync.js/src/utils.ts:1
  • sdk/zksync.js/src/abstract-wallet.ts has 629 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — sdk/zksync.js/src/abstract-wallet.ts:1
  • sdk/zksync.js/src/rest-provider.ts has 599 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — sdk/zksync.js/src/rest-provider.ts:1
  • sdk/zksync.js/src/types.ts has 559 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — sdk/zksync.js/src/types.ts:1
  • contracts/src.ts/deploy.ts has 498 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — contracts/src.ts/deploy.ts:1
  • sdk/zksync.js/src/remote-wallet.ts has 448 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — sdk/zksync.js/src/remote-wallet.ts:1

What to do

  • Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
R4 · Test Coverage5.6 / 10Adequate✓ Tool-verified

React / JS · Readiness — Static test reachability (D-386): the share of production files reachable from any test via the import graph — measured without running anything.

Method: Static test reachability: the share of production files reachable from any test via the import graph — measured without running anything. Deterministic.

  • No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×30) — contracts/scripts/read-variable.ts:1, infrastructure/exit-tool/perform_exodus/src/index.ts:1, contracts/scripts/upgrade-testnet.ts:1, …

What to do

  • Add tests that import the unreached modules (directly or through their public entry).
R5 · Dependency Freshness4.6 / 10Weak✓ Tool-verified

React / JS · Readiness — How outdated the npm dependencies are (a maturity signal). JS/npm CVEs are scored separately in D30 (JS/npm Dependency Vulnerabilities).

Method: npm dependency staleness from manifest/registry metadata (a maturity signal; JS/npm CVEs are scored separately in D30, which answers dependency vulnerabilities for every ecosystem). Deterministic.

  • 54 outdated package(s); JS/npm CVEs scored in D30

What to do

  • Bump outdated dependencies to current versions to limit upgrade debt.
R6 · Tooling10.0 / 10Exemplary✓ Tool-verified

React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each REDACTED 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: REDACTED scanned for test/lint/typecheck script wiring. Deterministic presence check.

R7 · Dead Code9.8 / 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.

  • 39 file(s) (~5193 LoC) were excluded from dead-code analysis. This package's entry point(s) resolved, but the walk stopped one hop in: contracts/test/factory.spec.ts imports '../typechain/ZkSyncNFTFactory', 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. — contracts
  • Unreachable from the 56 application, 10 tooling and 63 test entry point(s) detected in this repo. Gate removals on `yarn run build` — an undetected custom entry would make these reachable.
  • no import path from any entry point (56 application, 10 tooling, 63 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make — etc/js/env-config.js
  • Nothing imports this binding — it is safe to review for removal. (×2) — contracts/scripts/utils.ts:33, infrastructure/zk/src/db/db.ts:62

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 Hygiene0.0 / 10Critical✓ 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.

  • Imported but not declared in any reachable REDACTED — installs work only by hoisting accident. (×6) — core/tests/check-block-root-hahes.ts:8, contracts/scripts/utils.ts:2, contracts/src.ts/publish-utils.ts:4, …
  • Declared in the root REDACTED 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. (×2)
  • Declared in REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.

What to do

  • Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
R9 · Circular Imports4.8 / 10Weak✓ 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.

  • infrastructure/zk/src/contract.ts → infrastructure/zk/src/run/run.ts → infrastructure/zk/src/docker.ts → infrastructure/zk/src/contract.ts — infrastructure/zk/src/contract.ts:7
  • sdk/zksync.js/src/abstract-wallet.ts → sdk/zksync.js/src/batch-builder.ts → sdk/zksync.js/src/abstract-wallet.ts — sdk/zksync.js/src/abstract-wallet.ts:5
  • sdk/zksync.js/src/provider-interface.ts → sdk/zksync.js/src/utils.ts → sdk/zksync.js/src/provider-interface.ts — sdk/zksync.js/src/provider-interface.ts:18

What to do

  • Break each cycle by extracting the shared piece into a module both sides can import.
S1 · Web-Security Posture6.0 / 10Adequate✓ 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 serves HTTP itself (`HttpServer::new(` (core/bin/zksync_witness_generator/src/lib.rs:449)), 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.

  • This repository starts an HTTP server and nothing in its Rust source or committed `Rocket.toml` secures the transport: no TLS served (actix-web `bind_rustls`/`bind_openssl`, axum-server `bind_rustls` with a `RustlsConfig`, tonic `ServerTlsConfig`, a `TlsAcceptor`, Rocket's `[default.tls]`), no `Strict-Transport-Security` header, no `X-Forwarded-Proto` read from a TLS-terminating proxy — so its traffic may cross the network in clear text. (−2.0 on this card.) The server: `HttpServer::new(` (core/bin/zksync_witness_generator/src/lib.rs:449).
  • 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 set on a response this repository's Rust server sends — defense in depth, even when a proxy could set them. (−2.0 on this card.) The server: `HttpServer::new(` (core/bin/zksync_witness_generator/src/lib.rs:449).

What to do

  • Secure the server's transport: serve TLS itself (`HttpServer::bind_rustls_0_23(addr, config)` in actix-web, `axum_server::bind_rustls(addr, RustlsConfig::from_pem_file(…))`, tonic's `Server::builder().tls_config(ServerTlsConfig::new().identity(…))`, Rocket's `[default.tls]`), or run it behind a TLS-terminating proxy and check `X-Forwarded-Proto`; send `Strict-Transport-Security` once it is HTTPS-only.
  • Set security response headers on what the server sends — actix-web's `DefaultHeaders::new().add((header::X_CONTENT_TYPE_OPTIONS, "nosniff"))`, tower-http's `SetResponseHeaderLayer::overriding(…)` on an axum router, or keep Rocket's default `Shield` — with `Content-Security-Policy`, `X-Content-Type-Options` and a frame policy on every response.
X1 · Async correctness8.0 / 10Strong✓ Tool-verified

Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.

Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.

  • This `async` body is polled on an executor's worker thread, and `std::thread::sleep` blocks that thread: for the whole delay no other task scheduled on it makes progress — the Rust form of blocking on a task. Use `tokio::time::sleep(…).await` (or the runtime's own timer), which suspends only this task. Where the blocking work is not a sleep but a synchronous call that cannot be made async, move it off the executor with `tokio::task::spawn_blocking(…).await`. — core/bin/data_restore/src/data_restore_driver.rs:415

What to do

  • Blocking `thread::sleep` inside an `async` body
X12 · Unreachable branch10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.

Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.

X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.

Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.

X14 · Bypassable address classification10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.

Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.

X15 · Unvalidated length from an untrusted reader10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.

Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.

X16 · Unfloored truncation loop10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.

Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.

X17 · Uncapped recursion over a caller-supplied document10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.

Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.

X18 · Disposal-pattern correctness10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.

Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.

X19 · Unrestored process-global state5.5 / 10Adequate✓ Tool-verified

Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.

Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.

  • `clippy` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the `SQLX_OFFLINE` environment variable (set at line 37, cleared at line 42) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, not a `finally`, so it is skipped by any exception thrown in between — or by a promise that rejects at an `await`, and while this function is suspended at one every other callback the event loop runs sees the moved value too: the process then keeps the overwritten value for the rest of its life, and every later relative path, child-process launch or config read in ANY module resolves against it. That failure is silent and remote from its cause — the function that breaks is not the function that moved the directory. The durable fix is not to widen the restore but to stop mutating the global: pass the value to the operation that needs it — the `cwd` and `env` options of `child_process.spawn`/`exec`/`execSync` (or `Deno.Command`) scope both to the CHILD — or build absolute paths with `path.resolve`. Where the global genuinely must move, wrap it `try`/`finally` so the restore runs on every path. — infrastructure/zk/src/lint.ts:35

What to do

  • Each finding names the statement that changes the process-global value and the statement that puts it back. Confirm from the two that nothing between them is protected — then prefer removing the mutation over widening the restore: a working directory or an environment variable passed to the operation that needs it (the `cwd` and `env` options of `child_process`, or of `Deno.Command`) is scoped to that operation, which is what the save-and-restore was trying to approximate. Where the global genuinely must move, a `try`/`finally` is the least that makes the restore unconditional.
X2 · Cancellation propagation4.0 / 10Weak✓ Tool-verified

Other · Code Health — Whether async functions that make a cancellable request accept or pass on an AbortSignal (adoption curve).

Method: Roslyn scan: every async method (excluding framework-fixed overrides/Blazor handlers) checked for CancellationToken parameter presence. Deterministic, adoption percentage. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same question: every named async function that itself makes a request an AbortSignal can cancel (global `fetch`, axios and its file-local instances, ky, ofetch) counts, and it is compliant when its parameters or body name a signal or it hands one of its own parameters to the request as options; signatures a framework fixes (JSX event handlers, route and lifecycle exports, request-first handlers, `override`, `'use server'` modules, TanStack `mutationFn`) are exempt unless they take a signal. Deterministic, adoption percentage.

  • Only 0/3 async functions that make a cancellable request (fetch, axios, ky, ofetch) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
  • `ethData` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — infrastructure/zk/src/db/insert.ts:30
  • `fetchFromSourceTokenList` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — infrastructure/token-lists-manager/index.ts:19
  • `addToken` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — contracts/scripts/server-add-erc20.ts:12

What to do

  • Thread an AbortSignal through async functions that make requests, so the work stops when its caller gives up.
X21 · Side-effecting pattern guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.

Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.

X22 · Contradicted release guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back.

Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.

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.

X24 · Document value interpolated into markup unescaped10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.

Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.

X25 · Inert configuration knob10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.

Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.

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

Other · Code Health — 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.

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.

X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.

Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.

X3 · Exception handling6.4 / 10Adequate✓ Tool-verified

Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.

Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.

  • An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×3) — sdk/zksync.js/src/operations.ts:31, contracts/src.ts/deploy.ts:274, contracts/scripts/revert-reason.ts:94

What to do

  • Swallowed exception (empty catch)
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.

Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.

X5 · Nullable reference types4.9 / 10Weak✓ Tool-verified

Other · Code Health — Whether strict null checking is enabled and not undermined by heavy `!` assertion — TypeScript's `strictNullChecks` (which `strict` turns on) is what makes `string` exclude `null` and `undefined`, and the postfix `!` is the operator that silences it.

Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.

  • 3/8 of this repository's type-checking configuration(s) turn on strict null checking (`"strict": true`, or `"strictNullChecks": true`). A configuration that states neither is counted as OFF, because off is tsc's own default; a solution-style one whose `"files"` is empty and whose `"references"` point at other projects is in neither number, because it checks no source itself. Where it is off, `string` admits `null` and `undefined`: passing a value that is null compiles silently and throws on the first property access.
  • ~0.3 `!` null assertions per 1k TypeScript source lines — 4 assertion(s) across the 11616 source line(s) of the 65 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: infrastructure/api-docs/src/compile.ts (4). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce.

What to do

  • The findings name the configuration each number was taken from and, for the assertions, the files that hold them. Turn null checking on where it is off — `"strict": true` in the base tsconfig that the others extend switches `strictNullChecks` on with the rest of the family — and then resolve the assertions rather than adding to them. A `!` on a value the checker could show to be null is a promise the author cannot check from where they are standing, and each one is a `TypeError: Cannot read properties of null` waiting for the path that makes it true; where the value genuinely cannot be null, say something the checker can see instead (narrow it with a test, make the property required, drop the `?`).

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 Health61%AdequateAcceptable, with room to improve.
Architecture64%AdequateAcceptable, with room to improve.
Maturity59%Adequate — gated by D34, M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness41%Weak — gated by R8, P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security45%Weak — gated by D28, D29, D30, D31, D36, D43Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Domain Modelling78%StrongStrongest area.
Performance71%StrongSolid.
Unscored — 2 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.

  • X10 Duplicated predicate — 2 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 1 control(s) we could not find positive evidence for

These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.

  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 51 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 web markup found — accessibility is not applicable to this repository.
  • AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
  • AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
  • AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
  • AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
  • AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
  • AC7 A11y enforcement — No web markup found — accessibility is not applicable to this repository.
  • AX1 Captive dependencies — Not applicable: this repository's JavaScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; Rust with no dependency-injection crate has no container to hand one lifetime's instance to another — every value is owned by the code that builds it, and the borrow checker rejects a longer-lived value keeping a borrow of a shorter-lived one; this repository's TypeScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
  • AX2 Stateful singletons — Not applicable: 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) — dev-liquidity-token-watcher Pulling dev-ticker Pulling postgres Pulling geth Pulling geth Error Get "https://registry-1.docker.io/v2/": Forbidden dev-liquidity-token-watcher Error context canceled postgres Error context canceled dev-ticker Error context canceled Error response from daemon: Get "https://registry-1.docker.io/v2/": Forbidden; the earlier `compose pull` step reported: dev-liquidity-token-watcher Pulling dev-liquidity-token-watcher Error Get "https://registry-1.docker.io/v2/": Forbidden postgres Error Get "https://registry-1.docker.io/v2/": Forbidden dev-ticker Error Get "https://registry-1.docker.io/v2/": Forbidden geth 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 measured — JavaScript/TypeScript suite did not run
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D21 Naming Consistency — Naming consistency is measured on C# only; JavaScript, Rust, TypeScript not measured.
  • D22 Internal API Consistency — API consistency is measured on C# only; the exposed Rust, TypeScript surface was not measured.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ projects each declaring an entity of their own. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — D24 reads C# and Visual Basic comments only — this repository's production source is .rs, .ts, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • 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 — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • D8 Code Coverage — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — core/tests/ts-tests/ runs mocha but declares no coverage provider, so the suite can run and still produce no lcov — add `c8` (or `nyc`) as a devDependency so the suite can be wrapped for coverage. 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.
  • DM1 Aggregate boundaries — this Rust crate declares no domain aggregate (a struct with private state and its own command methods), so DM1's aggregate-boundary read has no population to be taken over
  • DM2 Strongly-typed ids — the crate defines newtype typed-ids but declares no domain aggregate that could carry an id — so DM2's adoption ratio has no population to be taken over
  • DM3 Integration-event coupling — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
  • DM7 Repository granularity — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
  • 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 — Not assessed, and this one is on us: 3 command handler(s) or message consumer(s) were found here, but this check does not yet recognise persistence writes in this repository's language. Idempotency was neither confirmed nor ruled out — this is a limit of the analyzer, not a finding about your code.
  • ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
  • GD1 Unfinished & placeholder code — no source files were read — this check reads C#, 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 — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • 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
  • PF2 Allocation hygiene — Not applicable: Rust spells out every heap allocation and makes borrowed slices (&[T], &str) its ordinary parameter types, so the allocation-aware style this card rewards elsewhere is the language's baseline rather than a rung to climb. TypeScript/JavaScript runs on a garbage-collected runtime that gives a program no allocation-control idiom to choose on a hot path — no pools, stack allocation or value types — so allocation awareness is not something this code can be rated on.
  • SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X26 Unsynchronised callback handoff — 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
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X4 Structured logging — This check asks whether log calls keep a message's values apart from its text, which needs a logger that can carry them as fields. This repository's Rust was read, and it logs through none: the `log` crate's macros take one finished message (as log4net does in C#; its `kv` values are an opt-in its backends mostly drop), `println!`/`eprintln!` are not loggers, or it makes no log call outside its tests and examples at all. Calls through `tracing` (`tracing::info!`, or `info!` imported from it) would be judged.
  • X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

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

Critical — 239 finding(s)
D30 · Dependency Vulnerabilities · High CVE · ×66
  • 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.
D28 · Secrets (history) · REDACTED · ×60
  • 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
  • + 35 more in this group — see findings.md.
D31 · IaC & Container Security · High IaC · ×43
  • 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
  • + 18 more in this group — see findings.md.
D30 · Dependency Vulnerabilities · Critical CVE · ×12
  • 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
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · High vulnerability · ×5
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Critical vulnerability · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D13 · REDACTED Scanning · Leaked secret · ×2
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
R9 · Circular Imports · Import cycle (2 files) · ×2
  • Import cycle (2 files) sdk/zksync.js/src/abstract-wallet.ts:5 — sdk/zksync.js/src/abstract-wallet.ts → sdk/zksync.js/src/batch-builder.ts → sdk/zksync.js/src/abstract-wallet.ts
  • Import cycle (2 files) sdk/zksync.js/src/provider-interface.ts:18 — sdk/zksync.js/src/provider-interface.ts → sdk/zksync.js/src/utils.ts → sdk/zksync.js/src/provider-interface.ts
AX4 · Dependency direction · Dependency-rule violation · ×1
  • Dependency-rule violation: zksync_core (Domain) → zksync_api_types (Web) — `zksync_core` is a Domain project but references `zksync_api_types`, a Web project. The clean-architecture rule is that dependencies point INWARD — the domain/application core must not depend on outer layers (infrastructure/web). Invert it: define the abstraction in the inner layer and implement it in the outer one.
AX8 · Test isolation · Production project references a test project · ×1
  • Production project references a test project: zksync_forced_exit_requests → zksync_test_account — `zksync_forced_exit_requests` (production) references the test project `zksync_test_account`. Production must never depend on test code — it pulls a unit-test framework and test fixtures into the shipped product and inverts the only correct direction (tests depend on production, never the reverse). Move any shared helper into a production support library, or invert the reference.
D28 · Secrets (history) · High secret · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
DM5 · Encapsulated state · Mutable field under value identity · ×1
  • Mutable field under value identity: ETHOperation core/lib/types/src/ethereum.rs:14 — `ETHOperation` implements a hand-rolled `Hash`/`PartialEq` (identity semantics) over a `pub` mutable id/hash field — mutating it after the value is placed in a set/map silently corrupts the collection. Make the identity field private + immutable (set once in the constructor).
R8 · Dependency Hygiene · Unlisted import 'node-fetch' · ×1
  • Unlisted import 'node-fetch' core/tests/check-block-root-hahes.ts:8 — Imported but not declared in any reachable REDACTED — installs work only by hoisting accident.
R8 · Dependency Hygiene · Unlisted import '@ethersproject/abi' · ×1
  • Unlisted import '@ethersproject/abi' contracts/scripts/utils.ts:2 — Imported but not declared in any reachable REDACTED — installs work only by hoisting accident.
R8 · Dependency Hygiene · Unlisted import '@resolver-engine/imports' · ×1
  • Unlisted import '@resolver-engine/imports' contracts/src.ts/publish-utils.ts:4 — Imported but not declared in any reachable REDACTED — installs work only by hoisting accident.
R8 · Dependency Hygiene · Unlisted import '@resolver-engine/imports-fs' · ×1
  • Unlisted import '@resolver-engine/imports-fs' contracts/src.ts/publish-utils.ts:5 — Imported but not declared in any reachable REDACTED — installs work only by hoisting accident.
R8 · Dependency Hygiene · Unlisted import 'ethereum-waffle' · ×1
  • Unlisted import 'ethereum-waffle' core/tests/ts-tests/tests/tester/register-factory.ts:1 — Imported but not declared in any reachable REDACTED — installs work only by hoisting accident.
R8 · Dependency Hygiene · Unlisted import '@ethersproject/abstract-signer' · ×1
  • Unlisted import '@ethersproject/abstract-signer' sdk/zksync.js/src/signer.ts:24 — Imported but not declared in any reachable REDACTED — installs work only by hoisting accident.
R9 · Circular Imports · Import cycle (3 files) · ×1
  • Import cycle (3 files) infrastructure/zk/src/contract.ts:7 — infrastructure/zk/src/contract.ts → infrastructure/zk/src/run/run.ts → infrastructure/zk/src/docker.ts → infrastructure/zk/src/contract.ts
Serious — 663 finding(s)
PF3 · Async & latency hygiene · Sync-over-async blocking · ×40
  • Sync-over-async blocking core/bin/data_restore/src/data_restore_driver.rs:337 — `run_state_update` is async and calls thread::sleep — a blocking call inside async code stalls the executor thread, and every task scheduled on it for as long as it runs.
  • Sync-over-async blocking core/bin/server/src/main.rs:154 — `run_server` is async and calls block_on — a blocking call inside async code stalls the executor thread, and every task scheduled on it for as long as it runs.
  • Sync-over-async blocking core/tests/ts-tests/tests/api.ts:30 — `fs.readFileSync` in `validateTypeJSON` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking core/tests/ts-tests/tests/api.ts:31 — `fs.writeFileSync` in `validateTypeJSON` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking core/tests/ts-tests/tests/api.ts:35 — `fs.unlinkSync` in `validateTypeJSON` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking infrastructure/api-docs/src/compile.ts:45 — `fs.readFileSync` in `setupWallet` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking infrastructure/api-docs/src/compile.ts:167 — `fs.writeFileSync` in `compileApibForDocumentation` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking infrastructure/api-docs/src/compile.ts:179 — `fs.writeFileSync` in `compileApibForTest` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking infrastructure/zk/src/config.ts:32 — `fs.existsSync` in `getEnvironment` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking infrastructure/zk/src/config.ts:67 — `fs.existsSync` in `checkConfigExistence` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking infrastructure/zk/src/config.ts:74 — `fs.mkdirSync` in `checkConfigExistence` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking infrastructure/zk/src/contract.ts:43 — `fs.readFileSync` in `deploy` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking infrastructure/zk/src/contract.ts:79 — `fs.writeFileSync` in `deploy` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking infrastructure/zk/src/db/db.ts:59 — `fs.unlinkSync` in `basicSetup` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking infrastructure/zk/src/env.ts:24 — `fs.existsSync` in `gitHooks` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking infrastructure/zk/src/env.ts:75 — `fs.existsSync` in `load` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking infrastructure/zk/src/env.ts:75 — `fs.readFileSync` in `load` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking infrastructure/zk/src/env.ts:81 — `fs.existsSync` in `load` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking infrastructure/zk/src/env.ts:82 — `fs.existsSync` in `load` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking infrastructure/zk/src/env.ts:83 — `fs.rmSync` in `load` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking infrastructure/zk/src/env.ts:87 — `fs.existsSync` in `load` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking infrastructure/zk/src/env.ts:91 — `fs.existsSync` in `load` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking infrastructure/zk/src/env.ts:94 — `fs.existsSync` in `load` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking infrastructure/zk/src/run/run.ts:82 — `fs.mkdirSync` in `plonkSetup` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking infrastructure/zk/src/run/run.ts:85 — `fs.existsSync` in `plonkSetup` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • + 15 more in this group — see findings.md.
D31 · IaC & Container Security · Medium IaC · ×36
  • 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
  • + 11 more in this group — see findings.md.
D30 · Dependency Vulnerabilities · Medium CVE · ×34
  • 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
  • + 9 more in this group — see findings.md.
D17 · Explicit Debt · TodoComment · ×33
  • TodoComment sdk/zksync.js/src/remote-wallet.ts:475 — // TODO: Catching general error is a bad idea, as a lot of things can throw an exception. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment sdk/zksync.js/src/remote-wallet.ts:494 — // TODO: Catching general error is a bad idea, as a lot of things can throw an exception. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment sdk/zksync.js/src/types.ts:467 — // TODO: server_version (ZKS-627)
  • TodoComment sdk/zksync.js/src/utils.ts:352 — // TODO: handle stale entries, edge case when we rename token after adding it (ZKS-120).
  • TodoComment sdk/zksync-rs/src/provider.rs:1 — // Provider API. TODO: Describe what's here (ZKS-116).
  • TodoComment core/tests/loadnext/src/constants.rs:14 — // TODO (ZKS-623): This value is not the greatest batch size zkSync supports.
  • TodoComment core/tests/loadnext/src/command/mod.rs:69 — // TODO: For some reason, batches of size 1 are being rejected because of nonce mistmatch. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment core/lib/types/src/gas_counter.rs:27 — // TODO: overvalued for quick fix of tx fails (ZKS-109).
  • TodoComment core/lib/types/src/gas_counter.rs:30 — // TODO: estimate after changepubkey gas cost estimation is fixed [ZKS-554]
  • TodoComment core/lib/types/src/gas_counter.rs:40 — // TODO: Verify value (ZKS-109).
  • TodoComment core/lib/types/src/gas_counter.rs:54 — // TODO: Restore when we figure out why this failed [ZKS-554]
  • TodoComment core/lib/types/src/tx/change_pubkey.rs:203 — // TODO: support CREATE2 (ZKS-452)
  • TodoComment core/lib/types/src/tests/hardcoded.rs:544 — // TODO restore this test, generate correct log — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment core/lib/storage/src/tests/event.rs:22 — // TODO: add a test for transaction events. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment core/lib/storage/src/chain/operations_ext/mod.rs:402 — // TODO: Maybe move the transformations to api_server (ZKS-114)?
  • TodoComment core/lib/storage/src/chain/operations_ext/mod.rs:539 — // TODO: Maybe move the transformations to api_server (ZKS-114)?
  • TodoComment core/lib/storage/src/chain/operations_ext/mod.rs:1403 — // TODO Remove it after migration is complete — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment core/lib/storage/src/chain/operations_ext/mod.rs:1447 — // TODO Remove it after migration is complete — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment core/lib/storage/src/chain/operations_ext/mod.rs:1967 — // TODO Delete it right after execution — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment core/lib/storage/src/chain/operations_ext/mod.rs:2005 — // TODO Delete it right after execution — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment core/lib/storage/src/chain/operations_ext/mod.rs:2034 — // TODO Delete it right after execution — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment core/lib/storage/src/chain/operations_ext/mod.rs:2051 — // TODO Delete it right after execution — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment core/lib/storage/src/chain/operations_ext/mod.rs:2093 — // TODO Delete it right after execution — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment core/lib/storage/src/chain/block/mod.rs:1400 — // TODO (ZKS-856): `get_last_committed_block` returns the last block for which *an aggregated operation*
  • TodoComment core/lib/crypto/src/params.rs:175 — // TODO: Check that in the future this constant cannot cause unexpected behavior (ZKS-520).
  • + 8 more in this group — see findings.md.
D30 · Dependency Vulnerabilities · Medium advisory (unmaintained) · ×33
  • 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
  • + 8 more in this group — see findings.md.
R4 · Test Coverage · No test reaches this file · ×30
  • No test reaches this file contracts/scripts/read-variable.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file infrastructure/exit-tool/perform_exodus/src/index.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file contracts/scripts/upgrade-testnet.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file contracts/scripts/deploy.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file contracts/scripts/revert-reason.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file contracts/scripts/deploy-erc20.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file REDACTED:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file infrastructure/zk/src/init.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file REDACTED:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file infrastructure/token-lists-manager/index.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file infrastructure/zk/src/index.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file contracts/scripts/test-upgrade-franklin.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file sdk/zksync-crypto/web-wasm.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file contracts/scripts/deploy-testkit.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file infrastructure/zk/src/completion.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file contracts/scripts/governance-add-erc20.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file infrastructure/zk/src/fmt.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file contracts/scripts/server-add-erc20.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file infrastructure/zk/src/lint.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file contracts/scripts/deploy-withdrawal-helpers.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file etc/js/env-config.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file contracts/scripts/deploy-eip1271.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file contracts/scripts/token-info.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file infrastructure/zk/src/kube.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file infrastructure/zk/src/prover.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • + 5 more in this group — see findings.md.
D10 · Test Quality · No assertions · ×28
  • No assertions: should check status response type core/tests/ts-tests/tests/api.test.ts:41 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: should check testnet config response type core/tests/ts-tests/tests/api.test.ts:45 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: should check withdrawal processing time response type core/tests/ts-tests/tests/api.test.ts:49 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: should check tx history response type core/tests/ts-tests/tests/api.test.ts:53 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: should check blocks response type core/tests/ts-tests/tests/api.test.ts:57 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: should recover failed ETH withdraw core/tests/ts-tests/tests/withdrawal-helpers.test.ts:46 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: should recover failed ERC20 withdraw core/tests/ts-tests/tests/withdrawal-helpers.test.ts:50 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: should recover multiple withdrawals core/tests/ts-tests/tests/withdrawal-helpers.test.ts:59 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: forced_exit_request should recover mutiple tokens core/tests/ts-tests/tests/withdrawal-helpers.test.ts:71 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: should execute a transfer to self core/tests/ts-tests/tests/suits/extended.ts:121 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: should fail trying to send tx with wrong signature core/tests/ts-tests/tests/suits/extended.ts:209 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: should fail trying to send tx with wrong params core/tests/ts-tests/tests/suits/extended.ts:213 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: Correctly Parse Deposit pubdata contracts/test/operations.spec.ts:111 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: Correctly write Deposit data priority queue contracts/test/operations.spec.ts:121 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: Correctly Parse FullExit pubdata contracts/test/operations.spec.ts:131 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: Correctly Write FullExit data priority queue contracts/test/operations.spec.ts:157 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: Correctly Parse Withdraw pubdata contracts/test/operations.spec.ts:175 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: Correctly Parse ForcedExit pubdata contracts/test/operations.spec.ts:186 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: Correctly Parse ChangePubKey pubdata contracts/test/operations.spec.ts:198 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: Deposit ERC20 success contracts/test/specific_tokens.spec.ts:95 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: Make a deposit of tokens that should take a fee from recipient contract contracts/test/specific_tokens.spec.ts:319 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: Make a deposit of tokens that should adds payout to the recipient contracts/test/specific_tokens.spec.ts:350 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: Process transfer to new contracts/test/zksync.spec.ts:701 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: Process deposit contracts/test/zksync.spec.ts:710 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: Process partial exit contracts/test/zksync.spec.ts:743 — 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.
  • + 3 more in this group — see findings.md.
D3 · God Classes · MethodTooLong · ×28
  • MethodTooLong: ZkSyncCircuit.swap core/lib/circuit/src/circuit.rs:3145 — MethodTooLong — swap runs 514 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 414 over it, 5.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.
  • MethodTooLong: ZkSyncCircuit.execute_op core/lib/circuit/src/circuit.rs:788 — MethodTooLong — execute_op runs 437 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 337 over it, 4.37× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ZkSyncCircuit.synthesize core/lib/circuit/src/circuit.rs:111 — MethodTooLong — synthesize runs 372 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 272 over it, 3.72× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ZkSyncCircuit.transfer_to_new core/lib/circuit/src/circuit.rs:2837 — MethodTooLong — transfer_to_new 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.
  • MethodTooLong: ZkSyncCircuit.mint_nft core/lib/circuit/src/circuit.rs:2246 — MethodTooLong — mint_nft runs 242 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 142 over it, 2.42× 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: MintNFTWitness.apply_data core/lib/circuit/src/witness/mint_nft.rs:209 — MethodTooLong — apply_data runs 229 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 129 over it, 2.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: MempoolSchema.return_executed_txs_to_mempool core/lib/storage/src/chain/mempool/mod.rs:765 — MethodTooLong — return_executed_txs_to_mempool runs 229 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 129 over it, 2.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: ZkSyncCircuit.withdraw_nft core/lib/circuit/src/circuit.rs:2553 — MethodTooLong — withdraw_nft runs 222 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 122 over it, 2.22× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ZkSyncCircuit.change_pubkey_offchain core/lib/circuit/src/circuit.rs:1901 — MethodTooLong — change_pubkey_offchain runs 218 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 118 over it, 2.18× 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: ZkSyncCircuit.transfer core/lib/circuit/src/circuit.rs:3796 — MethodTooLong — transfer runs 215 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 115 over it, 2.15× 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: ZkSyncCircuit.forced_exit core/lib/circuit/src/circuit.rs:4070 — MethodTooLong — forced_exit runs 214 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 114 over it, 2.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.
  • MethodTooLong: SwapWitness.apply_data core/lib/circuit/src/witness/swap.rs:303 — MethodTooLong — apply_data runs 202 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 102 over it, 2.02× 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: ZkSyncCircuit.withdraw core/lib/circuit/src/circuit.rs:1289 — MethodTooLong — withdraw runs 199 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 99 over it, 1.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: ZkSyncCircuit.full_exit core/lib/circuit/src/circuit.rs:1540 — MethodTooLong — full_exit runs 176 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 76 over it, 1.76× 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: WithdrawNFTWitness.apply_data core/lib/circuit/src/witness/withdraw_nft.rs:235 — MethodTooLong — apply_data runs 170 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 70 over it, 1.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: AllocatedOperationData.from_witness core/lib/circuit/src/allocated_structures.rs:291 — MethodTooLong — from_witness runs 160 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 60 over it, 1.60× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: BlockSchema.get_block_transactions_page core/lib/storage/src/chain/block/mod.rs:1182 — MethodTooLong — get_block_transactions_page runs 159 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 59 over it, 1.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: ZkSyncExitCircuit.synthesize core/lib/circuit/src/exit_circuit.rs:52 — MethodTooLong — synthesize runs 157 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 57 over it, 1.57× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: TransferToNewWitness.apply_data core/lib/circuit/src/witness/transfer_to_new.rs:186 — MethodTooLong — apply_data runs 151 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 51 over it, 1.51× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: OperationsExtSchema.get_account_transactions_history_from core/lib/storage/src/chain/operations_ext/mod.rs:863 — MethodTooLong — get_account_transactions_history_from runs 148 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 48 over it, 1.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.
  • MethodTooLong: StateSchema.commit_state_update core/lib/storage/src/chain/state/mod.rs:46 — MethodTooLong — commit_state_update runs 147 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 47 over it, 1.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.
  • MethodTooLong: TransferWitness.apply_data core/lib/circuit/src/witness/transfer.rs:162 — MethodTooLong — apply_data runs 135 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 35 over it, 1.35× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ForcedExitWitness.apply_data core/lib/circuit/src/witness/forced_exit.rs:195 — MethodTooLong — apply_data runs 134 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 34 over it, 1.34× 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: FullExitWitness.apply_data core/lib/circuit/src/witness/full_exit.rs:227 — MethodTooLong — apply_data runs 127 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 27 over it, 1.27× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: OperationsExtSchema.find_tx_by_hash core/lib/storage/src/chain/operations_ext/mod.rs:400 — MethodTooLong — find_tx_by_hash runs 112 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 12 over it, 1.12× 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.
  • + 3 more in this group — see findings.md.
D30 · Dependency Vulnerabilities · Medium advisory (unsound) · ×20
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Medium vulnerability · ×18
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×16
  • Duplicated block (9 lines × 2) core/lib/circuit/src/circuit.rs:607 — core/lib/circuit/src/circuit.rs:607-615 | core/lib/circuit/src/exit_circuit.rs:228-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 (9 lines × 2) core/lib/circuit/src/circuit.rs:2910 — core/lib/circuit/src/circuit.rs:2910-2918 | core/lib/circuit/src/circuit.rs:3865-3873 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) core/lib/circuit/src/witness/change_pubkey_offchain.rs:79 — core/lib/circuit/src/witness/change_pubkey_offchain.rs:79-87 | core/lib/circuit/src/witness/full_exit.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 both call sites, so a change lands once.
  • Duplicated block (9 lines × 2) core/lib/circuit/src/witness/forced_exit.rs:156 — core/lib/circuit/src/witness/forced_exit.rs:156-164 | core/lib/circuit/src/witness/transfer_to_new.rs:147-155 — before extracting anything, compare `core/lib/circuit/src/witness/forced_exit.rs` and `core/lib/circuit/src/witness/transfer_to_new.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) core/lib/circuit/src/witness/mint_nft.rs:218 — core/lib/circuit/src/witness/mint_nft.rs:218-226 | core/lib/circuit/src/witness/withdraw_nft.rs:247-255 — before extracting anything, compare `core/lib/circuit/src/witness/mint_nft.rs` and `core/lib/circuit/src/witness/withdraw_nft.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) core/lib/crypto/src/circuit/utils.rs:50 — core/lib/crypto/src/circuit/utils.rs:50-58 | core/lib/crypto/src/circuit/utils.rs:84-92 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) core/lib/eth_signer/src/raw_ethereum_tx.rs:64 — core/lib/eth_signer/src/raw_ethereum_tx.rs:64-72 | core/lib/eth_signer/src/raw_ethereum_tx.rs:126-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.
  • Duplicated block (9 lines × 2) core/lib/types/src/operations/full_exit_op.rs:91 — core/lib/types/src/operations/full_exit_op.rs:91-99 | core/lib/types/src/operations/full_exit_op.rs:133-141 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) sdk/zksync-rs/src/operations/transfer.rs:50 — sdk/zksync-rs/src/operations/transfer.rs:50-58 | sdk/zksync-rs/src/operations/withdraw.rs:49-57 — before extracting anything, compare `sdk/zksync-rs/src/operations/transfer.rs` and `sdk/zksync-rs/src/operations/withdraw.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) core/lib/types/src/tx/mint_nft.rs:137 — core/lib/types/src/tx/mint_nft.rs:137-145 | core/lib/types/src/tx/withdraw_nft.rs:143-151 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (9 lines × 2) sdk/zksync-rs/src/operations/transfer.rs:151 — sdk/zksync-rs/src/operations/transfer.rs:151-159 | sdk/zksync-rs/src/operations/withdraw.rs:151-159 — before extracting anything, compare `sdk/zksync-rs/src/operations/transfer.rs` and `sdk/zksync-rs/src/operations/withdraw.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) core/lib/storage/src/prover/mod.rs:200 — core/lib/storage/src/prover/mod.rs:200-209 | core/lib/storage/src/prover/mod.rs:273-281 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) core/lib/circuit/src/circuit.rs:1460 — core/lib/circuit/src/circuit.rs:1460-1468 | core/lib/circuit/src/circuit.rs:3040-3048 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) core/lib/circuit/src/circuit.rs:1738 — core/lib/circuit/src/circuit.rs:1738-1746 | core/lib/circuit/src/circuit.rs:2811-2819 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) core/lib/circuit/src/circuit.rs:1812 — core/lib/circuit/src/circuit.rs:1812-1820 | core/lib/circuit/src/circuit.rs:2223-2231 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) core/lib/circuit/src/signature.rs:66 — core/lib/circuit/src/signature.rs:66-74 | core/lib/circuit/src/signature.rs:133-141 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×14
  • Duplicated block (12 lines × 2) core/lib/circuit/src/circuit.rs:544 — core/lib/circuit/src/circuit.rs:544-555 | core/lib/circuit/src/circuit.rs:567-578 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) core/lib/circuit/src/circuit.rs:1955 — core/lib/circuit/src/circuit.rs:1955-1966 | core/lib/circuit/src/circuit.rs:1970-1981 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) core/lib/circuit/src/circuit.rs:2927 — core/lib/circuit/src/circuit.rs:2927-2938 | core/lib/circuit/src/circuit.rs:3882-3893 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) core/lib/circuit/src/circuit.rs:3131 — core/lib/circuit/src/circuit.rs:3131-3142 | core/lib/circuit/src/circuit.rs:4339-4350 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) core/lib/circuit/src/witness/transfer.rs:134 — core/lib/circuit/src/witness/transfer.rs:134-145 | core/lib/circuit/src/witness/transfer_to_new.rs:140-151 — before extracting anything, compare `core/lib/circuit/src/witness/transfer.rs` and `core/lib/circuit/src/witness/transfer_to_new.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 142 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 2) core/lib/mempool/src/transactions_handler.rs:53 — core/lib/mempool/src/transactions_handler.rs:53-64 | core/lib/mempool/src/transactions_handler.rs:155-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 (12 lines × 2) core/lib/types/src/operations/transfer_op.rs:65 — core/lib/types/src/operations/transfer_op.rs:65-76 | core/lib/types/src/operations/transfer_to_new_op.rs:71-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 both call sites, so a change lands once.
  • Duplicated block (12 lines × 2) sdk/zksync-rs/src/ethereum/mod.rs:250 — sdk/zksync-rs/src/ethereum/mod.rs:250-261 | sdk/zksync-rs/src/ethereum/mod.rs:356-367 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) core/lib/types/src/block/incomplete_block.rs:119 — core/lib/types/src/block/incomplete_block.rs:119-130 | core/lib/types/src/block/mod.rs:506-517 — 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) sdk/zksync-rs/src/operations/transfer.rs:35 — sdk/zksync-rs/src/operations/transfer.rs:35-46 | sdk/zksync-rs/src/operations/withdraw.rs:34-45 — before extracting anything, compare `sdk/zksync-rs/src/operations/transfer.rs` and `sdk/zksync-rs/src/operations/withdraw.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 100 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) sdk/zksync-rs/src/operations/transfer.rs:112 — sdk/zksync-rs/src/operations/transfer.rs:112-123 | sdk/zksync-rs/src/operations/withdraw.rs:112-123 — before extracting anything, compare `sdk/zksync-rs/src/operations/transfer.rs` and `sdk/zksync-rs/src/operations/withdraw.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 2) core/lib/circuit/src/witness/transfer_to_new.rs:188 — core/lib/circuit/src/witness/transfer_to_new.rs:188-199 | core/lib/circuit/src/witness/transfer_to_new.rs:257-269 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) core/lib/circuit/src/circuit.rs:302 — core/lib/circuit/src/circuit.rs:302-313 | core/lib/circuit/src/circuit.rs:427-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 (12 lines × 2) core/lib/circuit/src/circuit.rs:1827 — core/lib/circuit/src/circuit.rs:1827-1838 | core/lib/circuit/src/circuit.rs:2069-2080 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D3 · God Classes · ClassTooLong · ×13
  • ClassTooLong: ZkSyncCircuit core/lib/circuit/src/circuit.rs:49 — ClassTooLong — 3435 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 15 methods, 4 blocks, lines 49-4398. The bar is 400 significant lines; this is 3035 over it, 8.59× 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: OperationsExtSchema core/lib/storage/src/chain/operations_ext/mod.rs:56 — ClassTooLong — 1662 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 37 methods. The bar is 400 significant lines; this is 1262 over it, 4.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: BlockSchema core/lib/storage/src/chain/block/mod.rs:44 — ClassTooLong — 1070 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 41 methods. The bar is 400 significant lines; this is 670 over it, 2.68× 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: Wallet sdk/zksync.js/src/wallet.ts:47 — ClassTooLong — 876 significant lines (blank, comment-only and punctuation-only lines excluded), 42 methods. The bar is 400 significant lines; this is 476 over it, 2.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: MempoolSchema core/lib/storage/src/chain/mempool/mod.rs:34 — ClassTooLong — 762 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 22 methods. The bar is 400 significant lines; this is 362 over it, 1.91× 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: StateSchema core/lib/storage/src/chain/state/mod.rs:41 — ClassTooLong — 632 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. The bar is 400 significant lines; this is 232 over it, 1.58× 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: OperationsSchema core/lib/storage/src/chain/operations/mod.rs:27 — ClassTooLong — 542 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 20 methods. The bar is 400 significant lines; this is 142 over it, 1.36× 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: EthereumSchema core/lib/storage/src/ethereum/mod.rs:27 — ClassTooLong — 458 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 21 methods. The bar is 400 significant lines; this is 58 over it, 1.15× 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: AbstractWallet sdk/zksync.js/src/abstract-wallet.ts:36 — ClassTooLong — 430 significant lines (blank, comment-only and punctuation-only lines excluded), 51 methods. The bar is 400 significant lines; this is 30 over it, 1.08× 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: TokensSchema core/lib/storage/src/tokens/mod.rs:30 — ClassTooLong — 423 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 20 methods. The bar is 400 significant lines; this is 23 over it, 1.06× 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: EventsState core/lib/l1_event_listener/src/events_state.rs:23 — ClassTooLong — 416 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, 3 blocks, lines 23-686. The bar is 400 significant lines; this is 16 over it, 1.04× 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: AccountSchema core/lib/storage/src/chain/account/mod.rs:29 — ClassTooLong — 413 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 15 methods. The bar is 400 significant lines; this is 13 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: RestProvider sdk/zksync.js/src/rest-provider.ts:64 — ClassTooLong — 409 significant lines (blank, comment-only and punctuation-only lines excluded), 65 methods. The bar is 400 significant lines; this is 9 over it, 1.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.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×10
  • Duplicated block (10 lines × 2) core/lib/circuit/src/circuit.rs:1572 — core/lib/circuit/src/circuit.rs:1572-1581 | core/lib/circuit/src/circuit.rs:2589-2598 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) core/lib/circuit/src/circuit.rs:2359 — core/lib/circuit/src/circuit.rs:2359-2368 | core/lib/circuit/src/circuit.rs:2672-2681 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) core/lib/circuit/src/witness/utils.rs:270 — core/lib/circuit/src/witness/utils.rs:270-279 | core/lib/circuit/src/witness/utils.rs:297-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.
  • Duplicated block (10 lines × 2) core/lib/storage/src/chain/account/records.rs:56 — core/lib/storage/src/chain/account/records.rs:56-65 | core/lib/storage/src/tokens/records.rs:123-132 — 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) core/lib/storage/src/chain/operations_ext/mod.rs:1899 — core/lib/storage/src/chain/operations_ext/mod.rs:1899-1908 | core/lib/storage/src/chain/operations_ext/mod.rs:1923-1932 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) core/lib/types/src/tx/mint_nft.rs:204 — core/lib/types/src/tx/mint_nft.rs:204-213 | core/lib/types/src/tx/withdraw_nft.rs:220-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 (10 lines × 2) core/lib/types/src/tx/transfer.rs:307 — core/lib/types/src/tx/transfer.rs:307-316 | core/lib/types/src/tx/withdraw.rs:308-317 — before extracting anything, compare `core/lib/types/src/tx/transfer.rs` and `core/lib/types/src/tx/withdraw.rs` as WHOLE FILES: this scan already matched 7 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. 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) sdk/zksync-rs/src/operations/mint_nft.rs:49 — sdk/zksync-rs/src/operations/mint_nft.rs:49-58 | sdk/zksync-rs/src/operations/withdraw_nft.rs:53-62 — before extracting anything, compare `sdk/zksync-rs/src/operations/mint_nft.rs` and `sdk/zksync-rs/src/operations/withdraw_nft.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 2) core/lib/circuit/src/witness/forced_exit.rs:197 — core/lib/circuit/src/witness/forced_exit.rs:197-206 | core/lib/circuit/src/witness/forced_exit.rs:253-264 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) core/lib/circuit/src/circuit.rs:3254 — core/lib/circuit/src/circuit.rs:3254-3263 | core/lib/circuit/src/circuit.rs:3267-3276 — both copies are in the same file, so extract the 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 (7 lines × 2) · ×10
  • Duplicated block (7 lines × 2) core/lib/circuit/src/circuit.rs:1311 — core/lib/circuit/src/circuit.rs:1311-1318 | core/lib/circuit/src/circuit.rs:4099-4105 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) core/lib/circuit/src/witness/full_exit.rs:233 — core/lib/circuit/src/witness/full_exit.rs:233-239 | core/lib/circuit/src/witness/withdraw.rs:165-171 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) core/lib/eth_signer/src/json_rpc_signer.rs:70 — core/lib/eth_signer/src/json_rpc_signer.rs:70-76 | core/lib/eth_signer/src/json_rpc_signer.rs:101-107 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) core/lib/eth_signer/src/json_rpc_signer.rs:70 — core/lib/eth_signer/src/json_rpc_signer.rs:70-76 | core/lib/eth_signer/src/json_rpc_signer.rs:236-242 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) core/lib/types/src/priority_ops/mod.rs:136 — core/lib/types/src/priority_ops/mod.rs:136-142 | core/lib/types/src/priority_ops/mod.rs:204-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 (7 lines × 2) core/lib/types/src/priority_ops/mod.rs:251 — core/lib/types/src/priority_ops/mod.rs:251-257 | core/lib/types/src/priority_ops/mod.rs:314-320 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) core/lib/types/src/tx/change_pubkey.rs:293 — core/lib/types/src/tx/change_pubkey.rs:293-299 | core/lib/types/src/tx/withdraw.rs:163-169 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) core/lib/types/src/tx/swap.rs:265 — core/lib/types/src/tx/swap.rs:265-271 | core/lib/types/src/tx/swap.rs:281-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 (7 lines × 2) core/lib/circuit/src/circuit.rs:1683 — core/lib/circuit/src/circuit.rs:1683-1689 | core/lib/circuit/src/circuit.rs:4322-4330 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) core/lib/circuit/src/witness/transfer.rs:164 — core/lib/circuit/src/witness/transfer.rs:164-170 | core/lib/circuit/src/witness/transfer.rs:223-230 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D3 · God Classes · FileTooLong · ×9
  • FileTooLong: src/circuit.rs core/lib/circuit/src/circuit.rs — FileTooLong — 3921 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: ZkSyncCircuit (4 blocks, 49-4398). The bar is 500 significant lines; this is 3421 over it, 7.84× 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: operations_ext/mod.rs core/lib/storage/src/chain/operations_ext/mod.rs — FileTooLong — 1733 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 96% of them inside a single declaration: OperationsExtSchema (58-2116). The bar is 500 significant lines; this is 1233 over it, 3.47× 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: block/mod.rs core/lib/storage/src/chain/block/mod.rs — FileTooLong — 1097 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 98% of them inside a single declaration: BlockSchema (46-1550). The bar is 500 significant lines; this is 597 over it, 2.19× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: src/wallet.ts sdk/zksync.js/src/wallet.ts — FileTooLong — 919 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: Wallet (47-1212). The bar is 500 significant lines; this is 419 over it, 1.84× 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: mempool/mod.rs core/lib/storage/src/chain/mempool/mod.rs — FileTooLong — 780 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 98% of them inside a single declaration: MempoolSchema (36-1051). The bar is 500 significant lines; this is 280 over it, 1.56× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: witness/utils.rs core/lib/circuit/src/witness/utils.rs — FileTooLong — 705 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 205 over it, 1.41× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED sdk/zksync.js/src/utils.ts — FileTooLong — 664 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 164 over it, 1.33× 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: state/mod.rs core/lib/storage/src/chain/state/mod.rs — FileTooLong — 648 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 98% of them inside a single declaration: StateSchema (43-902). The bar is 500 significant lines; this is 148 over it, 1.30× 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: operations/mod.rs core/lib/storage/src/chain/operations/mod.rs — FileTooLong — 558 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: OperationsSchema (29-748). The bar is 500 significant lines; this is 58 over it, 1.12× 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.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×8
  • Duplicated block (11 lines × 2) core/lib/circuit/src/circuit.rs:413 — core/lib/circuit/src/circuit.rs:413-423 | core/lib/circuit/src/circuit.rs:485-495 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) core/lib/circuit/src/witness/forced_exit.rs:355 — core/lib/circuit/src/witness/forced_exit.rs:355-365 | core/lib/circuit/src/witness/withdraw.rs:248-258 — before extracting anything, compare `core/lib/circuit/src/witness/forced_exit.rs` and `core/lib/circuit/src/witness/withdraw.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 (11 lines × 2) core/lib/circuit/src/witness/utils.rs:164 — core/lib/circuit/src/witness/utils.rs:164-174 | core/lib/circuit/src/witness/utils.rs:188-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 (11 lines × 2) core/lib/storage/src/chain/account/mod.rs:495 — core/lib/storage/src/chain/account/mod.rs:495-505 | core/lib/storage/src/chain/account/mod.rs:539-549 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) core/lib/storage/src/chain/operations/mod.rs:198 — core/lib/storage/src/chain/operations/mod.rs:198-208 | core/lib/storage/src/chain/operations/mod.rs:225-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 (11 lines × 2) core/lib/storage/src/chain/operations_ext/mod.rs:234 — core/lib/storage/src/chain/operations_ext/mod.rs:234-245 | core/lib/storage/src/chain/operations_ext/mod.rs:328-338 — both copies are in the same file, so extract the block into 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) sdk/zksync-rs/src/ethereum/priority_op_handle.rs:93 — sdk/zksync-rs/src/ethereum/priority_op_handle.rs:93-103 | sdk/zksync-rs/src/operations/mod.rs:105-115 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (11 lines × 2) core/lib/circuit/src/utils.rs:252 — core/lib/circuit/src/utils.rs:252-262 | core/lib/circuit/src/utils.rs:292-302 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×8
  • Outbound HTTP without resilience core/bin/zksync_api/src/api_server/rest/network_status.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 core/bin/zksync_api/src/fee_ticker/ticker_api/coingecko.rs:44 — `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 core/lib/api_client/src/rest/client.rs:46 — `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 core/lib/eth_signer/src/json_rpc_signer.rs:164 — `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 core/lib/notifier/src/matter_most_notifier.rs:12 — `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 sdk/zksync-rs/src/provider.rs:196 — `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 sdk/zksync-rs/src/provider.rs:205 — `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 sdk/zksync-rs/src/provider.rs:214 — `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.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×7
  • Duplicated block (6 lines × 2) core/lib/circuit/src/circuit.rs:1353 — core/lib/circuit/src/circuit.rs:1353-1358 | core/lib/circuit/src/circuit.rs:1368-1373 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) core/lib/crypto/src/primitives.rs:135 — core/lib/crypto/src/primitives.rs:135-140 | core/lib/crypto/src/primitives.rs:155-160 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) core/lib/types/src/operations/mod.rs:224 — core/lib/types/src/operations/mod.rs:224-229 | core/lib/types/src/operations/mod.rs:245-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 (6 lines × 2) core/lib/crypto/src/circuit/utils.rs:102 — core/lib/crypto/src/circuit/utils.rs:102-108 | sdk/zksync-crypto/src/utils.rs:66-71 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) core/lib/types/src/tx/primitives/packed_public_key.rs:55 — core/lib/types/src/tx/primitives/packed_public_key.rs:55-60 | core/lib/types/src/tx/primitives/packed_signature.rs:82-87 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) core/lib/eth_client/src/clients/http_client.rs:129 — core/lib/eth_client/src/clients/http_client.rs:129-134 | core/lib/eth_client/src/clients/http_client.rs:469-474 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) core/lib/eth_signer/src/json_rpc_signer.rs:405 — core/lib/eth_signer/src/json_rpc_signer.rs:405-410 | core/lib/eth_signer/src/json_rpc_signer.rs:414-419 — both copies are in the same file, so extract the 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 (11 lines × 2 locations) · ×7
  • Duplicated block (11 lines × 2 locations) contracts/scripts/deploy.ts:9 — contracts/scripts/deploy.ts:9 · contracts/scripts/upgrade-testnet.ts:9 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
  • Duplicated block (11 lines × 2 locations) contracts/scripts/governance-add-erc20.ts:56 — contracts/scripts/governance-add-erc20.ts:56 · infrastructure/token-lists-manager/index.ts:74 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (11 lines × 2 locations) infrastructure/api-docs/src/compile.ts:158 — infrastructure/api-docs/src/compile.ts:158 · infrastructure/api-docs/src/compile.ts: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.
  • Duplicated block (11 lines × 2 locations) sdk/zksync.js/src/abstract-wallet.ts:431 — sdk/zksync.js/src/abstract-wallet.ts:431 · sdk/zksync.js/src/abstract-wallet.ts:647 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (11 lines × 2 locations) sdk/zksync.js/src/abstract-wallet.ts:579 — sdk/zksync.js/src/abstract-wallet.ts:579 · sdk/zksync.js/src/abstract-wallet.ts:602 — both copies are in the same file, so extract the block into 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 locations) sdk/zksync.js/src/rest-provider.ts:220 — sdk/zksync.js/src/rest-provider.ts:220 · sdk/zksync.js/src/rest-provider.ts:313 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (11 lines × 2 locations) sdk/zksync.js/src/utils.ts:278 — sdk/zksync.js/src/utils.ts:278 · sdk/zksync.js/src/utils.ts:297 — 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.
R11 · Import Boundaries · Boundary violation [package · ×7
  • Boundary violation [package:third-party-deep-import] contracts/scripts/deploy-erc20.ts:5 — contracts/scripts/deploy-erc20.ts:5 imports ethers/lib/utils, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] contracts/scripts/deploy.ts:4 — contracts/scripts/deploy.ts:4 imports ethers/lib/utils, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] contracts/scripts/revert-reason.ts:3 — contracts/scripts/revert-reason.ts:3 imports ethers/lib/utils, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] contracts/scripts/upgrade-testnet.ts:4 — contracts/scripts/upgrade-testnet.ts:4 imports ethers/lib/utils, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] contracts/src.ts/deploy.ts:3 — contracts/src.ts/deploy.ts:3 imports ethers/lib/utils, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:undeclared-workspace-dep] infrastructure/api-docs/src/compile.ts:4 — infrastructure/api-docs/src/compile.ts:4 imports zksync, a package this repository publishes, but this package's own REDACTED does not list it in dependencies (or peer/optional dependencies) — it resolves only through the workspace link, so an installed copy of this package is missing it. Add it to this package's dependencies.
  • Boundary violation [package:undeclared-workspace-dep] infrastructure/token-lists-manager/index.ts:3 — infrastructure/token-lists-manager/index.ts:3 imports reading-tool, a package this repository publishes, but this package's own REDACTED does not list it in dependencies (or peer/optional dependencies) — it resolves only through the workspace link, so an installed copy of this package is missing it. Add it to this package's dependencies.
D3 · God Classes · TooManyMethods · ×6
  • TooManyMethods: RestProvider sdk/zksync.js/src/rest-provider.ts:64 — TooManyMethods — 65 methods. The bar is 30 methods; this is 35 over it, 2.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: AbstractWallet sdk/zksync.js/src/abstract-wallet.ts:36 — 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: Wallet sdk/zksync.js/src/wallet.ts:47 — TooManyMethods — 42 methods. The bar is 30 methods; this is 12 over it, 1.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: BlockSchema core/lib/storage/src/chain/block/mod.rs:44 — 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: OperationsExtSchema core/lib/storage/src/chain/operations_ext/mod.rs:56 — TooManyMethods — 37 methods. The bar is 30 methods; 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.
  • TooManyMethods: ZkSyncState core/lib/state/src/state.rs:26 — TooManyMethods — 31 methods, declared across 4 files: src/state.rs (23), handler/swap.rs (4), handler/transfer.rs (3), handler/mint_nft.rs (1). The bar is 30 methods; this is 1 over it, 1.03× 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.
D36 · Supply-chain Provenance & Signing REDACTED · ×6
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×6
  • Duplicated block (8 lines × 2) core/lib/circuit/src/witness/close_account.rs:75 — core/lib/circuit/src/witness/close_account.rs:75-82 | core/lib/circuit/src/witness/transfer.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 both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) core/lib/circuit/src/witness/close_account.rs:81 — core/lib/circuit/src/witness/close_account.rs:81-88 | core/lib/circuit/src/witness/withdraw.rs:133-140 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) core/lib/circuit/src/witness/deposit.rs:159 — core/lib/circuit/src/witness/deposit.rs:159-166 | core/lib/circuit/src/witness/withdraw.rs:167-174 — before extracting anything, compare `core/lib/circuit/src/witness/deposit.rs` and `core/lib/circuit/src/witness/withdraw.rs` as WHOLE FILES: this scan already matched 3 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) core/lib/circuit/src/witness/transfer.rs:149 — core/lib/circuit/src/witness/transfer.rs:149-156 | core/lib/circuit/src/witness/transfer_to_new.rs:155-162 — before extracting anything, compare `core/lib/circuit/src/witness/transfer.rs` and `core/lib/circuit/src/witness/transfer_to_new.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 142 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) core/lib/eth_signer/src/json_rpc_signer.rs:345 — core/lib/eth_signer/src/json_rpc_signer.rs:345-352 | sdk/zksync-rs/src/provider.rs:358-365 — 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) sdk/zksync-rs/src/ethereum/priority_op_handle.rs:42 — sdk/zksync-rs/src/ethereum/priority_op_handle.rs:42-49 | sdk/zksync-rs/src/operations/mod.rs:54-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.
D5 · Coupling · Off the main sequence · ×6
  • Off the main sequence: vlog — vlog: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 20 project(s), so it's rigid to change.
  • Off the main sequence: zksync_utils — zksync_utils: abstractness 0.09, instability 0.00, distance 0.91 — zone of pain — concrete and depended on by 15 project(s), so it's rigid to change.
  • Off the main sequence: zksync_config — zksync_config: abstractness 0.00, instability 0.14, distance 0.86 — zone of pain — concrete and depended on by 19 project(s), so it's rigid to change.
  • Off the main sequence: zksync_types — zksync_types: abstractness 0.03, instability 0.12, distance 0.85 — zone of pain — concrete and depended on by 30 project(s), so it's rigid to change.
  • Off the main sequence: zksync_crypto — zksync_crypto: abstractness 0.18, instability 0.05, distance 0.77 — zone of pain — concrete and depended on by 18 project(s), so it's rigid to change.
  • Off the main sequence: zksync_storage — zksync_storage: abstractness 0.00, instability 0.27, distance 0.73 — zone of pain — concrete and depended on by 16 project(s), so it's rigid to change.
R10 · Code Duplication · Duplicated block (10 lines × 2 locations) · ×6
  • Duplicated block (10 lines × 2 locations) contracts/scripts/upgrade-testnet.ts:93 — contracts/scripts/upgrade-testnet.ts:93 · contracts/scripts/upgrade-testnet.ts: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 locations) contracts/scripts/upgrade-testnet.ts:107 — contracts/scripts/upgrade-testnet.ts:107 · contracts/scripts/upgrade-testnet.ts:118 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (10 lines × 2 locations) infrastructure/api-docs/src/utils.ts:5 — infrastructure/api-docs/src/utils.ts:5 · REDACTED:37 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
  • Duplicated block (10 lines × 2 locations) infrastructure/zk/src/fmt.ts:49 — infrastructure/zk/src/fmt.ts:49 · infrastructure/zk/src/lint.ts:52 — 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 (10 lines × 2 locations) sdk/zksync.js/src/provider.ts:104 — sdk/zksync.js/src/provider.ts:104 · sdk/zksync.js/src/provider.ts:123 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (10 lines × 2 locations) sdk/zksync.js/src/utils.ts:118 — sdk/zksync.js/src/utils.ts:118 · sdk/zksync.js/src/utils.ts:128 — 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.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×5
  • Duplicated block (15 lines × 2) core/lib/circuit/src/witness/change_pubkey_offchain.rs:168 — core/lib/circuit/src/witness/change_pubkey_offchain.rs:168-182 | core/lib/circuit/src/witness/withdraw.rs:186-204 — 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) core/lib/storage/src/chain/state/mod.rs:73 — core/lib/storage/src/chain/state/mod.rs:73-87 | core/lib/storage/src/chain/state/mod.rs:91-105 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2) core/lib/types/src/tx/change_pubkey.rs:269 — core/lib/types/src/tx/change_pubkey.rs:269-283 | core/lib/types/src/tx/forced_exit.rs:152-166 — 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) core/lib/types/src/tx/mint_nft.rs:101 — core/lib/types/src/tx/mint_nft.rs:101-115 | core/lib/types/src/tx/swap.rs:247-261 — before extracting anything, compare `core/lib/types/src/tx/mint_nft.rs` and `core/lib/types/src/tx/swap.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 (15 lines × 2) core/lib/storage/src/tokens/mod.rs:134 — core/lib/storage/src/tokens/mod.rs:134-148 | core/lib/storage/src/tokens/mod.rs:161-175 — both copies are in the same file, so extract the 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 lines × 2) · ×5
  • Duplicated block (14 lines × 2) core/lib/circuit/src/circuit.rs:3914 — core/lib/circuit/src/circuit.rs:3914-3927 | core/lib/circuit/src/circuit.rs:4176-4189 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) core/lib/circuit/src/circuit.rs:4672 — core/lib/circuit/src/circuit.rs:4672-4685 | core/lib/circuit/src/circuit.rs:4767-4780 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) core/lib/circuit/src/witness/forced_exit.rs:137 — core/lib/circuit/src/witness/forced_exit.rs:137-150 | core/lib/circuit/src/witness/transfer_to_new.rs:128-141 — before extracting anything, compare `core/lib/circuit/src/witness/forced_exit.rs` and `core/lib/circuit/src/witness/transfer_to_new.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (14 lines × 2) core/lib/types/src/tx/forced_exit.rs:79 — core/lib/types/src/tx/forced_exit.rs:79-92 | core/lib/types/src/tx/transfer.rs:87-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 (14 lines × 2) core/lib/circuit/src/circuit.rs:3361 — core/lib/circuit/src/circuit.rs:3361-3374 | core/lib/circuit/src/circuit.rs:3385-3398 — both copies are in the same file, so extract the 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 (17 lines × 2) · ×4
  • Duplicated block (17 lines × 2) core/lib/circuit/src/circuit.rs:1711 — core/lib/circuit/src/circuit.rs:1711-1727 | core/lib/circuit/src/circuit.rs:2791-2807 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (17 lines × 2) core/lib/circuit/src/circuit.rs:4737 — core/lib/circuit/src/circuit.rs:4737-4753 | core/lib/circuit/src/circuit.rs:4860-4876 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (17 lines × 2) core/lib/types/src/tx/transfer.rs:172 — core/lib/types/src/tx/transfer.rs:172-188 | core/lib/types/src/tx/withdraw.rs:173-189 — before extracting anything, compare `core/lib/types/src/tx/transfer.rs` and `core/lib/types/src/tx/withdraw.rs` as WHOLE FILES: this scan already matched 7 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. 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) sdk/zksync-rs/src/operations/transfer.rs:63 — sdk/zksync-rs/src/operations/transfer.rs:63-79 | sdk/zksync-rs/src/operations/withdraw.rs:60-76 — before extracting anything, compare `sdk/zksync-rs/src/operations/transfer.rs` and `sdk/zksync-rs/src/operations/withdraw.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 100 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 (16 lines × 2) · ×4
  • Duplicated block (16 lines × 2) core/lib/circuit/src/circuit.rs:3778 — core/lib/circuit/src/circuit.rs:3778-3793 | core/lib/circuit/src/circuit.rs:4052-4067 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) core/lib/circuit/src/circuit.rs:3941 — core/lib/circuit/src/circuit.rs:3941-3956 | core/lib/circuit/src/circuit.rs:4202-4217 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) core/lib/circuit/src/circuit.rs:4692 — core/lib/circuit/src/circuit.rs:4692-4707 | core/lib/circuit/src/circuit.rs:4787-4802 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) core/lib/types/src/tx/mint_nft.rs:72 — core/lib/types/src/tx/mint_nft.rs:72-87 | core/lib/types/src/tx/swap.rs:218-233 — before extracting anything, compare `core/lib/types/src/tx/mint_nft.rs` and `core/lib/types/src/tx/swap.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 (13 lines × 2) · ×4
  • Duplicated block (13 lines × 2) core/lib/circuit/src/witness/utils.rs:347 — core/lib/circuit/src/witness/utils.rs:347-359 | core/lib/circuit/src/witness/utils.rs:362-374 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) core/lib/storage/src/chain/mempool/mod.rs:167 — core/lib/storage/src/chain/mempool/mod.rs:167-179 | core/lib/storage/src/chain/mempool/mod.rs:201-213 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) core/lib/circuit/src/circuit.rs:3426 — core/lib/circuit/src/circuit.rs:3426-3438 | core/lib/circuit/src/circuit.rs:3440-3452 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) core/lib/storage/src/event/mod.rs:239 — core/lib/storage/src/event/mod.rs:239-251 | core/lib/storage/src/event/mod.rs:277-289 — both copies are in the same file, so extract the 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 · OperationsExtSchema · ×3
  • OperationsExtSchema::get_account_transactions_history_from (cognitive 26) core/lib/storage/src/chain/operations_ext/mod.rs:863 — OperationsExtSchema::get_account_transactions_history_from has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (20 pts), match/switch 2 (4 pts), loops 1 (2 pts) (nesting depth added 14). 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.
  • OperationsExtSchema::get_account_transactions_history (cognitive 23) core/lib/storage/src/chain/operations_ext/mod.rs:670 — OperationsExtSchema::get_account_transactions_history has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (18 pts), match/switch 1 (3 pts), loops 1 (2 pts) (nesting depth added 14). 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.
  • OperationsExtSchema::get_account_transactions (cognitive 19) core/lib/storage/src/chain/operations_ext/mod.rs:1051 — OperationsExtSchema::get_account_transactions has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), match/switch 2 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×3
  • Duplicated block (19 lines × 2) core/lib/types/src/priority_ops/mod.rs:186 — core/lib/types/src/priority_ops/mod.rs:186-204 | core/lib/types/src/priority_ops/mod.rs:296-314 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (19 lines × 2) sdk/zksync-rs/src/operations/transfer.rs:56 — sdk/zksync-rs/src/operations/transfer.rs:56-74 | sdk/zksync-rs/src/operations/transfer_nft.rs:62-80 — before extracting anything, compare `sdk/zksync-rs/src/operations/transfer.rs` and `sdk/zksync-rs/src/operations/transfer_nft.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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) core/lib/circuit/src/witness/mint_nft.rs:439 — core/lib/circuit/src/witness/mint_nft.rs:439-457 | core/lib/circuit/src/witness/withdraw_nft.rs:393-411 — before extracting anything, compare `core/lib/circuit/src/witness/mint_nft.rs` and `core/lib/circuit/src/witness/withdraw_nft.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 × 3) · ×3
  • Duplicated block (8 lines × 3) core/lib/circuit/src/witness/forced_exit.rs:158 — core/lib/circuit/src/witness/forced_exit.rs:158-165 | core/lib/circuit/src/witness/transfer_to_new.rs:149-156 | core/lib/circuit/src/witness/withdraw.rs:127-134 — before extracting anything, compare `core/lib/circuit/src/witness/forced_exit.rs` and `core/lib/circuit/src/witness/transfer_to_new.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 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) core/lib/types/src/tx/transfer.rs:115 — core/lib/types/src/tx/transfer.rs:115-122 | core/lib/types/src/tx/withdraw.rs:117-124 | core/lib/types/src/tx/withdraw_nft.rs:113-120 — before extracting anything, compare `core/lib/types/src/tx/transfer.rs` and `core/lib/types/src/tx/withdraw.rs` as WHOLE FILES: this scan already matched 7 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. 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) core/lib/circuit/src/circuit.rs:1653 — core/lib/circuit/src/circuit.rs:1653-1660 | core/lib/circuit/src/circuit.rs:1713-1720 | core/lib/circuit/src/circuit.rs:2793-2801 — 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 × 2) · ×3
  • Duplicated block (5 lines × 2) core/lib/circuit/src/witness/swap.rs:75 — core/lib/circuit/src/witness/swap.rs:75-79 | core/lib/circuit/src/witness/swap.rs:87-91 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) core/lib/circuit/src/circuit.rs:125 — core/lib/circuit/src/circuit.rs:125-129 | core/lib/circuit/src/exit_circuit.rs:54-60 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) core/lib/circuit/src/utils.rs:51 — core/lib/circuit/src/utils.rs:51-55 | core/lib/circuit/src/utils.rs:178-182 — both copies are in the same file, so extract the 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 (17 lines × 2 locations) · ×3
  • Duplicated block (17 lines × 2 locations) contracts/scripts/deploy-erc20.ts:51 — contracts/scripts/deploy-erc20.ts:51 · contracts/scripts/server-add-erc20.ts:33 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (17 lines × 2 locations) sdk/zksync.js/src/utils.ts:155 — sdk/zksync.js/src/utils.ts:155 · sdk/zksync.js/src/utils.ts:198 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (17 lines × 2 locations) sdk/zksync.js/src/utils.ts:675 — sdk/zksync.js/src/utils.ts:675 · sdk/zksync.js/src/utils.ts:792 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
X2 · Cancellation propagation · Async function without AbortSignal · ×3
  • Async function without AbortSignal: ethData infrastructure/zk/src/db/insert.ts:30 — `ethData` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: fetchFromSourceTokenList infrastructure/token-lists-manager/index.ts:19 — `fetchFromSourceTokenList` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: addToken contracts/scripts/server-add-erc20.ts:12 — `addToken` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
X3 · Exception handling · Swallowed exception (empty catch) · ×3
  • Swallowed exception (empty catch) sdk/zksync.js/src/operations.ts:31 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) contracts/src.ts/deploy.ts:274 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) contracts/scripts/revert-reason.ts:94 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
D2 · Cognitive Complexity · TxSender · ×2
  • TxSender::submit_txs_batch (cognitive 48) core/bin/zksync_api/src/api_server/tx_sender.rs:649 — TxSender::submit_txs_batch has cognitive complexity 48 (threshold 15). Drivers by points: if/else 26 (41 pts), loops 4, match/switch 1 (2 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.
  • TxSender::submit_tx (cognitive 20) core/bin/zksync_api/src/api_server/tx_sender.rs:493 — TxSender::submit_tx has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (18 pts), 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 · zksync_api · ×2
  • zksync_api::api_server::tx_sender::verify_txs_batch_signature (cognitive 38) core/bin/zksync_api/src/api_server/tx_sender.rs:1126 — zksync_api::api_server::tx_sender::verify_txs_batch_signature has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (32 pts), match/switch 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • zksync_api::signature_checker::verify_eth_signature_txs_batch (cognitive 20) core/bin/zksync_api/src/signature_checker.rs:232 — zksync_api::signature_checker::verify_eth_signature_txs_batch has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 2 (3 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 · ZkSyncPriorityOp · ×2
  • ZkSyncPriorityOp::legacy_parse_from_priority_queue_logs (cognitive 29) core/lib/types/src/priority_ops/mod.rs:110 — ZkSyncPriorityOp::legacy_parse_from_priority_queue_logs has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (28 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.
  • ZkSyncPriorityOp::parse_from_priority_queue_logs (cognitive 25) core/lib/types/src/priority_ops/mod.rs:229 — ZkSyncPriorityOp::parse_from_priority_queue_logs has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (24 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.
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D3 · God Classes · FunctionTooLong · ×2
  • FunctionTooLong: zksync_circuit::witness::utils::build_block_witness core/lib/circuit/src/witness/utils.rs:739 — FunctionTooLong — zksync_circuit::witness::utils::build_block_witness runs 161 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 61 over it, 1.61× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: zksync_circuit::exit_circuit::create_exit_circuit_with_public_input core/lib/circuit/src/exit_circuit.rs:239 — FunctionTooLong — zksync_circuit::exit_circuit::create_exit_circuit_with_public_input runs 110 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 10 over it, 1.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.
D36 · Supply-chain Provenance & Signing · REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (5 members, 50+ identical tokens) core/lib/circuit/src/circuit.rs:1304 — core/lib/circuit/src/circuit.rs:1304-1538 | core/lib/circuit/src/circuit.rs:2855-3142 | core/lib/circuit/src/circuit.rs:3160-3793 | core/lib/circuit/src/circuit.rs:3814-4067 | core/lib/circuit/src/circuit.rs:4088-4350 — 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) sdk/zksync-rs/src/signer.rs:205 — sdk/zksync-rs/src/signer.rs:205-236 | sdk/zksync-rs/src/signer.rs:246-277 | sdk/zksync-rs/src/signer.rs:286-315 | sdk/zksync-rs/src/signer.rs:324-355 | sdk/zksync-rs/src/signer.rs:365-397 — 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 · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (4 members, 50+ identical tokens) core/lib/circuit/src/exit_circuit.rs:246 — core/lib/circuit/src/exit_circuit.rs:246-372 | core/lib/circuit/src/witness/full_exit.rs:231-383 | core/lib/circuit/src/witness/mint_nft.rs:209-510 | core/lib/circuit/src/witness/withdraw_nft.rs:235-454 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) core/lib/circuit/src/witness/change_pubkey_offchain.rs:153 — core/lib/circuit/src/witness/change_pubkey_offchain.rs:153-246 | core/lib/circuit/src/witness/deposit.rs:155-222 | core/lib/circuit/src/witness/full_exit.rs:231-383 | core/lib/circuit/src/witness/withdraw.rs:163-261 — 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 (23 lines × 2) · ×2
  • Duplicated block (23 lines × 2) core/lib/circuit/src/circuit.rs:4707 — core/lib/circuit/src/circuit.rs:4707-4729 | core/lib/circuit/src/circuit.rs:4806-4828 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (23 lines × 2) core/lib/types/src/tx/primitives/eip712_signature/struct_builder.rs:101 — core/lib/types/src/tx/primitives/eip712_signature/struct_builder.rs:101-123 | core/lib/types/src/tx/primitives/eip712_signature/struct_builder.rs:140-162 — both copies are in the same file, so extract the 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 × 2) · ×2
  • Duplicated block (21 lines × 2) core/lib/circuit/src/witness/deposit.rs:64 — core/lib/circuit/src/witness/deposit.rs:64-84 | core/lib/circuit/src/witness/withdraw.rs:76-96 — before extracting anything, compare `core/lib/circuit/src/witness/deposit.rs` and `core/lib/circuit/src/witness/withdraw.rs` as WHOLE FILES: this scan already matched 3 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. 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 (21 lines × 2) core/lib/crypto/src/primitives.rs:294 — core/lib/crypto/src/primitives.rs:294-314 | core/lib/crypto/src/primitives.rs:354-374 — both copies are in the same file, so extract the 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) · ×2
  • Duplicated block (16–18 lines × 2) core/lib/circuit/src/witness/full_exit.rs:272 — core/lib/circuit/src/witness/full_exit.rs:272-287 | core/lib/circuit/src/witness/withdraw_nft.rs:329-346 — before extracting anything, compare `core/lib/circuit/src/witness/full_exit.rs` and `core/lib/circuit/src/witness/withdraw_nft.rs` as WHOLE FILES: this scan already matched 3 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. 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–18 lines × 2) core/lib/circuit/src/witness/transfer.rs:172 — core/lib/circuit/src/witness/transfer.rs:172-187 | core/lib/circuit/src/witness/transfer_to_new.rs:200-217 — before extracting anything, compare `core/lib/circuit/src/witness/transfer.rs` and `core/lib/circuit/src/witness/transfer_to_new.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 142 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 (16 lines × 3) · ×2
  • Duplicated block (16 lines × 3) core/lib/circuit/src/circuit.rs:1553 — core/lib/circuit/src/circuit.rs:1553-1568 | core/lib/circuit/src/circuit.rs:2262-2280 | core/lib/circuit/src/circuit.rs:2569-2588 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (16 lines × 3) sdk/zksync-rs/src/operations/change_pubkey.rs:68 — sdk/zksync-rs/src/operations/change_pubkey.rs:68-84 | sdk/zksync-rs/src/operations/mint_nft.rs:60-75 | sdk/zksync-rs/src/operations/withdraw_nft.rs:64-79 — before extracting anything, compare `sdk/zksync-rs/src/operations/change_pubkey.rs` and `sdk/zksync-rs/src/operations/mint_nft.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 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–13 lines × 2) · ×2
  • Duplicated block (11–13 lines × 2) core/lib/circuit/src/circuit.rs:1461 — core/lib/circuit/src/circuit.rs:1461-1471 | core/lib/circuit/src/circuit.rs:4236-4248 — both copies are in the same file, so extract the block into 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) core/lib/circuit/src/circuit.rs:2972 — core/lib/circuit/src/circuit.rs:2972-2982 | core/lib/circuit/src/circuit.rs:3932-3944 — both copies are in the same file, so extract the 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 × 2) · ×2
  • Duplicated block (12–13 lines × 2) core/lib/circuit/src/circuit.rs:2460 — core/lib/circuit/src/circuit.rs:2460-2472 | core/lib/circuit/src/circuit.rs:2770-2781 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12–13 lines × 2) core/lib/crypto/src/primitives.rs:158 — core/lib/crypto/src/primitives.rs:158-170 | sdk/zksync-crypto/src/utils.rs:53-64 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×2
  • Duplicated block (11–12 lines × 2) core/lib/circuit/src/circuit.rs:1491 — core/lib/circuit/src/circuit.rs:1491-1501 | core/lib/circuit/src/circuit.rs:2979-2990 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11–12 lines × 2) core/lib/circuit/src/circuit.rs:2462 — core/lib/circuit/src/circuit.rs:2462-2473 | core/lib/circuit/src/circuit.rs:2487-2497 — both copies are in the same file, so extract the 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 × 4) · ×2
  • Duplicated block (10–11 lines × 4) core/lib/circuit/src/circuit.rs:1526 — core/lib/circuit/src/circuit.rs:1526-1535 | core/lib/circuit/src/circuit.rs:3073-3083 | core/lib/circuit/src/circuit.rs:4001-4011 | core/lib/circuit/src/circuit.rs:4254-4264 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (10–11 lines × 4) core/lib/circuit/src/witness/utils.rs:780 — core/lib/circuit/src/witness/utils.rs:780-789 | core/lib/circuit/src/witness/utils.rs:795-805 | core/lib/circuit/src/witness/utils.rs:811-820 | core/lib/circuit/src/witness/utils.rs:868-877 — 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 × 4) · ×2
  • Duplicated block (10 lines × 4) core/lib/circuit/src/witness/utils.rs:853 — core/lib/circuit/src/witness/utils.rs:853-862 | core/lib/circuit/src/witness/utils.rs:887-896 | core/lib/circuit/src/witness/utils.rs:903-912 | core/lib/circuit/src/witness/utils.rs:918-927 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (10 lines × 4) core/lib/circuit/src/circuit.rs:1685 — core/lib/circuit/src/circuit.rs:1685-1694 | core/lib/circuit/src/circuit.rs:2461-2472 | core/lib/circuit/src/circuit.rs:2486-2496 | core/lib/circuit/src/circuit.rs:2771-2781 — 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 × 3) · ×2
  • Duplicated block (10 lines × 3) core/lib/circuit/src/circuit.rs:1585 — core/lib/circuit/src/circuit.rs:1585-1594 | core/lib/circuit/src/circuit.rs:2294-2303 | core/lib/circuit/src/circuit.rs:2606-2615 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (10 lines × 3) core/lib/circuit/src/circuit.rs:1403 — core/lib/circuit/src/circuit.rs:1403-1412 | core/lib/circuit/src/circuit.rs:1829-1838 | core/lib/circuit/src/circuit.rs:2071-2080 — 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 lines × 4) · ×2
  • Duplicated block (7 lines × 4) core/lib/circuit/src/circuit.rs:1490 — core/lib/circuit/src/circuit.rs:1490-1496 | core/lib/circuit/src/circuit.rs:2978-2985 | core/lib/circuit/src/circuit.rs:3940-3947 | core/lib/circuit/src/circuit.rs:4201-4208 — 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) core/lib/circuit/src/utils.rs:165 — core/lib/circuit/src/utils.rs:165-171 | core/lib/crypto/src/circuit/utils.rs:50-58 | core/lib/crypto/src/circuit/utils.rs:84-92 | core/lib/crypto/src/primitives.rs:136-142 — 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.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×2
  • Duplicated block (7 lines × 3) core/lib/storage/src/chain/account/records.rs:56 — core/lib/storage/src/chain/account/records.rs:56-62 | core/lib/storage/src/tokens/records.rs:123-129 | core/lib/storage/src/tokens/records.rs:141-147 — 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 (7 lines × 3) core/lib/types/src/tx/transfer.rs:130 — core/lib/types/src/tx/transfer.rs:130-136 | core/lib/types/src/tx/withdraw.rs:155-161 | core/lib/types/src/tx/withdraw_nft.rs:128-134 — before extracting anything, compare `core/lib/types/src/tx/transfer.rs` and `core/lib/types/src/tx/withdraw.rs` as WHOLE FILES: this scan already matched 7 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. 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.
D6 · Cohesion (LCOM4) · Low cohesion · ×2
  • Low cohesion: Database (LCOM4 20) core/bin/zksync_witness_generator/src/database.rs:25 — Database's methods fall into 20 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 20 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: Database (LCOM4 11) core/bin/zksync_eth_sender/src/database.rs:113 — Database's methods fall into 11 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 11 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.
R10 · Code Duplication · Duplicated block (22 lines × 2 locations) · ×2
  • Duplicated block (22 lines × 2 locations) sdk/zksync.js/src/rest-provider.ts:184 — sdk/zksync.js/src/rest-provider.ts:184 · sdk/zksync.js/src/rest-provider.ts:325 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
  • Duplicated block (22 lines × 2 locations) sdk/zksync.js/src/utils.ts:717 — sdk/zksync.js/src/utils.ts:717 · sdk/zksync.js/src/utils.ts: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.
R10 · Code Duplication · Duplicated block (16 lines × 2 locations) · ×2
  • Duplicated block (16 lines × 2 locations) sdk/zksync.js/src/eth-message-signer.ts:31 — sdk/zksync.js/src/eth-message-signer.ts:31 · sdk/zksync.js/src/eth-message-signer.ts:182 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2 locations) sdk/zksync.js/src/provider.ts:211 — sdk/zksync.js/src/provider.ts:211 · sdk/zksync.js/src/provider.ts:242 — 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 (13 lines × 2 locations) · ×2
  • Duplicated block (13 lines × 2 locations) sdk/zksync.js/src/operations.ts:74 — sdk/zksync.js/src/operations.ts:74 · sdk/zksync.js/src/operations.ts:117 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (13 lines × 2 locations) sdk/zksync.js/src/transport.ts:56 — sdk/zksync.js/src/transport.ts:56 · sdk/zksync.js/src/transport.ts:155 — 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 (12 lines × 2 locations) · ×2
  • Duplicated block (12 lines × 2 locations) sdk/zksync.js/src/rest-provider.ts:376 — sdk/zksync.js/src/rest-provider.ts:376 · sdk/zksync.js/src/rest-provider.ts:416 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (12 lines × 2 locations) sdk/zksync.js/src/wallet.ts:420 — sdk/zksync.js/src/wallet.ts:420 · sdk/zksync.js/src/wallet.ts:673 — 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 × 3 locations) · ×2
  • Duplicated block (11 lines × 3 locations) contracts/src.ts/deploy.ts:305 — contracts/src.ts/deploy.ts:305 · contracts/src.ts/deploy.ts:343 · contracts/src.ts/deploy.ts:436 — 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 locations) sdk/zksync.js/src/provider.ts:41 — sdk/zksync.js/src/provider.ts:41 · sdk/zksync.js/src/provider.ts:53 · sdk/zksync.js/src/provider.ts:73 — 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.
D1 · Cyclomatic Complexity · TxSender · ×1
  • TxSender::submit_txs_batch (cyclomatic 28) core/bin/zksync_api/src/api_server/tx_sender.rs:649 — TxSender::submit_txs_batch 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 · CallsHelper · ×1
  • CallsHelper::execute (cyclomatic 28) core/bin/zksync_api/src/api_server/web3/calls.rs:96 — CallsHelper::execute 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 · deploy.main (cyclomatic 26) · ×1
  • deploy.main (cyclomatic 26) contracts/scripts/deploy.ts:13 — deploy.main 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.
D1 · Cyclomatic Complexity · upgrade-testnet.main (cyclomatic 20) · ×1
  • upgrade-testnet.main (cyclomatic 20) contracts/scripts/upgrade-testnet.ts:13 — upgrade-testnet.main 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 · provider.getDefaultProvider (cyclomatic 20) · ×1
  • provider.getDefaultProvider (cyclomatic 20) sdk/zksync.js/src/provider.ts:33 — provider.getDefaultProvider 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 · zksync_server · ×1
  • zksync_server::run_server (cyclomatic 16) core/bin/server/src/main.rs:154 — zksync_server::run_server 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 · zksync_api · ×1
  • zksync_api::api_server::tx_sender::verify_txs_batch_signature (cyclomatic 16) core/bin/zksync_api/src/api_server/tx_sender.rs:1126 — zksync_api::api_server::tx_sender::verify_txs_batch_signature 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 · ZkSyncPriorityOp · ×1
  • ZkSyncPriorityOp::legacy_parse_from_priority_queue_logs (cyclomatic 16) core/lib/types/src/priority_ops/mod.rs:110 — ZkSyncPriorityOp::legacy_parse_from_priority_queue_logs 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.
D17 · Explicit Debt · HackComment · ×1
  • HackComment core/lib/types/src/gas_counter.rs:10 — // HACK: hardcode some configuration options for now. — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
D2 · Cognitive Complexity · CallsHelper · ×1
  • CallsHelper::execute (cognitive 52) core/bin/zksync_api/src/api_server/web3/calls.rs:96 — CallsHelper::execute has cognitive complexity 52 (threshold 15). Drivers by points: if/else 27 (46 pts), match/switch 3 (6 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 · DataRestoreDriver · ×1
  • DataRestoreDriver::run_state_update (cognitive 39) core/bin/data_restore/src/data_restore_driver.rs:337 — DataRestoreDriver::run_state_update has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (35 pts), boolean chains 3, loops 1 (nesting depth added 24). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · revert-reason.reason (cognitive 34) · ×1
  • revert-reason.reason (cognitive 34) contracts/scripts/revert-reason.ts:22 — revert-reason.reason has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (26 pts), error handling 2 (5 pts), loops 1 (2 pts), ternaries 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 · upgrade-testnet.main (cognitive 30) · ×1
  • upgrade-testnet.main (cognitive 30) contracts/scripts/upgrade-testnet.ts:13 — upgrade-testnet.main has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (23 pts), ternaries 4 (5 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · deploy.main (cognitive 27) · ×1
  • deploy.main (cognitive 27) contracts/scripts/deploy.ts:13 — deploy.main has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 9, ternaries 4 (5 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · read-variable.parseName (cognitive 27) · ×1
  • read-variable.parseName (cognitive 27) contracts/scripts/read-variable.ts:255 — read-variable.parseName has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (25 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 · provider.getDefaultProvider (cognitive 26) · ×1
  • provider.getDefaultProvider (cognitive 26) sdk/zksync.js/src/provider.ts:33 — provider.getDefaultProvider has cognitive complexity 26 (threshold 15). Drivers by points: if/else 20 (26 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · SparseMerkleTree · ×1
  • SparseMerkleTree::insert (cognitive 25) core/lib/crypto/src/merkle_tree/parallel_smt.rs:278 — SparseMerkleTree::insert has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (20 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.
D2 · Cognitive Complexity · ZkSyncStateKeeper · ×1
  • ZkSyncStateKeeper::execute_proposed_block (cognitive 21) core/bin/zksync_core/src/state_keeper/mod.rs:387 — ZkSyncStateKeeper::execute_proposed_block has cognitive complexity 21 (threshold 15). Drivers by points: match/switch 4 (10 pts), if/else 8 (9 pts), loops 2 (nesting depth added 7). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · zksync_server · ×1
  • zksync_server::run_server (cognitive 20) core/bin/server/src/main.rs:154 — zksync_server::run_server has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (19 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.
D2 · Cognitive Complexity · MempoolSchema · ×1
  • MempoolSchema::return_executed_txs_to_mempool (cognitive 20) core/lib/storage/src/chain/mempool/mod.rs:765 — MempoolSchema::return_executed_txs_to_mempool has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 4 (5 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.
D2 · Cognitive Complexity · AbstractWallet.depositToSyncFromEthereum (cognitive 20) · ×1
  • AbstractWallet.depositToSyncFromEthereum (cognitive 20) sdk/zksync.js/src/abstract-wallet.ts:456 — AbstractWallet.depositToSyncFromEthereum has cognitive complexity 20 (threshold 15). Drivers by points: error handling 4 (10 pts), if/else 4 (6 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TokenHandler · ×1
  • TokenHandler::save_new_tokens (cognitive 19) core/bin/zksync_core/src/token_handler.rs:97 — TokenHandler::save_new_tokens has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 4 (10 pts), if/else 5 (8 pts), loops 1 (nesting depth added 9). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · WitnessGenerator · ×1
  • WitnessGenerator::load_account_tree (cognitive 19) core/bin/zksync_witness_generator/src/witness_generator.rs:145 — WitnessGenerator::load_account_tree has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2 (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 · utils.bitsIntoBytesInBEOrder (cognitive 18) · ×1
  • utils.bitsIntoBytesInBEOrder (cognitive 18) sdk/zksync.js/src/utils.ts:109 — utils.bitsIntoBytesInBEOrder 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.
D2 · Cognitive Complexity · RestProvider.notifyAnyTransaction (cognitive 18) · ×1
  • RestProvider.notifyAnyTransaction (cognitive 18) sdk/zksync.js/src/rest-provider.ts:457 — RestProvider.notifyAnyTransaction has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 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 · Web3RpcApp · ×1
  • Web3RpcApp::_impl_get_logs (cognitive 17) core/bin/zksync_api/src/api_server/web3/rpc_impl.rs:223 — Web3RpcApp::_impl_get_logs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 3, loops 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 · zksync_l1_event_listener · ×1
  • zksync_l1_event_listener::contract::v4::rollup_ops_blocks_from_bytes_inner (cognitive 17) core/lib/l1_event_listener/src/contract/v4.rs:43 — zksync_l1_event_listener::contract::v4::rollup_ops_blocks_from_bytes_inner has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ETHSender · ×1
  • ETHSender::proceed_next_operations (cognitive 16) core/bin/zksync_eth_sender/src/lib.rs:251 — ETHSender::proceed_next_operations has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 3 (7 pts), if/else 3 (6 pts), loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tx_count_migration · ×1
  • tx_count_migration::main (cognitive 16) core/bin/tx_count_migration/src/main.rs:5 — tx_count_migration::main has cognitive complexity 16 (threshold 15). Drivers by points: if/else 2 (6 pts), match/switch 2 (6 pts), loops 2 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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
D4 · Code Duplication · Near-duplicate member family (5 members, 12 shared lines) · ×1
  • Near-duplicate member family (5 members, 12 shared lines) core/lib/circuit/src/circuit.rs:1304 — core/lib/circuit/src/circuit.rs:1304-1538 | core/lib/circuit/src/circuit.rs:1917-2180 | core/lib/circuit/src/circuit.rs:2855-3142 | core/lib/circuit/src/circuit.rs:3814-4067 | core/lib/circuit/src/circuit.rs:4088-4350 — These 5 members are variants of one another: a block of 12 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 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 · Near-duplicate member family (3 members, 53 shared lines) · ×1
  • Near-duplicate member family (3 members, 53 shared lines) core/lib/circuit/src/circuit.rs:1552 — core/lib/circuit/src/circuit.rs:1552-1759 | core/lib/circuit/src/circuit.rs:2261-2550 | core/lib/circuit/src/circuit.rs:2568-2834 — These 3 members are variants of one another: a block of 53 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 (96 shared lines) · ×1
  • Near-duplicate member pair (96 shared lines) core/lib/circuit/src/witness/transfer.rs:162 — core/lib/circuit/src/witness/transfer.rs:162-337 | core/lib/circuit/src/witness/transfer_to_new.rs:186-381 — These two members are variants of one another: 96 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 (7 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (7 members, 50+ identical tokens) core/lib/circuit/src/witness/close_account.rs:69 — core/lib/circuit/src/witness/close_account.rs:69-92 | core/lib/circuit/src/witness/forced_exit.rs:136-191 | core/lib/circuit/src/witness/mint_nft.rs:121-205 | core/lib/circuit/src/witness/transfer.rs:121-158 | core/lib/circuit/src/witness/transfer_to_new.rs:127-182 | core/lib/circuit/src/witness/withdraw.rs:120-159 | core/lib/circuit/src/witness/withdraw_nft.rs:150-231 — These 7 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 7 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 7 times.
D4 · Code Duplication · Duplicated block (54 lines × 2) · ×1
  • Duplicated block (54 lines × 2) core/lib/circuit/src/witness/transfer.rs:257 — core/lib/circuit/src/witness/transfer.rs:257-310 | core/lib/circuit/src/witness/transfer_to_new.rs:305-358 — before extracting anything, compare `core/lib/circuit/src/witness/transfer.rs` and `core/lib/circuit/src/witness/transfer_to_new.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 142 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 (41–43 lines × 2) · ×1
  • Duplicated block (41–43 lines × 2) core/lib/circuit/src/circuit.rs:2386 — core/lib/circuit/src/circuit.rs:2386-2426 | core/lib/circuit/src/circuit.rs:2696-2738 — both copies are in the same file, so extract the 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 (42 lines × 2) · ×1
  • Duplicated block (42 lines × 2) core/lib/storage/src/chain/operations_ext/mod.rs:760 — core/lib/storage/src/chain/operations_ext/mod.rs:760-801 | core/lib/storage/src/chain/operations_ext/mod.rs:1002-1043 — both copies are in the same file, so extract the 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 (34–36 lines × 4) · ×1
  • Duplicated block (34–36 lines × 4) core/lib/circuit/src/circuit.rs:1419 — core/lib/circuit/src/circuit.rs:1419-1452 | core/lib/circuit/src/circuit.rs:1987-2022 | core/lib/circuit/src/circuit.rs:2992-3025 | core/lib/circuit/src/circuit.rs:3954-3987 — 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 (30–31 lines × 2) · ×1
  • Duplicated block (30–31 lines × 2) core/lib/circuit/src/witness/swap.rs:345 — core/lib/circuit/src/witness/swap.rs:345-374 | core/lib/circuit/src/witness/swap.rs:375-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.
D4 · Code Duplication · Duplicated block (24–27 lines × 2) · ×1
  • Duplicated block (24–27 lines × 2) core/lib/circuit/src/circuit.rs:1789 — core/lib/circuit/src/circuit.rs:1789-1812 | core/lib/circuit/src/circuit.rs:2024-2050 — both copies are in the same file, so extract the 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–27 lines × 2) · ×1
  • Duplicated block (26–27 lines × 2) core/lib/circuit/src/witness/transfer.rs:201 — core/lib/circuit/src/witness/transfer.rs:201-226 | core/lib/circuit/src/witness/transfer_to_new.rs:236-262 — before extracting anything, compare `core/lib/circuit/src/witness/transfer.rs` and `core/lib/circuit/src/witness/transfer_to_new.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 142 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 (27 lines × 2) · ×1
  • Duplicated block (27 lines × 2) core/lib/types/src/priority_ops/mod.rs:142 — core/lib/types/src/priority_ops/mod.rs:142-168 | core/lib/types/src/priority_ops/mod.rs:257-283 — both copies are in the same file, so extract the 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) · ×1
  • Duplicated block (26 lines × 2) core/lib/circuit/src/circuit.rs:1585 — core/lib/circuit/src/circuit.rs:1585-1610 | core/lib/circuit/src/circuit.rs:2606-2631 — both copies are in the same file, so extract the 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 (22–25 lines × 2) · ×1
  • Duplicated block (22–25 lines × 2) core/lib/crypto/src/primitives.rs:252 — core/lib/crypto/src/primitives.rs:252-276 | core/lib/crypto/src/primitives.rs:325-346 — both copies are in the same file, so extract the 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 × 3) · ×1
  • Duplicated block (24 lines × 3) core/lib/circuit/src/witness/forced_exit.rs:212 — core/lib/circuit/src/witness/forced_exit.rs:212-235 | core/lib/circuit/src/witness/transfer.rs:176-199 | core/lib/circuit/src/witness/withdraw.rs:173-196 — before extracting anything, compare `core/lib/circuit/src/witness/forced_exit.rs` and `core/lib/circuit/src/witness/withdraw.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.
D4 · Code Duplication · Duplicated block (21–22 lines × 5) · ×1
  • Duplicated block (21–22 lines × 5) sdk/zksync-rs/src/signer.rs:216 — sdk/zksync-rs/src/signer.rs:216-236 | sdk/zksync-rs/src/signer.rs:257-277 | sdk/zksync-rs/src/signer.rs:295-315 | sdk/zksync-rs/src/signer.rs:334-355 | sdk/zksync-rs/src/signer.rs:376-397 — 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 (21–22 lines × 2) · ×1
  • Duplicated block (21–22 lines × 2) core/lib/circuit/src/circuit.rs:2427 — core/lib/circuit/src/circuit.rs:2427-2448 | core/lib/circuit/src/circuit.rs:2739-2759 — both copies are in the same file, so extract the 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) · ×1
  • Duplicated block (20–21 lines × 2) core/lib/circuit/src/circuit.rs:2262 — core/lib/circuit/src/circuit.rs:2262-2281 | core/lib/circuit/src/circuit.rs:2569-2589 — both copies are in the same file, so extract the 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–21 lines × 2) · ×1
  • Duplicated block (19–21 lines × 2) core/lib/circuit/src/witness/forced_exit.rs:105 — core/lib/circuit/src/witness/forced_exit.rs:105-123 | core/lib/circuit/src/witness/withdraw.rs:87-107 — before extracting anything, compare `core/lib/circuit/src/witness/forced_exit.rs` and `core/lib/circuit/src/witness/withdraw.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.
D4 · Code Duplication · Duplicated block (20 lines × 4) · ×1
  • Duplicated block (20 lines × 4) core/lib/circuit/src/witness/change_pubkey_offchain.rs:211 — core/lib/circuit/src/witness/change_pubkey_offchain.rs:211-230 | core/lib/circuit/src/witness/deposit.rs:191-210 | core/lib/circuit/src/witness/full_exit.rs:321-340 | core/lib/circuit/src/witness/withdraw.rs:226-245 — before extracting anything, compare `core/lib/circuit/src/witness/deposit.rs` and `core/lib/circuit/src/witness/withdraw.rs` as WHOLE FILES: this scan already matched 3 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. 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 (20 lines × 3) · ×1
  • Duplicated block (20 lines × 3) core/lib/types/src/tx/forced_exit.rs:228 — core/lib/types/src/tx/forced_exit.rs:228-247 | core/lib/types/src/tx/transfer.rs:269-288 | core/lib/types/src/tx/withdraw.rs:271-290 — before extracting anything, compare `core/lib/types/src/tx/transfer.rs` and `core/lib/types/src/tx/withdraw.rs` as WHOLE FILES: this scan already matched 7 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. 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 (20 lines × 2) · ×1
  • Duplicated block (20 lines × 2) core/lib/circuit/src/witness/full_exit.rs:108 — core/lib/circuit/src/witness/full_exit.rs:108-127 | core/lib/circuit/src/witness/withdraw_nft.rs:94-113 — before extracting anything, compare `core/lib/circuit/src/witness/full_exit.rs` and `core/lib/circuit/src/witness/withdraw_nft.rs` as WHOLE FILES: this scan already matched 3 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. 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 (18–20 lines × 2) · ×1
  • Duplicated block (18–20 lines × 2) core/lib/storage/src/chain/block/mod.rs:327 — core/lib/storage/src/chain/block/mod.rs:327-346 | core/lib/storage/src/chain/mempool/mod.rs:727-744 — 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–19 lines × 3) · ×1
  • Duplicated block (16–19 lines × 3) core/lib/storage/src/chain/account/mod.rs:290 — core/lib/storage/src/chain/account/mod.rs:290-305 | core/lib/storage/src/chain/state/mod.rs:402-420 | core/lib/storage/src/chain/state/mod.rs:623-638 — 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 (18 lines × 3) · ×1
  • Duplicated block (18 lines × 3) core/lib/circuit/src/circuit.rs:3071 — core/lib/circuit/src/circuit.rs:3071-3088 | core/lib/circuit/src/circuit.rs:3999-4016 | core/lib/circuit/src/circuit.rs:4252-4269 — 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 (4–18 lines × 3) · ×1
  • Duplicated block (4–18 lines × 3) core/lib/circuit/src/circuit.rs:1335 — core/lib/circuit/src/circuit.rs:1335-1338 | core/lib/circuit/src/circuit.rs:2872-2889 | core/lib/circuit/src/circuit.rs:3832-3847 — 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) core/lib/circuit/src/circuit.rs:1602 — core/lib/circuit/src/circuit.rs:1602-1618 | core/lib/circuit/src/circuit.rs:2311-2327 | core/lib/circuit/src/circuit.rs:2623-2639 — 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–17 lines × 2) · ×1
  • Duplicated block (9–17 lines × 2) core/lib/crypto/src/merkle_tree/parallel_smt.rs:491 — core/lib/crypto/src/merkle_tree/parallel_smt.rs:491-499 | core/lib/crypto/src/merkle_tree/parallel_smt.rs:734-750 — both copies are in the same file, so extract the 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) · ×1
  • Duplicated block (15–17 lines × 2) core/lib/l1_event_listener/src/events_state.rs:528 — core/lib/l1_event_listener/src/events_state.rs:528-544 | core/lib/l1_event_listener/src/events_state.rs:585-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.
D4 · Code Duplication · Duplicated block (15–16 lines × 2) · ×1
  • Duplicated block (15–16 lines × 2) core/lib/circuit/src/witness/transfer.rs:80 — core/lib/circuit/src/witness/transfer.rs:80-94 | core/lib/circuit/src/witness/transfer_to_new.rs:79-94 — before extracting anything, compare `core/lib/circuit/src/witness/transfer.rs` and `core/lib/circuit/src/witness/transfer_to_new.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 142 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 × 3) · ×1
  • Duplicated block (15 lines × 3) sdk/zksync-rs/src/operations/transfer.rs:62 — sdk/zksync-rs/src/operations/transfer.rs:62-76 | sdk/zksync-rs/src/operations/transfer_nft.rs:68-82 | sdk/zksync-rs/src/operations/withdraw.rs:59-73 — before extracting anything, compare `sdk/zksync-rs/src/operations/transfer.rs` and `sdk/zksync-rs/src/operations/transfer_nft.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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) core/lib/circuit/src/circuit.rs:3078 — core/lib/circuit/src/circuit.rs:3078-3091 | core/lib/circuit/src/circuit.rs:3747-3760 | core/lib/circuit/src/circuit.rs:4006-4019 | core/lib/circuit/src/circuit.rs:4259-4272 — 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 × 3) · ×1
  • Duplicated block (13–14 lines × 3) core/lib/circuit/src/circuit.rs:2985 — core/lib/circuit/src/circuit.rs:2985-2998 | core/lib/circuit/src/circuit.rs:3948-3960 | core/lib/circuit/src/circuit.rs:4209-4221 — 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 × 4) · ×1
  • Duplicated block (13 lines × 4) core/lib/circuit/src/circuit.rs:1320 — core/lib/circuit/src/circuit.rs:1320-1333 | core/lib/circuit/src/circuit.rs:2872-2886 | core/lib/circuit/src/circuit.rs:3832-3844 | core/lib/circuit/src/circuit.rs:4107-4120 — 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 (9–12 lines × 4) · ×1
  • Duplicated block (9–12 lines × 4) core/lib/circuit/src/circuit.rs:1461 — core/lib/circuit/src/circuit.rs:1461-1471 | core/lib/circuit/src/circuit.rs:2390-2398 | core/lib/circuit/src/circuit.rs:2702-2710 | core/lib/circuit/src/circuit.rs:4237-4248 — 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 (12 lines × 3) · ×1
  • Duplicated block (12 lines × 3) core/lib/crypto/src/circuit/utils.rs:52 — core/lib/crypto/src/circuit/utils.rs:52-66 | core/lib/crypto/src/primitives.rs:138-150 | sdk/zksync-crypto/src/utils.rs:38-49 — 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 (10–12 lines × 2) · ×1
  • Duplicated block (10–12 lines × 2) core/lib/circuit/src/utils.rs:167 — core/lib/circuit/src/utils.rs:167-176 | core/lib/crypto/src/circuit/utils.rs:86-97 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (11 lines × 4) · ×1
  • Duplicated block (11 lines × 4) core/lib/circuit/src/exit_circuit.rs:306 — core/lib/circuit/src/exit_circuit.rs:306-316 | core/lib/circuit/src/witness/full_exit.rs:308-318 | core/lib/circuit/src/witness/mint_nft.rs:414-424 | core/lib/circuit/src/witness/withdraw_nft.rs:368-378 — before extracting anything, compare `core/lib/circuit/src/witness/full_exit.rs` and `core/lib/circuit/src/witness/withdraw_nft.rs` as WHOLE FILES: this scan already matched 3 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. 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 × 3) · ×1
  • Duplicated block (11 lines × 3) core/lib/circuit/src/circuit.rs:1389 — core/lib/circuit/src/circuit.rs:1389-1399 | core/lib/circuit/src/circuit.rs:3915-3925 | core/lib/circuit/src/circuit.rs:4177-4187 — 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–10 lines × 3) · ×1
  • Duplicated block (9–10 lines × 3) core/lib/circuit/src/circuit.rs:1771 — core/lib/circuit/src/circuit.rs:1771-1780 | core/lib/circuit/src/circuit.rs:2856-2864 | core/lib/circuit/src/circuit.rs:3815-3824 — 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 (8–9 lines × 2) · ×1
  • Duplicated block (8–9 lines × 2) core/lib/storage/src/chain/block/mod.rs:1186 — core/lib/storage/src/chain/block/mod.rs:1186-1194 | core/lib/storage/src/chain/operations_ext/mod.rs:1055-1062 — 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 (7–8 lines × 2) · ×1
  • Duplicated block (7–8 lines × 2) core/lib/types/src/tx/transfer.rs:151 — core/lib/types/src/tx/transfer.rs:151-158 | core/lib/types/src/tx/withdraw.rs:132-138 — before extracting anything, compare `core/lib/types/src/tx/transfer.rs` and `core/lib/types/src/tx/withdraw.rs` as WHOLE FILES: this scan already matched 7 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. 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 × 17) · ×1
  • Duplicated block (7 lines × 17) core/lib/circuit/src/witness/close_account.rs:79 — core/lib/circuit/src/witness/close_account.rs:79-85 | core/lib/circuit/src/witness/forced_exit.rs:147-153 | core/lib/circuit/src/witness/forced_exit.rs:162-168 | core/lib/circuit/src/witness/mint_nft.rs:132-138 | core/lib/circuit/src/witness/mint_nft.rs:146-152 | core/lib/circuit/src/witness/mint_nft.rs:160-166 | core/lib/circuit/src/witness/mint_nft.rs:174-180 | core/lib/circuit/src/witness/mint_nft.rs:188-194 | core/lib/circuit/src/witness/transfer.rs:132-138 | core/lib/circuit/src/witness/transfer.rs:147-153 | core/lib/circuit/src/witness/transfer_to_new.rs:138-144 | core/lib/circuit/src/witness/transfer_to_new.rs:153-159 | core/lib/circuit/src/witness/withdraw.rs:131-137 | core/lib/circuit/src/witness/withdraw_nft.rs:161-167 | core/lib/circuit/src/witness/withdraw_nft.rs:175-181 | core/lib/circuit/src/witness/withdraw_nft.rs:189-195 | core/lib/circuit/src/witness/withdraw_nft.rs:203-209 — before extracting anything, compare `core/lib/circuit/src/witness/forced_exit.rs` and `core/lib/circuit/src/witness/transfer_to_new.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 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 (6 lines × 5) · ×1
  • Duplicated block (6 lines × 5) core/lib/circuit/src/circuit.rs:1490 — core/lib/circuit/src/circuit.rs:1490-1495 | core/lib/circuit/src/circuit.rs:2054-2060 | core/lib/circuit/src/circuit.rs:2978-2984 | core/lib/circuit/src/circuit.rs:3940-3946 | core/lib/circuit/src/circuit.rs:4201-4207 — 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 (6 lines × 4) · ×1
  • Duplicated block (6 lines × 4) core/lib/circuit/src/circuit.rs:2906 — core/lib/circuit/src/circuit.rs:2906-2911 | core/lib/circuit/src/circuit.rs:2921-2926 | core/lib/circuit/src/circuit.rs:3861-3866 | core/lib/circuit/src/circuit.rs:3876-3881 — 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 (5 lines × 8) · ×1
  • Duplicated block (5 lines × 8) core/lib/circuit/src/circuit.rs:1342 — core/lib/circuit/src/circuit.rs:1342-1346 | core/lib/circuit/src/circuit.rs:1374-1378 | core/lib/circuit/src/circuit.rs:1949-1953 | core/lib/circuit/src/circuit.rs:1981-1985 | core/lib/circuit/src/circuit.rs:2895-2899 | core/lib/circuit/src/circuit.rs:2927-2931 | core/lib/circuit/src/circuit.rs:3882-3886 | core/lib/circuit/src/circuit.rs:4143-4147 — 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.
D4 · Code Duplication · Duplicated block (5 lines × 6) · ×1
  • Duplicated block (5 lines × 6) core/lib/circuit/src/circuit.rs:1352 — core/lib/circuit/src/circuit.rs:1352-1356 | core/lib/circuit/src/circuit.rs:1367-1371 | core/lib/circuit/src/circuit.rs:2905-2909 | core/lib/circuit/src/circuit.rs:2920-2924 | core/lib/circuit/src/circuit.rs:3860-3864 | core/lib/circuit/src/circuit.rs:3875-3879 — 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.
D4 · Code Duplication · Duplicated block (8 lines × 5) · ×1
  • Duplicated block (8 lines × 5) core/lib/types/src/tx/mint_nft.rs:171 — core/lib/types/src/tx/mint_nft.rs:171-178 | core/lib/types/src/tx/swap.rs:374-381 | core/lib/types/src/tx/transfer.rs:205-212 | core/lib/types/src/tx/withdraw.rs:206-213 | core/lib/types/src/tx/withdraw_nft.rs:179-186 — before extracting anything, compare `core/lib/types/src/tx/mint_nft.rs` and `core/lib/types/src/tx/swap.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 (12 lines × 4) · ×1
  • Duplicated block (12 lines × 4) sdk/zksync-rs/src/operations/change_pubkey.rs:115 — sdk/zksync-rs/src/operations/change_pubkey.rs:115-126 | sdk/zksync-rs/src/operations/mint_nft.rs:96-107 | sdk/zksync-rs/src/operations/transfer_nft.rs:148-159 | sdk/zksync-rs/src/operations/withdraw_nft.rs:119-130 — before extracting anything, compare `sdk/zksync-rs/src/operations/change_pubkey.rs` and `sdk/zksync-rs/src/operations/mint_nft.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 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 × 6) · ×1
  • Duplicated block (9 lines × 6) sdk/zksync-rs/src/operations/change_pubkey.rs:143 — sdk/zksync-rs/src/operations/change_pubkey.rs:143-151 | sdk/zksync-rs/src/operations/mint_nft.rs:124-132 | sdk/zksync-rs/src/operations/transfer.rs:165-173 | sdk/zksync-rs/src/operations/transfer_nft.rs:176-184 | sdk/zksync-rs/src/operations/withdraw.rs:165-173 | sdk/zksync-rs/src/operations/withdraw_nft.rs:147-155 — before extracting anything, compare `sdk/zksync-rs/src/operations/change_pubkey.rs` and `sdk/zksync-rs/src/operations/mint_nft.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 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 × 4) · ×1
  • Duplicated block (8 lines × 4) sdk/zksync-rs/src/operations/mint_nft.rs:86 — sdk/zksync-rs/src/operations/mint_nft.rs:86-93 | sdk/zksync-rs/src/operations/transfer.rs:102-109 | sdk/zksync-rs/src/operations/withdraw.rs:102-109 | sdk/zksync-rs/src/operations/withdraw_nft.rs:100-107 — before extracting anything, compare `sdk/zksync-rs/src/operations/mint_nft.rs` and `sdk/zksync-rs/src/operations/withdraw_nft.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 65 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 × 5) · ×1
  • Duplicated block (9 lines × 5) sdk/zksync-rs/src/operations/mint_nft.rs:144 — sdk/zksync-rs/src/operations/mint_nft.rs:144-152 | sdk/zksync-rs/src/operations/transfer.rs:197-205 | sdk/zksync-rs/src/operations/transfer_nft.rs:208-216 | sdk/zksync-rs/src/operations/withdraw.rs:185-193 | sdk/zksync-rs/src/operations/withdraw_nft.rs:167-175 — before extracting anything, compare `sdk/zksync-rs/src/operations/mint_nft.rs` and `sdk/zksync-rs/src/operations/transfer_nft.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 (9 lines × 3) · ×1
  • Duplicated block (9 lines × 3) core/lib/circuit/src/circuit.rs:2457 — core/lib/circuit/src/circuit.rs:2457-2465 | core/lib/circuit/src/circuit.rs:2482-2490 | core/lib/circuit/src/circuit.rs:2530-2538 — 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.
D43 · Malicious Dependencies · Malicious package · ×1
  • REDACTED
D44 · Platform End-of-Life · End-of-life runtime · ×1
  • End-of-life runtime: Rust 1.91 rust-toolchain:1 — rust-toolchain declares Rust 1.91 as this project's toolchain file, and Rust 1.91, superseded by 1.92 on 2025-12-11 (the Rust project patches only the current stable). An unsupported runtime receives no security patches, so every vulnerability disclosed in it since 2025-12-11 is present and unfixable without moving off it. This is a migration rather than an upgrade: there is no newer release of a runtime that has ended.
D5 · Coupling · Unstable project zksync_api · ×1
  • Unstable project zksync_api — zksync_api has instability 0.89 with 2 dependents.
D5 · Coupling · Unstable project zksync_core · ×1
  • Unstable project zksync_core — zksync_core has instability 0.89 with 2 dependents.
D8 · Code Coverage · Coverage not measured · ×1
  • Coverage not measured — JavaScript/TypeScript suite — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — core/tests/ts-tests/ runs mocha but declares no coverage provider, so the suite can run and still produce no lcov — add `c8` (or `nyc`) as a devDependency so the suite can be wrapped for coverage. 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.
R10 · Code Duplication · Duplicated block with local edits (126 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (126 matched lines × 2 locations) sdk/zksync.js/src/remote-wallet.ts:219 — sdk/zksync.js/src/remote-wallet.ts:219 · sdk/zksync.js/src/wallet.ts:531 — the two spans are one implementation copied and then locally edited — 692 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 (37 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (37 matched lines × 2 locations) contracts/scripts/deploy-eip1271.ts:13 — contracts/scripts/deploy-eip1271.ts:13 · contracts/scripts/deploy-withdrawal-helpers.ts:12 — the two spans are one implementation copied and then locally edited — 259 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 (34 lines × 2 locations) · ×1
  • Duplicated block (34 lines × 2 locations) sdk/zksync.js/src/remote-wallet.ts:163 — sdk/zksync.js/src/remote-wallet.ts:163 · sdk/zksync.js/src/remote-wallet.ts:280 — 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 (31 lines × 2 locations) · ×1
  • Duplicated block (31 lines × 2 locations) sdk/zksync.js/src/rest-provider.ts:234 — sdk/zksync.js/src/rest-provider.ts:234 · sdk/zksync.js/src/rest-provider.ts:277 — 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 (23 lines × 2 locations) · ×1
  • Duplicated block (23 lines × 2 locations) sdk/zksync.js/src/eth-message-signer.ts:121 — sdk/zksync.js/src/eth-message-signer.ts:121 · sdk/zksync.js/src/eth-message-signer.ts:150 — 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 (20 lines × 2 locations) · ×1
  • Duplicated block (20 lines × 2 locations) sdk/zksync.js/src/signer.ts:362 — sdk/zksync.js/src/signer.ts:362 · sdk/zksync.js/src/signer.ts:400 — 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 (18 lines × 4 locations) · ×1
  • Duplicated block (18 lines × 4 locations) contracts/src.ts/deploy.ts:170 — contracts/src.ts/deploy.ts:170 · contracts/src.ts/deploy.ts:195 · contracts/src.ts/deploy.ts:221 · contracts/src.ts/deploy.ts:409 — all 4 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 × 5 locations) · ×1
  • Duplicated block (16 lines × 5 locations) contracts/src.ts/deploy.ts:136 — contracts/src.ts/deploy.ts:136 · contracts/src.ts/deploy.ts:309 · contracts/src.ts/deploy.ts:347 · contracts/src.ts/deploy.ts:383 · +1 more site(s) not listed — all 5 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (15 lines × 2 locations) · ×1
  • Duplicated block (15 lines × 2 locations) sdk/zksync.js/src/wallet.ts:78 — sdk/zksync.js/src/wallet.ts:78 · sdk/zksync.js/src/wallet.ts: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.
R10 · Code Duplication · Duplicated block (15 lines × 3 locations) · ×1
  • Duplicated block (15 lines × 3 locations) sdk/zksync.js/src/wallet.ts:833 — sdk/zksync.js/src/wallet.ts:833 · sdk/zksync.js/src/wallet.ts:903 · sdk/zksync.js/src/wallet.ts:1008 — 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 (14 lines × 2 locations) · ×1
  • Duplicated block (14 lines × 2 locations) contracts/scripts/deploy-testkit.ts:10 — contracts/scripts/deploy-testkit.ts:10 · REDACTED:12 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block with local edits (11 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (11 matched lines × 2 locations) infrastructure/token-lists-manager/index.ts:38 — infrastructure/token-lists-manager/index.ts:38 · REDACTED:56 — the two spans are one implementation copied and then locally edited — 61 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 (9 lines × 7 locations) · ×1
  • Duplicated block (9 lines × 7 locations) contracts/scripts/deploy-erc20.ts:88 — contracts/scripts/deploy-erc20.ts:88 · contracts/scripts/governance-add-erc20.ts:58 · contracts/scripts/read-variable.ts:359 · contracts/scripts/server-add-erc20.ts:56 · +3 more site(s) not listed — the 7 copies are spread across 7 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 (9 lines × 2 locations) · ×1
  • Duplicated block (9 lines × 2 locations) contracts/scripts/deploy.ts:26 — contracts/scripts/deploy.ts:26 · contracts/scripts/upgrade-testnet.ts:37 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
R2 · Cyclomatic Complexity · Complex function main (cyclomatic 26, cognitive 26) · ×1
  • Complex function main (cyclomatic 26, cognitive 26) contracts/scripts/deploy.ts:13 — main has cyclomatic complexity 26 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function main (cyclomatic 20, cognitive 29) · ×1
  • Complex function main (cyclomatic 20, cognitive 29) contracts/scripts/upgrade-testnet.ts:13 — main has cyclomatic complexity 20 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function getDefaultProvider (cyclomatic 20, cognitive 26) · ×1
  • Complex function getDefaultProvider (cyclomatic 20, cognitive 26) sdk/zksync.js/src/provider.ts:33 — getDefaultProvider has cyclomatic complexity 20 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function parseName (cyclomatic 15, cognitive 27) · ×1
  • Complex function parseName (cyclomatic 15, cognitive 27) contracts/scripts/read-variable.ts:255 — parseName has cyclomatic complexity 15 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function reason (cyclomatic 14, cognitive 34) · ×1
  • Complex function reason (cyclomatic 14, cognitive 34) contracts/scripts/revert-reason.ts:22 — reason has cyclomatic complexity 14 and cognitive complexity 34; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function processBatchBuilderTransactions (cyclomatic 13, cognitive 11) · ×1
  • Complex function processBatchBuilderTransactions (cyclomatic 13, cognitive 11) sdk/zksync.js/src/wallet.ts:162 — processBatchBuilderTransactions has cyclomatic complexity 13 and cognitive complexity 11; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function depositToSyncFromEthereum (cyclomatic 11, cognitive 23) · ×1
  • Complex function depositToSyncFromEthereum (cyclomatic 11, cognitive 23) sdk/zksync.js/src/abstract-wallet.ts:456 — depositToSyncFromEthereum has cyclomatic complexity 11 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function bitsIntoBytesInBEOrder (cyclomatic 11, cognitive 18) · ×1
  • Complex function bitsIntoBytesInBEOrder (cyclomatic 11, cognitive 18) sdk/zksync.js/src/utils.ts:109 — bitsIntoBytesInBEOrder has cyclomatic complexity 11 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function getPartialOrder (cyclomatic 11, cognitive 10) · ×1
  • Complex function getPartialOrder (cyclomatic 11, cognitive 10) sdk/zksync.js/src/wallet.ts:1164 — getPartialOrder has cyclomatic complexity 11 and cognitive complexity 10; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R3 · Large Files · sdk/zksync.js/src/wallet.ts · ×1
  • sdk/zksync.js/src/wallet.ts: 1081 lines of code sdk/zksync.js/src/wallet.ts:1 — sdk/zksync.js/src/wallet.ts has 1081 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 · sdk/zksync.js/src/utils.ts · ×1
  • sdk/zksync.js/src/utils.ts: 855 lines of code sdk/zksync.js/src/utils.ts:1 — sdk/zksync.js/src/utils.ts has 855 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 · sdk/zksync.js/src/abstract-wallet.ts · ×1
  • sdk/zksync.js/src/abstract-wallet.ts: 629 lines of code sdk/zksync.js/src/abstract-wallet.ts:1 — sdk/zksync.js/src/abstract-wallet.ts has 629 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 · sdk/zksync.js/src/rest-provider.ts · ×1
  • sdk/zksync.js/src/rest-provider.ts: 599 lines of code sdk/zksync.js/src/rest-provider.ts:1 — sdk/zksync.js/src/rest-provider.ts has 599 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 · sdk/zksync.js/src/types.ts · ×1
  • sdk/zksync.js/src/types.ts: 559 lines of code sdk/zksync.js/src/types.ts:1 — sdk/zksync.js/src/types.ts has 559 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 · contracts/src.ts/deploy.ts · ×1
  • contracts/src.ts/deploy.ts: 498 lines of code contracts/src.ts/deploy.ts:1 — contracts/src.ts/deploy.ts has 498 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 · sdk/zksync.js/src/remote-wallet.ts · ×1
  • sdk/zksync.js/src/remote-wallet.ts: 448 lines of code sdk/zksync.js/src/remote-wallet.ts:1 — sdk/zksync.js/src/remote-wallet.ts has 448 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R5 · Dependency Freshness · Dependency Freshness · ×1
  • Dependency Freshness — 54 outdated package(s); JS/npm CVEs scored in D30
R7 · Dead Code · Dead file (~56 LoC) · ×1
  • Dead file (~56 LoC) etc/js/env-config.js — no import path from any entry point (56 application, 10 tooling, 63 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R8 · Dependency Hygiene · Unused dependency 'markdown-toc' · ×1
  • Unused dependency 'markdown-toc' — Declared in the root REDACTED 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 'markdownlint-cli' · ×1
  • Unused dependency 'markdownlint-cli' — Declared in the root REDACTED 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 '@typechain/ethers-v5' · ×1
  • Unused dependency '@typechain/ethers-v5' — Declared in REDACTED 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.
X1 · Async correctness · Blocking `thread · ×1
  • Blocking `thread::sleep` inside an `async` body core/bin/data_restore/src/data_restore_driver.rs:415 — This `async` body is polled on an executor's worker thread, and `std::thread::sleep` blocks that thread: for the whole delay no other task scheduled on it makes progress — the Rust form of blocking on a task. Use `tokio::time::sleep(…).await` (or the runtime's own timer), which suspends only this task. Where the blocking work is not a sleep but a synchronous call that cannot be made async, move it off the executor with `tokio::task::spawn_blocking(…).await`.
X19 · Unrestored process-global state · Process-global state is restored only on the happy path · ×1
  • Process-global state is restored only on the happy path infrastructure/zk/src/lint.ts:35 — `clippy` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the `SQLX_OFFLINE` environment variable (set at line 37, cleared at line 42) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, not a `finally`, so it is skipped by any exception thrown in between — or by a promise that rejects at an `await`, and while this function is suspended at one every other callback the event loop runs sees the moved value too: the process then keeps the overwritten value for the rest of its life, and every later relative path, child-process launch or config read in ANY module resolves against it. That failure is silent and remote from its cause — the function that breaks is not the function that moved the directory. The durable fix is not to widen the restore but to stop mutating the global: pass the value to the operation that needs it — the `cwd` and `env` options of `child_process.spawn`/`exec`/`execSync` (or `Deno.Command`) scope both to the CHILD — or build absolute paths with `path.resolve`. Where the global genuinely must move, wrap it `try`/`finally` so the restore runs on every path.
Minor — 269 finding(s)
D34 · Knowledge Freshness · Orphaned file · ×216
  • Orphaned file sdk/zksync.js/src/wallet.ts: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 core/lib/storage/src/chain/mempool/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 core/lib/state/src/state.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 core/lib/circuit/src/witness/utils.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 core/lib/storage/src/chain/state/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 sdk/zksync.js/src/utils.ts: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 core/lib/l1_event_listener/src/events_state.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 core/lib/storage/src/ethereum/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 core/lib/storage/src/chain/operations/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 sdk/zksync.js/src/rest-provider.ts: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 sdk/zksync.js/src/abstract-wallet.ts: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 core/lib/circuit/src/witness/swap.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 core/lib/types/src/tx/change_pubkey.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 contracts/src.ts/deploy.ts: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 core/lib/eth_signer/src/json_rpc_signer.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 REDACTED: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 core/lib/circuit/src/witness/mint_nft.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 core/lib/storage/src/tokens/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 core/lib/types/src/gas_counter.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 core/lib/storage/src/chain/account/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 core/lib/circuit/src/exit_circuit.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 core/lib/types/src/priority_ops/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 core/lib/crypto/src/primitives.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 core/lib/types/src/tx/zksync_tx.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 core/lib/types/src/block/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.
  • + 191 more in this group — see findings.md.
D30 · Dependency Vulnerabilities · Low CVE · ×16
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D31 · IaC & Container Security · Low IaC · ×6
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D34 · Knowledge Freshness · Most significant orphaned file · ×3
  • Most significant orphaned file core/lib/circuit/src/circuit.rs:1 — One of the orphaned files carrying the most lost knowledge — ranked by size weighted by the file's role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites.
  • Most significant orphaned file core/lib/storage/src/chain/operations_ext/mod.rs:1 — One of the orphaned files carrying the most lost knowledge — ranked by size weighted by the file's role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites.
  • Most significant orphaned file core/lib/storage/src/chain/block/mod.rs:1 — One of the orphaned files carrying the most lost knowledge — ranked by size weighted by the file's role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites.
D30 · Dependency Vulnerabilities · Low vulnerability · ×2
  • REDACTED
  • REDACTED
X10 · Duplicated predicate · Duplicated predicate · ×2
  • Duplicated predicate sdk/zksync.js/src/batch-builder.ts:272 — `changePubKey.validUntil || MAX_TIMESTAMP` appears character-identically in 2 files — sdk/zksync.js/src/batch-builder.ts, sdk/zksync.js/src/wallet.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate core/lib/types/src/tx/forced_exit.rs:237 — `self.fee != BigUint::zero() && self.token > max_processable_token()` appears character-identically in 3 files — core/lib/types/src/tx/forced_exit.rs, core/lib/types/src/tx/transfer.rs, core/lib/types/src/tx/withdraw.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.
C2 · Access Controls · No named authorization policies · ×1
  • No named authorization policies — Authorization IS enforced here (by route guards, auth middleware or checks that refuse a caller) — this is NOT a claim that endpoints are unprotected. What's missing is a NAMED rule set: who may do what is encoded inline where it is checked, so the rules can't be listed, reviewed or tested apart from the code that applies them. Recommendation, not a defect.
D16 · Bus Factor · Off-boarding risk · ×1
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 2 significant file(s) lose their only recent owner: core/lib/types/src/tx/change_pubkey.rs, core/lib/types/src/tx/withdraw.rs. Pair on, review, or document these before any departure.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 1 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (3 single-owned of 221 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; 221 of the 361 production source files in this repository met that bar). They are anonymized user #2 (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: core/lib/crypto/src/merkle_tree/parallel_smt.rs.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion — 3 of 48 project(s) overshoot their size bounds, lowering Project Cohesion to 8.8/10. The most over is `core/bin/zksync_api` (16346 LoC, 123 module-visible types across 14 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D28 · Secrets (history) · Rotate the exposed credentials · ×1
  • REDACTED
D34 · Knowledge Freshness · Concentrated knowledge decay · ×1
  • Concentrated knowledge decay — 219 of 222 significant files have no living knowledge, while the repository is still being changed at a low rate (1 commit(s) in the last 90 days) — so this is one repo-wide knowledge-decay state, not 219 separate risks. Counted over 222 of the 361 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over. The code moved on without the people who understood these files: document them or schedule a read-through before the next change lands in them.
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
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.
P10 · Library API & versioning · Large public API surface · ×1
  • Large public API surface — 497/576 types (86%) declared in the published library are public. For a library, every public type is a stability contract — keep implementation types off the surface and expose only the intended API.
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 22/31 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `core/bin/add_seq_no`, `core/bin/block_revert`, `core/bin/exit_tree_generator`, `core/bin/parse_pub_data`, `core/bin/remove_proofs` and 4 more.
P4 · Deployment & Rollback · No rollback/health safety · ×1
  • No rollback/health safety — Deployment is orchestrated by compose, but no service declares a `healthcheck:` and nothing pins a previous image to fall back to — the runtime can tell that the container is up, not that it is serving, so a bad release is harder to detect and reverse.
P6 · Release Hygiene · Changelog looks stale/thin · ×1
  • Changelog looks stale/thin — The changelog this check read carries 0 versioned entries, against a bar of 3. Counted as either the distinct `x.y.z` versions it names (a link's target is not counted) or its version-shaped section headings (`## [1.2.0]`, `## V14.x.x`, `## Updates in 8.0.x`), whichever is the larger — so a log sectioned by minor series counts its sections, not its individual patch numbers. Entries recorded somewhere this check does not read — release notes generated at tag time from a generator config it did not recognise, or a log kept outside the repository — are not counted here, and this row is about what is re-findable in the tree rather than about how often you release.
R7 · Dead Code · Unused export 'storedBlockInfoParam' · ×1
  • Unused export 'storedBlockInfoParam' contracts/scripts/utils.ts:33 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'updateToken' · ×1
  • Unused export 'updateToken' infrastructure/zk/src/db/db.ts:62 — Nothing imports this binding — it is safe to review for removal.
S1 · Web-Security Posture · No app-layer HTTPS enforcement detected · ×1
  • No app-layer HTTPS enforcement detected — This repository starts an HTTP server and nothing in its Rust source or committed `Rocket.toml` secures the transport: no TLS served (actix-web `bind_rustls`/`bind_openssl`, axum-server `bind_rustls` with a `RustlsConfig`, tonic `ServerTlsConfig`, a `TlsAcceptor`, Rocket's `[default.tls]`), no `Strict-Transport-Security` header, no `X-Forwarded-Proto` read from a TLS-terminating proxy — so its traffic may cross the network in clear text. (−2.0 on this card.) The server: `HttpServer::new(` (core/bin/zksync_witness_generator/src/lib.rs:449).
S1 · Web-Security Posture · No security response headers detected · ×1
  • No security response headers detected — 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 set on a response this repository's Rust server sends — defense in depth, even when a proxy could set them. (−2.0 on this card.) The server: `HttpServer::new(` (core/bin/zksync_witness_generator/src/lib.rs:449).
X2 · Cancellation propagation · Not all async functions that make a request accept an AbortSignal · ×1
  • Not all async functions that make a request accept an AbortSignal — Only 0/3 async functions that make a cancellable request (fetch, axios, ky, ofetch) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
X5 · Nullable reference types · Strict null checking is not enabled everywhere the repository type-checks · ×1
  • Strict null checking is not enabled everywhere the repository type-checks — 3/8 of this repository's type-checking configuration(s) turn on strict null checking (`"strict": true`, or `"strictNullChecks": true`). A configuration that states neither is counted as OFF, because off is tsc's own default; a solution-style one whose `"files"` is empty and whose `"references"` point at other projects is in neither number, because it checks no source itself. Where it is off, `string` admits `null` and `undefined`: passing a value that is null compiles silently and throws on the first property access.
X5 · Nullable reference types · Null assertions (`!`) reduce the strict null checking score · ×1
  • Null assertions (`!`) reduce the strict null checking score — ~0.3 `!` null assertions per 1k TypeScript source lines — 4 assertion(s) across the 11616 source line(s) of the 65 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: infrastructure/api-docs/src/compile.ts (4). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce.
X7 · Silent fallback defaults · Silent fallback default on Err · ×1
  • Silent fallback default on Err core/bin/zksync_api/src/bin/dev-ticker-server.rs:134 — `load_tokens` 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.
Minor — 24 finding(s)
D12 · Dependency Hygiene · Outdated · ×24
  • Outdated: actix-rt — `actix-rt` is locked at 2.11.0 but 2.15.0 is the current stable release on crates.io, and it already satisfies the `"2.2.0"` requirement declared in core/bin/zksync_api/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p actix-rt` and commit the updated REDACTED.
  • Outdated: actix-web — `actix-web` is locked at 4.10.2 but 4.18.1 is the current stable release on crates.io, and it already satisfies the `"4.0.0"` requirement declared in core/bin/zksync_api/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p actix-web` and commit the updated REDACTED.
  • Outdated: anyhow — `anyhow` is locked at 1.0.45 but 1.0.104 is the current stable release on crates.io, and it already satisfies the `"1.0"` requirement declared in core/bin/add_seq_no/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p anyhow` and commit the updated REDACTED.
  • Outdated: async-trait — `async-trait` is locked at 0.1.52 but 0.1.92 is the current stable release on crates.io, and it already satisfies the `"0.1"` requirement declared in sdk/zksync-rs/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p async-trait` and commit the updated REDACTED.
  • Outdated: chrono — `chrono` is locked at 0.4.37 but 0.4.45 is the current stable release on crates.io, and it already satisfies the `"0.4"` requirement declared in core/bin/data_restore/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p chrono` and commit the updated REDACTED.
  • Outdated: csv — `csv` is locked at 1.1.6 but 1.4.0 is the current stable release on crates.io, and it already satisfies the `"1.1.6"` requirement declared in core/bin/exit_tree_generator/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p csv` and commit the updated REDACTED.
  • Outdated: ctrlc — `ctrlc` is locked at 3.2.1 but 3.5.2 is the current stable release on crates.io, and it already satisfies the `"3.1"` requirement declared in core/bin/prover/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p ctrlc` and commit the updated REDACTED.
  • Outdated: either — `either` is locked at 1.15.0 but 1.19.0 is the current stable release on crates.io, and it already satisfies the `"1.6.1"` requirement declared in core/lib/api_types/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p either` and commit the updated REDACTED.
  • Outdated: futures — `futures` is locked at 0.3.17 but 0.3.34 is the current stable release on crates.io, and it already satisfies the `"0.3"` requirement declared in core/bin/prover/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p futures` and commit the updated REDACTED.
  • Outdated: futures-util — `futures-util` is locked at 0.3.32 but 0.3.34 is the current stable release on crates.io, and it already satisfies the `"0.3"` requirement declared in core/bin/zksync_event_listener/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p futures-util` and commit the updated REDACTED.
  • Outdated: lazy_static — `lazy_static` is locked at 1.4.0 but 1.5.1 is the current stable release on crates.io, and it already satisfies the `"1.2.0"` requirement declared in core/lib/crypto/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p lazy_static` and commit the updated REDACTED.
  • Outdated: log — `log` is locked at 0.4.29 but 0.4.34 is the current stable release on crates.io, and it already satisfies the `"0.4"` requirement declared in core/bin/zksync_forced_exit_requests/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p log` and commit the updated REDACTED.
  • Outdated: proc-macro2 — `proc-macro2` is locked at 1.0.103 but 1.0.107 is the current stable release on crates.io, and it already satisfies the `"1.0.7"` requirement declared in core/lib/storage/db_test_macro/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p proc-macro2` and commit the updated REDACTED.
  • Outdated: quote — `quote` is locked at 1.0.42 but 1.0.47 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in core/lib/storage/db_test_macro/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p quote` and commit the updated REDACTED.
  • Outdated: rayon — `rayon` is locked at 1.11.0 but 1.12.0 is the current stable release on crates.io, and it already satisfies the `"1.10"` requirement declared in core/bin/exit_tree_generator/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p rayon` and commit the updated REDACTED.
  • Outdated: regex — `regex` is locked at 1.5.5 but 1.13.1 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in core/bin/zksync_api/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p regex` and commit the updated REDACTED.
  • Outdated: serde — `serde` is locked at 1.0.228 but 1.0.229 is the current stable release on crates.io, and it already satisfies the `"1.0"` requirement declared in sdk/zksync-rs/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p serde` and commit the updated REDACTED.
  • Outdated: serde_derive — `serde_derive` is locked at 1.0.228 but 1.0.229 is the current stable release on crates.io, and it already satisfies the `"1.0.90"` requirement declared in core/lib/eth_signer/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p serde_derive` and commit the updated REDACTED.
  • Outdated: serde_json — `serde_json` is locked at 1.0.149 but 1.0.154 is the current stable release on crates.io, and it already satisfies the `"1.0"` requirement declared in sdk/zksync-rs/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p serde_json` and commit the updated REDACTED.
  • Outdated: serde_repr — `serde_repr` is locked at 0.1.7 but 0.1.21 is the current stable release on crates.io, and it already satisfies the `"0.1"` requirement declared in core/bin/zksync_api/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p serde_repr` and commit the updated REDACTED.
  • Outdated: structopt — `structopt` is locked at 0.3.25 but 0.3.26 is the current stable release on crates.io, and it already satisfies the `"0.3.20"` requirement declared in core/bin/block_revert/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p structopt` and commit the updated REDACTED.
  • Outdated: tokio — `tokio` is locked at 1.48.0 but 1.54.1 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in sdk/zksync-rs/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tokio` and commit the updated REDACTED.
  • Outdated: tokio-stream — `tokio-stream` is locked at 0.1.8 but 0.1.19 is the current stable release on crates.io, and it already satisfies the `"0.1"` requirement declared in core/lib/gateway_watcher/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tokio-stream` and commit the updated REDACTED.
  • Outdated: tracing — `tracing` is locked at 0.1.35 but 0.1.44 is the current stable release on crates.io, and it already satisfies the `"0.1.22"` requirement declared in core/bin/zksync_witness_generator/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tracing` and commit the updated REDACTED.

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-bfd72c717d1b43adb67ba46638d31b9a/history.json --exit-code 0 --source .75artifacts/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-bfd72c717d1b43adb67ba46638d31b9a/tree.json --exit-code 0 --source .10artifacts/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 sdk/zksync.js/src/typechain .39artifacts/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-update209artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .85artifacts/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-update1artifacts/raw/trivy-fs.json

Run 01a1816c-0d7a-793c-b351-f5f4ad1cb352 · 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