Public report of matter-labs/zksync, published 14 November 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 14 November 2026, 19:30 UTC, at code version ebf0651

Code coverage is not measured: JavaScript/TypeScript suite (CouldNotMeasureNoCollector).

CAI score 49out of 100 At risk Up 1 since the last survey

The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.

A 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, 42

Findings by how serious they are

321 critical 774 serious 326 minor

15 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look 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

Assert small markCanine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
14 November 2026, 19:30 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 the Canine Code Analyzer. It is open to any tool that implements it, and today the Canine Code Analyzer 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. We work 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 ▸

70of 70 dimensions measured by tools.
1353of 1421 findings point to an exact file and line, so you can open each one in the code. The other 68 concern the repository as a whole, such as missing documentation.
70dimensions 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, most of them in the packages it uses. Its score is held back in part because it has uses of packages that aren't listed. It scores 49 out of 100, which the At risk rating leaves unchanged.

Production Readiness, at 42, is the weakest lens and counts most in the score. The best first step is making the 28 tests that check nothing check their results, worth about 6 points. Tidying the declared packages would lift Production Readiness itself, worth about 5 points. Raising Production Readiness to 70 would lift the score to about 54.

171 known security holes in the packages the code depends on can be used by attackers. Fifty-five passwords or keys 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 €130,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 42 · counts for 46%Security and Compliance 48 · counts for 25%Code Health 55 · counts for 14%Architecture 58 · counts for 8%Maturity 63 · counts for 4%Performance 71 · counts for 2%Domain Modelling 78 · counts for 1%

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

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

These 263 critical or serious findings weren't in the previous survey, on 28 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.

  • Code Duplication · Near-duplicate member pair (96 shared lines) core/lib/circuit/src/witness/transfer.rs
  • Code Duplication · Edited copy of a member (112 corresponding lines) core/lib/types/src/priority_ops/mod.rs
  • Code Duplication · Edited copy of a member (81 corresponding lines) core/lib/circuit/src/circuit.rs
  • Code Duplication · Edited copy of a member (133 corresponding lines) core/lib/storage/src/chain/operations_ext/mod.rs
  • Code Duplication · Edited copy of a member (59 corresponding lines) core/lib/crypto/src/serialization.rs
  • Code Duplication · Edited copy of a member (93 corresponding lines) core/lib/storage/src/chain/account/mod.rs
  • Code Duplication · Edited copy of a member (31 corresponding lines) core/lib/types/src/operations/mod.rs
  • Code Duplication · Edited copy of a member (43 corresponding lines) core/lib/types/src/operations/forced_exit.rs
  • Code Duplication · Edited copy of a member (51 corresponding lines) core/lib/crypto/src/primitives.rs
  • Code Duplication · Edited copies of one member (4 members, 47+ corresponding lines) core/lib/types/src/operations/mint_nft_op.rs
  • Code Duplication · Edited copies of one member (4 members, 42+ corresponding lines) sdk/zksync-rs/src/operations/mint_nft.rs
  • Code Duplication · Edited copy of a member (50 corresponding lines) core/lib/circuit/src/witness/full_exit.rs
  • Code Duplication · Edited copy of a member (43 corresponding lines) sdk/zksync-rs/src/ethereum/mod.rs
  • Code Duplication · Edited copies of one member (3 members, 34+ corresponding lines) core/lib/types/src/tx/forced_exit.rs
  • Code Duplication · Edited copy of a member (36 corresponding lines) core/lib/storage/src/prover/mod.rs
  • Code Duplication · Edited copy of a member (34 corresponding lines) core/lib/types/src/tx/primitives/eip712_signature/struct_builder.rs
  • Code Duplication · Edited copy of a member (21 corresponding lines) core/lib/types/src/tx/zksync_tx.rs
  • Code Duplication · Edited copy of a member (40 corresponding lines) core/lib/mempool/src/transactions_handler.rs
  • Code Duplication · Edited copy of a member (18 corresponding lines) core/lib/types/src/gas_counter.rs
  • Code Duplication · Edited copies of one member (6 members, 35+ corresponding lines) core/lib/circuit/src/witness/change_pubkey_offchain.rs
  • Code Duplication · Edited copy of a member (29 corresponding lines) core/lib/storage/src/event/mod.rs
  • Code Duplication · Edited copy of a member (33 corresponding lines) core/lib/storage/src/chain/operations_ext/mod.rs
  • Code Duplication · Edited copy of a member (20 corresponding lines) core/lib/circuit/src/utils.rs
  • Code Duplication · Edited copies of one member (3 members, 14+ corresponding lines) core/lib/types/src/tx/change_pubkey.rs
  • Code Duplication · Edited copy of a member (27 corresponding lines) sdk/zksync-rs/src/ethereum/mod.rs
  • Code Duplication · Edited copy of a member (21 corresponding lines) core/lib/l1_event_listener/src/events_state.rs
  • Code Duplication · Edited copy of a member (19 corresponding lines) core/lib/circuit/src/utils.rs
  • Code Duplication · Edited copy of a member (15 corresponding lines) core/lib/types/src/operations/mod.rs
  • Code Duplication · Edited copy of a member (22 corresponding lines) core/lib/eth_signer/src/json_rpc_signer.rs
  • Code Duplication · Edited copy of a member (23 corresponding lines) core/lib/types/src/tx/mint_nft.rs
  • Code Duplication · Edited copy of a member (16 corresponding lines) core/lib/crypto/src/merkle_tree/parallel_smt.rs
  • Code Duplication · Edited copy of a member (32 corresponding lines) core/lib/storage/src/chain/operations_ext/mod.rs
  • Code Duplication · Edited copies of one member (3 members, 75+ corresponding lines) core/lib/storage/src/chain/operations_ext/mod.rs
  • Code Duplication · Edited copy of a member (26 corresponding lines) core/lib/storage/src/chain/account/mod.rs
  • Code Duplication · Edited copies of one member (7 members, 12+ corresponding lines) core/lib/types/src/tx/change_pubkey.rs
  • Code Duplication · Edited copy of a member (17 corresponding lines) core/lib/circuit/src/witness/forced_exit.rs
  • Code Duplication · Edited copy of a member (25 corresponding lines) core/lib/mempool/src/state.rs
  • Code Duplication · Edited copy of a member (33 corresponding lines) core/lib/storage/src/chain/operations_ext/mod.rs
  • Code Duplication · Edited copy of a member (21 corresponding lines) sdk/zksync-rs/src/ethereum/priority_op_handle.rs
  • Code Duplication · Edited copy of a member (14 corresponding lines) core/lib/circuit/src/witness/transfer.rs
  • Code Duplication · Edited copies of one member (6 members, 18+ corresponding lines) core/lib/storage/src/chain/mempool/mod.rs
  • Code Duplication · Edited copy of a member (27 corresponding lines) core/lib/storage/src/chain/operations_ext/mod.rs
  • Code Duplication · Edited copies of one member (6 members, 10+ corresponding lines) core/lib/types/src/operations/change_pubkey_op.rs
  • Code Duplication · Edited copy of a member (19 corresponding lines) core/lib/storage/src/chain/operations_ext/mod.rs
  • Code Duplication · Edited copy of a member (14 corresponding lines) core/lib/storage/src/prover/mod.rs
  • Code Duplication · Edited copy of a member (25 corresponding lines) core/lib/storage/src/chain/tree_cache/json_schema.rs
  • Code Duplication · Edited copy of a member (17 corresponding lines) core/lib/circuit/src/element.rs
  • Code Duplication · Edited copy of a member (21 corresponding lines) core/lib/storage/src/tokens/mod.rs
  • Code Duplication · Edited copy of a member (11 corresponding lines) core/lib/types/src/tx/swap.rs
  • Code Duplication · Edited copy of a member (23 corresponding lines) core/lib/storage/src/forced_exit_requests/mod.rs
  • Code Duplication · Edited copy of a member (17 corresponding lines) core/lib/crypto/src/circuit/utils.rs
  • Code Duplication · Edited copy of a member (9 corresponding lines) core/lib/crypto/src/serialization.rs
  • Code Duplication · Edited copy of a member (19 corresponding lines) core/lib/types/src/tx/mint_nft.rs
  • Code Duplication · Edited copies of one member (3 members, 14+ corresponding lines) core/lib/crypto/src/circuit/utils.rs
  • Code Duplication · Edited copies of one member (3 members, 21+ corresponding lines) core/lib/storage/src/chain/block/mod.rs
  • Code Duplication · Edited copies of one member (4 members, 10+ corresponding lines) core/lib/storage/src/chain/account/mod.rs
  • Code Duplication · Edited copies of one member (5 members, 16+ corresponding lines) core/lib/storage/src/chain/state/mod.rs
  • Code Duplication · Edited copy of a member (12 corresponding lines) core/lib/utils/src/serde_wrappers.rs
  • Code Duplication · Edited copy of a member (8 corresponding lines) core/lib/types/src/operations/forced_exit.rs
  • Code Duplication · Edited copies of one member (3 members, 24+ corresponding lines) core/lib/storage/src/chain/tree_cache/bincode_schema.rs
  • Code Duplication · Edited copy of a member (12 corresponding lines) core/lib/circuit/src/utils.rs
  • Code Duplication · Edited copies of one member (4 members, 13+ corresponding lines) core/lib/eth_client/src/clients/http_client.rs
  • Code Duplication · Edited copy of a member (15 corresponding lines) core/lib/storage/src/chain/tree_cache/bincode_schema.rs
  • Code Duplication · Edited copies of one member (4 members, 8+ corresponding lines) core/lib/eth_client/src/clients/http_client.rs
  • Code Duplication · Edited copy of a member (14 corresponding lines) core/lib/storage/src/chain/operations_ext/mod.rs
  • Code Duplication · Edited copy of a member (15 corresponding lines) sdk/zksync-rs/src/ethereum/mod.rs
  • Code Duplication · Edited copies of one member (4 members, 16+ corresponding lines) core/lib/types/src/tx/forced_exit.rs
  • Code Duplication · Edited copy of a member (10 corresponding lines) core/lib/storage/src/chain/block/mod.rs
  • Code Duplication · Edited copy of a member (9 corresponding lines) core/lib/crypto/src/primitives.rs
  • Code Duplication · Edited copy of a member (10 corresponding lines) core/lib/storage/src/chain/mempool/records.rs
  • Code Duplication · Edited copy of a member (13 corresponding lines) core/lib/storage/src/chain/stats.rs
  • Code Duplication · Edited copy of a member (13 corresponding lines) core/lib/circuit/src/circuit.rs
  • Code Duplication · Edited copy of a member (15 corresponding lines) core/lib/storage/src/chain/mempool/mod.rs
  • Code Duplication · Edited copies of one member (5 members, 15+ corresponding lines) core/lib/storage/src/ethereum/mod.rs
  • Code Duplication · Edited copies of one member (5 members, 17+ corresponding lines) core/lib/storage/src/ethereum/mod.rs
  • Code Duplication · Edited copy of a member (17 corresponding lines) core/lib/types/src/tx/change_pubkey.rs
  • Code Duplication · Edited copy of a member (9 corresponding lines) core/lib/prover_utils/src/fs_utils.rs
  • Code Duplication · Edited copies of one member (3 members, 13+ corresponding lines) core/lib/storage/src/chain/operations/mod.rs
  • Code Duplication · Edited copies of one member (5 members, 12+ corresponding lines) core/lib/storage/src/prover/mod.rs
  • Code Duplication · Edited copies of one member (6 members, 15+ corresponding lines) core/lib/storage/src/chain/block/mod.rs
  • Code Duplication · Edited copies of one member (3 members, 15+ corresponding lines) core/lib/storage/src/chain/mempool/mod.rs
  • Code Duplication · Edited copy of a member (15 corresponding lines) core/lib/types/src/tx/transfer.rs
  • Code Duplication · Edited copy of a member (14 corresponding lines) core/lib/storage/src/chain/account/mod.rs
  • Code Duplication · Edited copies of one member (7 members, 14+ corresponding lines) core/lib/storage/src/chain/block/mod.rs
  • Code Duplication · Edited copies of one member (3 members, 11+ corresponding lines) core/lib/storage/src/chain/block/mod.rs
  • Code Duplication · Edited copy of a member (8 corresponding lines) core/lib/storage/src/data_restore/mod.rs
  • Code Duplication · Edited copies of one member (5 members, 12+ corresponding lines) core/lib/types/src/tx/change_pubkey.rs
  • Code Duplication · Edited copies of one member (3 members, 9+ corresponding lines) core/lib/storage/src/config/mod.rs
  • Code Duplication · Edited copies of one member (3 members, 14+ corresponding lines) core/lib/types/src/tx/change_pubkey.rs
  • Code Duplication · Edited copy of a member (15 corresponding lines) core/lib/storage/src/chain/mempool/mod.rs
  • Code Duplication · Edited copy of a member (11 corresponding lines) core/lib/crypto/src/primitives.rs
  • Code Duplication · Edited copy of a member (4 corresponding lines) core/lib/types/src/tx/primitives/packed_public_key.rs
  • Code Duplication · Edited copy of a member (9 corresponding lines) core/lib/storage/src/chain/mempool/mod.rs
  • Code Duplication · Edited copy of a member (11 corresponding lines) sdk/zksync-rs/src/operations/change_pubkey.rs
  • Code Duplication · Duplicated block (26–27 lines × 2) core/lib/circuit/src/witness/transfer.rs
  • Code Duplication · Duplicated block (20–21 lines × 2) core/lib/circuit/src/circuit.rs
  • Code Duplication · Duplicated block (19 lines × 2) sdk/zksync-rs/src/operations/transfer.rs
  • Code Duplication · Duplicated block (4–18 lines × 3) core/lib/circuit/src/circuit.rs
  • Code Duplication · Duplicated block (17 lines × 2) sdk/zksync-rs/src/operations/transfer.rs
  • Code Duplication · Duplicated block (16 lines × 3) core/lib/circuit/src/circuit.rs

We compare 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: 78 findings

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

  • Code Duplication · Near-duplicate member pair (96 shared lines) core/lib/circuit/src/witness/transfer.rs
  • Code Duplication · Duplicated block (26–27 lines × 2) core/lib/circuit/src/witness/transfer.rs
  • Code Duplication · Duplicated block (21–22 lines × 2) core/lib/circuit/src/circuit.rs
  • Code Duplication · Duplicated block (20–21 lines × 2) core/lib/circuit/src/circuit.rs
  • Code Duplication · Duplicated block (19 lines × 2) sdk/zksync-rs/src/operations/transfer.rs
  • Code Duplication · Duplicated block (4–18 lines × 3) core/lib/circuit/src/circuit.rs
  • Code Duplication · Duplicated block (17 lines × 2) sdk/zksync-rs/src/operations/transfer.rs
  • Code Duplication · Duplicated block (16 lines × 3) core/lib/circuit/src/circuit.rs
  • Code Duplication · Duplicated block (16 lines × 3) sdk/zksync-rs/src/operations/change_pubkey.rs
  • Code Duplication · Duplicated block (16 lines × 2) core/lib/circuit/src/circuit.rs
  • Code Duplication · Duplicated block (15 lines × 3) sdk/zksync-rs/src/operations/transfer.rs
  • Code Duplication · Duplicated block (13 lines × 4) core/lib/circuit/src/circuit.rs
  • Code Duplication · Duplicated block (11–13 lines × 2) core/lib/circuit/src/circuit.rs
  • Code Duplication · Duplicated block (9–12 lines × 4) core/lib/circuit/src/circuit.rs
  • Code Duplication · Duplicated block (11 lines × 4) core/lib/circuit/src/exit_circuit.rs
  • Code Duplication · Duplicated block (10 lines × 3) core/lib/circuit/src/circuit.rs
  • Code Duplication · Duplicated block (9–10 lines × 3) core/lib/circuit/src/circuit.rs
  • Code Duplication · Duplicated block (10 lines × 2) sdk/zksync-rs/src/operations/mint_nft.rs
  • Code Duplication · Duplicated block (8–9 lines × 2) core/lib/storage/src/chain/block/mod.rs
  • Code Duplication · Duplicated block (9 lines × 2) sdk/zksync-rs/src/operations/transfer.rs
  • Code Duplication · Duplicated block (8 lines × 2) core/lib/circuit/src/witness/transfer.rs
  • Code Duplication · Duplicated block (7 lines × 4) core/lib/circuit/src/circuit.rs
  • Code Duplication · Duplicated block (6 lines × 5) core/lib/circuit/src/circuit.rs
  • Code Duplication · Duplicated block (6 lines × 4) core/lib/circuit/src/circuit.rs
  • Code Duplication · Duplicated block (6 lines × 2) core/lib/circuit/src/circuit.rs
  • Code Duplication · Duplicated block (9 lines × 2) core/lib/types/src/tx/mint_nft.rs
  • Code Duplication · Duplicated block (8 lines × 2) sdk/zksync-rs/src/ethereum/priority_op_handle.rs
  • Code Duplication · Duplicated block (9 lines × 6) sdk/zksync-rs/src/operations/change_pubkey.rs
  • Code Duplication · Duplicated block (8 lines × 4) sdk/zksync-rs/src/operations/mint_nft.rs
  • Code Duplication · Duplicated block (9 lines × 5) sdk/zksync-rs/src/operations/mint_nft.rs
  • Code Duplication · Duplicated block (12 lines × 2) sdk/zksync-rs/src/operations/transfer.rs
  • Code Duplication · Duplicated block (9 lines × 2) sdk/zksync-rs/src/operations/transfer.rs
  • Code Duplication · Duplicated block (15 lines × 2) core/lib/storage/src/tokens/mod.rs
  • Code Duplication · Duplicated block (13 lines × 2) core/lib/storage/src/chain/mempool/mod.rs
  • Code Duplication · Duplicated block (6 lines × 2) core/lib/eth_client/src/clients/http_client.rs
  • REDACTED Scanning · Leaked secret: high-entropy-secret core/lib/types/src/tx/tests.rs
  • REDACTED Scanning · Leaked secret: high-entropy-secret core/lib/types/src/tx/tests.rs
  • Secrets (history) · REDACTED: REDACTED dev.env
  • Secrets (history) · REDACTED: REDACTED dev.env
  • Secrets (history) · REDACTED: REDACTED docker/dev-ticker/nginx.conf
  • Secrets (history) · REDACTED: REDACTED docker/dev-ticker/nginx.conf
  • Secrets (history) · REDACTED: REDACTED etc/env/base/dev_liquidity_token_watcher.toml
  • Secrets (history) · REDACTED: REDACTED plasma/server/.env_example
  • 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: [GHSA redacted] REDACTED
  • Dependency Vulnerabilities · High CVE: REDACTED REDACTED
  • Dependency Vulnerabilities · High CVE: REDACTED REDACTED
  • Dependency Vulnerabilities · High vulnerability: REDACTED REDACTED
  • Dependency Vulnerabilities · High CVE: REDACTED REDACTED
  • Dependency Vulnerabilities · High CVE: REDACTED REDACTED
  • Dependency Vulnerabilities · High CVE: [CVE redacted] REDACTED
  • Dependency Vulnerabilities · Medium vulnerability: [GHSA redacted] REDACTED
  • Dependency Vulnerabilities · Medium vulnerability: [GHSA redacted] REDACTED
  • Dependency Vulnerabilities · Medium vulnerability: [GHSA redacted] REDACTED
  • Dependency Vulnerabilities · Medium CVE: [CVE redacted] 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 core/tests/ts-tests/tests/api.ts
  • Async & latency hygiene · Sync-over-async blocking core/tests/ts-tests/tests/api.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
  • Async & latency hygiene · Sync-over-async blocking infrastructure/zk/src/test/integration.ts
Rebuild cost: about €130,000 · Estimate
Cost to rebuild€42,000 to €210,000, for 697 to 2,210 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 49. 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: We price 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 28 No assertions finding(s) in Test Quality — start with operations.spec.ts (7), zksync.spec.ts (6), api.test.ts (5).
Raises the score by about 6 points · Medium effort · Test Quality
2
Resolve the 2 Malicious package finding(s) in Malicious Dependencies — start with REDACTED, REDACTED.
Raises the score by about 2 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 5 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 €130,000 to build again, about 0.9 person-years of work. Its weakest lens is Production Readiness, at 42 (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 28 No assertions finding(s) in Test Quality. Of all the actions in this report, it raises the score most for the work it takes: about 6 points for medium effort, because it clears the 28 Test Quality 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 938 dependencies between them. 9 loops run through 44 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_api_types.v02.pagination5 zksync_circuit.operation6 zksync_config.configs.chain7 zksync_config.configs.eth_sender8 zksync_crypto.proof9 zksync_storage.connection10 zksync_types.account.pubkey_hash11 zksync_types.operations12 zksync_types.tokens13 zksync_types.tx.primitives.eth_signature14 zksync_types.tx.primitives.signature15 zksync_types.tx.primitives.tx_hash16 sdk.zksync_js.src.signer17 zksync_api.fee_ticker18 zksync_circuit.witness19 zksync_config20 zksync_eth_client.ethereum_gateway21 zksync_storage.chain22 zksync_types.account23 zksync_types.priority_ops24 zksync_types.tx.change_pubkey25 zksync_api_types.v02.transaction26 zksync_l1_event_listener.events_state27 zksync_types.tx.zksync_tx28 zksync_api.api_server.rpc_server.rpc_trait29 zksync_api_client.rest.client30 zksync_state.state31 zksync_storage32 zksync_types.block33 zksync_api.api_server.web3.types34 zksync_circuit.witness.utils35 zksync_core.state_keeper36 zksync_data_restore.storage_interactor37 zksync_token_db_cache38 zksync_types.aggregated_operations39 zksync_api.api_server.tx_sender40 zksync_api.api_server.rpc_server
1 sdk.zksync_js.src.types
2 zksync.wallet
3 zksync_api.bin.dev-ticker-server
4 zksync_api_types.v02.pagination
5 zksync_circuit.operation
6 zksync_config.configs.chain
7 zksync_config.configs.eth_sender
8 zksync_crypto.proof
9 zksync_storage.connection
10 zksync_types.account.pubkey_hash
11 zksync_types.operations
12 zksync_types.tokens
13 zksync_types.tx.primitives.eth_signature
14 zksync_types.tx.primitives.signature
15 zksync_types.tx.primitives.tx_hash
16 sdk.zksync_js.src.signer9
17 zksync_api.fee_ticker122
18 zksync_circuit.witness1
19 zksync_config11
20 zksync_eth_client.ethereum_gateway1
21 zksync_storage.chain1
22 zksync_types.account1
23 zksync_types.priority_ops1
24 zksync_types.tx.change_pubkey221
25 zksync_api_types.v02.transaction11181
26 zksync_l1_event_listener.events_state11
27 zksync_types.tx.zksync_tx11111
28 zksync_api.api_server.rpc_server.rpc_trait11111
29 zksync_api_client.rest.client11111
30 zksync_state.state31311
31 zksync_storage111
32 zksync_types.block311
33 zksync_api.api_server.web3.types11
34 zksync_circuit.witness.utils21
35 zksync_core.state_keeper1111
36 zksync_data_restore.storage_interactor212
37 zksync_token_db_cache21
38 zksync_types.aggregated_operations145
39 zksync_api.api_server.tx_sender121311121
40 zksync_api.api_server.rpc_server2211121111
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_api_types.v02.pagination5 zksync_circuit.operation6 zksync_config.configs.chain7 zksync_config.configs.eth_sender8 zksync_crypto.proof9 zksync_storage.connection10 zksync_types.account.pubkey_hash11 zksync_types.operations12 zksync_types.tokens13 zksync_types.tx.primitives.eth_signature14 zksync_types.tx.primitives.signature15 zksync_types.tx.primitives.tx_hash16 sdk.zksync_js.src.signer17 zksync_api.fee_ticker18 zksync_circuit.witness19 zksync_config20 zksync_eth_client.ethereum_gateway21 zksync_storage.chain22 zksync_types.account23 zksync_types.priority_ops24 zksync_types.tx.change_pubkey25 zksync_api_types.v02.transaction26 zksync_l1_event_listener.events_state27 zksync_types.tx.zksync_tx28 zksync_api.api_server.rpc_server.rpc_trait29 zksync_api_client.rest.client30 zksync_state.state31 zksync_storage32 zksync_types.block33 zksync_api.api_server.web3.types34 zksync_circuit.witness.utils35 zksync_core.state_keeper36 zksync_data_restore.storage_interactor37 zksync_token_db_cache38 zksync_types.aggregated_operations39 zksync_api.api_server.tx_sender40 zksync_api.api_server.rpc_serversdk.zksync_js.src.types1zksync.wallet2zksync_api.bin.dev-ticker-server3zksync_api_types.v02.pagination4zksync_circuit.operation5zksync_config.configs.chain6zksync_config.configs.eth_sender7zksync_crypto.proof8zksync_storage.connection9zksync_types.account.pubkey_hash10zksync_types.operations11zksync_types.tokens12zksync_types.tx.primitives.eth_signature13zksync_types.tx.primitives.signature14zksync_types.tx.primitives.tx_hash15sdk.zksync_js.src.signer16zksync_api.fee_ticker17zksync_circuit.witness18zksync_config19zksync_eth_client.ethereum_gateway20zksync_storage.chain21zksync_types.account22zksync_types.priority_ops23zksync_types.tx.change_pubkey24zksync_api_types.v02.transaction25zksync_l1_event_listener.events_state26zksync_types.tx.zksync_tx27zksync_api.api_server.rpc_server.rpc_trait28zksync_api_client.rest.client29zksync_state.state30zksync_storage31zksync_types.block32zksync_api.api_server.web3.types33zksync_circuit.witness.utils34zksync_core.state_keeper35zksync_data_restore.storage_interactor36zksync_token_db_cache37zksync_types.aggregated_operations38zksync_api.api_server.tx_sender39zksync_api.api_server.rpc_server409122111111122111181111111111111111113131111131111211111212211451213111212211121111+382 more modules (most-connected shown)

At a glance — Code Health · 55% · Adequate · gated by R10 ·

At a glance — Architecture · 58% · Adequate · gated by R11 ·

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

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

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

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 Failures351High / Critical
A02:2025 — Security Misconfiguration85High / Critical
A07:2025 — Authentication Failures56High / Critical
A05:2025 — Injection44High / Critical
A08:2025 — Software or Data Integrity Failures2Medium

Roadmap

Top priorities: Resolve the 28 No assertions finding(s) in Test Quality — start with operations.spec.ts (7), zksync.spec.ts (6), api.test.ts (5); Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies; 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.

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

Do thisHelpsEffortDimension
Resolve the 28 No assertions finding(s) in Test Quality — start with operations.spec.ts (7), zksync.spec.ts (6), api.test.ts (5).+5.6 ptsMediumTest Quality
Resolve the 2 Malicious package finding(s) in Malicious Dependencies — start with REDACTED, REDACTED.+2.4 ptsLowMalicious Dependencies
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.+4.7 ptsMediumDependency Hygiene
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.+3.0 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
Resolve the 1 End-of-life runtime finding(s) in Platform End-of-Life — start with rust-toolchain.+1.3 ptsLowPlatform End-of-Life
Resolve the 54 REDACTED finding(s) in Secrets (history) — start with REDACTED (10), REDACTED (10), REDACTED (6).+2.4 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.3 ptsMediumWeb-Security Posture

File quality

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

FileScoreBandWorst signal
REDACTED0.0SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED0.0SlopDependency Vulnerabilities: Critical vulnerability: REDACTED
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
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

How the grades work

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

Critical — 321

A definite problem that already costs you something and drags the score down: a missing authorisation check, a dependency with a known exploit, a build that does not reproduce. Failure here tends to cause failures elsewhere.

Serious — 774

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

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

Could not be resolved — 15

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

This survey 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. All 70 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.9, the weighted average across measured dimensions.

Every figure here is one of two 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. 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.

What we checked — 70 dimensions across the health lenses
D1D2D3D4D5D6D10D12D13D14D15D16D17D19D20D21D24D26D28D29D30D31D34D35D36D37D43D44AX10AX3AX4AX8AX9C2DM4DM5DM6M1M2M3M4P1P10P2P3P4P6P7P8PF1PF3R1R10R11R2R3R4R5R6R7R8R9S1X1X14X2X21X28X29X5

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, 1353 of 1421 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 or a scanner, 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
Canine Code Analyzer 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

Every finding is locatable in findings.md. Run 01a1db89-c660-754a-b232-2317dd7b52c0.

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 — We measured this, but not all of it. What we 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 — We 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 — We 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 — We measured this, but not all of it. What we 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 — We measured this, but not all of it. What we 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 — measured, with a gap in what it reached — We measured this, but not all of it. What we 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. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D22 Internal API Consistency — not measured this run — We 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 — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
  • D27 Navigability — not measured this run — We 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.
  • AX6 Interface segregation — not measured this run — We 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 most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • AXR1 Runtime accessibility — not measured this run — We 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 1 — a container did not start, exited, or never became healthy) — container .-dev-liquidity-token-watcher-1 exited (101); runtime evidence skipped.
  • ED5 Idempotency — not measured this run — We 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 — We 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 — We 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 — We measured this, but not all of it. What we 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 — We measured this, but not all of it. What we 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.
  • X12 Unreachable branch — not measured this run — We 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 most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X13 Undrained process stream — not measured this run — We 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 most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X16 Unfloored truncation loop — not measured this run — We 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 most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X19 Unrestored process-global state — not measured this run — We 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 most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X26 Unsynchronised callback handoff — not measured this run — We 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.
  • X3 Exception handling — not measured this run — We 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 most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.

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

We assess the repository exactly as committed, and only the repository. By design we do 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.
  • 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 checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
  • D21 Naming Consistency: Naming consistency compares each name with the convention its structural peers follow in this repository: it cannot tell whether a consistently used name is a good one, and languages other than C# and TypeScript are not measured.
  • D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • 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: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
  • 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.

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.

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).

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

D4 · Code Duplication6.5 / 10Adequate✓ Tool-verified

What it measures: How much of the production code is copy-pasted: the share of production lines inside a reported copy (every copy of a duplicated block or of an edited member, each line once), 10 at none and 0 at a quarter of the lines.

Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), scored on the share of production lines inside a reported copy (each line once; 10 at none, 0 at a quarter). Deterministic.

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

171 duplicated block group(s) detected. 8.7 % of the production lines (8,534 of 98,445) are in a reported copy. A further 101 rows report members as variants of one another; the share counts each copied line once, however many rows cite it.

Duplicated block (9 lines × 2) · ×15core/lib/circuit/src/circuit.rs:607
Duplicated block (12 lines × 2) · ×13core/lib/circuit/src/circuit.rs:544
Duplicated block (10 lines × 2) · ×11core/lib/circuit/src/circuit.rs:1572
Duplicated block (7 lines × 2) · ×11core/lib/circuit/src/witness/full_exit.rs:233
Duplicated block (11 lines × 2) · ×9core/lib/circuit/src/circuit.rs:413

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

What to do

  1. Resolve the 15 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 (15 warning-level).
  2. Resolve the 13 Duplicated block (12 lines × 2) finding(s) in Code Duplication — start with circuit.rs (6), transfer.rs (2), transactions_handler.rs. — One of this dimension's main actionable groups (13 warning-level).
  3. Resolve the 11 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 (11 warning-level).

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).

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).

Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.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).

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, not deprecated, and not bloated. Known vulnerabilities are D30's.

Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (capped-linear for deprecation, prerelease and outdated) per KLoC. Known-vulnerable packages are D30's and are not charged here (rubric-2026.11.2). Exhaustive.

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

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

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

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

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

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

REDACTED scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.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

2 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is core/lib/types/src/tx/change_pubkey.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

✓ 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).

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

D19 · Documentation Quality7.0 / 10Strong✓ Tool-verified

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

1 of 2 documentation facets pass in full; short on: F2 example. 23 document(s) read across 9 unit(s).

Documentation: no build, run or usage example · ×3contracts/README.md:1

What to do

  1. Resolve the 3 Documentation finding(s) in Documentation Quality — start with README.md (3). — One of this dimension's main actionable groups (3 recommendation-level).

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

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

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

Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.

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

No architecture decision records were found.

No ADRs foundcore/bin/zksync_event_listener/src/main.rs:1

What to do

  1. Resolve the 1 No ADRs found finding(s) in ADR Quality — start with main.rs. — 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.

D21 · Naming Consistency7.1 / 10Strong✓ Tool-verified

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

Method: Seven vocabulary-free rules (N1-N7) mine each naming convention from the repository and flag a name that breaks a convention its structural peers in the same unit follow; production C# and TypeScript, each its own population. Deterministic, no model, no sample. Advisory.

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

2 naming inconsistencies among 68 declarations measured against a convention their peers follow.

`mintNft` spells `Nft` where 90 names in the project spell it `NFT`sdk/zksync.js/src/signer.ts:38
`withdrawNft` spells `Nft` where 90 names in the project spell it `NFT`sdk/zksync.js/src/signer.ts:62

What to do

  1. Resolve the 1 `mintNft` spells `Nft` where 90 names in the project spell it `NFT` finding(s) in Naming Consistency — start with signer.ts. — One of this dimension's main actionable groups (1 recommendation-level).
  2. Resolve the 1 `withdrawNft` spells `Nft` where 90 names in the project spell it `NFT` finding(s) in Naming Consistency — start with signer.ts. — One of this dimension's main actionable groups (1 recommendation-level).

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

D24 · Comment Value8.3 8.1 / 10Strong✓ Tool-verified

What it measures: Whether comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).

Method: Every inline C# comment compared word by word with the identifiers, literals and constructs of the code it annotates (taken from the syntax); a comment whose words that code already contains is redundant, as are closing-brace labels and generator template text. Comments giving a reason or a reference are kept; other scripts and languages are not judged. Deterministic, exhaustive, advisory.

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

6 of 344 judged comments only repeat the code they sit on (1.7 %). 7 comment(s) in another language or script were not judged.

redundant comment · ×6contracts/scripts/test-upgrade-franklin.ts:59
doc comments repeat the namessdk/zksync.js/src/utils.ts:284

What to do

  1. Resolve the 6 redundant comment finding(s) in Comment Value — start with test-upgrade-franklin.ts, forced_exit.spec.ts, ownable.spec.js. — One of this dimension's main actionable groups (6 recommendation-level).

Detailed fixes: d24_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.

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

55 finding(s): 0 critical, 55 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 54 REDACTED finding(s) in Secrets (history) — start with REDACTED (10), REDACTED (10), REDACTED (6). — One of this dimension's main actionable groups (54 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.0 / 10Critical✓ Tool-verified

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

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

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

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

44 finding(s): 0 critical, 40 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

+ 9 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 5 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3), REDACTED, REDACTED. — One of this dimension's main actionable groups (5 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. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.

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

336 finding(s): 29 critical, 142 high, 127 medium, 38 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 133 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (70), REDACTED (58), REDACTED (4). — One of this dimension's main actionable groups (133 issue-level).
  2. Resolve the 23 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (11), REDACTED (11), REDACTED. — One of this dimension's main actionable groups (23 issue-level).
  3. Resolve the 9 High vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED (4), REDACTED (3), REDACTED (2). — One of this dimension's main actionable groups (9 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.0 / 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.0 / 10 · rule-coverage 100% · ceiling Documented

221 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 · ×218sdk/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 218 Orphaned file finding(s) in Knowledge Freshness — start with mod.rs (22), lib.rs (10), utils.rs (6). — One of this dimension's main actionable groups (218 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. Reported 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. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.

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

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

REDACTED

What to do

  1. Resolve the 2 Malicious package finding(s) in Malicious Dependencies — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 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.

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).
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)8.6 / 10Strong✓ Tool-verified

Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.

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

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 repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.

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 project's current-state documentation describes the code that exists.

Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.

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

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

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

P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.

Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language's code model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.

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

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

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

  • Only 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.

  • `REDACTED` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`. — REDACTED:30

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 each language's code 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 `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. — REDACTED: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

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.

R10 · Code Duplication3.4 / 10Weak✓ Tool-verified

React / JS · Code Health — The share of the scored frontend lines inside a near-exact copy-pasted block of substantial extent (the D4 clone algorithm over JS/TS tokens, D-386; each line once, 10 at none and 0 at a quarter of the lines, as D4): 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. Scored on the share of the scored frontend lines inside a reported copy, on the same curve as D4. 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 Boundaries2.6 / 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
  • REDACTED:4 imports sdk/zksync.js/src/index.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — REDACTED: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 sdk/zksync.js/src/index.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — 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. — 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; move the shared test helper into a source directory production code may depend on (2 rows).
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
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
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, REDACTED: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. (×7)
  • Declared in core/tests/ts-tests/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
  • Declared in sdk/zksync.js/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.

What to do

  • Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
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
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.

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, got, undici, node:http) 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 })`. — REDACTED: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.

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.

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. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.

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 Health55%Adequate — gated by R10Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture58%Adequate — gated by R11Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity63%Adequate — gated by D34, M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness42%Weak — gated by R8, P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security48%Weak — gated by D28, D29, D31, D36Capped 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 — 62 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.
  • 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
  • AX6 Interface segregation — AX6 reached only 10% of this repository's production lines — rust (88,213 lines), solidity (5,448 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • 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 1 — a container did not start, exited, or never became healthy) — container .-dev-liquidity-token-watcher-1 exited (101); 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.
  • 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+ sibling projects each declaring an entity of their own or taking another project's integration events. 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"]`.
  • 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.
  • 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.
  • 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 — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
  • PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X12 Unreachable branch — X12 reached only 10% of this repository's production lines — rust (88,213 lines), solidity (5,448 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X13 Undrained process stream — X13 reached only 10% of this repository's production lines — rust (88,213 lines), solidity (5,448 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X16 Unfloored truncation loop — X16 reached only 10% of this repository's production lines — rust (88,213 lines), solidity (5,448 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X18 Disposal-pattern correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X19 Unrestored process-global state — X19 reached only 10% of this repository's production lines — rust (88,213 lines), solidity (5,448 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • 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.
  • X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X24 Document value interpolated into markup unescaped — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X25 Inert configuration knob — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • 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
  • X27 Collection changed while being enumerated — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X3 Exception handling — X3 reached only 10% of this repository's production lines — rust (88,213 lines), solidity (5,448 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X30 Support guard that admits what it rejects — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • 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 — 321 finding(s)
D30 · Dependency Vulnerabilities · High CVE · ×133
  • 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
  • + 108 more in this group — see findings.md.
D28 · Secrets (history) · REDACTED · ×54
  • 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
  • + 29 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 · ×23
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · High vulnerability · ×9
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Critical vulnerability · ×6
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • 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 · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×3
  • REDACTED
  • 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 — 774 finding(s)
D30 · Dependency Vulnerabilities · Medium CVE · ×57
  • 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
  • + 32 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 advisory (unmaintained) · ×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.
PF3 · Async & latency hygiene · Sync-over-async blocking · ×33
  • 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 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 REDACTED: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.
  • Sync-over-async blocking infrastructure/zk/src/run/run.ts:107 — `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.
  • Sync-over-async blocking infrastructure/zk/src/run/run.ts:108 — `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.
  • Sync-over-async blocking infrastructure/zk/src/run/run.ts:117 — `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.
  • + 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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) · ×21
  • REDACTED
  • 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 · ×15
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×15
  • 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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/circuit.rs:607` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `core/lib/circuit/src/circuit.rs:2919` calls `extend`, `u8_into_bits_be`, `get_bits_be` and `core/lib/circuit/src/circuit.rs:3874` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/witness/change_pubkey_offchain.rs:79` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) 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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/witness/forced_exit.rs:156` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) 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 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) core/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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/crypto/src/circuit/utils.rs:50` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) 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) 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `sdk/zksync-rs/src/operations/transfer.rs:59` calls `unwrap_or` and `sdk/zksync-rs/src/operations/withdraw.rs:59` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `core/lib/types/src/tx/withdraw_nft.rs:138` calls `extend_from_slice`, `as_be_bytes` and `core/lib/types/src/tx/mint_nft.rs:132` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/storage/src/prover/mod.rs:200` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (9 lines × 2) 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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/circuit.rs:1460` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `core/lib/circuit/src/circuit.rs:3036` calls `get_value` and `core/lib/circuit/src/circuit.rs:1456` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/circuit.rs:1738` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) 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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/signature.rs:66` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
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 (12 lines × 2) · ×13
  • 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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/circuit.rs:544` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/circuit.rs:1955` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `core/lib/circuit/src/circuit.rs:1982` calls `extend`, `get_bits_be` and `core/lib/circuit/src/circuit.rs:1967` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) 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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/circuit.rs:2927` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) 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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/circuit.rs:3131` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `core/lib/circuit/src/circuit.rs:4338` calls `clone` and `core/lib/circuit/src/circuit.rs:3130` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `core/lib/mempool/src/transactions_handler.rs:152` calls `iter` and `core/lib/mempool/src/transactions_handler.rs:51` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/zksync-rs/src/ethereum/mod.rs:250` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) 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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/types/src/block/mod.rs:506` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) 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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/witness/transfer_to_new.rs:188` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) 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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/circuit.rs:302` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) core/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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/circuit.rs:1827` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×11
  • 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `core/lib/circuit/src/circuit.rs:1569` calls `extend`, `get_bits_be` and `core/lib/circuit/src/circuit.rs:2588` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 2) 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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/circuit.rs:2359` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `val` to `StorageMintNFTUpdate` in one and `StorageNFT` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/storage/src/chain/operations_ext/mod.rs:1899` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/types/src/tx/mint_nft.rs:204` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) 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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/types/src/tx/transfer.rs:307` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) 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 5 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/zksync-rs/src/operations/mint_nft.rs:49` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) core/lib/types/src/operations/full_exit_op.rs:90 — core/lib/types/src/operations/full_exit_op.rs:90-99 | core/lib/types/src/operations/full_exit_op.rs:132-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 (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) · ×11
  • 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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/eth_signer/src/json_rpc_signer.rs:70` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/eth_signer/src/json_rpc_signer.rs:70` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) core/lib/types/src/operations/mod.rs:224 — core/lib/types/src/operations/mod.rs:224-230 | core/lib/types/src/operations/mod.rs:245-251 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/types/src/operations/mod.rs:224` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `core/lib/types/src/priority_ops/mod.rs:200` calls `from_slice` and `core/lib/types/src/priority_ops/mod.rs:133` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/types/src/tx/change_pubkey.rs:293` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `core/lib/types/src/tx/swap.rs:289` calls `rescue_hash_orders` and `core/lib/types/src/tx/swap.rs:273` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 2) core/lib/circuit/src/circuit.rs:1353 — core/lib/circuit/src/circuit.rs:1353-1359 | core/lib/circuit/src/circuit.rs:1368-1374 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `core/lib/circuit/src/circuit.rs:1375` calls `extend`, `get_bits_be` and `core/lib/circuit/src/circuit.rs:1360` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (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) · ×9
  • 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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/circuit.rs:413` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 2) 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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/witness/forced_exit.rs:355` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `core/lib/circuit/src/witness/forced_exit.rs:366` calls `Some` and `core/lib/circuit/src/witness/withdraw.rs:259` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/witness/utils.rs:164` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) 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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/storage/src/chain/account/mod.rs:495` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/storage/src/chain/operations/mod.rs:198` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 2) 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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/storage/src/chain/operations_ext/mod.rs:234` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/zksync-rs/src/ethereum/priority_op_handle.rs:93` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) core/lib/circuit/src/witness/swap.rs:75 — core/lib/circuit/src/witness/swap.rs:75-85 | core/lib/circuit/src/witness/swap.rs:87-97 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/utils.rs:252` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
R11 · Import Boundaries · Boundary violation [package · ×9
  • 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:test-suite-dependency] REDACTED:4 — REDACTED:4 imports sdk/zksync.js/src/index.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
  • 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:test-suite-dependency] infrastructure/api-docs/src/compile.ts:4 — infrastructure/api-docs/src/compile.ts:4 imports sdk/zksync.js/src/index.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
  • 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.
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.
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.
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
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (15 corresponding lines) · ×6
  • Edited copy of a member (15 corresponding lines) core/lib/types/src/operations/mod.rs:223 — core/lib/types/src/operations/mod.rs:223-240 | core/lib/types/src/operations/mod.rs:244-258 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) core/lib/storage/src/chain/tree_cache/bincode_schema.rs:53 — core/lib/storage/src/chain/tree_cache/bincode_schema.rs:53-74 | core/lib/storage/src/chain/tree_cache/json_schema.rs:53-67 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) sdk/zksync-rs/src/ethereum/mod.rs:129 — sdk/zksync-rs/src/ethereum/mod.rs:129-149 | sdk/zksync-rs/src/ethereum/mod.rs:173-187 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) core/lib/storage/src/chain/mempool/mod.rs:275 — core/lib/storage/src/chain/mempool/mod.rs:275-289 | core/lib/storage/src/chain/mempool/mod.rs:291-305 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) core/lib/types/src/tx/transfer.rs:216 — core/lib/types/src/tx/transfer.rs:216-230 | core/lib/types/src/tx/withdraw.rs:217-231 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) core/lib/storage/src/chain/mempool/mod.rs:573 — core/lib/storage/src/chain/mempool/mod.rs:573-587 | core/lib/storage/src/withdrawals/mod.rs:132-158 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/witness/change_pubkey_offchain.rs:168` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) 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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/storage/src/chain/state/mod.rs:73` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (15 lines × 2) 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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/types/src/tx/mint_nft.rs:101` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) 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 (8 lines × 2) · ×5
  • 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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/witness/close_account.rs:75` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) 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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/witness/close_account.rs:81` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) 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/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.
D4 · Code Duplication · Edited copy of a member (21 corresponding lines) · ×4
  • Edited copy of a member (21 corresponding lines) core/lib/types/src/tx/zksync_tx.rs:277 — core/lib/types/src/tx/zksync_tx.rs:277-297 | core/lib/types/src/tx/zksync_tx.rs:317-342 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) core/lib/l1_event_listener/src/events_state.rs:327 — core/lib/l1_event_listener/src/events_state.rs:327-347 | core/lib/l1_event_listener/src/events_state.rs:489-511 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) sdk/zksync-rs/src/ethereum/priority_op_handle.rs:92 — sdk/zksync-rs/src/ethereum/priority_op_handle.rs:92-112 | sdk/zksync-rs/src/operations/mod.rs:104-124 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) core/lib/storage/src/tokens/mod.rs:495 — core/lib/storage/src/tokens/mod.rs:495-516 | core/lib/storage/src/tokens/mod.rs:548-568 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (17 corresponding lines) · ×4
  • Edited copy of a member (17 corresponding lines) core/lib/circuit/src/witness/forced_exit.rs:63 — core/lib/circuit/src/witness/forced_exit.rs:63-86 | core/lib/circuit/src/witness/withdraw.rs:57-73 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) core/lib/circuit/src/element.rs:207 — core/lib/circuit/src/element.rs:207-225 | core/lib/circuit/src/element.rs:233-249 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) core/lib/crypto/src/circuit/utils.rs:49 — core/lib/crypto/src/circuit/utils.rs:49-66 | core/lib/crypto/src/primitives.rs:134-150 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) core/lib/types/src/tx/change_pubkey.rs:470 — core/lib/types/src/tx/change_pubkey.rs:470-486 | core/lib/types/src/tx/forced_exit.rs:176-193 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (14 corresponding lines) · ×4
  • Edited copy of a member (14 corresponding lines) core/lib/circuit/src/witness/transfer.rs:63 — core/lib/circuit/src/witness/transfer.rs:63-76 | core/lib/circuit/src/witness/transfer_to_new.rs:62-76 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) core/lib/storage/src/prover/mod.rs:291 — core/lib/storage/src/prover/mod.rs:291-304 | core/lib/storage/src/prover/mod.rs:311-325 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) core/lib/storage/src/chain/operations_ext/mod.rs:621 — core/lib/storage/src/chain/operations_ext/mod.rs:621-666 | core/lib/storage/src/prover/mod.rs:354-367 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) core/lib/storage/src/chain/account/mod.rs:200 — core/lib/storage/src/chain/account/mod.rs:200-217 | core/lib/storage/src/chain/operations_ext/mod.rs:383-396 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (9 corresponding lines) · ×4
  • Edited copy of a member (9 corresponding lines) core/lib/crypto/src/serialization.rs:140 — core/lib/crypto/src/serialization.rs:140-152 | core/lib/crypto/src/serialization.rs:187-195 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) core/lib/crypto/src/primitives.rs:377 — core/lib/crypto/src/primitives.rs:377-386 | sdk/zksync-crypto/src/utils.rs:100-108 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) core/lib/prover_utils/src/fs_utils.rs:11 — core/lib/prover_utils/src/fs_utils.rs:11-21 | core/lib/prover_utils/src/fs_utils.rs:23-31 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) core/lib/storage/src/chain/mempool/mod.rs:502 — core/lib/storage/src/chain/mempool/mod.rs:502-510 | core/lib/storage/src/chain/state/mod.rs:224-232 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · 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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/circuit.rs:1711` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (17 lines × 2) 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. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/zksync-rs/src/operations/transfer.rs:63` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `sdk/zksync-rs/src/operations/transfer.rs:59` calls `unwrap_or` and `sdk/zksync-rs/src/operations/withdraw.rs:57` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×4
  • 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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/circuit.rs:3914` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) core/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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/witness/forced_exit.rs:137` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/types/src/tx/forced_exit.rs:79` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) 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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/circuit.rs:3361` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/storage/src/chain/mempool/mod.rs:167` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/circuit.rs:3426` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/storage/src/event/mod.rs:239` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×4
  • 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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/witness/forced_exit.rs:158` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) core/lib/storage/src/chain/account/records.rs:56 — core/lib/storage/src/chain/account/records.rs:56-63 | core/lib/storage/src/tokens/records.rs:123-130 | core/lib/storage/src/tokens/records.rs:141-148 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/storage/src/chain/account/records.rs:56` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `val` to `StorageMintNFTUpdate` in one and `StorageNFT` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `core/lib/storage/src/tokens/records.rs:149` calls `from_str`, `unwrap` and `core/lib/storage/src/chain/account/records.rs:64` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/types/src/tx/transfer.rs:115` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/circuit.rs:1653` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `core/lib/circuit/src/circuit.rs:2788` calls `push`, `multi_and`, `namespace` and `core/lib/circuit/src/circuit.rs:1651` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×4
  • 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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/crypto/src/primitives.rs:135` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `x` to `&P` in one and `&Fr` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (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_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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/eth_signer/src/json_rpc_signer.rs:405` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
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 · Edited copies of one member (3 members, 14+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 14+ corresponding lines) core/lib/types/src/tx/change_pubkey.rs:286 — core/lib/types/src/tx/change_pubkey.rs:286-299 | core/lib/types/src/tx/transfer.rs:150-168 | core/lib/types/src/tx/withdraw.rs:131-147 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) core/lib/crypto/src/circuit/utils.rs:83 — core/lib/crypto/src/circuit/utils.rs:83-100 | sdk/zksync-crypto/src/utils.rs:36-49 | sdk/zksync-crypto/src/utils.rs:51-64 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) core/lib/types/src/tx/change_pubkey.rs:249 — core/lib/types/src/tx/change_pubkey.rs:249-265 | core/lib/types/src/tx/forced_exit.rs:104-117 | core/lib/types/src/tx/swap.rs:139-154 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (19 corresponding lines) · ×3
  • Edited copy of a member (19 corresponding lines) core/lib/circuit/src/utils.rs:238 — core/lib/circuit/src/utils.rs:238-262 | core/lib/circuit/src/utils.rs:284-302 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) core/lib/storage/src/chain/operations_ext/mod.rs:1896 — core/lib/storage/src/chain/operations_ext/mod.rs:1896-1914 | core/lib/storage/src/chain/operations_ext/mod.rs:1920-1938 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) core/lib/types/src/tx/mint_nft.rs:150 — core/lib/types/src/tx/mint_nft.rs:150-168 | core/lib/types/src/tx/withdraw_nft.rs:156-176 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (11 corresponding lines) · ×3
  • Edited copy of a member (11 corresponding lines) core/lib/types/src/tx/swap.rs:264 — core/lib/types/src/tx/swap.rs:264-274 | core/lib/types/src/tx/swap.rs:280-291 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) core/lib/crypto/src/primitives.rs:173 — core/lib/crypto/src/primitives.rs:173-183 | sdk/zksync-crypto/src/utils.rs:24-34 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) sdk/zksync-rs/src/operations/change_pubkey.rs:32 — sdk/zksync-rs/src/operations/change_pubkey.rs:32-42 | sdk/zksync-rs/src/operations/withdraw_nft.rs:32-43 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (23 lines × 2) · ×3
  • 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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/circuit.rs:4707` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (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.
  • Duplicated block (23 lines × 2) core/lib/circuit/src/witness/transfer.rs:134 — core/lib/circuit/src/witness/transfer.rs:134-156 | core/lib/circuit/src/witness/transfer_to_new.rs:140-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 6 separate duplicated blocks between them, totalling at least 145 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/witness/transfer.rs:134` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/types/src/priority_ops/mod.rs:186` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/zksync-rs/src/operations/transfer.rs:56` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (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 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/witness/mint_nft.rs:439` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `core/lib/circuit/src/witness/withdraw_nft.rs:390` calls `Some`, `fr_from` and `core/lib/circuit/src/witness/mint_nft.rs:437` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×3
  • 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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/circuit.rs:3778` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/circuit.rs:3941` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×3
  • 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `core/lib/circuit/src/circuit.rs:3948` calls `push`, `clone` and `core/lib/circuit/src/circuit.rs:1498` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/utils.rs:165` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `bits` to `&[bool]` in one and `Vec<bool>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (7 lines × 4) core/lib/circuit/src/circuit.rs:2906 — core/lib/circuit/src/circuit.rs:2906-2912 | core/lib/circuit/src/circuit.rs:2921-2927 | core/lib/circuit/src/circuit.rs:3861-3867 | core/lib/circuit/src/circuit.rs:3876-3882 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `core/lib/circuit/src/circuit.rs:2928` calls `extend`, `get_bits_be` and `core/lib/circuit/src/circuit.rs:2913` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
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 REDACTED: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 })`.
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 · Edited copy of a member (43 corresponding lines) · ×2
  • Edited copy of a member (43 corresponding lines) core/lib/types/src/operations/forced_exit.rs:73 — core/lib/types/src/operations/forced_exit.rs:73-117 | core/lib/types/src/operations/full_exit_op.rs:78-120 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (43 corresponding lines) sdk/zksync-rs/src/ethereum/mod.rs:249 — sdk/zksync-rs/src/ethereum/mod.rs:249-296 | sdk/zksync-rs/src/ethereum/mod.rs:304-346 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (33 corresponding lines) · ×2
  • Edited copy of a member (33 corresponding lines) core/lib/storage/src/chain/operations_ext/mod.rs:1544 — core/lib/storage/src/chain/operations_ext/mod.rs:1544-1579 | core/lib/storage/src/chain/operations_ext/mod.rs:1581-1613 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (33 corresponding lines) core/lib/storage/src/chain/operations_ext/mod.rs:1174 — core/lib/storage/src/chain/operations_ext/mod.rs:1174-1231 | core/lib/storage/src/chain/operations_ext/mod.rs:1240-1272 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (27 corresponding lines) · ×2
  • Edited copy of a member (27 corresponding lines) sdk/zksync-rs/src/ethereum/mod.rs:415 — sdk/zksync-rs/src/ethereum/mod.rs:415-444 | sdk/zksync-rs/src/ethereum/mod.rs:451-477 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) core/lib/storage/src/chain/operations_ext/mod.rs:1972 — core/lib/storage/src/chain/operations_ext/mod.rs:1972-2003 | core/lib/storage/src/chain/operations_ext/mod.rs:2006-2032 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (23 corresponding lines) · ×2
  • Edited copy of a member (23 corresponding lines) core/lib/types/src/tx/mint_nft.rs:191 — core/lib/types/src/tx/mint_nft.rs:191-213 | core/lib/types/src/tx/withdraw_nft.rs:200-230 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) core/lib/storage/src/forced_exit_requests/mod.rs:169 — core/lib/storage/src/forced_exit_requests/mod.rs:169-191 | core/lib/storage/src/tokens/mod.rs:207-231 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (25 corresponding lines) · ×2
  • Edited copy of a member (25 corresponding lines) core/lib/mempool/src/state.rs:24 — core/lib/mempool/src/state.rs:24-49 | core/lib/mempool/src/state.rs:50-74 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) core/lib/storage/src/chain/tree_cache/json_schema.rs:74 — core/lib/storage/src/chain/tree_cache/json_schema.rs:74-108 | core/lib/storage/src/chain/tree_cache/json_schema.rs:115-139 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (12 corresponding lines) · ×2
  • Edited copy of a member (12 corresponding lines) core/lib/utils/src/serde_wrappers.rs:167 — core/lib/utils/src/serde_wrappers.rs:167-178 | core/lib/utils/src/serde_wrappers.rs:207-224 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) core/lib/circuit/src/utils.rs:311 — core/lib/circuit/src/utils.rs:311-322 | core/lib/circuit/src/utils.rs:331-342 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (8 corresponding lines) · ×2
  • Edited copy of a member (8 corresponding lines) core/lib/types/src/operations/forced_exit.rs:52 — core/lib/types/src/operations/forced_exit.rs:52-59 | core/lib/types/src/operations/withdraw_op.rs:40-47 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) core/lib/storage/src/data_restore/mod.rs:419 — core/lib/storage/src/data_restore/mod.rs:419-431 | core/lib/storage/src/ethereum/mod.rs:477-484 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (10 corresponding lines) · ×2
  • Edited copy of a member (10 corresponding lines) core/lib/storage/src/chain/block/mod.rs:592 — core/lib/storage/src/chain/block/mod.rs:592-601 | core/lib/storage/src/chain/operations/mod.rs:35-52 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) core/lib/storage/src/chain/mempool/records.rs:74 — core/lib/storage/src/chain/mempool/records.rs:74-83 | core/lib/storage/src/chain/operations/records.rs:29-38 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (13 corresponding lines) · ×2
  • Edited copy of a member (13 corresponding lines) core/lib/storage/src/chain/stats.rs:17 — core/lib/storage/src/chain/stats.rs:17-30 | core/lib/storage/src/prover/mod.rs:27-39 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) core/lib/circuit/src/circuit.rs:4650 — core/lib/circuit/src/circuit.rs:4650-4663 | core/lib/circuit/src/utils.rs:201-213 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 12+ corresponding lines) · ×2
  • Edited copies of one member (5 members, 12+ corresponding lines) core/lib/storage/src/prover/mod.rs:137 — core/lib/storage/src/prover/mod.rs:137-151 | core/lib/storage/src/prover/mod.rs:154-169 | core/lib/storage/src/prover/mod.rs:412-423 | core/lib/storage/src/prover/mod.rs:426-437 | core/lib/storage/src/prover/mod.rs:440-451 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
  • Edited copies of one member (5 members, 12+ corresponding lines) core/lib/types/src/tx/change_pubkey.rs:565 — core/lib/types/src/tx/change_pubkey.rs:565-576 | core/lib/types/src/tx/forced_exit.rs:262-273 | core/lib/types/src/tx/transfer.rs:306-320 | core/lib/types/src/tx/withdraw.rs:307-320 | core/lib/types/src/tx/withdraw_nft.rs:245-256 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/witness/deposit.rs:64` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/crypto/src/primitives.rs:294` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
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 53 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 6 separate duplicated blocks between them, totalling at least 145 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/witness/transfer_to_new.rs:200` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `core/lib/circuit/src/circuit.rs:1569` calls `extend`, `get_bits_be` and `core/lib/circuit/src/circuit.rs:2589` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/zksync-rs/src/operations/change_pubkey.rs:68` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `sdk/zksync-rs/src/operations/change_pubkey.rs:86` calls `default`, `Ok`, `from` and `sdk/zksync-rs/src/operations/mint_nft.rs:77` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/circuit.rs:1461` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11–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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/circuit.rs:2460` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12–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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/crypto/src/primitives.rs:158` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `bits` to `Vec<bool>` in one and `&[bool]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/circuit.rs:1491` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11–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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/circuit.rs:2462` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `core/lib/circuit/src/circuit.rs:4248` calls `push`, `clone` and `core/lib/circuit/src/circuit.rs:3995` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10–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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/witness/utils.rs:780` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/witness/utils.rs:853` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/circuit.rs:1685` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `core/lib/circuit/src/circuit.rs:2473` calls `push`, `clone` and `core/lib/circuit/src/circuit.rs:1696` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/circuit.rs:1585` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/circuit.rs:1403` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8–9 lines × 2) · ×2
  • 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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/storage/src/chain/block/mod.rs:1186` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `query` to `&PaginationQuery<BlockAndTxHash>` in one and `&PaginationQuery<AccountTxsRequest>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (8–9 lines × 2) core/lib/circuit/src/circuit.rs:1310 — core/lib/circuit/src/circuit.rs:1310-1318 | core/lib/circuit/src/circuit.rs:4098-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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/circuit.rs:1310` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `core/lib/circuit/src/circuit.rs:4097` calls `extend`, `get_bits_be` and `core/lib/circuit/src/circuit.rs:1309` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×2
  • 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (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.
D43 · Malicious Dependencies · Malicious package · ×2
  • REDACTED
  • REDACTED
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 · Edited copy of a member (112 corresponding lines) · ×1
  • Edited copy of a member (112 corresponding lines) core/lib/types/src/priority_ops/mod.rs:115 — core/lib/types/src/priority_ops/mod.rs:115-226 | core/lib/types/src/priority_ops/mod.rs:233-348 — These two members are one piece of code written twice and then edited apart: 112 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (81 corresponding lines) · ×1
  • Edited copy of a member (81 corresponding lines) core/lib/circuit/src/circuit.rs:4671 — core/lib/circuit/src/circuit.rs:4671-4759 | core/lib/circuit/src/circuit.rs:4766-4846 — These two members are one piece of code written twice and then edited apart: 81 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (133 corresponding lines) · ×1
  • Edited copy of a member (133 corresponding lines) core/lib/storage/src/chain/operations_ext/mod.rs:675 — core/lib/storage/src/chain/operations_ext/mod.rs:675-807 | core/lib/storage/src/chain/operations_ext/mod.rs:869-1049 — These two members are one piece of code written twice and then edited apart: 133 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (59 corresponding lines) · ×1
  • Edited copy of a member (59 corresponding lines) core/lib/crypto/src/serialization.rs:270 — core/lib/crypto/src/serialization.rs:270-330 | core/lib/crypto/src/serialization.rs:334-392 — These two members are one piece of code written twice and then edited apart: 59 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (93 corresponding lines) · ×1
  • Edited copy of a member (93 corresponding lines) core/lib/storage/src/chain/account/mod.rs:225 — core/lib/storage/src/chain/account/mod.rs:225-328 | core/lib/storage/src/chain/state/mod.rs:350-442 — These two members are one piece of code written twice and then edited apart: 93 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (31 corresponding lines) · ×1
  • Edited copy of a member (31 corresponding lines) core/lib/types/src/operations/mod.rs:149 — core/lib/types/src/operations/mod.rs:149-184 | core/lib/types/src/operations/mod.rs:190-220 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (51 corresponding lines) · ×1
  • Edited copy of a member (51 corresponding lines) core/lib/crypto/src/primitives.rs:251 — core/lib/crypto/src/primitives.rs:251-314 | core/lib/crypto/src/primitives.rs:324-374 — These two members are one piece of code written twice and then edited apart: 51 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 47+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 47+ corresponding lines) core/lib/types/src/operations/mint_nft_op.rs:38 — core/lib/types/src/operations/mint_nft_op.rs:38-93 | core/lib/types/src/operations/transfer_op.rs:51-98 | core/lib/types/src/operations/transfer_to_new_op.rs:52-100 | core/lib/types/src/operations/withdraw_op.rs:61-107 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 47 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 42+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 42+ corresponding lines) sdk/zksync-rs/src/operations/mint_nft.rs:42 — sdk/zksync-rs/src/operations/mint_nft.rs:42-83 | sdk/zksync-rs/src/operations/transfer.rs:49-99 | sdk/zksync-rs/src/operations/withdraw.rs:48-99 | sdk/zksync-rs/src/operations/withdraw_nft.rs:46-97 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 42 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (50 corresponding lines) · ×1
  • Edited copy of a member (50 corresponding lines) core/lib/circuit/src/witness/full_exit.rs:86 — core/lib/circuit/src/witness/full_exit.rs:86-135 | core/lib/circuit/src/witness/withdraw_nft.rs:85-142 — These two members are one piece of code written twice and then edited apart: 50 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 34+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 34+ corresponding lines) core/lib/types/src/tx/forced_exit.rs:214 — core/lib/types/src/tx/forced_exit.rs:214-247 | core/lib/types/src/tx/transfer.rs:246-288 | core/lib/types/src/tx/withdraw.rs:248-290 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 34 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (36 corresponding lines) · ×1
  • Edited copy of a member (36 corresponding lines) core/lib/storage/src/prover/mod.rs:177 — core/lib/storage/src/prover/mod.rs:177-212 | core/lib/storage/src/prover/mod.rs:249-285 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (34 corresponding lines) · ×1
  • Edited copy of a member (34 corresponding lines) core/lib/types/src/tx/primitives/eip712_signature/struct_builder.rs:98 — core/lib/types/src/tx/primitives/eip712_signature/struct_builder.rs:98-131 | core/lib/types/src/tx/primitives/eip712_signature/struct_builder.rs:137-170 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (40 corresponding lines) · ×1
  • Edited copy of a member (40 corresponding lines) core/lib/mempool/src/transactions_handler.rs:45 — core/lib/mempool/src/transactions_handler.rs:45-84 | core/lib/mempool/src/transactions_handler.rs:92-134 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (18 corresponding lines) · ×1
  • Edited copy of a member (18 corresponding lines) core/lib/types/src/gas_counter.rs:48 — core/lib/types/src/gas_counter.rs:48-83 | core/lib/types/src/gas_counter.rs:113-130 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 35+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 35+ corresponding lines) core/lib/circuit/src/witness/change_pubkey_offchain.rs:78 — core/lib/circuit/src/witness/change_pubkey_offchain.rs:78-118 | core/lib/circuit/src/witness/forced_exit.rs:88-128 | core/lib/circuit/src/witness/mint_nft.rs:81-115 | core/lib/circuit/src/witness/transfer.rs:78-115 | core/lib/circuit/src/witness/transfer_to_new.rs:78-121 | core/lib/circuit/src/witness/withdraw.rs:75-112 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 35 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (29 corresponding lines) · ×1
  • Edited copy of a member (29 corresponding lines) core/lib/storage/src/event/mod.rs:212 — core/lib/storage/src/event/mod.rs:212-251 | core/lib/storage/src/event/mod.rs:261-289 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (20 corresponding lines) · ×1
  • Edited copy of a member (20 corresponding lines) core/lib/circuit/src/utils.rs:48 — core/lib/circuit/src/utils.rs:48-67 | core/lib/circuit/src/utils.rs:78-104 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (22 corresponding lines) · ×1
  • Edited copy of a member (22 corresponding lines) core/lib/eth_signer/src/json_rpc_signer.rs:304 — core/lib/eth_signer/src/json_rpc_signer.rs:304-325 | sdk/zksync-rs/src/provider.rs:290-311 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (16 corresponding lines) · ×1
  • Edited copy of a member (16 corresponding lines) core/lib/crypto/src/merkle_tree/parallel_smt.rs:487 — core/lib/crypto/src/merkle_tree/parallel_smt.rs:487-502 | core/lib/crypto/src/merkle_tree/parallel_smt.rs:725-756 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (32 corresponding lines) · ×1
  • Edited copy of a member (32 corresponding lines) core/lib/storage/src/chain/operations_ext/mod.rs:59 — core/lib/storage/src/chain/operations_ext/mod.rs:59-90 | core/lib/storage/src/chain/operations_ext/mod.rs:346-381 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 75+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 75+ corresponding lines) core/lib/storage/src/chain/operations_ext/mod.rs:92 — core/lib/storage/src/chain/operations_ext/mod.rs:92-170 | core/lib/storage/src/chain/operations_ext/mod.rs:176-250 | core/lib/storage/src/chain/operations_ext/mod.rs:252-341 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 75 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (26 corresponding lines) · ×1
  • Edited copy of a member (26 corresponding lines) core/lib/storage/src/chain/account/mod.rs:86 — core/lib/storage/src/chain/account/mod.rs:86-112 | core/lib/storage/src/chain/block/mod.rs:1362-1387 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (7 members, 12+ corresponding lines) · ×1
  • Edited copies of one member (7 members, 12+ corresponding lines) core/lib/types/src/tx/change_pubkey.rs:306 — core/lib/types/src/tx/change_pubkey.rs:306-319 | core/lib/types/src/tx/forced_exit.rs:137-148 | core/lib/types/src/tx/mint_nft.rs:122-134 | core/lib/types/src/tx/swap.rs:295-308 | core/lib/types/src/tx/transfer.rs:129-143 | core/lib/types/src/tx/withdraw.rs:154-169 | core/lib/types/src/tx/withdraw_nft.rs:127-140 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 18+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 18+ corresponding lines) core/lib/storage/src/chain/mempool/mod.rs:124 — core/lib/storage/src/chain/mempool/mod.rs:124-142 | core/lib/storage/src/data_restore/mod.rs:133-153 | core/lib/storage/src/data_restore/mod.rs:433-450 | core/lib/storage/src/data_restore/mod.rs:455-473 | core/lib/storage/src/ethereum/mod.rs:700-720 | core/lib/storage/src/prover/mod.rs:454-474 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 10+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 10+ corresponding lines) core/lib/types/src/operations/change_pubkey_op.rs:28 — core/lib/types/src/operations/change_pubkey_op.rs:28-38 | core/lib/types/src/operations/forced_exit.rs:40-50 | core/lib/types/src/operations/mint_nft_op.rs:27-36 | core/lib/types/src/operations/transfer_op.rs:28-37 | core/lib/types/src/operations/transfer_to_new_op.rs:28-38 | core/lib/types/src/operations/withdraw_op.rs:29-38 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 21+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 21+ corresponding lines) core/lib/storage/src/chain/block/mod.rs:1517 — core/lib/storage/src/chain/block/mod.rs:1517-1549 | core/lib/storage/src/tokens/mod.rs:133-153 | core/lib/storage/src/tokens/mod.rs:160-180 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 10+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 10+ corresponding lines) core/lib/storage/src/chain/account/mod.rs:412 — core/lib/storage/src/chain/account/mod.rs:412-431 | core/lib/storage/src/chain/account/mod.rs:436-449 | core/lib/storage/src/chain/account/mod.rs:578-595 | core/lib/storage/src/chain/block/mod.rs:1503-1512 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 16+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 16+ corresponding lines) core/lib/storage/src/chain/state/mod.rs:695 — core/lib/storage/src/chain/state/mod.rs:695-710 | core/lib/storage/src/tokens/mod.rs:362-379 | core/lib/storage/src/tokens/mod.rs:384-409 | core/lib/storage/src/tokens/mod.rs:470-489 | core/lib/storage/src/tokens/mod.rs:522-538 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 24+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 24+ corresponding lines) core/lib/storage/src/chain/tree_cache/bincode_schema.rs:23 — core/lib/storage/src/chain/tree_cache/bincode_schema.rs:23-47 | core/lib/storage/src/chain/tree_cache/json_schema.rs:23-47 | core/lib/storage/src/event/mod.rs:47-70 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 13+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 13+ corresponding lines) core/lib/eth_client/src/clients/http_client.rs:96 — core/lib/eth_client/src/clients/http_client.rs:96-108 | core/lib/eth_client/src/clients/http_client.rs:110-122 | core/lib/eth_client/src/clients/http_client.rs:237-249 | core/lib/eth_client/src/clients/http_client.rs:506-518 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 8+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 8+ corresponding lines) core/lib/eth_client/src/clients/http_client.rs:127 — core/lib/eth_client/src/clients/http_client.rs:127-134 | core/lib/eth_client/src/clients/http_client.rs:254-261 | core/lib/eth_client/src/clients/http_client.rs:415-423 | core/lib/eth_client/src/clients/http_client.rs:467-474 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 16+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 16+ corresponding lines) core/lib/types/src/tx/forced_exit.rs:77 — core/lib/types/src/tx/forced_exit.rs:77-92 | core/lib/types/src/tx/transfer.rs:83-100 | core/lib/types/src/tx/withdraw.rs:84-102 | core/lib/types/src/tx/withdraw_nft.rs:80-98 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 15+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 15+ corresponding lines) core/lib/storage/src/ethereum/mod.rs:279 — core/lib/storage/src/ethereum/mod.rs:279-293 | core/lib/storage/src/forced_exit_requests/mod.rs:66-87 | core/lib/storage/src/forced_exit_requests/mod.rs:115-139 | core/lib/storage/src/tokens/mod.rs:329-343 | core/lib/storage/src/tokens/mod.rs:346-360 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 17+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 17+ corresponding lines) core/lib/storage/src/ethereum/mod.rs:332 — core/lib/storage/src/ethereum/mod.rs:332-349 | core/lib/storage/src/ethereum/mod.rs:426-446 | core/lib/storage/src/forced_exit_requests/mod.rs:145-164 | core/lib/storage/src/forced_exit_requests/mod.rs:198-219 | core/lib/storage/src/prover/mod.rs:332-348 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 13+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 13+ corresponding lines) core/lib/storage/src/chain/operations/mod.rs:146 — core/lib/storage/src/chain/operations/mod.rs:146-164 | core/lib/storage/src/config/mod.rs:40-54 | core/lib/storage/src/ethereum/mod.rs:311-323 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 15+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 15+ corresponding lines) core/lib/storage/src/chain/block/mod.rs:232 — core/lib/storage/src/chain/block/mod.rs:232-287 | core/lib/storage/src/chain/block/mod.rs:357-414 | core/lib/storage/src/chain/block/mod.rs:421-478 | core/lib/storage/src/chain/operations_ext/mod.rs:1831-1890 | core/lib/storage/src/data_restore/mod.rs:395-409 | core/lib/storage/src/event/mod.rs:73-95 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 15+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 15+ corresponding lines) core/lib/storage/src/chain/mempool/mod.rs:342 — core/lib/storage/src/chain/mempool/mod.rs:342-358 | core/lib/storage/src/chain/operations/mod.rs:83-97 | core/lib/storage/src/chain/operations_ext/mod.rs:1764-1825 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (7 members, 14+ corresponding lines) · ×1
  • Edited copies of one member (7 members, 14+ corresponding lines) core/lib/storage/src/chain/block/mod.rs:131 — core/lib/storage/src/chain/block/mod.rs:131-144 | core/lib/storage/src/chain/block/mod.rs:192-210 | core/lib/storage/src/chain/block/mod.rs:1063-1079 | core/lib/storage/src/chain/operations/mod.rs:103-118 | core/lib/storage/src/chain/operations_ext/mod.rs:1368-1401 | core/lib/storage/src/chain/state/mod.rs:716-735 | core/lib/storage/src/chain/state/mod.rs:737-754 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 11+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 11+ corresponding lines) core/lib/storage/src/chain/block/mod.rs:853 — core/lib/storage/src/chain/block/mod.rs:853-866 | core/lib/storage/src/chain/mempool/mod.rs:601-611 | core/lib/storage/src/tokens/mod.rs:313-326 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 9+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 9+ corresponding lines) core/lib/storage/src/config/mod.rs:22 — core/lib/storage/src/config/mod.rs:22-30 | core/lib/storage/src/data_restore/mod.rs:158-172 | core/lib/storage/src/ethereum/mod.rs:296-308 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (4 corresponding lines) · ×1
  • Edited copy of a member (4 corresponding lines) core/lib/types/src/tx/primitives/packed_public_key.rs:45 — core/lib/types/src/tx/primitives/packed_public_key.rs:45-48 | core/lib/types/src/tx/primitives/packed_signature.rs:72-75 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · 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 6 separate duplicated blocks between them, totalling at least 145 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/witness/transfer.rs:257` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (63–64 lines × 2) · ×1
  • Duplicated block (63–64 lines × 2) core/lib/circuit/src/circuit.rs:2386 — core/lib/circuit/src/circuit.rs:2386-2448 | core/lib/circuit/src/circuit.rs:2696-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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/circuit.rs:2386` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/storage/src/chain/operations_ext/mod.rs:760` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/circuit.rs:1987` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (36 lines × 2) · ×1
  • Duplicated block (36 lines × 2) core/lib/circuit/src/circuit.rs:4672 — core/lib/circuit/src/circuit.rs:4672-4707 | core/lib/circuit/src/circuit.rs:4767-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.
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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (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 6 separate duplicated blocks between them, totalling at least 145 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/witness/transfer_to_new.rs:236` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/types/src/priority_ops/mod.rs:142` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/circuit.rs:1585` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `core/lib/circuit/src/witness/forced_exit.rs:210` calls `fr_from` and `core/lib/circuit/src/witness/withdraw.rs:171` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/zksync-rs/src/signer.rs:216` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `core/lib/circuit/src/circuit.rs:2590` calls `extend`, `get_bits_be` and `core/lib/circuit/src/circuit.rs:2282` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/witness/forced_exit.rs:105` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/types/src/tx/forced_exit.rs:228` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (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 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/witness/full_exit.rs:108` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (18–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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/storage/src/chain/state/mod.rs:402` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/circuit.rs:3071` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `core/lib/circuit/src/circuit.rs:4248` calls `push`, `clone` and `core/lib/circuit/src/circuit.rs:3995` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/circuit.rs:2872` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/circuit.rs:1602` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/crypto/src/merkle_tree/parallel_smt.rs:491` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15–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 6 separate duplicated blocks between them, totalling at least 145 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/witness/transfer.rs:80` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15 lines × 4) · ×1
  • Duplicated block (15 lines × 4) core/lib/circuit/src/exit_circuit.rs:302 — core/lib/circuit/src/exit_circuit.rs:302-316 | core/lib/circuit/src/witness/full_exit.rs:304-318 | core/lib/circuit/src/witness/mint_nft.rs:410-424 | core/lib/circuit/src/witness/withdraw_nft.rs:364-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 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/exit_circuit.rs:302` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `sdk/zksync-rs/src/operations/transfer.rs:62` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `sdk/zksync-rs/src/operations/transfer.rs:59` calls `unwrap_or` and `sdk/zksync-rs/src/operations/withdraw.rs:57` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/circuit.rs:2985` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `core/lib/circuit/src/circuit.rs:3947` calls `push`, `clone` and `core/lib/circuit/src/circuit.rs:2984` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/circuit.rs:1320` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/circuit.rs:1461` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/crypto/src/circuit/utils.rs:52` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `bits` to `&[bool]` in one and `Vec<bool>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
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 × 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `core/lib/circuit/src/circuit.rs:3827` calls `extend`, `get_bits_be` and `core/lib/circuit/src/circuit.rs:1783` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (7–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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `core/lib/circuit/src/circuit.rs:3948` calls `push`, `clone` and `core/lib/circuit/src/circuit.rs:1498` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/circuit.rs:1342` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `core/lib/circuit/src/circuit.rs:1979` calls `extend_from_slice`, `get_bits_be` and `core/lib/circuit/src/circuit.rs:1340` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (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 5 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 × 4) · ×1
  • Duplicated block (9 lines × 4) sdk/zksync-rs/src/operations/transfer.rs:197 — 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/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 (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. Read the line range as the matched WINDOW rather than a finished unit: at `core/lib/circuit/src/circuit.rs:2457` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `core/lib/circuit/src/circuit.rs:2526` calls `push` and `core/lib/circuit/src/circuit.rs:2454` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×1
  • 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.
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.
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.
R8 · Dependency Hygiene · Unused dependency 'ethjs' · ×1
  • Unused dependency 'ethjs' — 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.
R8 · Dependency Hygiene · Unused dependency 'handlebars' · ×1
  • Unused dependency 'handlebars' — 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.
R8 · Dependency Hygiene · Unused dependency 'openzeppelin-solidity' · ×1
  • Unused dependency 'openzeppelin-solidity' — 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.
R8 · Dependency Hygiene · Unused dependency 'path' · ×1
  • Unused dependency 'path' — 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.
R8 · Dependency Hygiene · Unused dependency 'querystring' · ×1
  • Unused dependency 'querystring' — 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.
R8 · Dependency Hygiene · Unused dependency 'solc' · ×1
  • Unused dependency 'solc' — 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.
R8 · Dependency Hygiene · Unused dependency 'web3' · ×1
  • Unused dependency 'web3' — Declared in core/tests/ts-tests/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
R8 · Dependency Hygiene · Unused dependency 'rollup-plugin-copy' · ×1
  • Unused dependency 'rollup-plugin-copy' — Declared in sdk/zksync.js/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
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`.
Minor — 301 finding(s)
D34 · Knowledge Freshness · Orphaned file · ×218
  • 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/crypto/src/merkle_tree/parallel_smt.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/types/src/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/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 core/lib/types/src/tx/tests.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/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.
  • + 193 more in this group — see findings.md.
D30 · Dependency Vulnerabilities · Low 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.
D24 · Comment Value · redundant comment · ×6
  • redundant comment contracts/scripts/test-upgrade-franklin.ts:59 — "wait notice period" repeats the code it sits on: 3 of its 3 words (wait, notice, period) are already in `console.log('Waiting notice period');`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment contracts/test/forced_exit.spec.ts:47 — "Withdrawing the funds from the contract to the wallet4" repeats the code it sits on: 4 of its 4 words (withdrawing, funds, contract, wallet) are already in `const withdrawTxHandle = await forcedExitContract.withdrawPendingFunds(await wallet4.getAddress());`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment contracts/test/ownable.spec.js:29 — "transfer mastership to wallet" repeats the code it sits on: 3 of its 3 words (transfer, mastership, wallet) are already in `await testContract.transferMastership(wallet.address);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment contracts/test/upgrade.fork.ts:33 — "Access upgrade gatekeeper master account" repeats the code it sits on: 4 of its 5 words (upgrade, gatekeeper, master, account) are already in `await hardhat.network.provider.send('hardhat_impersonateAccount', [UPGRADE_GATEKEEPER_MASTER_ADDRESS]);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment sdk/zksync.js/src/types.ts:379 — "Gas price (in wei)" repeats the code it sits on: 3 of its 3 words (gas, price, wei) are already in `gasPriceWei: BigNumber;`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment sdk/zksync.js/src/utils.ts:575 — "PubKeyHash or eth address" repeats the code it sits on: 4 of its 5 words (pub, key, hash, address) are already in `export function serializeAddress(address: Address | PubKeyHash): Uint8Array`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
D31 · IaC & Container Security · Low IaC · ×6
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Low vulnerability · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D19 · Documentation Quality · Documentation · ×3
  • Documentation: no build, run or usage example contracts/README.md:1 — `contracts` is a published package (`REDACTED` without `"private": true`) and neither `contracts/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example infrastructure/zk/README.md:1 — `zk` is a command-line package (`bin` in `REDACTED`) and neither `infrastructure/zk/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example sdk/zksync.js/README.md:1 — `zksync.js` is a published package (`REDACTED` without `"private": true`) and neither `sdk/zksync.js/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
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.
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.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found core/bin/zksync_event_listener/src/main.rs:1 — 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/`. ADRs are expected here because `core/bin/zksync_event_listener/src/main.rs` makes this repository a deployable product (line 1).
D21 · Naming Consistency · `mintNft` spells `Nft` where 90 names in the project spell it `NFT` · ×1
  • `mintNft` spells `Nft` where 90 names in the project spell it `NFT` sdk/zksync.js/src/signer.ts:38 — 90 of 92 names in project zksync-root spell the token `NFT` (90 of 92; unit: names in project zksync-root containing `NFT`). Peers: Deployer.deployNFTFactory (contracts/src.ts/deploy.ts:295); Tester.testBatchBuilderNFT (core/tests/ts-tests/tests/tester/batch-builder.ts:39); Tester.testMintNFT (core/tests/ts-tests/tests/tester/mint-nft.ts:10); Tester.testGetNFT (core/tests/ts-tests/tests/tester/mint-nft.ts:17); Tester.testFullExitNFT (core/tests/ts-tests/tests/tester/priority-ops.ts:12). Rename to `mintNFT`. [rule N6]
D21 · Naming Consistency · `withdrawNft` spells `Nft` where 90 names in the project spell it `NFT` · ×1
  • `withdrawNft` spells `Nft` where 90 names in the project spell it `NFT` sdk/zksync.js/src/signer.ts:62 — 90 of 92 names in project zksync-root spell the token `NFT` (90 of 92; unit: names in project zksync-root containing `NFT`). Peers: Deployer.deployNFTFactory (contracts/src.ts/deploy.ts:295); Tester.testBatchBuilderNFT (core/tests/ts-tests/tests/tester/batch-builder.ts:39); Tester.testMintNFT (core/tests/ts-tests/tests/tester/mint-nft.ts:10); Tester.testGetNFT (core/tests/ts-tests/tests/tester/mint-nft.ts:17); Tester.testFullExitNFT (core/tests/ts-tests/tests/tester/priority-ops.ts:12). Rename to `withdrawNFT`. [rule N6]
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 — 221 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 221 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.
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.
P3 · Security & performance tooling · No dependency-update automation · ×1
  • No dependency-update automation REDACTED:30 — `REDACTED` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`.
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' REDACTED: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, got, undici, node:http) 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 (`!`) override strict null checking · ×1
  • Null assertions (`!`) override strict null checking — ~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. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.
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 — 25 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.19.0 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.35 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.
D24 · Comment Value · doc comments repeat the names · ×1
  • doc comments repeat the names sdk/zksync.js/src/utils.ts:284 — 0 of 8 documented parameters and 0 of 22 summaries in `zksync` only repeat the member or parameter name (e.g. "" for `amount`). 2 documentation tag(s) are empty. Delete the restating tags, or add what the name does not say.

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/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-64223dcd483847bb8d846b8a9d8ea6ad/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/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-64223dcd483847bb8d846b8a9d8ea6ad/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/canine-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 .44artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .336artifacts/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/** .2artifacts/raw/trivy-fs.json

Run 01a1db89-c660-754a-b232-2317dd7b52c0 · 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