Public report — zksync, published 30 Sep 2026. Concrete security findings (which rule fired, in which file, on which line; CVE IDs, secret matches, dependency versions) are REDACTED in this version; ask the repo owner for the full report.
Public
Codebase survey Measured under the Code Assurance Index · rubric rubric-2026.09.18 (frozen) · verify this survey Filed cd_4b01a949cbb4439d8de1a71794e72736 Filed 30 September 2026, 06:20 UTC Public

Matter-Labs/zksync

Measured 30 September 2026, 06:16 UTC

39% At Risk

Medium · 65,125 LoC · 32 projects · rebuild ~0.6 person-years · weakest lens: Security (20%)

Findings by grade

233 critical 605 serious 47 minor 37 could not be resolved — could be critical — see Limitations

This survey was produced by

Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
30 September 2026, 06:16 UTC

A measurement, not a certificate. The Code Assurance Index does not certify, approve or guarantee this codebase; it records a reproducible number and the evidence it was computed from. The standard is authored by Canine Development, who also build Watchdog — its only implementation today. That is said here so the number is checked rather than believed.

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

55/60dimensions tool-verifieddeterministic · confidence 1.0 · 5 LLM-assisted, advisory
848findings with an exact file:lineof 885 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
60/138dimensions across the health lenses65125 LoC · 32 projects — wide & deep
Chapters

Executive summary

⚠ A critical security finding caps this grade — resolve it before relying on the score below; see the Security lens.

The system is currently at risk, with an overall health score of 39%. While the codebase is technically sound and well-structured, its critical weakness in security exposes the business to significant operational and compliance threats. This is not a fragile system, but it is one that requires immediate attention to prevent costly incidents.

The asset is of medium size, comprising over 65,000 lines of production code. Rebuilding this logic from scratch would require approximately 0.6 person-years, costing around €84,000. This represents a substantial investment tied up in the current architecture. The code itself is clean, with high maintainability and strong domain modeling, suggesting that the core business logic is well-understood and not burdened by technical debt in the traditional sense.

The primary concern is security exposure. With a readiness score of only 44% and a security lens at 20%, the system lacks the necessary safeguards for safe operation. This low score indicates potential vulnerabilities that could lead to data breaches or service outages, directly impacting customer trust and regulatory standing. The risk is amplified by the fact that the system is production-ready in terms of structure but not in terms of safety protocols.

A secondary theme is operational maturity. The maturity score of 57% suggests that while the system works, it may be difficult for new teams to onboard or for existing teams to maintain efficiently. The lack of measured coverage for JavaScript and TypeScript suites means we cannot fully assess the reliability of the frontend logic, creating blind spots in our quality assurance.

What is genuinely good is the code quality and architecture. The high scores in code health (80%) and domain modeling (78%) indicate that the system is well-designed, readable, and logically sound. This provides a solid foundation for future improvements, as the core logic is not entangled or poorly structured.

Where to focus first is resolving the single malicious package finding. This is the highest-leverage action, as it addresses the most critical security risk with minimal effort. Start by reviewing the REDACTED file to identify and remove the malicious dependency. This immediate step will significantly reduce the security exposure and provide a quick win for the team.

The picture is partial, as several key areas like event-driven architecture and performance were not measured. However, the existing data clearly points to security as the urgent priority.

How the score is built — each lens's share of the headline Width is the lens's weight in the worst-heaviest fold (the weakest area pulls hardest); colour is that lens's own band. A lens fixes the score in proportion to its width.
Security 20% · 46% weightReadiness 44% · 25% weightMaturity 57% · 14% weightArchitecture 70% · 8% weightPerformance 71% · 4% weightDomain Modelling 78% · 2% weightCode Health 80% · 1% weight

Raise Security 20 → 70 (the Healthy floor) ⇒ headline 39 → ~55.

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

72 finding(s) are new versus the previous scan (2026-09-13) — surfaced by this scheduled scan itself, no pull request required.

  • D5 · Off the main sequence: vlog
  • D5 · Off the main sequence: zksync_utils
  • D5 · Off the main sequence: zksync_types
  • D5 · Off the main sequence: zksync_crypto
  • D6 · Low cohesion: Database (LCOM4 20) core/bin/zksync_witness_generator/src/database.rs
  • D6 · Low cohesion: Database (LCOM4 11) core/bin/zksync_eth_sender/src/database.rs
  • D22 · Ambiguous parameter naming and overlapping intent. `account_info` takes a generic `account_id_or_address` string and a `state_type` to filter, while `account_full_info` takes the same generic identifier but presumably returns all states. The naming convention `account_info` vs `account_full_info` is inconsistent with other methods like `block_by_position` vs `block_transactions`. Furthermore, `account_id_or_address` is a poor API design choice compared to using a dedicated enum or distinct methods for ID vs Address lookups.
  • D22 · Inconsistent verb usage in module-level functions. The functions use the prefix `run_` which implies execution of a process, but they are essentially factory or calculation methods (`create_leaves`, `calculate_root`, `create_proof`). The prefix `run_` is redundant and inconsistent with the method naming style in other modules (e.g., `restore_zksync_tree_from_files`).
  • D22 · Inconsistent parameter typing for token identification. `token_by_id` uses `TokenLike` (likely a struct/enum), while `token_price` uses `TokenLike` for the first arg but `str` for `token_id_or_usd`. This suggests `TokenLike` might not be fully utilized or that `token_price` should also accept a structured token identifier for consistency.
  • D22 · Inconsistent parameter structure for transaction submission. `submit_tx` takes a transaction and a signature separately. `submit_batch` takes a `TxWithSignature` (which already contains the signature) and a separate `EthBatchSignatures`. This implies `TxWithSignature` might be a list or a single item, but the naming and structure are confusing compared to the single tx case.
  • D29 · REDACTED
  • D29 · REDACTED
  • D30 · REDACTED
  • D30 · REDACTED
  • D30 · REDACTED
  • D30 · REDACTED
  • D30 · REDACTED
  • D30 · REDACTED
  • D30 · REDACTED
  • D30 · REDACTED
  • D30 · REDACTED
  • D30 · REDACTED
  • D30 · REDACTED
  • D30 · REDACTED
  • D30 · REDACTED
  • D30 · REDACTED
  • D30 · REDACTED
  • D30 · REDACTED
  • D30 · REDACTED
  • D30 · REDACTED
  • D30 · REDACTED
  • D30 · REDACTED
  • D43 · REDACTED
  • D44 · End-of-life runtime: Rust 1.91
  • R10 · Duplicated block with local edits (126 matched lines × 2 locations) sdk/zksync.js/src/remote-wallet.ts
  • R10 · Duplicated block (31 lines × 2 locations) sdk/zksync.js/src/rest-provider.ts
  • R10 · Duplicated block (23 lines × 2 locations) sdk/zksync.js/src/eth-message-signer.ts
  • R10 · Duplicated block (18 lines × 4 locations) contracts/src.ts/deploy.ts
  • R10 · Duplicated block (17 lines × 2 locations) contracts/scripts/deploy-erc20.ts
  • R10 · Duplicated block (14 lines × 2 locations) contracts/scripts/deploy-testkit.ts
  • R10 · Duplicated block (11 lines × 2 locations) contracts/scripts/governance-add-erc20.ts
  • R5 · Dependency Freshness
  • PF3 · Sync-over-async blocking core/bin/data_restore/src/data_restore_driver.rs
  • PF3 · Sync-over-async blocking core/bin/server/src/main.rs
  • PF3 · Sync-over-async blocking contracts/scripts/deploy-eip1271.ts
  • PF3 · Sync-over-async blocking REDACTED
  • PF3 · Sync-over-async blocking contracts/scripts/deploy-withdrawal-helpers.ts
  • PF3 · Sync-over-async blocking contracts/scripts/governance-add-erc20.ts
  • PF3 · Sync-over-async blocking core/tests/check-block-root-hahes.js
  • PF3 · Sync-over-async blocking core/tests/check-block-root-hahes.ts
  • PF3 · Sync-over-async blocking core/tests/ts-tests/tests/api.ts
  • PF3 · Sync-over-async blocking infrastructure/api-docs/src/compile.ts
  • PF3 · Sync-over-async blocking infrastructure/api-docs/src/compile.ts
  • PF3 · Sync-over-async blocking infrastructure/api-docs/src/compile.ts
  • PF3 · Sync-over-async blocking infrastructure/exit-tool/perform_exodus/src/index.ts
  • PF3 · Sync-over-async blocking infrastructure/zk/src/config.ts
  • PF3 · Sync-over-async blocking infrastructure/zk/src/config.ts
  • PF3 · Sync-over-async blocking infrastructure/zk/src/env.ts
  • PF3 · Sync-over-async blocking infrastructure/zk/src/env.ts
  • PF3 · Sync-over-async blocking infrastructure/zk/src/db/db.ts
  • PF3 · Sync-over-async blocking infrastructure/zk/src/run/verify-keys.ts
  • PF3 · Sync-over-async blocking infrastructure/zk/src/run/verify-keys.ts
  • PF3 · Sync-over-async blocking infrastructure/zk/src/run/verify-keys.ts
  • PF3 · Sync-over-async blocking infrastructure/zk/src/run/run.ts
  • PF3 · Sync-over-async blocking infrastructure/zk/src/run/run.ts
  • PF3 · Sync-over-async blocking infrastructure/zk/src/run/run.ts
  • PF3 · Sync-over-async blocking infrastructure/zk/src/contract.ts
  • PF3 · Sync-over-async blocking infrastructure/zk/src/server.ts
  • PF3 · Sync-over-async blocking infrastructure/zk/src/test/integration.ts
  • PF3 · Sync-over-async blocking infrastructure/zk/src/test/integration.ts
  • PF3 · Sync-over-async blocking infrastructure/zk/src/test/integration.ts
  • PF3 · Sync-over-async blocking infrastructure/zk/src/index.ts

A full-fidelity diff against the previous run's complete recorded findings — line-move tolerant: a finding that only shifted line counts as unchanged, only genuinely new titles/files surface here.

Rebuild cost & value ~ Modeled — €28,000–€140,000
Cost to rebuild€28,000–€140,000 (0.3–0.9 person-years (465–1,474 h), ~1–2 engineers)
Domain complexityStandard — harder problems cost more per line
Quality factor0.7× (at 39% quality) — the last 20% of quality is most of the work
Size & shapeMedium · effort split not classified (source measured from disk; the effort-tier breakdown is a C#-only syntax walk)

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

How we model this: boilerplate at a scaffolding rate + logic × domain Standard (×1.0) — standard service × a 0.7× quality factor, at €60–95/h; indicative, ±~30% · size measured directly from source · effort from total production LoC as straight-line logic (the tier split is a C#-only syntax walk), a conservative lower bound. Indicative only — most sensitive to the hourly rate and the domain tier (both tunable in config).

Top priorities

The highest-leverage moves; the full ranked list is in the Roadmap below.

1
Resolve the 1 Malicious package finding(s) in Malicious Dependencies — start with REDACTED.
+5.7 pts · Low effort · Malicious Dependencies
2
Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED.
+5.6 pts · Low effort · REDACTED Scanning
3
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
+5.7 pts · Medium effort · Dependency Hygiene

Diagnosis — what's actually going on

Value concentrated against a weak lens · High · Value at risk
This is a Medium asset (~0.6 person-years to rebuild), and its weakest lens is Security at 20%. The operational and business risk on an asset this size concentrates there — that's where remediation buys the most protection.
Evidence: valuation: Medium, ~0.6 person-years rebuild (65,125 LoC) · weakest lens: Security 20%
→ Direct remediation budget at Security first — highest risk-reduction per euro on an asset this size.
Highest-leverage move · Medium · Leverage
Of everything flagged, the best return on effort is: Resolve the 1 Malicious package finding(s) in Malicious Dependencies — start with REDACTED. The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ Resolve the 1 Malicious package finding(s) in Malicious Dependencies — start with REDACTED.

Architecture — module dependency graph

Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways — a layering smell or cycle. A clean layered graph has none.

arch vlog vlog zksync (Cargo) zksync (Cargo) zksync_config zksync_config zksync (Cargo)->zksync_config zksync_crypto zksync_crypto zksync (Cargo)->zksync_crypto zksync_eth_client zksync_eth_client zksync (Cargo)->zksync_eth_client zksync_eth_signer zksync_eth_signer zksync (Cargo)->zksync_eth_signer zksync_types zksync_types zksync (Cargo)->zksync_types zksync_utils zksync_utils zksync (Cargo)->zksync_utils zksync_api_client zksync_api_client zksync_api_types zksync_api_types zksync_api_client->zksync_api_types zksync_api_client->zksync_crypto zksync_api_client->zksync_types zksync_api_client->zksync_utils zksync_api_types->zksync_crypto zksync_api_types->zksync_types zksync_api_types->zksync_utils zksync_basic_types zksync_basic_types 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_crypto->zksync_basic_types zksync_eth_client->vlog zksync_eth_client->zksync_config zksync_eth_client->zksync_eth_signer zksync_eth_client->zksync_types zksync_eth_signer->zksync_types zksync_gateway_watcher zksync_gateway_watcher zksync_gateway_watcher->vlog zksync_gateway_watcher->zksync_config zksync_gateway_watcher->zksync_eth_client zksync_gateway_watcher->zksync_utils zksync_l1_event_listener zksync_l1_event_listener zksync_l1_event_listener->vlog zksync_l1_event_listener->zksync_config zksync_l1_event_listener->zksync_types zksync_mempool zksync_mempool zksync_mempool->vlog zksync_storage zksync_storage zksync_mempool->zksync_storage zksync_mempool->zksync_types zksync_prometheus_exporter zksync_prometheus_exporter zksync_prometheus_exporter->vlog zksync_prometheus_exporter->zksync_storage zksync_token_db_cache zksync_token_db_cache zksync_prometheus_exporter->zksync_token_db_cache zksync_prometheus_exporter->zksync_types zksync_prover_utils zksync_prover_utils zksync_prover_utils->vlog zksync_prover_utils->zksync_circuit zksync_prover_utils->zksync_crypto zksync_prover_utils->zksync_types zksync_state->vlog zksync_state->zksync_crypto zksync_state->zksync_types zksync_state->zksync_utils zksync_storage->vlog zksync_storage->zksync_api_types zksync_storage->zksync_crypto zksync_storage->zksync_prover_utils zksync_storage->zksync_types zksync_storage->zksync_utils zksync_token_db_cache->zksync_storage zksync_token_db_cache->zksync_types zksync_types->vlog zksync_types->zksync_basic_types zksync_types->zksync_crypto zksync_types->zksync_utils __more__ +12 more projects

Architecture — module dependency matrix

Rows and columns are the same modules, ordered so that a module only depends on ones above it. A cell means the row depends on the column, and its number is how many type pairs create that dependency. Read one thing: is anything above the diagonal? A mark there is a dependency cycle. (A cycle is all this shows — an unusual but cycle-free dependency sits below the diagonal like any other.)

447 modules, 1096 dependencies. 5 dependency cycles across 109 modules, marked above the diagonal.

Showing the 40 most-connected modules; 407 more are not drawn.

Module dependency matrix. The row depends on the column; the number is how many type pairs create the dependency. A cell above the diagonal is part of a dependency cycle.
depends on →1 zksync.wallet2 zksync_api.bin.dev-ticker-server3 zksync_circuit.operation4 zksync_config.configs.chain5 zksync_config.configs.eth_sender6 zksync_storage.connection7 zksync_types.account.pubkey_hash8 zksync_types.operations9 zksync_types.tx.primitives.eth_signature10 zksync_types.tx.primitives.tx_hash11 sdk.zksync_js.src.types12 zksync_circuit.witness13 zksync_config.test_config.unit_vectors14 zksync_crypto.proof15 zksync_types.priority_ops16 zksync_types.tokens17 sdk.zksync_js.src.provider-interface18 sdk.zksync_js.src.signer19 zksync_api.fee_ticker20 zksync_api_types.v02.transaction21 zksync_types.tx.zksync_tx22 sdk.zksync_js.src.wallet23 zksync_config24 zksync_types.block25 core.tests.ts-tests.tests.tester.tester26 zksync_api.api_server.web3.types27 zksync_types.aggregated_operations28 zksync_api_types.v02.pagination29 zksync_circuit.witness.utils30 zksync_eth_client.ethereum_gateway31 zksync_l1_event_listener.events_state32 zksync_api_types.v02.account33 zksync_data_restore.storage_interactor34 zksync_storage35 zksync_state.state36 zksync_token_db_cache37 zksync_api.api_server.tx_sender38 zksync_api.api_server.rest.v02.error39 zksync_api.api_server.rpc_server40 zksync_api_client.rest.client
1 zksync.wallet
2 zksync_api.bin.dev-ticker-server
3 zksync_circuit.operation
4 zksync_config.configs.chain
5 zksync_config.configs.eth_sender
6 zksync_storage.connection
7 zksync_types.account.pubkey_hash
8 zksync_types.operations
9 zksync_types.tx.primitives.eth_signature
10 zksync_types.tx.primitives.tx_hash
11 sdk.zksync_js.src.types1
12 zksync_circuit.witness1
13 zksync_config.test_config.unit_vectors21
14 zksync_crypto.proof1
15 zksync_types.priority_ops1
16 zksync_types.tokens1
17 sdk.zksync_js.src.provider-interface111
18 sdk.zksync_js.src.signer9
19 zksync_api.fee_ticker1221
20 zksync_api_types.v02.transaction1118313
21 zksync_types.tx.zksync_tx1117
22 sdk.zksync_js.src.wallet1111
23 zksync_config111
24 zksync_types.block3112
25 core.tests.ts-tests.tests.tester.tester111
26 zksync_api.api_server.web3.types11
27 zksync_types.aggregated_operations415
28 zksync_api_types.v02.pagination11
29 zksync_circuit.witness.utils2111
30 zksync_eth_client.ethereum_gateway11
31 zksync_l1_event_listener.events_state111
32 zksync_api_types.v02.account1111
33 zksync_data_restore.storage_interactor11221
34 zksync_storage11
35 zksync_state.state38311
36 zksync_token_db_cache111
37 zksync_api.api_server.tx_sender121312112111
38 zksync_api.api_server.rest.v02.error1
39 zksync_api.api_server.rpc_server221112111
40 zksync_api_client.rest.client111111
Dependency, pointing down the layeringAbove the diagonal — part of a cycleThe module itself
zksync.wallet…bin.dev-ticker-server…ync_circuit.operation…_config.configs.chain…ig.configs.eth_sender…nc_storage.connection…s.account.pubkey_hash…sync_types.operations…mitives.eth_signature…tx.primitives.tx_hash…k.zksync_js.src.typeszksync_circuit.witness…t_config.unit_vectorszksync_crypto.proof…nc_types.priority_opszksync_types.tokens…rc.provider-interface….zksync_js.src.signerzksync_api.fee_ticker…types.v02.transaction…nc_types.tx.zksync_tx….zksync_js.src.walletzksync_configzksync_types.block…s.tests.tester.tester…api_server.web3.types…aggregated_operations…_types.v02.pagination…circuit.witness.utils…ient.ethereum_gateway…listener.events_state…api_types.v02.account…re.storage_interactorzksync_storagezksync_state.statezksync_token_db_cache….api_server.tx_sender…server.rest.v02.error…api_server.rpc_server…pi_client.rest.clientzksync.wallet1…bin.dev-ticker-server2…ync_circuit.operation3…_config.configs.chain4…ig.configs.eth_sender5…nc_storage.connection6…s.account.pubkey_hash7…sync_types.operations8…mitives.eth_signature9…tx.primitives.tx_hash10…k.zksync_js.src.types11zksync_circuit.witness12…t_config.unit_vectors13zksync_crypto.proof14…nc_types.priority_ops15zksync_types.tokens16…rc.provider-interface17….zksync_js.src.signer18zksync_api.fee_ticker19…types.v02.transaction20…nc_types.tx.zksync_tx21….zksync_js.src.wallet22zksync_config23zksync_types.block24…s.tests.tester.tester25…api_server.web3.types26…aggregated_operations27…_types.v02.pagination28…circuit.witness.utils29…ient.ethereum_gateway30…listener.events_state31…api_types.v02.account32…re.storage_interactor33zksync_storage34zksync_state.state35zksync_token_db_cache36….api_server.tx_sender37…server.rest.v02.error38…api_server.rpc_server39…pi_client.rest.client401121111111912211118313111711111113112111114151121111111111111122111383111111213121121111221112111111111+407 more modules (most-connected shown)

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

At a glance — Architecture · 70% · Strong ·

At a glance — Maturity · 57% · Adequate · gated by M2 ·

At a glance — Readiness · 44% · Weak · gated by R8 ·

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

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

At a glance — Performance · 71% · Strong ·

Security & Compliance — OWASP Top-10 mapping

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

OWASP categoryFindingsSeverity
A06:2021 — Vulnerable & Outdated Components187High / Critical
A05:2021 — Security Misconfiguration85High / Critical
A02:2021 — Cryptographic Failures63High / Critical
A03:2021 — Injection38High / Critical

Roadmap

Immediately address security risks by removing the malicious dependency from REDACTED and resolving the leaked secret in REDACTED. Next, clean up the dependency tree by eliminating unused packages, explicitly declaring imports, and moving development-only tools to devDependencies. Finally, update the 54 outdated packages to reduce upgrade debt and purge the 60 historical secrets found in configuration files like REDACTED and REDACTED.

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

Do thisHelpsEffortDimension
Resolve the 1 Malicious package finding(s) in Malicious Dependencies — start with REDACTED.+5.7 ptsLowMalicious Dependencies
Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED.+5.6 ptsLowREDACTED Scanning
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.+5.7 ptsMediumDependency Hygiene
Bump outdated dependencies to current versions to limit upgrade debt.+5.6 ptsMediumDependency Freshness
Resolve the 60 REDACTED finding(s) in Secrets (history) — start with REDACTED (10), REDACTED (10), REDACTED (6).+5.5 ptsMediumSecrets (history)
Add tests that import the unreached modules (directly or through their public entry).+5.5 ptsMediumTest Coverage
Keep implementation types off the public surface (Rust: `pub(crate)`, or keep the module private) so internals can change without breaking consumers.+5.5 ptsMediumLibrary API & versioning
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.+5.2 ptsMediumSecurity & performance tooling

File quality

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

FileScoreBandWorst signal
REDACTED0.0SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED0.1SlopIaC & Container Security: High IaC: REDACTED
REDACTED0.2SlopDependency Vulnerabilities: Critical vulnerability: REDACTED
REDACTED0.2SlopIaC & Container Security: High IaC: REDACTED
REDACTED0.8SlopIaC & Container Security: High IaC: REDACTED
REDACTED0.9SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED1.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED1.4SlopIaC & Container Security: High IaC: REDACTED
REDACTED1.4SlopIaC & Container Security: High IaC: REDACTED
REDACTED1.4SlopIaC & Container Security: High IaC: REDACTED
REDACTED2.0SlopIaC & Container Security: High IaC: REDACTED
REDACTED2.3SlopSecrets (history): REDACTED: REDACTED
REDACTED2.7SlopIaC & Container Security: High IaC: REDACTED
REDACTED2.7SlopIaC & Container Security: High IaC: REDACTED
REDACTED2.8SlopIaC & Container Security: High IaC: REDACTED
REDACTED3.0SlopStatic Analysis (SAST): High: REDACTED
REDACTED3.7SlopIaC & Container Security: High IaC: REDACTED
REDACTED4.4MixedIaC & Container Security: High IaC: REDACTED
REDACTED4.4MixedSecrets (history): REDACTED: REDACTED
REDACTED4.4MixedSecrets (history): REDACTED: 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 — 233

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

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

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

Could not be resolved — 37

Something this survey could not settle from the outside, and which could be critical or serious. Either a control was required and no positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean result. These are excluded from the score rather than awarded a pass, so the number on the cover neither rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each one is named under Limitations.

Methodology & how to trust this report

Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 55 of 60 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 5 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.

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

What we checked — 60 dimensions across the health lenses
D1D2D3D4D5D6D9D10D13D15D16D17D19D20D21D22D26D28D29D30D31D34D35D36D37D43D44AX10AX3AX4AX8AX9DM4DM5DM6M1M2M3M4P1P10P2P3P4P6P8PF1PF3R1R10R11R2R3R4R5R6R7R8R9X29

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, 848 of 885 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
  2. Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
  3. Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.

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

Tools & methods

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

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

Every finding is locatable in findings.md. Run 01a0f0f5-61a0-7a0b-bd28-b5e2dda86112.

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

Run transparency — what happened this run

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

  • D10 Test Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 157 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 109 test source file(s) (.rs) that it cannot: it reads JavaScript/TypeScript test declarations off disk, so a JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
  • D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability NOT MEASURED: the JavaScript/TypeScript suite could not be re-run in the analyzer sandbox — the mocha run in core/tests/ts-tests/ produced no per-test report (> ts-tests@1.0.0 test). This is OUR limitation, not a defect in the repo — it is excluded from the score.
  • D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the mocha suite in core/tests/ts-tests/ was NOT MEASURED: the mocha run in core/tests/ts-tests/ produced no per-test report (> ts-tests@1.0.0 test). This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
  • D12 Dependency Hygiene — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Dependency Hygiene couldn't be assessed within its 5-minute budget on a solution this large — not included in this run.
  • D14 License Compliance — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. License Compliance couldn't be assessed within its 15-minute budget on a solution this large — not included in this run.
  • AX6 Interface segregation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • C1 Data Protection — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
  • C2 Access Controls — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
  • C3 Audit Trail — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
  • C4 Data Retention — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These retention controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks retention controls.
  • C5 Data-Subject Rights — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These data-subject rights controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks data-subject rights controls.
  • ED5 Idempotency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check finds retry-prone mutations by walking the repository's declared types, and NONE was loaded on this run, so it had nothing to look at. That is a limit of the analyzer's reach — it reads .NET projects — not a finding that this repository has no command handlers or message consumers.
  • GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • IC1 Incompleteness & stubs — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • R10 Code Duplication — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 12 further occurrence(s) are not listed individually; the score already reflects all 52.
  • S1 Web-Security Posture — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
  • X1 Async correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X12 Unreachable branch — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X13 Undrained process stream — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X14 Bypassable address classification — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X15 Unvalidated length from an untrusted reader — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X16 Unfloored truncation loop — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X17 Uncapped recursion over a caller-supplied document — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X18 Disposal-pattern correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X19 Unrestored process-global state — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X2 Cancellation propagation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X20 Mistyped argument guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X21 Side-effecting pattern guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X22 Contradicted release guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X23 Unguarded diagnostic materialisation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X24 Document value interpolated into markup unescaped — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X25 Inert configuration knob — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X26 Unsynchronised callback handoff — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X27 Collection changed while being enumerated — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X28 Index access outside its own emptiness guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X3 Exception handling — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X30 Support guard that admits what it rejects — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X4 Structured logging — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X5 Nullable reference types — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.

Repo exclusion declarations: 10 pattern(s) declared (.gitattributes linguist-generated/vendored, .editorconfig generated_code) excluded 0 source file(s) from code-quality scoring. Declarations are the repo's own visible statement that a tree is machine-written or vendored — auditable in any diff, honored by GitHub the same way.

Limitations & what we did not check

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

Per-dimension blind spots

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

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
  • D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
  • 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").
  • 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 is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement. Its critique rows are drawn from a closed category vocabulary and each row means the same thing in every run, so two scans can be compared row by row; the SET that fires is still a sample, and does not repeat exactly. Measured on one frozen input, six scans at one engine SHA: 2-5 critique rows per scan, 8 distinct rows across the six, 3 of those 8 seen in only one scan. So a D19 row is evidence about the documentation, but a COUNT of D19 rows is not a quantity — never read a change in it as an improvement or a regression.
  • D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
  • D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
  • D22 Internal API Consistency: API-surface coherence is an LLM judgement over a sample of the public surface — consistency of intent across the whole API is approximated, not exhaustively verified.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
  • DM4 Rich vs anemic domain model: Behaviour is detected as state mutation inside a method body — a method that enforces an invariant by validating-and-throwing without mutating reads as a query, and mutation delegated through an interface the scan can't resolve isn't credited; entities with zero public properties still drop out of the population. It detects that state changes, not whether the rule is correct.
  • DM6 Domain ↔ infrastructure boundary: Infrastructure reached through a hand-rolled wrapper, a domain-named facade, reflection, or a string-keyed service locator resolves to a non-infra type and isn't seen; the body scan is symbol resolution over syntax, not full dataflow. A clean result means "no resolved infra reference in a domain body", not a proof of purity.
  • M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

The LLM boundary

LLM-set scores this run (5): D19, D21, D22, D26, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score; each names its own sample and method on its card. They are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.

Dimensions

D1 · Cyclomatic 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. Resolve the 1 TxSender finding(s) in Cyclomatic Complexity — start with tx_sender.rs. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 CallsHelper finding(s) in Cyclomatic Complexity — start with calls.rs. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 deploy.main (cyclomatic 26) finding(s) in Cyclomatic Complexity — start with deploy.ts. — One of this dimension's main actionable groups (1 warning-level).
  4. Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D2 · Cognitive 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. Resolve the 3 OperationsExtSchema finding(s) in Cognitive Complexity — start with mod.rs (3). — One of this dimension's main actionable groups (3 warning-level).
  2. Resolve the 2 TxSender finding(s) in Cognitive Complexity — start with tx_sender.rs (2). — One of this dimension's main actionable groups (2 warning-level).
  3. Resolve the 2 zksync_api finding(s) in Cognitive Complexity — start with tx_sender.rs, signature_checker.rs. — One of this dimension's main actionable groups (2 warning-level).
  4. Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D3 · God Classes8.1 / 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.1 / 10 · rule-coverage 100% · ceiling Prevented

58 god class(es) detected.

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

What to do

  1. Resolve the 28 MethodTooLong finding(s) in God Classes — start with circuit.rs (12), mod.rs (6), mint_nft.rs (2). — One of this dimension's main actionable groups (28 warning-level).
  2. Resolve the 13 ClassTooLong finding(s) in God Classes — start with mod.rs (8), circuit.rs, wallet.ts. — One of this dimension's main actionable groups (13 warning-level).
  3. Resolve the 9 FileTooLong finding(s) in God Classes — start with mod.rs (5), circuit.rs, wallet.ts. — One of this dimension's main actionable groups (9 warning-level).
  4. Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D4 · Code Duplication8.7 / 10Strong✓ Tool-verified

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

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

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

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

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

+ 78 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 14 Duplicated block (12 lines × 2) finding(s) in Code Duplication — start with circuit.rs (6), transfer.rs (3), transactions_handler.rs. — One of this dimension's main actionable groups (14 warning-level).
  3. Resolve the 10 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with circuit.rs (3), mint_nft.rs (2), utils.rs. — One of this dimension's main actionable groups (10 warning-level).
  4. Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

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

D5 · Coupling9.0 / 10Stronggated by 4 serious findings✓ Tool-verified

What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.

Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.

Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.

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

32 production modules (Cargo+npm), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 4 module(s) off the main sequence, with abstractness counted on 27 of the 32 (the rest declare no modelled class or interface, export only macros, or have no source directory of their own).

Off the main sequence: vlog · ×4

What to do

  1. Resolve the 4 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (4 warning-level).
  2. Enforce Coupling in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

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

What it measures: Whether a class's methods are focused on a single responsibility.

Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.

Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.

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

2 of 203 classes have LCOM4 above 3.

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

What to do

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

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

D9 · Test Distribution10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.

Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.

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

490 test methods: 464 unit, 26 integration, 0 BDD, 0 e2e. The JavaScript/TypeScript suite contributes 157 `it`/`test` case(s) across 24 test file(s) declaring at least one; its tier split is read from package names and paths only. The Rust suite contributes 333 `#[test]` function(s) across 82 file(s) declaring at least one; its unit/integration split is Cargo's own — 2 of those file(s) are integration-test targets under a crate's tests/ directory, and the rest are #[test] functions compiled into the crate they test.

✓ On the Gold path — maintain.

Detailed fixes: d9_recommendation.md.

D10 · Test Quality7.3 / 10Strong✓ Tool-verified

What it measures: Whether the tests truly assert behaviour rather than just running the code.

Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.

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

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

No assertions: Process transfer to new · ×28contracts/test/zksync.spec.ts:701

What to do

  1. Resolve the 28 No assertions finding(s) in Test Quality — start with operations.spec.ts (7), zksync.spec.ts (6), api.test.ts (5). — One of this dimension's main actionable groups (28 warning-level).
  2. Enforce Test Quality in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D13 · REDACTED Scanning5.0 / 10Adequate✓ Tool-verified

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

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

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

1 secret(s) detected.

REDACTED

What to do

  1. Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  2. Enforce REDACTED Scanning in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D15 · Churn × Complexity Hotspots9.9 / 10Stronggated by 1 serious finding✓ Tool-verified

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

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

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

Top hotspots: core/bin/zksync_api/src/api_server/tx_sender.rs (2×28=56)

Hotspot: core/bin/zksync_api/src/api_server/tx_sender.rscore/bin/zksync_api/src/api_server/tx_sender.rs:649

What to do

  1. Resolve the 1 Hotspot finding(s) in Churn × Complexity Hotspots — start with tx_sender.rs. — One of this dimension's main actionable groups (1 warning-level).

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

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

4 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is core/lib/crypto/src/merkle_tree/parallel_smt.rs. Counted over 223 of the 362 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

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

✓ On the Gold path — maintain.

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

D17 · Explicit Debt9.9 / 10Stronggated by 34 serious findings✓ Tool-verified

What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.

Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.

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

34 deducted task-comment markers across 65125 LoC (0.1/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 · ×33contracts/scripts/deploy-testkit.ts:37
HackCommentcore/lib/types/src/gas_counter.rs:10

What to do

  1. Resolve the 33 TodoComment finding(s) in Explicit Debt — start with mod.rs (11), gas_counter.rs (4), allocated_structures.rs (3). — One of this dimension's main actionable groups (33 warning-level).
  2. Resolve the 1 HackComment finding(s) in Explicit Debt — start with gas_counter.rs. — One of this dimension's main actionable groups (1 warning-level).
  3. Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D19 · Documentation QualityStrong◐ Sampled · advisory

What it measures: Whether the project's documentation is clear, complete, and useful.

Method: Judged by language model at low temperature (0.0-0.1) on a deterministic doc sample (READMEs plus first 25 architecture docs), with two-pass stability filtering. Advisory, sampled.

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

The repository's root README is a well-written overview of the ZKSync scaling and privacy engine (with a deprecation notice), plus detailed withdrawal-flow instructions for the Exit Tree Generator. It also documents several subdirectories with focused READMEs: contracts/README describes zkSync smart contracts; core/README describes the core backend API; infrastructure/README explains the supplementary infrastructure; test_config/README details test data types; exit-tool/README covers the exodus-transaction tool and its prerequisites, mechanics, usage, and a full changelog; loadnext/README is an extensive loadtest utility with launch, configuration, and a detailed Flaw section. The architecture document (docs/architecture.md) gives a high-level overview of the repository's applications and server forms, plus a low-level overview that is clipped mid-sentence. This is a comprehensive documentation set for the zkSync project: 16 README-style deployment/usage guides (including one full contract docs document) plus an architecture/protocol reference. The contracts-and-interfaces section is especially dense and well-written, covering Ownable, UpgradeableMaster, Upgradeable, Proxy, and UpgradeGatekeeper with storage-index rationale and a note about the proxy's context role. All documents are clipped mid-sentence by the scanner; internal jargon and unshown sections cannot be flagged as defects.

What to do

  1. Improve Documentation Quality — currently 8.3/10. — The repository's root README is a well-written overview of the ZKSync scaling and privacy engine (with a deprecation notice), plus detailed withdrawal-flow instructions for the Exit Tree Generator. It also documents several subdirectories with focused READMEs: contracts/README describes zkSync smart contracts; core/README describes the core backend API; infrastructure/README explains the supplementary infrastructure; test_config/README details test data types; exit-tool/README covers the exodus-transaction tool and its prerequisites, mechanics, usage, and a full changelog; loadnext/README is an extensive loadtest utility with launch, configuration, and a detailed Flaw section. The architecture document (docs/architecture.md) gives a high-level overview of the repository's applications and server forms, plus a low-level overview that is clipped mid-sentence. This is a comprehensive documentation set for the zkSync project: 16 README-style deployment/usage guides (including one full contract docs document) plus an architecture/protocol reference. The contracts-and-interfaces section is especially dense and well-written, covering Ownable, UpgradeableMaster, Upgradeable, Proxy, and UpgradeGatekeeper with storage-index rationale and a note about the proxy's context role. All documents are clipped mid-sentence by the scanner; internal jargon and unshown sections cannot be flagged as defects.

Detailed fixes: d19_recommendation.md.

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

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

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

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

No architecture decision records were found.

No ADRs found

What to do

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

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

D21 · Naming ConsistencyExemplary◐ Sampled · advisory

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

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

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

0 naming inconsistencies across 0 sampled symbols.

✓ On the Gold path — maintain.

Detailed fixes: d21_recommendation.md.

D22 · Internal API ConsistencyAdequate◐ Sampled · advisory

What it measures: Whether the internal API surface is consistent and coherent.

Method: Judged by language model at low temperature over a sample of the public API surface (IsPackable or .Contracts types). Sampled, advisory; confidence discounted by model uncertainty.

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

4 API inconsistencies across a 400-member sample of 590 exposed types.

Ambiguous parameter naming and overlapping intent. `account_info` takes a generic `account_id_or_address` string and a `state_type` to filter, while `account_full_info` takes the same generic identifier but presumably returns all states. The naming convention `account_info` vs `account_full_info` is inconsistent with other methods like `block_by_position` vs `block_transactions`. Furthermore, `account_id_or_address` is a poor API design choice compared to using a dedicated enum or distinct methods for ID vs Address lookups.
Inconsistent verb usage in module-level functions. The functions use the prefix `run_` which implies execution of a process, but they are essentially factory or calculation methods (`create_leaves`, `calculate_root`, `create_proof`). The prefix `run_` is redundant and inconsistent with the method naming style in other modules (e.g., `restore_zksync_tree_from_files`).
Inconsistent parameter typing for token identification. `token_by_id` uses `TokenLike` (likely a struct/enum), while `token_price` uses `TokenLike` for the first arg but `str` for `token_id_or_usd`. This suggests `TokenLike` might not be fully utilized or that `token_price` should also accept a structured token identifier for consistency.
Inconsistent parameter structure for transaction submission. `submit_tx` takes a transaction and a signature separately. `submit_batch` takes a `TxWithSignature` (which already contains the signature) and a separate `EthBatchSignatures`. This implies `TxWithSignature` might be a list or a single item, but the naming and structure are confusing compared to the single tx case.

What to do

  1. Resolve the 1 Ambiguous parameter naming and overlapping intent. `account_info` takes… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 Inconsistent verb usage in module-level functions. The functions use the… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 Inconsistent parameter typing for token identification. `token_by_id`… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).

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

D26 · Project Cohesion8.5 / 10Strong✓ Tool-verified

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

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

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

2 of 26 build units (Cargo, npm) flagged as possibly oversized/incoherent.

Split core/lib/storage
Split core/lib/types

What to do

  1. Resolve the 1 Split core/lib/storage finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).
  2. Resolve the 1 Split core/lib/types finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).

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

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

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

Method: REDACTED scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.

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

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

REDACTED
REDACTED
REDACTED

What to do

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

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

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

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

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

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

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

38 finding(s): 0 critical, 35 high, 3 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

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

What to do

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

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

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

What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.

Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05.

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

186 finding(s): 14 critical, 70 high, 85 medium, 17 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 65 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (60), REDACTED (4), REDACTED. — One of this dimension's main actionable groups (65 issue-level).
  2. Resolve the 11 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (11). — One of this dimension's main actionable groups (11 issue-level).
  3. Resolve the 5 High vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED (3), REDACTED (2). — One of this dimension's main actionable groups (5 issue-level).

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

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

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

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

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

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

REDACTED
REDACTED
REDACTED

What to do

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

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

D34 · Knowledge Freshness4.5 / 10Weak✓ 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 4.5 / 10 · rule-coverage 100% · ceiling Documented

122 of 223 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 223 of the 362 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Most significant orphaned file · ×3core/lib/circuit/src/circuit.rs
Dormant codebase

What to do

  1. Resolve the 3 Most significant orphaned file finding(s) in Knowledge Freshness — start with circuit.rs, mod.rs, wallet.ts. — One of this dimension's main actionable groups (3 recommendation-level).
  2. Resolve the 1 Dormant codebase 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 2 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED (2). — One of this dimension's main actionable groups (2 warning-level).
  2. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).

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

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d37_recommendation.md.

D43 · Malicious Dependencies0.0 / 10Critical✓ Tool-verified

What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Scored apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.

Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. SCORED, not informational.

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

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

REDACTED

What to do

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

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

D44 · Platform End-of-Life6.0 / 10Adequate✓ Tool-verified

What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.

Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.

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

1 end-of-life runtime(s) and 0 end-of-life framework(s), read from 1 platform declaration(s) and 0 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.

End-of-life runtime: Rust 1.91

What to do

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

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

Frontend & cross-cutting dimensions

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

AX10 · Code composition9.2 / 10Exemplary✓ Tool-verified

Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.

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

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

What to do

  • The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
AX3 · Project dependency cycles10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).

Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.

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

Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.

Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.

AX8 · Test isolation10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether production projects stay free of references to test projects — tests may depend on production, never the reverse.

Method: Csproj graph: each production project checked for references to test projects (identified by test-framework presence, not name). Zero violations is clean. Deterministic.

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

Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.

Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.

Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.

DM4 · Rich vs anemic domain model10.0 / 10Exemplary✓ Tool-verified

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

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

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

DM5 · Encapsulated state5.0 / 10Adequate✓ Tool-verified

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

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

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

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

What to do

  • Make the id/hash field private and immutable — value identity must be stable for the lifetime of the value.
DM6 · Domain ↔ infrastructure boundary10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

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

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

What to do

  • Add a build/run (quick start) section to the root README — the first thing a newcomer needs.
  • Add a 'Testing' section to the root README — how to run the test suite.
  • Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
  • Add a README to the 24 of 32 project(s) that lack one — worth up to 1.5 pts.
M2 · Architecture documentation2.0 / 10Critical✓ Tool-verified

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

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

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

What to do

  • Record significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree, with each file named `NNNN-title` in whatever markup those docs already use, is the most discoverable form).
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

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

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

M4 · Documentation accuracy7.0 / 10Strong◐ Sampled · advisory

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

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

  • README omits the ZKSync prover binary entirely — reported by the model that read the README against this repository; no term search was run for this one, so nothing here has been checked against the tree. Treat it as a reading to confirm, not as a measured contradiction: verify it against the code before acting on it, and if the footprint it describes does exist, this row is wrong.
  • README omits the JavaScript SDK (zksync.js) and Rust SDK (zksync-rs) — reported by the model that read the README against this repository; no term search was run for this one, so nothing here has been checked against the tree. Treat it as a reading to confirm, not as a measured contradiction: verify it against the code before acting on it, and if the footprint it describes does exist, this row is wrong.

What to do

  • Reconcile the README with reality: README omits the ZKSync prover binary entirely; README omits the JavaScript SDK (zksync.js) and Rust SDK (zksync-rs).
P1 · CI/CD gates10.0 / 10Exemplary○ Nothing flagged

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

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

P10 · Library API & versioning6.0 / 10Adequate✓ Tool-verified

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

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

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

What to do

  • Keep implementation types off the public surface (Rust: `pub(crate)`, or keep the module private) so internals can change without breaking consumers.
P2 · Observability8.4 / 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 12/15 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `core/lib/eth_signer`, `infrastructure/exit-tool/perform_exodus`, `infrastructure/zk`.

What to do

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

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

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

What to do

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

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

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

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

What to do

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

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

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

  • The changelog this check read carries 0 versioned entries, against a bar of 3. Counted as either an `x.y.z` string or a version-shaped section heading (`## [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.
P8 · Schema migrations10.0 / 10Exemplary○ Nothing flagged

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

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

PF1 · Benchmark discipline8.5 / 10Strong✓ Tool-verified

Readiness · Performance — Whether the code protects its performance with benchmarks — a benchmark suite, allocation/memory measurement, and (ideally) a CI gate. Presence is credited as a bonus, never a deduction.

Method: Repo + source scan: BenchmarkDotNet referenced (csproj/source), [Benchmark]/[MemoryDiagnoser] attribute counts, and a benchmark step in CI; off .NET, the same ladder over Go testing.B, Rust criterion/#[bench]/divan, JMH/kotlinx-benchmark, pytest-benchmark/asv/pyperf, tinybench/mitata/vitest bench/benchmark.js and Swift package-benchmark — scored as a bonus ladder (absence is neutral, never a deduction). Deterministic, presence detection.

PF3 · Async & latency hygiene6.0 / 10Adequate✓ Tool-verified

Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.

Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from the language model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin) or inside a Java method returning a Reactor Mono/Flux — 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
  • `main` is async and calls writeFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×5) — contracts/scripts/deploy-eip1271.ts:16, REDACTED:15, contracts/scripts/deploy-withdrawal-helpers.ts:15, …
  • `main` is async and calls readFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — contracts/scripts/governance-add-erc20.ts:33, infrastructure/exit-tool/perform_exodus/src/index.ts:155
  • `validateTypeJSON` is async and calls readFileSync, writeFileSync, unlinkSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — core/tests/ts-tests/tests/api.ts:25
  • `setupWallet` is async and calls readFileSync — 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:43
  • `compileApibForDocumentation` is async and calls writeFileSync — 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:158
  • `compileApibForTest` is async and calls writeFileSync — 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:170
  • `getEnvironment` is async and calls existsSync — 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:29
  • `checkConfigExistence` is async and calls existsSync, mkdirSync — 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:64
  • `gitHooks` is async and calls existsSync — 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:23
  • `load` is async and calls existsSync, readFileSync, rmSync — 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:72
  • `basicSetup` is async and calls unlinkSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — infrastructure/zk/src/db/db.ts:44
  • `gen` is async and calls utimesSync, mkdirSync, copyFileSync — 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:13
  • `unpack` is async and calls existsSync — 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:34
  • `pack` is async and calls mkdirSync — 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:43
  • `plonkSetup` is async and calls mkdirSync, existsSync — 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:77
  • `catLogs` is async and calls readFileSync — 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:105
  • `testAccounts` is async and calls readFileSync — 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:115
  • `deploy` is async and calls readFileSync, writeFileSync — 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:39
  • `genesis` is async and calls readFileSync, mkdirSync, copyFileSync — 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:37
  • `ensureZkSyncSdkBuilt` is async and calls existsSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — infrastructure/zk/src/test/integration.ts:9
  • `runTsTests` is async and calls existsSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — infrastructure/zk/src/test/integration.ts:23
  • `withServer` is async and calls openSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — infrastructure/zk/src/test/integration.ts:42
  • `main` is async and calls spawnSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — infrastructure/zk/src/index.ts:46

What to do

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

React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.

Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.

What to do

  • Migrate the remaining .js/.jsx files to TypeScript.
R10 · Code Duplication7.8 / 10Strong✓ Tool-verified

React / JS · Code Health — Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm over JS/TS tokens, D-386): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.

Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Deterministic.

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

What to do

  • Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
R11 · Import Boundaries4.2 / 10Weak✓ Tool-verified

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

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

  • contracts/scripts/deploy-erc20.ts:5 imports ethers/lib/utils, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — contracts/scripts/deploy-erc20.ts:5
  • contracts/scripts/deploy.ts:4 imports ethers/lib/utils, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — contracts/scripts/deploy.ts:4
  • contracts/scripts/revert-reason.ts:3 imports ethers/lib/utils, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — contracts/scripts/revert-reason.ts:3
  • contracts/scripts/upgrade-testnet.ts:4 imports ethers/lib/utils, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — contracts/scripts/upgrade-testnet.ts:4
  • contracts/src.ts/deploy.ts:3 imports ethers/lib/utils, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — contracts/src.ts/deploy.ts:3
  • infrastructure/api-docs/src/compile.ts:4 imports zksync, a package this repository publishes, but this package's own package.json 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 package.json 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 package.json dependencies (2 rows) — those imports are already bare package specifiers, so the import statements do not change, only the manifest.
R2 · Cyclomatic Complexity9.9 / 10Exemplary✓ Tool-verified

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

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

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

What to do

  • Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
R3 · Large Files6.4 / 10Adequate✓ Tool-verified

React / JS · Code Health — How many source files exceed the large-file threshold.

Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.

  • 7 file(s) over 400 lines (counted as significant lines — blank lines excluded — over production source only, tests excluded), largest first: sdk/zksync.js/src/wallet.ts (1081), sdk/zksync.js/src/utils.ts (855), sdk/zksync.js/src/abstract-wallet.ts (629), sdk/zksync.js/src/rest-provider.ts (599), sdk/zksync.js/src/types.ts (559), contracts/src.ts/deploy.ts (498) (+1 more).

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, infrastructure/exit-tool/perform_exodus/src/index.ts, contracts/scripts/upgrade-testnet.ts, …

What to do

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

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

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

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

What to do

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

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

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

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

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

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

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

What to do

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

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

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

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

What to do

  • Break each cycle by extracting the shared piece into a module both sides can import.
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.

Reference — by lens

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

LensScoreRatingImpact
Code Health80%StrongStrongest area.
Architecture70%StrongSolid.
Maturity57%Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness44%Weak — gated by R8Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security20%Critical — gated by D28, D29, D30, D31, D36, D43Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Domain Modelling78%StrongSolid.
Performance71%StrongSolid.
Unscored — 1 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.

  • X7 Silent fallback defaults — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 4 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.

  • C3 Audit Trail — Not assessed: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) 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. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C4 Data Retention — Not assessed: these retention controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) 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. Absence of an idiom this check recognises is NOT evidence that this repository lacks retention controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C5 Data-Subject Rights — Not assessed: these data-subject rights controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) 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. Absence of an idiom this check recognises is NOT evidence that this repository lacks data-subject rights controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 73 check(s) not relevant to this codebase

These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.

  • AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
  • AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
  • AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
  • AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
  • AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
  • AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
  • AC7 A11y enforcement — No web markup found — accessibility is not applicable to this repository.
  • AX1 Captive dependencies — Not applicable: this repository's JavaScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; Rust with no dependency-injection crate has no container to hand one lifetime's instance to another — every value is owned by the code that builds it, and the borrow checker rejects a longer-lived value keeping a borrow of a shorter-lived one; this repository's TypeScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
  • AX2 Stateful singletons — Not applicable: Rust's compiler refuses unsynchronised shared mutation — a value shared across threads must be Sync — so the race this check looks for cannot be written. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX6 Interface segregation — not assessed — interface segregation is computed over a type surface that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXR1 Runtime accessibility — compose up failed (exit 18 — an image could not be pulled) — geth Pulling dev-liquidity-token-watcher Pulling dev-ticker Pulling postgres Pulling geth Error Get "https://registry-1.docker.io/v2/": Forbidden dev-liquidity-token-watcher Error context canceled postgres Error context canceled dev-ticker Error context canceled Error response from daemon: Get "https://registry-1.docker.io/v2/": Forbidden; the earlier `compose pull` step reported: postgres Pulling dev-liquidity-token-watcher Pulling geth Pulling dev-ticker Pulling geth Error Get "https://registry-1.docker.io/v2/": Forbidden dev-liquidity-token-watcher Error context canceled dev-ticker Error context canceled postgres Error context canceled Error response from daemon: Get "https://registry-1.docker.io/v2/": Forbidden; the runtime sandbox reaches registries only through the in-fence pull-through mirror, so an image the mirror does not carry cannot be fetched — this is a limit of our sandbox, not of your stack; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
  • C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) 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. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) 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. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • D11 Test Reliability — Test reliability not measured — JavaScript/TypeScript suite did not run
  • D12 Dependency Hygiene — Dependency Hygiene not included (time budget)
  • D14 License Compliance — License Compliance not included (time budget)
  • 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.
  • 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. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — No inline comments to assess — comment value is not applicable here.
  • D25 ADR Conformance — no ADRs to check
  • D27 Navigability — symbol resolution incomplete — navigability not assessed
  • D32 Data Compliance (PII/GDPR) — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.
  • D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • D8 Code Coverage — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — core/tests/ts-tests/ runs mocha but declares no coverage provider, so the suite can run and still produce no lcov — add `c8` (or `nyc`) as a devDependency so the suite can be wrapped for coverage. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan. Alternatively, commit the lcov/Cobertura report your CI produces and it is read without a re-run.
  • DM1 Aggregate boundaries — this Rust crate declares no domain aggregate (a struct with private state and its own command methods), so DM1's aggregate-boundary read has no population to be taken over
  • DM2 Strongly-typed ids — the crate defines newtype typed-ids but declares no domain aggregate that could carry an id — so DM2's adoption ratio has no population to be taken over
  • DM3 Integration-event coupling — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
  • DM7 Repository granularity — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
  • ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and a call made through an inferred or generic receiver has no resolvable owner in the source. Reported as guidance rather than measured
  • ED5 Idempotency — This check finds retry-prone mutations (command handlers and message/event consumers) by walking the repository's declared types, and none was loaded here, so it has nothing to report. That 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# syntax, and none was loaded for this repository. 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'.
  • P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the JavaScript/TypeScript, Rust source, so there is no service whose uptime a failing dependency could take down
  • P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
  • PF2 Allocation hygiene — Not applicable: Rust spells out every heap allocation and makes borrowed slices (&[T], &str) its ordinary parameter types, so the allocation-aware style this card rewards elsewhere is the language's baseline rather than a rung to climb. TypeScript/JavaScript runs on a garbage-collected runtime that gives a program no allocation-control idiom to choose on a hot path — no pools, stack allocation or value types — so allocation awareness is not something this code can be rated on.
  • S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) 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. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X1 Async correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X10 Duplicated predicate — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X12 Unreachable branch — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X13 Undrained process stream — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X14 Bypassable address classification — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X15 Unvalidated length from an untrusted reader — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X16 Unfloored truncation loop — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X17 Uncapped recursion over a caller-supplied document — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X18 Disposal-pattern correctness — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X19 Unrestored process-global state — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X2 Cancellation propagation — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X20 Mistyped argument guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X21 Side-effecting pattern guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X22 Contradicted release guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X23 Unguarded diagnostic materialisation — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X24 Document value interpolated into markup unescaped — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X25 Inert configuration knob — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X26 Unsynchronised callback handoff — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X27 Collection changed while being enumerated — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X28 Index access outside its own emptiness guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X3 Exception handling — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X30 Support guard that admits what it rejects — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X32 Type resolved by simple name across every loaded assembly — This check 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 — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • 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 — 233 finding(s)
D30 · Dependency Vulnerabilities · High CVE · ×65
  • 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
  • + 40 more in this group — see findings.md.
D28 · Secrets (history) · REDACTED · ×60
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 35 more in this group — see findings.md.
D31 · IaC & Container Security · High IaC · ×43
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 18 more in this group — see findings.md.
D30 · Dependency Vulnerabilities · Critical CVE · ×11
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · High vulnerability · ×5
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Critical vulnerability · ×3
  • REDACTED
  • REDACTED
  • REDACTED
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 — 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 — sdk/zksync.js/src/provider-interface.ts → sdk/zksync.js/src/utils.ts → sdk/zksync.js/src/provider-interface.ts
D13 · REDACTED Scanning · Leaked secret · ×1
  • REDACTED
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 '@ethersproject/abi' · ×1
  • Unlisted import '@ethersproject/abi' contracts/scripts/utils.ts:2 — Imported but not declared in any reachable package.json — 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 package.json — 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 package.json — 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 package.json — 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 package.json — installs work only by hoisting accident.
R9 · Circular Imports · Import cycle (3 files) · ×1
  • Import cycle (3 files) infrastructure/zk/src/contract.ts — infrastructure/zk/src/contract.ts → infrastructure/zk/src/run/run.ts → infrastructure/zk/src/docker.ts → infrastructure/zk/src/contract.ts
Serious — 605 finding(s)
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.
D17 · Explicit Debt · TodoComment · ×33
  • TodoComment contracts/scripts/deploy-testkit.ts:37 — // todo: should be decided when building — 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/api_client/src/rest/client.rs:13 — // TODO Make error handling as correct as possible. (ZKS-125)
  • TodoComment core/lib/circuit/src/utils.rs:57 — // TODO: handle the case where it is not valid (ZKS-101)
  • TodoComment core/lib/circuit/src/utils.rs:94 — // TODO: handle the case where it is not valid (ZKS-101)
  • TodoComment core/lib/circuit/src/circuit.rs:3117 — // TODO: this is actually redundant, cause they are both enforced to be of appropriate length (ZKS-106).
  • TodoComment core/lib/circuit/src/allocated_structures.rs:201 — //TODO: think of more consistent constant flow (ZKS-54).
  • TodoComment core/lib/circuit/src/allocated_structures.rs:394 — //TODO: think of more consistent constant flow (ZKS-54).
  • TodoComment core/lib/circuit/src/allocated_structures.rs:400 — //TODO: think of more consistent constant flow (ZKS-54).
  • TodoComment core/lib/crypto/src/params.rs:175 — // TODO: Check that in the future this constant cannot cause unexpected behavior (ZKS-520).
  • 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/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/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/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/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.
  • + 8 more in this group — see findings.md.
D30 · Dependency Vulnerabilities · Medium advisory (unmaintained) · ×33
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 8 more in this group — see findings.md.
D30 · Dependency Vulnerabilities · Medium CVE · ×31
  • 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
  • + 6 more in this group — see findings.md.
PF3 · Async & latency hygiene · Sync-over-async blocking · ×30
  • 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 contracts/scripts/deploy-eip1271.ts:16 — `main` is async and calls writeFileSync — 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:15 — `main` is async and calls writeFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking contracts/scripts/deploy-withdrawal-helpers.ts:15 — `main` is async and calls writeFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking contracts/scripts/governance-add-erc20.ts:33 — `main` is async and calls readFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking core/tests/check-block-root-hahes.js:16 — `main` is async and calls writeFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking core/tests/check-block-root-hahes.ts:18 — `main` is async and calls writeFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking core/tests/ts-tests/tests/api.ts:25 — `validateTypeJSON` is async and calls readFileSync, writeFileSync, unlinkSync — 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:43 — `setupWallet` is async and calls readFileSync — 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:158 — `compileApibForDocumentation` is async and calls writeFileSync — 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:170 — `compileApibForTest` is async and calls writeFileSync — 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/exit-tool/perform_exodus/src/index.ts:155 — `main` is async and calls readFileSync — 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:29 — `getEnvironment` is async and calls existsSync — 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:64 — `checkConfigExistence` is async and calls existsSync, mkdirSync — 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:23 — `gitHooks` is async and calls existsSync — 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:72 — `load` is async and calls existsSync, readFileSync, rmSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking infrastructure/zk/src/db/db.ts:44 — `basicSetup` is async and calls unlinkSync — 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/verify-keys.ts:13 — `gen` is async and calls utimesSync, mkdirSync, copyFileSync — 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/verify-keys.ts:34 — `unpack` is async and calls existsSync — 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/verify-keys.ts:43 — `pack` is async and calls mkdirSync — 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:77 — `plonkSetup` is async and calls mkdirSync, existsSync — 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:105 — `catLogs` is async and calls readFileSync — 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:115 — `testAccounts` is async and calls readFileSync — 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:39 — `deploy` is async and calls readFileSync, writeFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • + 5 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 — 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 — 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 — 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 — 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 — 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 — 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 — 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 — 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 — 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 — 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 — 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 — 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 — 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 — 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 — 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 — 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 — 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 — 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 — 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 — 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 — 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 — 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 — 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 — 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 — 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: Process transfer to new contracts/test/zksync.spec.ts:701 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: Process deposit contracts/test/zksync.spec.ts:710 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: Process partial exit contracts/test/zksync.spec.ts:743 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: Process full exit contracts/test/zksync.spec.ts:758 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: Change pubkey with auth contracts/test/zksync.spec.ts:803 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: Change pubkey with posted signature contracts/test/zksync.spec.ts:833 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: Deposit ERC20 success contracts/test/specific_tokens.spec.ts:95 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: Make a deposit of tokens that should take a fee from recipient contract contracts/test/specific_tokens.spec.ts:319 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: Make a deposit of tokens that should adds payout to the recipient contracts/test/specific_tokens.spec.ts:350 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: Correctly Parse Deposit pubdata contracts/test/operations.spec.ts:111 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: Correctly write Deposit data priority queue contracts/test/operations.spec.ts:121 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: Correctly Parse FullExit pubdata contracts/test/operations.spec.ts:131 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: Correctly Write FullExit data priority queue contracts/test/operations.spec.ts:157 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: Correctly Parse Withdraw pubdata contracts/test/operations.spec.ts:175 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: Correctly Parse ForcedExit pubdata contracts/test/operations.spec.ts:186 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: Correctly Parse ChangePubKey pubdata contracts/test/operations.spec.ts:198 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: should recover failed ETH withdraw core/tests/ts-tests/tests/withdrawal-helpers.test.ts:46 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: should recover failed ERC20 withdraw core/tests/ts-tests/tests/withdrawal-helpers.test.ts:50 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: should recover multiple withdrawals core/tests/ts-tests/tests/withdrawal-helpers.test.ts:59 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: forced_exit_request should recover mutiple tokens core/tests/ts-tests/tests/withdrawal-helpers.test.ts:71 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: should check status response type core/tests/ts-tests/tests/api.test.ts:41 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: should check testnet config response type core/tests/ts-tests/tests/api.test.ts:45 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: should check withdrawal processing time response type core/tests/ts-tests/tests/api.test.ts:49 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: should check tx history response type core/tests/ts-tests/tests/api.test.ts:53 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: should check blocks response type core/tests/ts-tests/tests/api.test.ts:57 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • + 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.
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.
  • Duplicated block (9 lines × 2) core/lib/circuit/src/circuit.rs:2910 — core/lib/circuit/src/circuit.rs:2910-2918 | core/lib/circuit/src/circuit.rs:3865-3873 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) core/lib/circuit/src/witness/change_pubkey_offchain.rs:79 — core/lib/circuit/src/witness/change_pubkey_offchain.rs:79-87 | core/lib/circuit/src/witness/full_exit.rs:87-95 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (9 lines × 2) core/lib/circuit/src/witness/forced_exit.rs:156 — core/lib/circuit/src/witness/forced_exit.rs:156-164 | core/lib/circuit/src/witness/transfer_to_new.rs:147-155 — before extracting anything, compare `core/lib/circuit/src/witness/forced_exit.rs` and `core/lib/circuit/src/witness/transfer_to_new.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) core/lib/circuit/src/witness/mint_nft.rs:218 — core/lib/circuit/src/witness/mint_nft.rs:218-226 | core/lib/circuit/src/witness/withdraw_nft.rs:247-255 — before extracting anything, compare `core/lib/circuit/src/witness/mint_nft.rs` and `core/lib/circuit/src/witness/withdraw_nft.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) core/lib/eth_signer/src/raw_ethereum_tx.rs:64 — core/lib/eth_signer/src/raw_ethereum_tx.rs:64-72 | core/lib/eth_signer/src/raw_ethereum_tx.rs:126-134 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) core/lib/types/src/operations/full_exit_op.rs:91 — core/lib/types/src/operations/full_exit_op.rs:91-99 | core/lib/types/src/operations/full_exit_op.rs:133-141 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) sdk/zksync-rs/src/operations/transfer.rs:50 — sdk/zksync-rs/src/operations/transfer.rs:50-58 | sdk/zksync-rs/src/operations/withdraw.rs:49-57 — before extracting anything, compare `sdk/zksync-rs/src/operations/transfer.rs` and `sdk/zksync-rs/src/operations/withdraw.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) core/lib/types/src/tx/mint_nft.rs:137 — core/lib/types/src/tx/mint_nft.rs:137-145 | core/lib/types/src/tx/withdraw_nft.rs:143-151 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (9 lines × 2) sdk/zksync-rs/src/operations/transfer.rs:151 — sdk/zksync-rs/src/operations/transfer.rs:151-159 | sdk/zksync-rs/src/operations/withdraw.rs:151-159 — before extracting anything, compare `sdk/zksync-rs/src/operations/transfer.rs` and `sdk/zksync-rs/src/operations/withdraw.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) core/lib/storage/src/prover/mod.rs:200 — core/lib/storage/src/prover/mod.rs:200-209 | core/lib/storage/src/prover/mod.rs:273-281 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) core/lib/circuit/src/circuit.rs:1460 — core/lib/circuit/src/circuit.rs:1460-1468 | core/lib/circuit/src/circuit.rs:3040-3048 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) core/lib/circuit/src/circuit.rs:1738 — core/lib/circuit/src/circuit.rs:1738-1746 | core/lib/circuit/src/circuit.rs:2811-2819 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) core/lib/circuit/src/circuit.rs:1812 — core/lib/circuit/src/circuit.rs:1812-1820 | core/lib/circuit/src/circuit.rs:2223-2231 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) core/lib/circuit/src/signature.rs:66 — core/lib/circuit/src/signature.rs:66-74 | core/lib/circuit/src/signature.rs:133-141 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×14
  • Duplicated block (12 lines × 2) core/lib/circuit/src/circuit.rs:544 — core/lib/circuit/src/circuit.rs:544-555 | core/lib/circuit/src/circuit.rs:567-578 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) core/lib/circuit/src/circuit.rs:1955 — core/lib/circuit/src/circuit.rs:1955-1966 | core/lib/circuit/src/circuit.rs:1970-1981 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) core/lib/circuit/src/circuit.rs:2927 — core/lib/circuit/src/circuit.rs:2927-2938 | core/lib/circuit/src/circuit.rs:3882-3893 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) core/lib/circuit/src/circuit.rs:3131 — core/lib/circuit/src/circuit.rs:3131-3142 | core/lib/circuit/src/circuit.rs:4339-4350 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) core/lib/circuit/src/witness/transfer.rs:134 — core/lib/circuit/src/witness/transfer.rs:134-145 | core/lib/circuit/src/witness/transfer_to_new.rs:140-151 — before extracting anything, compare `core/lib/circuit/src/witness/transfer.rs` and `core/lib/circuit/src/witness/transfer_to_new.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 142 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 2) core/lib/mempool/src/transactions_handler.rs:53 — core/lib/mempool/src/transactions_handler.rs:53-64 | core/lib/mempool/src/transactions_handler.rs:155-166 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) core/lib/types/src/operations/transfer_op.rs:65 — core/lib/types/src/operations/transfer_op.rs:65-76 | core/lib/types/src/operations/transfer_to_new_op.rs:71-82 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (12 lines × 2) sdk/zksync-rs/src/ethereum/mod.rs:250 — sdk/zksync-rs/src/ethereum/mod.rs:250-261 | sdk/zksync-rs/src/ethereum/mod.rs:356-367 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) core/lib/types/src/block/incomplete_block.rs:119 — core/lib/types/src/block/incomplete_block.rs:119-130 | core/lib/types/src/block/mod.rs:506-517 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (12 lines × 2) sdk/zksync-rs/src/operations/transfer.rs:35 — sdk/zksync-rs/src/operations/transfer.rs:35-46 | sdk/zksync-rs/src/operations/withdraw.rs:34-45 — before extracting anything, compare `sdk/zksync-rs/src/operations/transfer.rs` and `sdk/zksync-rs/src/operations/withdraw.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 2) sdk/zksync-rs/src/operations/transfer.rs:112 — sdk/zksync-rs/src/operations/transfer.rs:112-123 | sdk/zksync-rs/src/operations/withdraw.rs:112-123 — before extracting anything, compare `sdk/zksync-rs/src/operations/transfer.rs` and `sdk/zksync-rs/src/operations/withdraw.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 2) core/lib/circuit/src/witness/transfer_to_new.rs:188 — core/lib/circuit/src/witness/transfer_to_new.rs:188-199 | core/lib/circuit/src/witness/transfer_to_new.rs:257-269 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) core/lib/circuit/src/circuit.rs:302 — core/lib/circuit/src/circuit.rs:302-313 | core/lib/circuit/src/circuit.rs:427-438 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) core/lib/circuit/src/circuit.rs:1827 — core/lib/circuit/src/circuit.rs:1827-1838 | core/lib/circuit/src/circuit.rs:2069-2080 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D3 · God Classes · ClassTooLong · ×13
  • ClassTooLong: ZkSyncCircuit core/lib/circuit/src/circuit.rs:49 — ClassTooLong — 3435 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 15 methods, 4 blocks, lines 49-4398. The bar is 400 significant lines; this is 3035 over it, 8.59× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: OperationsExtSchema core/lib/storage/src/chain/operations_ext/mod.rs:56 — ClassTooLong — 1662 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 37 methods. The bar is 400 significant lines; this is 1262 over it, 4.16× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: BlockSchema core/lib/storage/src/chain/block/mod.rs:44 — ClassTooLong — 1070 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 41 methods. The bar is 400 significant lines; this is 670 over it, 2.68× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Wallet sdk/zksync.js/src/wallet.ts:47 — ClassTooLong — 876 significant lines (blank, comment-only and punctuation-only lines excluded), 42 methods. The bar is 400 significant lines; this is 476 over it, 2.19× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: MempoolSchema core/lib/storage/src/chain/mempool/mod.rs:34 — ClassTooLong — 762 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 22 methods. The bar is 400 significant lines; this is 362 over it, 1.91× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: StateSchema core/lib/storage/src/chain/state/mod.rs:41 — ClassTooLong — 632 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 17 methods. The bar is 400 significant lines; this is 232 over it, 1.58× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: OperationsSchema core/lib/storage/src/chain/operations/mod.rs:27 — ClassTooLong — 542 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 20 methods. The bar is 400 significant lines; this is 142 over it, 1.36× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: EthereumSchema core/lib/storage/src/ethereum/mod.rs:27 — ClassTooLong — 458 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 21 methods. The bar is 400 significant lines; this is 58 over it, 1.15× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: AbstractWallet sdk/zksync.js/src/abstract-wallet.ts:36 — ClassTooLong — 430 significant lines (blank, comment-only and punctuation-only lines excluded), 51 methods. The bar is 400 significant lines; this is 30 over it, 1.08× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: TokensSchema core/lib/storage/src/tokens/mod.rs:30 — ClassTooLong — 423 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 20 methods. The bar is 400 significant lines; this is 23 over it, 1.06× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: EventsState core/lib/l1_event_listener/src/events_state.rs:23 — ClassTooLong — 416 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 16 methods, 3 blocks, lines 23-686. The bar is 400 significant lines; this is 16 over it, 1.04× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: AccountSchema core/lib/storage/src/chain/account/mod.rs:29 — ClassTooLong — 413 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 15 methods. The bar is 400 significant lines; this is 13 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: RestProvider sdk/zksync.js/src/rest-provider.ts:64 — ClassTooLong — 409 significant lines (blank, comment-only and punctuation-only lines excluded), 65 methods. The bar is 400 significant lines; this is 9 over it, 1.02× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D30 · Dependency Vulnerabilities · Medium vulnerability · ×12
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×10
  • Duplicated block (10 lines × 2) core/lib/circuit/src/circuit.rs:1572 — core/lib/circuit/src/circuit.rs:1572-1581 | core/lib/circuit/src/circuit.rs:2589-2598 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) core/lib/circuit/src/circuit.rs:2359 — core/lib/circuit/src/circuit.rs:2359-2368 | core/lib/circuit/src/circuit.rs:2672-2681 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) core/lib/circuit/src/witness/utils.rs:270 — core/lib/circuit/src/witness/utils.rs:270-279 | core/lib/circuit/src/witness/utils.rs:297-306 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) core/lib/storage/src/chain/account/records.rs:56 — core/lib/storage/src/chain/account/records.rs:56-65 | core/lib/storage/src/tokens/records.rs:123-132 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (10 lines × 2) core/lib/storage/src/chain/operations_ext/mod.rs:1899 — core/lib/storage/src/chain/operations_ext/mod.rs:1899-1908 | core/lib/storage/src/chain/operations_ext/mod.rs:1923-1932 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) core/lib/types/src/tx/mint_nft.rs:204 — core/lib/types/src/tx/mint_nft.rs:204-213 | core/lib/types/src/tx/withdraw_nft.rs:220-230 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (10 lines × 2) core/lib/types/src/tx/transfer.rs:307 — core/lib/types/src/tx/transfer.rs:307-316 | core/lib/types/src/tx/withdraw.rs:308-317 — before extracting anything, compare `core/lib/types/src/tx/transfer.rs` and `core/lib/types/src/tx/withdraw.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 2) sdk/zksync-rs/src/operations/mint_nft.rs:49 — sdk/zksync-rs/src/operations/mint_nft.rs:49-58 | sdk/zksync-rs/src/operations/withdraw_nft.rs:53-62 — before extracting anything, compare `sdk/zksync-rs/src/operations/mint_nft.rs` and `sdk/zksync-rs/src/operations/withdraw_nft.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 2) core/lib/circuit/src/witness/forced_exit.rs:197 — core/lib/circuit/src/witness/forced_exit.rs:197-206 | core/lib/circuit/src/witness/forced_exit.rs:253-264 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) core/lib/circuit/src/circuit.rs:3254 — core/lib/circuit/src/circuit.rs:3254-3263 | core/lib/circuit/src/circuit.rs:3267-3276 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×10
  • Duplicated block (7 lines × 2) core/lib/circuit/src/circuit.rs:1311 — core/lib/circuit/src/circuit.rs:1311-1318 | core/lib/circuit/src/circuit.rs:4099-4105 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) core/lib/circuit/src/witness/full_exit.rs:233 — core/lib/circuit/src/witness/full_exit.rs:233-239 | core/lib/circuit/src/witness/withdraw.rs:165-171 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) core/lib/eth_signer/src/json_rpc_signer.rs:70 — core/lib/eth_signer/src/json_rpc_signer.rs:70-76 | core/lib/eth_signer/src/json_rpc_signer.rs:101-107 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) core/lib/eth_signer/src/json_rpc_signer.rs:70 — core/lib/eth_signer/src/json_rpc_signer.rs:70-76 | core/lib/eth_signer/src/json_rpc_signer.rs:236-242 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) core/lib/types/src/priority_ops/mod.rs:136 — core/lib/types/src/priority_ops/mod.rs:136-142 | core/lib/types/src/priority_ops/mod.rs:204-210 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) core/lib/types/src/priority_ops/mod.rs:251 — core/lib/types/src/priority_ops/mod.rs:251-257 | core/lib/types/src/priority_ops/mod.rs:314-320 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) core/lib/types/src/tx/change_pubkey.rs:293 — core/lib/types/src/tx/change_pubkey.rs:293-299 | core/lib/types/src/tx/withdraw.rs:163-169 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) core/lib/types/src/tx/swap.rs:265 — core/lib/types/src/tx/swap.rs:265-271 | core/lib/types/src/tx/swap.rs:281-287 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) core/lib/circuit/src/circuit.rs:1683 — core/lib/circuit/src/circuit.rs:1683-1689 | core/lib/circuit/src/circuit.rs:4322-4330 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) core/lib/circuit/src/witness/transfer.rs:164 — core/lib/circuit/src/witness/transfer.rs:164-170 | core/lib/circuit/src/witness/transfer.rs:223-230 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D3 · God Classes · FileTooLong · ×9
  • FileTooLong: src/circuit.rs core/lib/circuit/src/circuit.rs — FileTooLong — 3921 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 88% of them inside a single declaration: ZkSyncCircuit (4 blocks, 49-4398). The bar is 500 significant lines; this is 3421 over it, 7.84× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: operations_ext/mod.rs core/lib/storage/src/chain/operations_ext/mod.rs — FileTooLong — 1733 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 96% of them inside a single declaration: OperationsExtSchema (58-2116). The bar is 500 significant lines; this is 1233 over it, 3.47× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: block/mod.rs core/lib/storage/src/chain/block/mod.rs — FileTooLong — 1097 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 98% of them inside a single declaration: BlockSchema (46-1550). The bar is 500 significant lines; this is 597 over it, 2.19× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: src/wallet.ts sdk/zksync.js/src/wallet.ts — FileTooLong — 919 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: Wallet (47-1212). The bar is 500 significant lines; this is 419 over it, 1.84× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: mempool/mod.rs core/lib/storage/src/chain/mempool/mod.rs — FileTooLong — 780 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 98% of them inside a single declaration: MempoolSchema (36-1051). The bar is 500 significant lines; this is 280 over it, 1.56× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: witness/utils.rs core/lib/circuit/src/witness/utils.rs — FileTooLong — 705 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 205 over it, 1.41× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED sdk/zksync.js/src/utils.ts — FileTooLong — 664 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 164 over it, 1.33× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: state/mod.rs core/lib/storage/src/chain/state/mod.rs — FileTooLong — 648 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 98% of them inside a single declaration: StateSchema (43-902). The bar is 500 significant lines; this is 148 over it, 1.30× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: operations/mod.rs core/lib/storage/src/chain/operations/mod.rs — FileTooLong — 558 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 97% of them inside a single declaration: OperationsSchema (29-748). The bar is 500 significant lines; this is 58 over it, 1.12× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
D30 · Dependency Vulnerabilities · Medium advisory (unsound) · ×9
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×8
  • Duplicated block (11 lines × 2) core/lib/circuit/src/circuit.rs:413 — core/lib/circuit/src/circuit.rs:413-423 | core/lib/circuit/src/circuit.rs:485-495 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) core/lib/circuit/src/witness/forced_exit.rs:355 — core/lib/circuit/src/witness/forced_exit.rs:355-365 | core/lib/circuit/src/witness/withdraw.rs:248-258 — before extracting anything, compare `core/lib/circuit/src/witness/forced_exit.rs` and `core/lib/circuit/src/witness/withdraw.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 2) core/lib/circuit/src/witness/utils.rs:164 — core/lib/circuit/src/witness/utils.rs:164-174 | core/lib/circuit/src/witness/utils.rs:188-198 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) core/lib/storage/src/chain/account/mod.rs:495 — core/lib/storage/src/chain/account/mod.rs:495-505 | core/lib/storage/src/chain/account/mod.rs:539-549 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) core/lib/storage/src/chain/operations/mod.rs:198 — core/lib/storage/src/chain/operations/mod.rs:198-208 | core/lib/storage/src/chain/operations/mod.rs:225-235 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) core/lib/storage/src/chain/operations_ext/mod.rs:234 — core/lib/storage/src/chain/operations_ext/mod.rs:234-245 | core/lib/storage/src/chain/operations_ext/mod.rs:328-338 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) sdk/zksync-rs/src/ethereum/priority_op_handle.rs:93 — sdk/zksync-rs/src/ethereum/priority_op_handle.rs:93-103 | sdk/zksync-rs/src/operations/mod.rs:105-115 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (11 lines × 2) core/lib/circuit/src/utils.rs:252 — core/lib/circuit/src/utils.rs:252-262 | core/lib/circuit/src/utils.rs:292-302 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×7
  • Duplicated block (6 lines × 2) core/lib/circuit/src/circuit.rs:1353 — core/lib/circuit/src/circuit.rs:1353-1358 | core/lib/circuit/src/circuit.rs:1368-1373 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) core/lib/crypto/src/primitives.rs:135 — core/lib/crypto/src/primitives.rs:135-140 | core/lib/crypto/src/primitives.rs:155-160 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) core/lib/types/src/operations/mod.rs:224 — core/lib/types/src/operations/mod.rs:224-229 | core/lib/types/src/operations/mod.rs:245-250 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) core/lib/crypto/src/circuit/utils.rs:102 — core/lib/crypto/src/circuit/utils.rs:102-108 | sdk/zksync-crypto/src/utils.rs:66-71 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) core/lib/types/src/tx/primitives/packed_public_key.rs:55 — core/lib/types/src/tx/primitives/packed_public_key.rs:55-60 | core/lib/types/src/tx/primitives/packed_signature.rs:82-87 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) core/lib/eth_client/src/clients/http_client.rs:129 — core/lib/eth_client/src/clients/http_client.rs:129-134 | core/lib/eth_client/src/clients/http_client.rs:469-474 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) core/lib/eth_signer/src/json_rpc_signer.rs:405 — core/lib/eth_signer/src/json_rpc_signer.rs:405-410 | core/lib/eth_signer/src/json_rpc_signer.rs:414-419 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (11 lines × 2 locations) · ×7
  • Duplicated block (11 lines × 2 locations) contracts/scripts/deploy.ts:9 — contracts/scripts/deploy.ts:9 · contracts/scripts/upgrade-testnet.ts:9 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
  • Duplicated block (11 lines × 2 locations) contracts/scripts/governance-add-erc20.ts:56 — contracts/scripts/governance-add-erc20.ts:56 · infrastructure/token-lists-manager/index.ts:74 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (11 lines × 2 locations) infrastructure/api-docs/src/compile.ts:158 — infrastructure/api-docs/src/compile.ts:158 · infrastructure/api-docs/src/compile.ts:170 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2 locations) sdk/zksync.js/src/abstract-wallet.ts:431 — sdk/zksync.js/src/abstract-wallet.ts:431 · sdk/zksync.js/src/abstract-wallet.ts:647 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (11 lines × 2 locations) sdk/zksync.js/src/abstract-wallet.ts:579 — sdk/zksync.js/src/abstract-wallet.ts:579 · sdk/zksync.js/src/abstract-wallet.ts:602 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2 locations) sdk/zksync.js/src/rest-provider.ts:220 — sdk/zksync.js/src/rest-provider.ts:220 · sdk/zksync.js/src/rest-provider.ts:313 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (11 lines × 2 locations) sdk/zksync.js/src/utils.ts:278 — sdk/zksync.js/src/utils.ts:278 · sdk/zksync.js/src/utils.ts:297 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R11 · Import Boundaries · Boundary violation [package · ×7
  • Boundary violation [package:third-party-deep-import] contracts/scripts/deploy-erc20.ts:5 — contracts/scripts/deploy-erc20.ts:5 imports ethers/lib/utils, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] contracts/scripts/deploy.ts:4 — contracts/scripts/deploy.ts:4 imports ethers/lib/utils, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] contracts/scripts/revert-reason.ts:3 — contracts/scripts/revert-reason.ts:3 imports ethers/lib/utils, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] contracts/scripts/upgrade-testnet.ts:4 — contracts/scripts/upgrade-testnet.ts:4 imports ethers/lib/utils, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] contracts/src.ts/deploy.ts:3 — contracts/src.ts/deploy.ts:3 imports ethers/lib/utils, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:undeclared-workspace-dep] infrastructure/api-docs/src/compile.ts:4 — infrastructure/api-docs/src/compile.ts:4 imports zksync, a package this repository publishes, but this package's own package.json 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 package.json does not list it in dependencies (or peer/optional dependencies) — it resolves only through the workspace link, so an installed copy of this package is missing it. Add it to this package's dependencies.
D3 · God Classes · TooManyMethods · ×6
  • TooManyMethods: RestProvider sdk/zksync.js/src/rest-provider.ts:64 — TooManyMethods — 65 methods. The bar is 30 methods; this is 35 over it, 2.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: AbstractWallet sdk/zksync.js/src/abstract-wallet.ts:36 — TooManyMethods — 51 methods. The bar is 30 methods; this is 21 over it, 1.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Wallet sdk/zksync.js/src/wallet.ts:47 — TooManyMethods — 42 methods. The bar is 30 methods; this is 12 over it, 1.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: BlockSchema core/lib/storage/src/chain/block/mod.rs:44 — TooManyMethods — 41 methods. The bar is 30 methods; this is 11 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: OperationsExtSchema core/lib/storage/src/chain/operations_ext/mod.rs:56 — TooManyMethods — 37 methods. The bar is 30 methods; this is 7 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ZkSyncState core/lib/state/src/state.rs:26 — TooManyMethods — 31 methods, declared across 4 files: src/state.rs (23), handler/swap.rs (4), handler/transfer.rs (3), handler/mint_nft.rs (1). The bar is 30 methods; this is 1 over it, 1.03× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×6
  • Duplicated block (8 lines × 2) core/lib/circuit/src/witness/close_account.rs:75 — core/lib/circuit/src/witness/close_account.rs:75-82 | core/lib/circuit/src/witness/transfer.rs:143-150 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) core/lib/circuit/src/witness/close_account.rs:81 — core/lib/circuit/src/witness/close_account.rs:81-88 | core/lib/circuit/src/witness/withdraw.rs:133-140 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) core/lib/circuit/src/witness/deposit.rs:159 — core/lib/circuit/src/witness/deposit.rs:159-166 | core/lib/circuit/src/witness/withdraw.rs:167-174 — before extracting anything, compare `core/lib/circuit/src/witness/deposit.rs` and `core/lib/circuit/src/witness/withdraw.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) core/lib/circuit/src/witness/transfer.rs:149 — core/lib/circuit/src/witness/transfer.rs:149-156 | core/lib/circuit/src/witness/transfer_to_new.rs:155-162 — before extracting anything, compare `core/lib/circuit/src/witness/transfer.rs` and `core/lib/circuit/src/witness/transfer_to_new.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 142 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) core/lib/eth_signer/src/json_rpc_signer.rs:345 — core/lib/eth_signer/src/json_rpc_signer.rs:345-352 | sdk/zksync-rs/src/provider.rs:358-365 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) sdk/zksync-rs/src/ethereum/priority_op_handle.rs:42 — sdk/zksync-rs/src/ethereum/priority_op_handle.rs:42-49 | sdk/zksync-rs/src/operations/mod.rs:54-61 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
R10 · Code Duplication · Duplicated block (10 lines × 2 locations) · ×6
  • Duplicated block (10 lines × 2 locations) contracts/scripts/upgrade-testnet.ts:93 — contracts/scripts/upgrade-testnet.ts:93 · contracts/scripts/upgrade-testnet.ts:117 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2 locations) contracts/scripts/upgrade-testnet.ts:107 — contracts/scripts/upgrade-testnet.ts:107 · contracts/scripts/upgrade-testnet.ts:118 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (10 lines × 2 locations) infrastructure/api-docs/src/utils.ts:5 — infrastructure/api-docs/src/utils.ts:5 · REDACTED:37 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
  • Duplicated block (10 lines × 2 locations) infrastructure/zk/src/fmt.ts:49 — infrastructure/zk/src/fmt.ts:49 · infrastructure/zk/src/lint.ts:52 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (10 lines × 2 locations) sdk/zksync.js/src/provider.ts:104 — sdk/zksync.js/src/provider.ts:104 · sdk/zksync.js/src/provider.ts:123 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (10 lines × 2 locations) sdk/zksync.js/src/utils.ts:118 — sdk/zksync.js/src/utils.ts:118 · sdk/zksync.js/src/utils.ts:128 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×5
  • Duplicated block (15 lines × 2) core/lib/circuit/src/witness/change_pubkey_offchain.rs:168 — core/lib/circuit/src/witness/change_pubkey_offchain.rs:168-182 | core/lib/circuit/src/witness/withdraw.rs:186-204 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (15 lines × 2) core/lib/storage/src/chain/state/mod.rs:73 — core/lib/storage/src/chain/state/mod.rs:73-87 | core/lib/storage/src/chain/state/mod.rs:91-105 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2) core/lib/types/src/tx/change_pubkey.rs:269 — core/lib/types/src/tx/change_pubkey.rs:269-283 | core/lib/types/src/tx/forced_exit.rs:152-166 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (15 lines × 2) core/lib/types/src/tx/mint_nft.rs:101 — core/lib/types/src/tx/mint_nft.rs:101-115 | core/lib/types/src/tx/swap.rs:247-261 — before extracting anything, compare `core/lib/types/src/tx/mint_nft.rs` and `core/lib/types/src/tx/swap.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (15 lines × 2) core/lib/storage/src/tokens/mod.rs:134 — core/lib/storage/src/tokens/mod.rs:134-148 | core/lib/storage/src/tokens/mod.rs:161-175 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×5
  • Duplicated block (14 lines × 2) core/lib/circuit/src/circuit.rs:3914 — core/lib/circuit/src/circuit.rs:3914-3927 | core/lib/circuit/src/circuit.rs:4176-4189 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) core/lib/circuit/src/circuit.rs:4672 — core/lib/circuit/src/circuit.rs:4672-4685 | core/lib/circuit/src/circuit.rs:4767-4780 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) core/lib/circuit/src/witness/forced_exit.rs:137 — core/lib/circuit/src/witness/forced_exit.rs:137-150 | core/lib/circuit/src/witness/transfer_to_new.rs:128-141 — before extracting anything, compare `core/lib/circuit/src/witness/forced_exit.rs` and `core/lib/circuit/src/witness/transfer_to_new.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (14 lines × 2) core/lib/types/src/tx/forced_exit.rs:79 — core/lib/types/src/tx/forced_exit.rs:79-92 | core/lib/types/src/tx/transfer.rs:87-100 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (14 lines × 2) core/lib/circuit/src/circuit.rs:3361 — core/lib/circuit/src/circuit.rs:3361-3374 | core/lib/circuit/src/circuit.rs:3385-3398 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×4
  • Duplicated block (17 lines × 2) core/lib/circuit/src/circuit.rs:1711 — core/lib/circuit/src/circuit.rs:1711-1727 | core/lib/circuit/src/circuit.rs:2791-2807 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (17 lines × 2) core/lib/circuit/src/circuit.rs:4737 — core/lib/circuit/src/circuit.rs:4737-4753 | core/lib/circuit/src/circuit.rs:4860-4876 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (17 lines × 2) core/lib/types/src/tx/transfer.rs:172 — core/lib/types/src/tx/transfer.rs:172-188 | core/lib/types/src/tx/withdraw.rs:173-189 — before extracting anything, compare `core/lib/types/src/tx/transfer.rs` and `core/lib/types/src/tx/withdraw.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (17 lines × 2) sdk/zksync-rs/src/operations/transfer.rs:63 — sdk/zksync-rs/src/operations/transfer.rs:63-79 | sdk/zksync-rs/src/operations/withdraw.rs:60-76 — before extracting anything, compare `sdk/zksync-rs/src/operations/transfer.rs` and `sdk/zksync-rs/src/operations/withdraw.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×4
  • Duplicated block (16 lines × 2) core/lib/circuit/src/circuit.rs:3778 — core/lib/circuit/src/circuit.rs:3778-3793 | core/lib/circuit/src/circuit.rs:4052-4067 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) core/lib/circuit/src/circuit.rs:3941 — core/lib/circuit/src/circuit.rs:3941-3956 | core/lib/circuit/src/circuit.rs:4202-4217 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) core/lib/circuit/src/circuit.rs:4692 — core/lib/circuit/src/circuit.rs:4692-4707 | core/lib/circuit/src/circuit.rs:4787-4802 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) core/lib/types/src/tx/mint_nft.rs:72 — core/lib/types/src/tx/mint_nft.rs:72-87 | core/lib/types/src/tx/swap.rs:218-233 — before extracting anything, compare `core/lib/types/src/tx/mint_nft.rs` and `core/lib/types/src/tx/swap.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×4
  • Duplicated block (13 lines × 2) core/lib/circuit/src/witness/utils.rs:347 — core/lib/circuit/src/witness/utils.rs:347-359 | core/lib/circuit/src/witness/utils.rs:362-374 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) core/lib/storage/src/chain/mempool/mod.rs:167 — core/lib/storage/src/chain/mempool/mod.rs:167-179 | core/lib/storage/src/chain/mempool/mod.rs:201-213 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) core/lib/circuit/src/circuit.rs:3426 — core/lib/circuit/src/circuit.rs:3426-3438 | core/lib/circuit/src/circuit.rs:3440-3452 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) core/lib/storage/src/event/mod.rs:239 — core/lib/storage/src/event/mod.rs:239-251 | core/lib/storage/src/event/mod.rs:277-289 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D5 · Coupling · Off the main sequence · ×4
  • Off the main sequence: vlog — vlog: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 10 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 8 project(s), so it's rigid to change.
  • Off the main sequence: zksync_types — zksync_types: abstractness 0.03, instability 0.21, distance 0.76 — zone of pain — concrete and depended on by 15 project(s), so it's rigid to change.
  • Off the main sequence: zksync_crypto — zksync_crypto: abstractness 0.18, instability 0.10, distance 0.72 — zone of pain — concrete and depended on by 9 project(s), so it's rigid to change.
D2 · Cognitive Complexity · OperationsExtSchema · ×3
  • OperationsExtSchema::get_account_transactions_history_from (cognitive 26) core/lib/storage/src/chain/operations_ext/mod.rs:863 — OperationsExtSchema::get_account_transactions_history_from has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (20 pts), match/switch 2 (4 pts), loops 1 (2 pts) (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • OperationsExtSchema::get_account_transactions_history (cognitive 23) core/lib/storage/src/chain/operations_ext/mod.rs:670 — OperationsExtSchema::get_account_transactions_history has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (18 pts), match/switch 1 (3 pts), loops 1 (2 pts) (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • OperationsExtSchema::get_account_transactions (cognitive 19) core/lib/storage/src/chain/operations_ext/mod.rs:1051 — OperationsExtSchema::get_account_transactions has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), match/switch 2 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×3
  • Duplicated block (19 lines × 2) core/lib/types/src/priority_ops/mod.rs:186 — core/lib/types/src/priority_ops/mod.rs:186-204 | core/lib/types/src/priority_ops/mod.rs:296-314 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (19 lines × 2) sdk/zksync-rs/src/operations/transfer.rs:56 — sdk/zksync-rs/src/operations/transfer.rs:56-74 | sdk/zksync-rs/src/operations/transfer_nft.rs:62-80 — before extracting anything, compare `sdk/zksync-rs/src/operations/transfer.rs` and `sdk/zksync-rs/src/operations/transfer_nft.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (19 lines × 2) core/lib/circuit/src/witness/mint_nft.rs:439 — core/lib/circuit/src/witness/mint_nft.rs:439-457 | core/lib/circuit/src/witness/withdraw_nft.rs:393-411 — before extracting anything, compare `core/lib/circuit/src/witness/mint_nft.rs` and `core/lib/circuit/src/witness/withdraw_nft.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×3
  • Duplicated block (8 lines × 3) core/lib/circuit/src/witness/forced_exit.rs:158 — core/lib/circuit/src/witness/forced_exit.rs:158-165 | core/lib/circuit/src/witness/transfer_to_new.rs:149-156 | core/lib/circuit/src/witness/withdraw.rs:127-134 — before extracting anything, compare `core/lib/circuit/src/witness/forced_exit.rs` and `core/lib/circuit/src/witness/transfer_to_new.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 3) core/lib/types/src/tx/transfer.rs:115 — core/lib/types/src/tx/transfer.rs:115-122 | core/lib/types/src/tx/withdraw.rs:117-124 | core/lib/types/src/tx/withdraw_nft.rs:113-120 — before extracting anything, compare `core/lib/types/src/tx/transfer.rs` and `core/lib/types/src/tx/withdraw.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 3) core/lib/circuit/src/circuit.rs:1653 — core/lib/circuit/src/circuit.rs:1653-1660 | core/lib/circuit/src/circuit.rs:1713-1720 | core/lib/circuit/src/circuit.rs:2793-2801 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×3
  • Duplicated block (5 lines × 2) core/lib/circuit/src/witness/swap.rs:75 — core/lib/circuit/src/witness/swap.rs:75-79 | core/lib/circuit/src/witness/swap.rs:87-91 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) core/lib/circuit/src/circuit.rs:125 — core/lib/circuit/src/circuit.rs:125-129 | core/lib/circuit/src/exit_circuit.rs:54-60 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) core/lib/circuit/src/utils.rs:51 — core/lib/circuit/src/utils.rs:51-55 | core/lib/circuit/src/utils.rs:178-182 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (17 lines × 2 locations) · ×3
  • Duplicated block (17 lines × 2 locations) contracts/scripts/deploy-erc20.ts:51 — contracts/scripts/deploy-erc20.ts:51 · contracts/scripts/server-add-erc20.ts:33 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (17 lines × 2 locations) sdk/zksync.js/src/utils.ts:155 — sdk/zksync.js/src/utils.ts:155 · sdk/zksync.js/src/utils.ts:198 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (17 lines × 2 locations) sdk/zksync.js/src/utils.ts:675 — sdk/zksync.js/src/utils.ts:675 · sdk/zksync.js/src/utils.ts:792 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D2 · Cognitive Complexity · TxSender · ×2
  • TxSender::submit_txs_batch (cognitive 48) core/bin/zksync_api/src/api_server/tx_sender.rs:649 — TxSender::submit_txs_batch has cognitive complexity 48 (threshold 15). Drivers by points: if/else 26 (41 pts), loops 4, match/switch 1 (2 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TxSender::submit_tx (cognitive 20) core/bin/zksync_api/src/api_server/tx_sender.rs:493 — TxSender::submit_tx has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · zksync_api · ×2
  • zksync_api::api_server::tx_sender::verify_txs_batch_signature (cognitive 38) core/bin/zksync_api/src/api_server/tx_sender.rs:1126 — zksync_api::api_server::tx_sender::verify_txs_batch_signature has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (32 pts), match/switch 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • zksync_api::signature_checker::verify_eth_signature_txs_batch (cognitive 20) core/bin/zksync_api/src/signature_checker.rs:232 — zksync_api::signature_checker::verify_eth_signature_txs_batch has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 2 (3 pts), match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ZkSyncPriorityOp · ×2
  • ZkSyncPriorityOp::legacy_parse_from_priority_queue_logs (cognitive 29) core/lib/types/src/priority_ops/mod.rs:110 — ZkSyncPriorityOp::legacy_parse_from_priority_queue_logs has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (28 pts), match/switch 1 (nesting depth added 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • ZkSyncPriorityOp::parse_from_priority_queue_logs (cognitive 25) core/lib/types/src/priority_ops/mod.rs:229 — ZkSyncPriorityOp::parse_from_priority_queue_logs has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (24 pts), match/switch 1 (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D3 · God Classes · FunctionTooLong · ×2
  • FunctionTooLong: zksync_circuit::witness::utils::build_block_witness core/lib/circuit/src/witness/utils.rs:739 — FunctionTooLong — zksync_circuit::witness::utils::build_block_witness runs 161 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 61 over it, 1.61× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: zksync_circuit::exit_circuit::create_exit_circuit_with_public_input core/lib/circuit/src/exit_circuit.rs:239 — FunctionTooLong — zksync_circuit::exit_circuit::create_exit_circuit_with_public_input runs 110 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 10 over it, 1.10× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D36 · Supply-chain Provenance & Signing · REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (5 members, 50+ identical tokens) core/lib/circuit/src/circuit.rs:1304 — core/lib/circuit/src/circuit.rs:1304-1538 | core/lib/circuit/src/circuit.rs:2855-3142 | core/lib/circuit/src/circuit.rs:3160-3793 | core/lib/circuit/src/circuit.rs:3814-4067 | core/lib/circuit/src/circuit.rs:4088-4350 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) sdk/zksync-rs/src/signer.rs:205 — sdk/zksync-rs/src/signer.rs:205-236 | sdk/zksync-rs/src/signer.rs:246-277 | sdk/zksync-rs/src/signer.rs:286-315 | sdk/zksync-rs/src/signer.rs:324-355 | sdk/zksync-rs/src/signer.rs:365-397 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (4 members, 50+ identical tokens) core/lib/circuit/src/exit_circuit.rs:246 — core/lib/circuit/src/exit_circuit.rs:246-372 | core/lib/circuit/src/witness/full_exit.rs:231-383 | core/lib/circuit/src/witness/mint_nft.rs:209-510 | core/lib/circuit/src/witness/withdraw_nft.rs:235-454 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) core/lib/circuit/src/witness/change_pubkey_offchain.rs:153 — core/lib/circuit/src/witness/change_pubkey_offchain.rs:153-246 | core/lib/circuit/src/witness/deposit.rs:155-222 | core/lib/circuit/src/witness/full_exit.rs:231-383 | core/lib/circuit/src/witness/withdraw.rs:163-261 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Duplicated block (23 lines × 2) · ×2
  • Duplicated block (23 lines × 2) core/lib/circuit/src/circuit.rs:4707 — core/lib/circuit/src/circuit.rs:4707-4729 | core/lib/circuit/src/circuit.rs:4806-4828 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (23 lines × 2) core/lib/types/src/tx/primitives/eip712_signature/struct_builder.rs:101 — core/lib/types/src/tx/primitives/eip712_signature/struct_builder.rs:101-123 | core/lib/types/src/tx/primitives/eip712_signature/struct_builder.rs:140-162 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×2
  • Duplicated block (21 lines × 2) core/lib/circuit/src/witness/deposit.rs:64 — core/lib/circuit/src/witness/deposit.rs:64-84 | core/lib/circuit/src/witness/withdraw.rs:76-96 — before extracting anything, compare `core/lib/circuit/src/witness/deposit.rs` and `core/lib/circuit/src/witness/withdraw.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (21 lines × 2) core/lib/crypto/src/primitives.rs:294 — core/lib/crypto/src/primitives.rs:294-314 | core/lib/crypto/src/primitives.rs:354-374 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (16–18 lines × 2) · ×2
  • Duplicated block (16–18 lines × 2) core/lib/circuit/src/witness/full_exit.rs:272 — core/lib/circuit/src/witness/full_exit.rs:272-287 | core/lib/circuit/src/witness/withdraw_nft.rs:329-346 — before extracting anything, compare `core/lib/circuit/src/witness/full_exit.rs` and `core/lib/circuit/src/witness/withdraw_nft.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (16–18 lines × 2) core/lib/circuit/src/witness/transfer.rs:172 — core/lib/circuit/src/witness/transfer.rs:172-187 | core/lib/circuit/src/witness/transfer_to_new.rs:200-217 — before extracting anything, compare `core/lib/circuit/src/witness/transfer.rs` and `core/lib/circuit/src/witness/transfer_to_new.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 142 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (16 lines × 3) · ×2
  • Duplicated block (16 lines × 3) core/lib/circuit/src/circuit.rs:1553 — core/lib/circuit/src/circuit.rs:1553-1568 | core/lib/circuit/src/circuit.rs:2262-2280 | core/lib/circuit/src/circuit.rs:2569-2588 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (16 lines × 3) sdk/zksync-rs/src/operations/change_pubkey.rs:68 — sdk/zksync-rs/src/operations/change_pubkey.rs:68-84 | sdk/zksync-rs/src/operations/mint_nft.rs:60-75 | sdk/zksync-rs/src/operations/withdraw_nft.rs:64-79 — before extracting anything, compare `sdk/zksync-rs/src/operations/change_pubkey.rs` and `sdk/zksync-rs/src/operations/mint_nft.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (11–13 lines × 2) · ×2
  • Duplicated block (11–13 lines × 2) core/lib/circuit/src/circuit.rs:1461 — core/lib/circuit/src/circuit.rs:1461-1471 | core/lib/circuit/src/circuit.rs:4236-4248 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11–13 lines × 2) core/lib/circuit/src/circuit.rs:2972 — core/lib/circuit/src/circuit.rs:2972-2982 | core/lib/circuit/src/circuit.rs:3932-3944 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×2
  • Duplicated block (12–13 lines × 2) core/lib/circuit/src/circuit.rs:2460 — core/lib/circuit/src/circuit.rs:2460-2472 | core/lib/circuit/src/circuit.rs:2770-2781 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12–13 lines × 2) core/lib/crypto/src/primitives.rs:158 — core/lib/crypto/src/primitives.rs:158-170 | sdk/zksync-crypto/src/utils.rs:53-64 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×2
  • Duplicated block (11–12 lines × 2) core/lib/circuit/src/circuit.rs:1491 — core/lib/circuit/src/circuit.rs:1491-1501 | core/lib/circuit/src/circuit.rs:2979-2990 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11–12 lines × 2) core/lib/circuit/src/circuit.rs:2462 — core/lib/circuit/src/circuit.rs:2462-2473 | core/lib/circuit/src/circuit.rs:2487-2497 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (10–11 lines × 4) · ×2
  • Duplicated block (10–11 lines × 4) core/lib/circuit/src/circuit.rs:1526 — core/lib/circuit/src/circuit.rs:1526-1535 | core/lib/circuit/src/circuit.rs:3073-3083 | core/lib/circuit/src/circuit.rs:4001-4011 | core/lib/circuit/src/circuit.rs:4254-4264 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (10–11 lines × 4) core/lib/circuit/src/witness/utils.rs:780 — core/lib/circuit/src/witness/utils.rs:780-789 | core/lib/circuit/src/witness/utils.rs:795-805 | core/lib/circuit/src/witness/utils.rs:811-820 | core/lib/circuit/src/witness/utils.rs:868-877 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (10 lines × 4) · ×2
  • Duplicated block (10 lines × 4) core/lib/circuit/src/witness/utils.rs:853 — core/lib/circuit/src/witness/utils.rs:853-862 | core/lib/circuit/src/witness/utils.rs:887-896 | core/lib/circuit/src/witness/utils.rs:903-912 | core/lib/circuit/src/witness/utils.rs:918-927 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (10 lines × 4) core/lib/circuit/src/circuit.rs:1685 — core/lib/circuit/src/circuit.rs:1685-1694 | core/lib/circuit/src/circuit.rs:2461-2472 | core/lib/circuit/src/circuit.rs:2486-2496 | core/lib/circuit/src/circuit.rs:2771-2781 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×2
  • Duplicated block (10 lines × 3) core/lib/circuit/src/circuit.rs:1585 — core/lib/circuit/src/circuit.rs:1585-1594 | core/lib/circuit/src/circuit.rs:2294-2303 | core/lib/circuit/src/circuit.rs:2606-2615 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (10 lines × 3) core/lib/circuit/src/circuit.rs:1403 — core/lib/circuit/src/circuit.rs:1403-1412 | core/lib/circuit/src/circuit.rs:1829-1838 | core/lib/circuit/src/circuit.rs:2071-2080 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×2
  • Duplicated block (7 lines × 3) core/lib/storage/src/chain/account/records.rs:56 — core/lib/storage/src/chain/account/records.rs:56-62 | core/lib/storage/src/tokens/records.rs:123-129 | core/lib/storage/src/tokens/records.rs:141-147 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (7 lines × 3) core/lib/types/src/tx/transfer.rs:130 — core/lib/types/src/tx/transfer.rs:130-136 | core/lib/types/src/tx/withdraw.rs:155-161 | core/lib/types/src/tx/withdraw_nft.rs:128-134 — before extracting anything, compare `core/lib/types/src/tx/transfer.rs` and `core/lib/types/src/tx/withdraw.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D6 · Cohesion (LCOM4) · Low cohesion · ×2
  • Low cohesion: Database (LCOM4 20) core/bin/zksync_witness_generator/src/database.rs:25 — Database's methods fall into 20 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 20 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Database (LCOM4 11) core/bin/zksync_eth_sender/src/database.rs:113 — Database's methods fall into 11 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 11 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
R10 · Code Duplication · Duplicated block (22 lines × 2 locations) · ×2
  • Duplicated block (22 lines × 2 locations) sdk/zksync.js/src/rest-provider.ts:184 — sdk/zksync.js/src/rest-provider.ts:184 · sdk/zksync.js/src/rest-provider.ts:325 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
  • Duplicated block (22 lines × 2 locations) sdk/zksync.js/src/utils.ts:717 — sdk/zksync.js/src/utils.ts:717 · sdk/zksync.js/src/utils.ts:807 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (16 lines × 2 locations) · ×2
  • Duplicated block (16 lines × 2 locations) sdk/zksync.js/src/eth-message-signer.ts:31 — sdk/zksync.js/src/eth-message-signer.ts:31 · sdk/zksync.js/src/eth-message-signer.ts:182 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2 locations) sdk/zksync.js/src/provider.ts:211 — sdk/zksync.js/src/provider.ts:211 · sdk/zksync.js/src/provider.ts:242 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (13 lines × 2 locations) · ×2
  • Duplicated block (13 lines × 2 locations) sdk/zksync.js/src/operations.ts:74 — sdk/zksync.js/src/operations.ts:74 · sdk/zksync.js/src/operations.ts:117 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (13 lines × 2 locations) sdk/zksync.js/src/transport.ts:56 — sdk/zksync.js/src/transport.ts:56 · sdk/zksync.js/src/transport.ts:155 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (12 lines × 2 locations) · ×2
  • Duplicated block (12 lines × 2 locations) sdk/zksync.js/src/rest-provider.ts:376 — sdk/zksync.js/src/rest-provider.ts:376 · sdk/zksync.js/src/rest-provider.ts:416 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (12 lines × 2 locations) sdk/zksync.js/src/wallet.ts:420 — sdk/zksync.js/src/wallet.ts:420 · sdk/zksync.js/src/wallet.ts:673 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (11 lines × 3 locations) · ×2
  • Duplicated block (11 lines × 3 locations) contracts/src.ts/deploy.ts:305 — contracts/src.ts/deploy.ts:305 · contracts/src.ts/deploy.ts:343 · contracts/src.ts/deploy.ts:436 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (11 lines × 3 locations) sdk/zksync.js/src/provider.ts:41 — sdk/zksync.js/src/provider.ts:41 · sdk/zksync.js/src/provider.ts:53 · sdk/zksync.js/src/provider.ts:73 — all 3 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
D1 · Cyclomatic Complexity · TxSender · ×1
  • TxSender::submit_txs_batch (cyclomatic 28) core/bin/zksync_api/src/api_server/tx_sender.rs:649 — TxSender::submit_txs_batch has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CallsHelper · ×1
  • CallsHelper::execute (cyclomatic 28) core/bin/zksync_api/src/api_server/web3/calls.rs:96 — CallsHelper::execute has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · deploy.main (cyclomatic 26) · ×1
  • deploy.main (cyclomatic 26) contracts/scripts/deploy.ts:13 — deploy.main has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · upgrade-testnet.main (cyclomatic 20) · ×1
  • upgrade-testnet.main (cyclomatic 20) contracts/scripts/upgrade-testnet.ts:13 — upgrade-testnet.main has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · provider.getDefaultProvider (cyclomatic 20) · ×1
  • provider.getDefaultProvider (cyclomatic 20) sdk/zksync.js/src/provider.ts:33 — provider.getDefaultProvider has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · zksync_server · ×1
  • zksync_server::run_server (cyclomatic 16) core/bin/server/src/main.rs:154 — zksync_server::run_server has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · zksync_api · ×1
  • zksync_api::api_server::tx_sender::verify_txs_batch_signature (cyclomatic 16) core/bin/zksync_api/src/api_server/tx_sender.rs:1126 — zksync_api::api_server::tx_sender::verify_txs_batch_signature has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ZkSyncPriorityOp · ×1
  • ZkSyncPriorityOp::legacy_parse_from_priority_queue_logs (cyclomatic 16) core/lib/types/src/priority_ops/mod.rs:110 — ZkSyncPriorityOp::legacy_parse_from_priority_queue_logs has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D15 · Churn × Complexity Hotspots · Hotspot · ×1
  • Hotspot: core/bin/zksync_api/src/api_server/tx_sender.rs core/bin/zksync_api/src/api_server/tx_sender.rs:649 — core/bin/zksync_api/src/api_server/tx_sender.rs changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in TxSender::submit_txs_batch at line 649. 1 of those changes was a fix/bug commit, and the other 1 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-02-07..2026-05-08, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-02-07 11:04:12 +02:00' --until='2026-05-08 11:04:12 +02:00' --full-history --no-merges -- core/bin/zksync_api/src/api_server/tx_sender.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
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.
D22 · Internal API Consistency · Ambiguous parameter naming and overlapping intent. `account_info` takes a generic `account_id_or_address` string and a `state_type` to filter, while `account_full_info` takes the same generic identifier but presumably returns all states. The naming convention `account_info` vs `account_full_info` is inconsistent with other methods like `block_by_position` vs `block_transactions`. Furthermore, `account_id_or_address` is a poor API design choice compared to using a dedicated enum or distinct methods for ID vs Address lookups. · ×1
  • Ambiguous parameter naming and overlapping intent. `account_info` takes a generic `account_id_or_address` string and a `state_type` to filter, while `account_full_info` takes the same generic identifier but presumably returns all states. The naming convention `account_info` vs `account_full_info` is inconsistent with other methods like `block_by_position` vs `block_transactions`. Furthermore, `account_id_or_address` is a poor API design choice compared to using a dedicated enum or distinct methods for ID vs Address lookups. — Rename `account_info` to `get_account_state` or similar to clarify it retrieves a specific state. Consider splitting `account_id_or_address` into distinct `get_account_by_id` and `get_account_by_address` methods, or use a strongly-typed `AccountId` or `Address` type instead of `str`. (signatures: Client.account_info(account_id_or_address: str, state_type: str): Result | Client.account_full_info(account_id_or_address: str): Result)
D22 · Internal API Consistency · Inconsistent verb usage in module-level functions. The functions use the prefix `run_` which implies execution of a process, but they are essentially factory or calculation methods (`create_leaves`, `calculate_root`, `create_proof`). The prefix `run_` is redundant and inconsistent with the method naming style in other modules (e.g., `restore_zksync_tree_from_files`). · ×1
  • Inconsistent verb usage in module-level functions. The functions use the prefix `run_` which implies execution of a process, but they are essentially factory or calculation methods (`create_leaves`, `calculate_root`, `create_proof`). The prefix `run_` is redundant and inconsistent with the method naming style in other modules (e.g., `restore_zksync_tree_from_files`). — Remove the `run_` prefix from these functions to align with standard naming conventions (e.g., `create_keccak_leaves`, `calculate_root_for_keccak_tree`). If they are meant to be entry points, ensure all entry points follow the same pattern. (signatures: keccak_merkle_tree.run_create_keccak_leaves(...) | keccak_merkle_tree.run_calculate_root_for_keccak_tree(...) | keccak_merkle_tree.run_create_proof_for_keccak_tree(...))
D22 · Internal API Consistency · Inconsistent parameter typing for token identification. `token_by_id` uses `TokenLike` (likely a struct/enum), while `token_price` uses `TokenLike` for the first arg but `str` for `token_id_or_usd`. This suggests `TokenLike` might not be fully utilized or that `token_price` should also accept a structured token identifier for consistency. · ×1
  • Inconsistent parameter typing for token identification. `token_by_id` uses `TokenLike` (likely a struct/enum), while `token_price` uses `TokenLike` for the first arg but `str` for `token_id_or_usd`. This suggests `TokenLike` might not be fully utilized or that `token_price` should also accept a structured token identifier for consistency. — Standardize token identification across all client methods to use a single type (e.g., `TokenLike` or `TokenId`) rather than mixing `TokenLike` and `str`. (signatures: Client.token_by_id(token: TokenLike): Result | Client.token_price(token: TokenLike, token_id_or_usd: str): Result)
D22 · Internal API Consistency · Inconsistent parameter structure for transaction submission. `submit_tx` takes a transaction and a signature separately. `submit_batch` takes a `TxWithSignature` (which already contains the signature) and a separate `EthBatchSignatures`. This implies `TxWithSignature` might be a list or a single item, but the naming and structure are confusing compared to the single tx case. · ×1
  • Inconsistent parameter structure for transaction submission. `submit_tx` takes a transaction and a signature separately. `submit_batch` takes a `TxWithSignature` (which already contains the signature) and a separate `EthBatchSignatures`. This implies `TxWithSignature` might be a list or a single item, but the naming and structure are confusing compared to the single tx case. — Align the signature handling. Either always pass `TxWithSignature` (or a list thereof) and handle signature verification internally, or consistently pass `Tx` and `Signature` separately. Clarify if `TxWithSignature` is a single item or a collection. (signatures: Client.submit_tx(tx: ZkSyncTx, signature: TxEthSignatureVariant): Result | Client.submit_batch(txs: TxWithSignature, signature: EthBatchSignatures): Result)
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member family (5 members, 12 shared lines) · ×1
  • Near-duplicate member family (5 members, 12 shared lines) core/lib/circuit/src/circuit.rs:1304 — core/lib/circuit/src/circuit.rs:1304-1538 | core/lib/circuit/src/circuit.rs:1917-2180 | core/lib/circuit/src/circuit.rs:2855-3142 | core/lib/circuit/src/circuit.rs:3814-4067 | core/lib/circuit/src/circuit.rs:4088-4350 — These 5 members are variants of one another: a block of 12 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Near-duplicate member family (3 members, 53 shared lines) · ×1
  • Near-duplicate member family (3 members, 53 shared lines) core/lib/circuit/src/circuit.rs:1552 — core/lib/circuit/src/circuit.rs:1552-1759 | core/lib/circuit/src/circuit.rs:2261-2550 | core/lib/circuit/src/circuit.rs:2568-2834 — These 3 members are variants of one another: a block of 53 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
D4 · Code Duplication · Near-duplicate member pair (96 shared lines) · ×1
  • Near-duplicate member pair (96 shared lines) core/lib/circuit/src/witness/transfer.rs:162 — core/lib/circuit/src/witness/transfer.rs:162-337 | core/lib/circuit/src/witness/transfer_to_new.rs:186-381 — These two members are variants of one another: 96 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Members sharing a duplicated core (7 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (7 members, 50+ identical tokens) core/lib/circuit/src/witness/close_account.rs:69 — core/lib/circuit/src/witness/close_account.rs:69-92 | core/lib/circuit/src/witness/forced_exit.rs:136-191 | core/lib/circuit/src/witness/mint_nft.rs:121-205 | core/lib/circuit/src/witness/transfer.rs:121-158 | core/lib/circuit/src/witness/transfer_to_new.rs:127-182 | core/lib/circuit/src/witness/withdraw.rs:120-159 | core/lib/circuit/src/witness/withdraw_nft.rs:150-231 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
D4 · Code Duplication · Duplicated block (54 lines × 2) · ×1
  • Duplicated block (54 lines × 2) core/lib/circuit/src/witness/transfer.rs:257 — core/lib/circuit/src/witness/transfer.rs:257-310 | core/lib/circuit/src/witness/transfer_to_new.rs:305-358 — before extracting anything, compare `core/lib/circuit/src/witness/transfer.rs` and `core/lib/circuit/src/witness/transfer_to_new.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 142 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (41–43 lines × 2) · ×1
  • Duplicated block (41–43 lines × 2) core/lib/circuit/src/circuit.rs:2386 — core/lib/circuit/src/circuit.rs:2386-2426 | core/lib/circuit/src/circuit.rs:2696-2738 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (42 lines × 2) · ×1
  • Duplicated block (42 lines × 2) core/lib/storage/src/chain/operations_ext/mod.rs:760 — core/lib/storage/src/chain/operations_ext/mod.rs:760-801 | core/lib/storage/src/chain/operations_ext/mod.rs:1002-1043 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (34–36 lines × 4) · ×1
  • Duplicated block (34–36 lines × 4) core/lib/circuit/src/circuit.rs:1419 — core/lib/circuit/src/circuit.rs:1419-1452 | core/lib/circuit/src/circuit.rs:1987-2022 | core/lib/circuit/src/circuit.rs:2992-3025 | core/lib/circuit/src/circuit.rs:3954-3987 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (30–31 lines × 2) · ×1
  • Duplicated block (30–31 lines × 2) core/lib/circuit/src/witness/swap.rs:345 — core/lib/circuit/src/witness/swap.rs:345-374 | core/lib/circuit/src/witness/swap.rs:375-405 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (24–27 lines × 2) · ×1
  • Duplicated block (24–27 lines × 2) core/lib/circuit/src/circuit.rs:1789 — core/lib/circuit/src/circuit.rs:1789-1812 | core/lib/circuit/src/circuit.rs:2024-2050 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (26–27 lines × 2) · ×1
  • Duplicated block (26–27 lines × 2) core/lib/circuit/src/witness/transfer.rs:201 — core/lib/circuit/src/witness/transfer.rs:201-226 | core/lib/circuit/src/witness/transfer_to_new.rs:236-262 — before extracting anything, compare `core/lib/circuit/src/witness/transfer.rs` and `core/lib/circuit/src/witness/transfer_to_new.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 142 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (27 lines × 2) · ×1
  • Duplicated block (27 lines × 2) core/lib/types/src/priority_ops/mod.rs:142 — core/lib/types/src/priority_ops/mod.rs:142-168 | core/lib/types/src/priority_ops/mod.rs:257-283 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (26 lines × 2) · ×1
  • Duplicated block (26 lines × 2) core/lib/circuit/src/circuit.rs:1585 — core/lib/circuit/src/circuit.rs:1585-1610 | core/lib/circuit/src/circuit.rs:2606-2631 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (22–25 lines × 2) · ×1
  • Duplicated block (22–25 lines × 2) core/lib/crypto/src/primitives.rs:252 — core/lib/crypto/src/primitives.rs:252-276 | core/lib/crypto/src/primitives.rs:325-346 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (24 lines × 3) · ×1
  • Duplicated block (24 lines × 3) core/lib/circuit/src/witness/forced_exit.rs:212 — core/lib/circuit/src/witness/forced_exit.rs:212-235 | core/lib/circuit/src/witness/transfer.rs:176-199 | core/lib/circuit/src/witness/withdraw.rs:173-196 — before extracting anything, compare `core/lib/circuit/src/witness/forced_exit.rs` and `core/lib/circuit/src/witness/withdraw.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (21–22 lines × 5) · ×1
  • Duplicated block (21–22 lines × 5) sdk/zksync-rs/src/signer.rs:216 — sdk/zksync-rs/src/signer.rs:216-236 | sdk/zksync-rs/src/signer.rs:257-277 | sdk/zksync-rs/src/signer.rs:295-315 | sdk/zksync-rs/src/signer.rs:334-355 | sdk/zksync-rs/src/signer.rs:376-397 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (21–22 lines × 2) · ×1
  • Duplicated block (21–22 lines × 2) core/lib/circuit/src/circuit.rs:2427 — core/lib/circuit/src/circuit.rs:2427-2448 | core/lib/circuit/src/circuit.rs:2739-2759 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (20–21 lines × 2) · ×1
  • Duplicated block (20–21 lines × 2) core/lib/circuit/src/circuit.rs:2262 — core/lib/circuit/src/circuit.rs:2262-2281 | core/lib/circuit/src/circuit.rs:2569-2589 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (19–21 lines × 2) · ×1
  • Duplicated block (19–21 lines × 2) core/lib/circuit/src/witness/forced_exit.rs:105 — core/lib/circuit/src/witness/forced_exit.rs:105-123 | core/lib/circuit/src/witness/withdraw.rs:87-107 — before extracting anything, compare `core/lib/circuit/src/witness/forced_exit.rs` and `core/lib/circuit/src/witness/withdraw.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (20 lines × 4) · ×1
  • Duplicated block (20 lines × 4) core/lib/circuit/src/witness/change_pubkey_offchain.rs:211 — core/lib/circuit/src/witness/change_pubkey_offchain.rs:211-230 | core/lib/circuit/src/witness/deposit.rs:191-210 | core/lib/circuit/src/witness/full_exit.rs:321-340 | core/lib/circuit/src/witness/withdraw.rs:226-245 — before extracting anything, compare `core/lib/circuit/src/witness/deposit.rs` and `core/lib/circuit/src/witness/withdraw.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (20 lines × 3) · ×1
  • Duplicated block (20 lines × 3) core/lib/types/src/tx/forced_exit.rs:228 — core/lib/types/src/tx/forced_exit.rs:228-247 | core/lib/types/src/tx/transfer.rs:269-288 | core/lib/types/src/tx/withdraw.rs:271-290 — before extracting anything, compare `core/lib/types/src/tx/transfer.rs` and `core/lib/types/src/tx/withdraw.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×1
  • Duplicated block (20 lines × 2) core/lib/circuit/src/witness/full_exit.rs:108 — core/lib/circuit/src/witness/full_exit.rs:108-127 | core/lib/circuit/src/witness/withdraw_nft.rs:94-113 — before extracting anything, compare `core/lib/circuit/src/witness/full_exit.rs` and `core/lib/circuit/src/witness/withdraw_nft.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (18–20 lines × 2) · ×1
  • Duplicated block (18–20 lines × 2) core/lib/storage/src/chain/block/mod.rs:327 — core/lib/storage/src/chain/block/mod.rs:327-346 | core/lib/storage/src/chain/mempool/mod.rs:727-744 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (16–19 lines × 3) · ×1
  • Duplicated block (16–19 lines × 3) core/lib/storage/src/chain/account/mod.rs:290 — core/lib/storage/src/chain/account/mod.rs:290-305 | core/lib/storage/src/chain/state/mod.rs:402-420 | core/lib/storage/src/chain/state/mod.rs:623-638 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (18 lines × 3) · ×1
  • Duplicated block (18 lines × 3) core/lib/circuit/src/circuit.rs:3071 — core/lib/circuit/src/circuit.rs:3071-3088 | core/lib/circuit/src/circuit.rs:3999-4016 | core/lib/circuit/src/circuit.rs:4252-4269 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (4–18 lines × 3) · ×1
  • Duplicated block (4–18 lines × 3) core/lib/circuit/src/circuit.rs:1335 — core/lib/circuit/src/circuit.rs:1335-1338 | core/lib/circuit/src/circuit.rs:2872-2889 | core/lib/circuit/src/circuit.rs:3832-3847 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (17 lines × 3) · ×1
  • Duplicated block (17 lines × 3) core/lib/circuit/src/circuit.rs:1602 — core/lib/circuit/src/circuit.rs:1602-1618 | core/lib/circuit/src/circuit.rs:2311-2327 | core/lib/circuit/src/circuit.rs:2623-2639 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (9–17 lines × 2) · ×1
  • Duplicated block (9–17 lines × 2) core/lib/crypto/src/merkle_tree/parallel_smt.rs:491 — core/lib/crypto/src/merkle_tree/parallel_smt.rs:491-499 | core/lib/crypto/src/merkle_tree/parallel_smt.rs:734-750 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (15–17 lines × 2) · ×1
  • Duplicated block (15–17 lines × 2) core/lib/l1_event_listener/src/events_state.rs:528 — core/lib/l1_event_listener/src/events_state.rs:528-544 | core/lib/l1_event_listener/src/events_state.rs:585-599 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (15–16 lines × 2) · ×1
  • Duplicated block (15–16 lines × 2) core/lib/circuit/src/witness/transfer.rs:80 — core/lib/circuit/src/witness/transfer.rs:80-94 | core/lib/circuit/src/witness/transfer_to_new.rs:79-94 — before extracting anything, compare `core/lib/circuit/src/witness/transfer.rs` and `core/lib/circuit/src/witness/transfer_to_new.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 142 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (12–15 lines × 3) · ×1
  • Duplicated block (12–15 lines × 3) core/lib/crypto/src/circuit/utils.rs:52 — core/lib/crypto/src/circuit/utils.rs:52-66 | core/lib/crypto/src/primitives.rs:138-150 | sdk/zksync-crypto/src/utils.rs:38-49 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
D4 · Code Duplication · Duplicated block (15 lines × 3) · ×1
  • Duplicated block (15 lines × 3) sdk/zksync-rs/src/operations/transfer.rs:62 — sdk/zksync-rs/src/operations/transfer.rs:62-76 | sdk/zksync-rs/src/operations/transfer_nft.rs:68-82 | sdk/zksync-rs/src/operations/withdraw.rs:59-73 — before extracting anything, compare `sdk/zksync-rs/src/operations/transfer.rs` and `sdk/zksync-rs/src/operations/transfer_nft.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (14 lines × 4) · ×1
  • Duplicated block (14 lines × 4) core/lib/circuit/src/circuit.rs:3078 — core/lib/circuit/src/circuit.rs:3078-3091 | core/lib/circuit/src/circuit.rs:3747-3760 | core/lib/circuit/src/circuit.rs:4006-4019 | core/lib/circuit/src/circuit.rs:4259-4272 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (13–14 lines × 3) · ×1
  • Duplicated block (13–14 lines × 3) core/lib/circuit/src/circuit.rs:2985 — core/lib/circuit/src/circuit.rs:2985-2998 | core/lib/circuit/src/circuit.rs:3948-3960 | core/lib/circuit/src/circuit.rs:4209-4221 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (13 lines × 4) · ×1
  • Duplicated block (13 lines × 4) core/lib/circuit/src/circuit.rs:1320 — core/lib/circuit/src/circuit.rs:1320-1333 | core/lib/circuit/src/circuit.rs:2872-2886 | core/lib/circuit/src/circuit.rs:3832-3844 | core/lib/circuit/src/circuit.rs:4107-4120 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (9–12 lines × 4) · ×1
  • Duplicated block (9–12 lines × 4) core/lib/circuit/src/circuit.rs:1461 — core/lib/circuit/src/circuit.rs:1461-1471 | core/lib/circuit/src/circuit.rs:2390-2398 | core/lib/circuit/src/circuit.rs:2702-2710 | core/lib/circuit/src/circuit.rs:4237-4248 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (10–12 lines × 2) · ×1
  • Duplicated block (10–12 lines × 2) core/lib/circuit/src/utils.rs:167 — core/lib/circuit/src/utils.rs:167-176 | core/lib/crypto/src/circuit/utils.rs:86-97 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (11 lines × 4) · ×1
  • Duplicated block (11 lines × 4) core/lib/circuit/src/exit_circuit.rs:306 — core/lib/circuit/src/exit_circuit.rs:306-316 | core/lib/circuit/src/witness/full_exit.rs:308-318 | core/lib/circuit/src/witness/mint_nft.rs:414-424 | core/lib/circuit/src/witness/withdraw_nft.rs:368-378 — before extracting anything, compare `core/lib/circuit/src/witness/full_exit.rs` and `core/lib/circuit/src/witness/withdraw_nft.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×1
  • Duplicated block (11 lines × 3) core/lib/circuit/src/circuit.rs:1389 — core/lib/circuit/src/circuit.rs:1389-1399 | core/lib/circuit/src/circuit.rs:3915-3925 | core/lib/circuit/src/circuit.rs:4177-4187 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (9–10 lines × 3) · ×1
  • Duplicated block (9–10 lines × 3) core/lib/circuit/src/circuit.rs:1771 — core/lib/circuit/src/circuit.rs:1771-1780 | core/lib/circuit/src/circuit.rs:2856-2864 | core/lib/circuit/src/circuit.rs:3815-3824 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (7–9 lines × 4) · ×1
  • Duplicated block (7–9 lines × 4) core/lib/circuit/src/utils.rs:165 — core/lib/circuit/src/utils.rs:165-171 | core/lib/crypto/src/circuit/utils.rs:50-58 | core/lib/crypto/src/circuit/utils.rs:84-92 | core/lib/crypto/src/primitives.rs:136-142 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (8–9 lines × 2) · ×1
  • Duplicated block (8–9 lines × 2) core/lib/storage/src/chain/block/mod.rs:1186 — core/lib/storage/src/chain/block/mod.rs:1186-1194 | core/lib/storage/src/chain/operations_ext/mod.rs:1055-1062 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (7–8 lines × 2) · ×1
  • Duplicated block (7–8 lines × 2) core/lib/types/src/tx/transfer.rs:151 — core/lib/types/src/tx/transfer.rs:151-158 | core/lib/types/src/tx/withdraw.rs:132-138 — before extracting anything, compare `core/lib/types/src/tx/transfer.rs` and `core/lib/types/src/tx/withdraw.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (7 lines × 17) · ×1
  • Duplicated block (7 lines × 17) core/lib/circuit/src/witness/close_account.rs:79 — core/lib/circuit/src/witness/close_account.rs:79-85 | core/lib/circuit/src/witness/forced_exit.rs:147-153 | core/lib/circuit/src/witness/forced_exit.rs:162-168 | core/lib/circuit/src/witness/mint_nft.rs:132-138 | core/lib/circuit/src/witness/mint_nft.rs:146-152 | core/lib/circuit/src/witness/mint_nft.rs:160-166 | core/lib/circuit/src/witness/mint_nft.rs:174-180 | core/lib/circuit/src/witness/mint_nft.rs:188-194 | core/lib/circuit/src/witness/transfer.rs:132-138 | core/lib/circuit/src/witness/transfer.rs:147-153 | core/lib/circuit/src/witness/transfer_to_new.rs:138-144 | core/lib/circuit/src/witness/transfer_to_new.rs:153-159 | core/lib/circuit/src/witness/withdraw.rs:131-137 | core/lib/circuit/src/witness/withdraw_nft.rs:161-167 | core/lib/circuit/src/witness/withdraw_nft.rs:175-181 | core/lib/circuit/src/witness/withdraw_nft.rs:189-195 | core/lib/circuit/src/witness/withdraw_nft.rs:203-209 — before extracting anything, compare `core/lib/circuit/src/witness/forced_exit.rs` and `core/lib/circuit/src/witness/transfer_to_new.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (6 lines × 5) · ×1
  • Duplicated block (6 lines × 5) core/lib/circuit/src/circuit.rs:1490 — core/lib/circuit/src/circuit.rs:1490-1495 | core/lib/circuit/src/circuit.rs:2054-2060 | core/lib/circuit/src/circuit.rs:2978-2984 | core/lib/circuit/src/circuit.rs:3940-3946 | core/lib/circuit/src/circuit.rs:4201-4207 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (6 lines × 4) · ×1
  • Duplicated block (6 lines × 4) core/lib/circuit/src/circuit.rs:2906 — core/lib/circuit/src/circuit.rs:2906-2911 | core/lib/circuit/src/circuit.rs:2921-2926 | core/lib/circuit/src/circuit.rs:3861-3866 | core/lib/circuit/src/circuit.rs:3876-3881 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (5 lines × 8) · ×1
  • Duplicated block (5 lines × 8) core/lib/circuit/src/circuit.rs:1342 — core/lib/circuit/src/circuit.rs:1342-1346 | core/lib/circuit/src/circuit.rs:1374-1378 | core/lib/circuit/src/circuit.rs:1949-1953 | core/lib/circuit/src/circuit.rs:1981-1985 | core/lib/circuit/src/circuit.rs:2895-2899 | core/lib/circuit/src/circuit.rs:2927-2931 | core/lib/circuit/src/circuit.rs:3882-3886 | core/lib/circuit/src/circuit.rs:4143-4147 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (5 lines × 6) · ×1
  • Duplicated block (5 lines × 6) core/lib/circuit/src/circuit.rs:1352 — core/lib/circuit/src/circuit.rs:1352-1356 | core/lib/circuit/src/circuit.rs:1367-1371 | core/lib/circuit/src/circuit.rs:2905-2909 | core/lib/circuit/src/circuit.rs:2920-2924 | core/lib/circuit/src/circuit.rs:3860-3864 | core/lib/circuit/src/circuit.rs:3875-3879 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (8 lines × 5) · ×1
  • Duplicated block (8 lines × 5) core/lib/types/src/tx/mint_nft.rs:171 — core/lib/types/src/tx/mint_nft.rs:171-178 | core/lib/types/src/tx/swap.rs:374-381 | core/lib/types/src/tx/transfer.rs:205-212 | core/lib/types/src/tx/withdraw.rs:206-213 | core/lib/types/src/tx/withdraw_nft.rs:179-186 — before extracting anything, compare `core/lib/types/src/tx/mint_nft.rs` and `core/lib/types/src/tx/swap.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (12 lines × 4) · ×1
  • Duplicated block (12 lines × 4) sdk/zksync-rs/src/operations/change_pubkey.rs:115 — sdk/zksync-rs/src/operations/change_pubkey.rs:115-126 | sdk/zksync-rs/src/operations/mint_nft.rs:96-107 | sdk/zksync-rs/src/operations/transfer_nft.rs:148-159 | sdk/zksync-rs/src/operations/withdraw_nft.rs:119-130 — before extracting anything, compare `sdk/zksync-rs/src/operations/change_pubkey.rs` and `sdk/zksync-rs/src/operations/mint_nft.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (9 lines × 6) · ×1
  • Duplicated block (9 lines × 6) sdk/zksync-rs/src/operations/change_pubkey.rs:143 — sdk/zksync-rs/src/operations/change_pubkey.rs:143-151 | sdk/zksync-rs/src/operations/mint_nft.rs:124-132 | sdk/zksync-rs/src/operations/transfer.rs:165-173 | sdk/zksync-rs/src/operations/transfer_nft.rs:176-184 | sdk/zksync-rs/src/operations/withdraw.rs:165-173 | sdk/zksync-rs/src/operations/withdraw_nft.rs:147-155 — before extracting anything, compare `sdk/zksync-rs/src/operations/change_pubkey.rs` and `sdk/zksync-rs/src/operations/mint_nft.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (8 lines × 4) · ×1
  • Duplicated block (8 lines × 4) sdk/zksync-rs/src/operations/mint_nft.rs:86 — sdk/zksync-rs/src/operations/mint_nft.rs:86-93 | sdk/zksync-rs/src/operations/transfer.rs:102-109 | sdk/zksync-rs/src/operations/withdraw.rs:102-109 | sdk/zksync-rs/src/operations/withdraw_nft.rs:100-107 — before extracting anything, compare `sdk/zksync-rs/src/operations/mint_nft.rs` and `sdk/zksync-rs/src/operations/withdraw_nft.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (9 lines × 5) · ×1
  • Duplicated block (9 lines × 5) sdk/zksync-rs/src/operations/mint_nft.rs:144 — sdk/zksync-rs/src/operations/mint_nft.rs:144-152 | sdk/zksync-rs/src/operations/transfer.rs:197-205 | sdk/zksync-rs/src/operations/transfer_nft.rs:208-216 | sdk/zksync-rs/src/operations/withdraw.rs:185-193 | sdk/zksync-rs/src/operations/withdraw_nft.rs:167-175 — before extracting anything, compare `sdk/zksync-rs/src/operations/mint_nft.rs` and `sdk/zksync-rs/src/operations/transfer_nft.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×1
  • Duplicated block (9 lines × 3) core/lib/circuit/src/circuit.rs:2457 — core/lib/circuit/src/circuit.rs:2457-2465 | core/lib/circuit/src/circuit.rs:2482-2490 | core/lib/circuit/src/circuit.rs:2530-2538 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D43 · Malicious Dependencies · Malicious package · ×1
  • REDACTED
D44 · Platform End-of-Life · End-of-life runtime · ×1
  • End-of-life runtime: Rust 1.91 — rust-toolchain 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.
D8 · Code Coverage · Coverage not measured · ×1
  • Coverage not measured — JavaScript/TypeScript suite — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — core/tests/ts-tests/ runs mocha but declares no coverage provider, so the suite can run and still produce no lcov — add `c8` (or `nyc`) as a devDependency so the suite can be wrapped for coverage. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan. Alternatively, commit the lcov/Cobertura report your CI produces and it is read without a re-run.
R10 · Code Duplication · Duplicated block with local edits (126 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (126 matched lines × 2 locations) sdk/zksync.js/src/remote-wallet.ts:219 — sdk/zksync.js/src/remote-wallet.ts:219 · sdk/zksync.js/src/wallet.ts:531 — the two spans are one implementation copied and then locally edited — 692 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (37 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (37 matched lines × 2 locations) contracts/scripts/deploy-eip1271.ts:13 — contracts/scripts/deploy-eip1271.ts:13 · contracts/scripts/deploy-withdrawal-helpers.ts:12 — the two spans are one implementation copied and then locally edited — 259 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (34 lines × 2 locations) · ×1
  • Duplicated block (34 lines × 2 locations) sdk/zksync.js/src/remote-wallet.ts:163 — sdk/zksync.js/src/remote-wallet.ts:163 · sdk/zksync.js/src/remote-wallet.ts:280 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (31 lines × 2 locations) · ×1
  • Duplicated block (31 lines × 2 locations) sdk/zksync.js/src/rest-provider.ts:234 — sdk/zksync.js/src/rest-provider.ts:234 · sdk/zksync.js/src/rest-provider.ts:277 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (23 lines × 2 locations) · ×1
  • Duplicated block (23 lines × 2 locations) sdk/zksync.js/src/eth-message-signer.ts:121 — sdk/zksync.js/src/eth-message-signer.ts:121 · sdk/zksync.js/src/eth-message-signer.ts:150 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (20 lines × 2 locations) · ×1
  • Duplicated block (20 lines × 2 locations) sdk/zksync.js/src/signer.ts:362 — sdk/zksync.js/src/signer.ts:362 · sdk/zksync.js/src/signer.ts:400 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (18 lines × 4 locations) · ×1
  • Duplicated block (18 lines × 4 locations) contracts/src.ts/deploy.ts:170 — contracts/src.ts/deploy.ts:170 · contracts/src.ts/deploy.ts:195 · contracts/src.ts/deploy.ts:221 · contracts/src.ts/deploy.ts:409 — all 4 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (16 lines × 5 locations) · ×1
  • Duplicated block (16 lines × 5 locations) contracts/src.ts/deploy.ts:136 — contracts/src.ts/deploy.ts:136 · contracts/src.ts/deploy.ts:309 · contracts/src.ts/deploy.ts:347 · contracts/src.ts/deploy.ts:383 · +1 more site(s) not listed — all 5 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (15 lines × 2 locations) · ×1
  • Duplicated block (15 lines × 2 locations) sdk/zksync.js/src/wallet.ts:78 — sdk/zksync.js/src/wallet.ts:78 · sdk/zksync.js/src/wallet.ts:112 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (15 lines × 3 locations) · ×1
  • Duplicated block (15 lines × 3 locations) sdk/zksync.js/src/wallet.ts:833 — sdk/zksync.js/src/wallet.ts:833 · sdk/zksync.js/src/wallet.ts:903 · sdk/zksync.js/src/wallet.ts:1008 — all 3 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (14 lines × 2 locations) · ×1
  • Duplicated block (14 lines × 2 locations) contracts/scripts/deploy-testkit.ts:10 — contracts/scripts/deploy-testkit.ts:10 · REDACTED:12 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block with local edits (11 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (11 matched lines × 2 locations) infrastructure/token-lists-manager/index.ts:38 — infrastructure/token-lists-manager/index.ts:38 · REDACTED:56 — the two spans are one implementation copied and then locally edited — 61 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (9 lines × 7 locations) · ×1
  • Duplicated block (9 lines × 7 locations) contracts/scripts/deploy-erc20.ts:88 — contracts/scripts/deploy-erc20.ts:88 · contracts/scripts/governance-add-erc20.ts:58 · contracts/scripts/read-variable.ts:359 · contracts/scripts/server-add-erc20.ts:56 · +3 more site(s) not listed — the 7 copies are spread across 7 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (9 lines × 2 locations) · ×1
  • Duplicated block (9 lines × 2 locations) contracts/scripts/deploy.ts:26 — contracts/scripts/deploy.ts:26 · contracts/scripts/upgrade-testnet.ts:37 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
R2 · Cyclomatic Complexity · Complex function main (cyclomatic 26, cognitive 26) · ×1
  • Complex function main (cyclomatic 26, cognitive 26) contracts/scripts/deploy.ts:13 — main has cyclomatic complexity 26 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function main (cyclomatic 20, cognitive 29) · ×1
  • Complex function main (cyclomatic 20, cognitive 29) contracts/scripts/upgrade-testnet.ts:13 — main has cyclomatic complexity 20 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function getDefaultProvider (cyclomatic 20, cognitive 26) · ×1
  • Complex function getDefaultProvider (cyclomatic 20, cognitive 26) sdk/zksync.js/src/provider.ts:33 — getDefaultProvider has cyclomatic complexity 20 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function parseName (cyclomatic 15, cognitive 27) · ×1
  • Complex function parseName (cyclomatic 15, cognitive 27) contracts/scripts/read-variable.ts:255 — parseName has cyclomatic complexity 15 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function reason (cyclomatic 14, cognitive 34) · ×1
  • Complex function reason (cyclomatic 14, cognitive 34) contracts/scripts/revert-reason.ts:22 — reason has cyclomatic complexity 14 and cognitive complexity 34; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function processBatchBuilderTransactions (cyclomatic 13, cognitive 11) · ×1
  • Complex function processBatchBuilderTransactions (cyclomatic 13, cognitive 11) sdk/zksync.js/src/wallet.ts:162 — processBatchBuilderTransactions has cyclomatic complexity 13 and cognitive complexity 11; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function depositToSyncFromEthereum (cyclomatic 11, cognitive 23) · ×1
  • Complex function depositToSyncFromEthereum (cyclomatic 11, cognitive 23) sdk/zksync.js/src/abstract-wallet.ts:456 — depositToSyncFromEthereum has cyclomatic complexity 11 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function bitsIntoBytesInBEOrder (cyclomatic 11, cognitive 18) · ×1
  • Complex function bitsIntoBytesInBEOrder (cyclomatic 11, cognitive 18) sdk/zksync.js/src/utils.ts:109 — bitsIntoBytesInBEOrder has cyclomatic complexity 11 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function getPartialOrder (cyclomatic 11, cognitive 10) · ×1
  • Complex function getPartialOrder (cyclomatic 11, cognitive 10) sdk/zksync.js/src/wallet.ts:1164 — getPartialOrder has cyclomatic complexity 11 and cognitive complexity 10; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R3 · Large Files · Large Files · ×1
  • Large Files — 7 file(s) over 400 lines (counted as significant lines — blank lines excluded — over production source only, tests excluded), largest first: sdk/zksync.js/src/wallet.ts (1081), sdk/zksync.js/src/utils.ts (855), sdk/zksync.js/src/abstract-wallet.ts (629), sdk/zksync.js/src/rest-provider.ts (599), sdk/zksync.js/src/types.ts (559), contracts/src.ts/deploy.ts (498) (+1 more).
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 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 'markdownlint-cli' · ×1
  • Unused dependency 'markdownlint-cli' — Declared in the root package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
R8 · Dependency Hygiene · Unused dependency '@typechain/ethers-v5' · ×1
  • Unused dependency '@typechain/ethers-v5' — Declared in contracts/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.
Minor — 47 finding(s)
D30 · Dependency Vulnerabilities · Low CVE · ×15
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D31 · IaC & Container Security · Low IaC · ×6
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D34 · Knowledge Freshness · Most significant orphaned file · ×3
  • Most significant orphaned file core/lib/circuit/src/circuit.rs — 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 — 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 sdk/zksync.js/src/wallet.ts — One of the orphaned files carrying the most lost knowledge — ranked by size weighted by the file's role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites.
D30 · Dependency Vulnerabilities · Low vulnerability · ×2
  • REDACTED
  • REDACTED
M4 · Documentation accuracy · README/code drift · ×2
  • README/code drift — README omits the ZKSync prover binary entirely — reported by the model that read the README against this repository; no term search was run for this one, so nothing here has been checked against the tree. Treat it as a reading to confirm, not as a measured contradiction: verify it against the code before acting on it, and if the footprint it describes does exist, this row is wrong.
  • README/code drift — README omits the JavaScript SDK (zksync.js) and Rust SDK (zksync-rs) — reported by the model that read the README against this repository; no term search was run for this one, so nothing here has been checked against the tree. Treat it as a reading to confirm, not as a measured contradiction: verify it against the code before acting on it, and if the footprint it describes does exist, this row is wrong.
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/crypto/src/merkle_tree/parallel_smt.rs, core/lib/crypto/src/circuit/utils.rs. Pair on, review, or document these before any departure.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 1 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (4 single-owned of 223 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 223 of the 362 production source files in this repository met that bar). They are anonymized user #2 (2 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`.
D26 · Project Cohesion · Split core/lib/storage · ×1
  • Split core/lib/storage — A generic 'storage' catch-all at 12k LoC across 20 namespaces is large and sprawling. Suggested: split into domain-specific storage modules like data_restore, prover, tokens, ethereum
D26 · Project Cohesion · Split core/lib/types · ×1
  • Split core/lib/types — A generic 'types' catch-all at 11k LoC across 9 namespaces is large and sprawling. Suggested: split into domain-specific type modules like tx/primitives/eip712_signature
D28 · Secrets (history) · Rotate the exposed credentials · ×1
  • REDACTED
D34 · Knowledge Freshness · Dormant codebase · ×1
  • Dormant codebase — 122 of 223 significant files have no living knowledge — the codebase as a whole is dormant, not 122 separate risks. Counted over 223 of the 362 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over. Re-engage owners or document before change.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M2 · Architecture documentation · No ADRs · ×1
  • No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
P10 · Library API & versioning · Large public API surface · ×1
  • Large public API surface — 497/576 types (86%) declared in the published library are public. For a library, every public type is a stability contract — keep implementation types off the surface and expose only the intended API.
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 12/15 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `core/lib/eth_signer`, `infrastructure/exit-tool/perform_exodus`, `infrastructure/zk`.
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 an `x.y.z` string or a version-shaped section heading (`## [1.2.0]`, `## V14.x.x`, `## Updates in 8.0.x`), whichever is the larger — so a log sectioned by minor series counts its sections, not its individual patch numbers. Entries recorded somewhere this check does not read — release notes generated at tag time from a generator config it did not recognise, or a log kept outside the repository — are not counted here, and this row is about what is re-findable in the tree rather than about how often you release.
R7 · Dead Code · Unused export 'storedBlockInfoParam' · ×1
  • Unused export 'storedBlockInfoParam' contracts/scripts/utils.ts:33 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'updateToken' · ×1
  • Unused export 'updateToken' infrastructure/zk/src/db/db.ts:62 — Nothing imports this binding — it is safe to review for removal.
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.

Appendix B — Reproduction & audit trail

Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-9a63b7a65e2a413db5917175290c9319/history.json --exit-code 0 --source .75artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-9a63b7a65e2a413db5917175290c9319/tree.json --exit-code 0 --source .10artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/watchdog-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off .38artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** . --skip-db-update186artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .85artifacts/raw/trivy-config.json
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** . --skip-db-update1artifacts/raw/trivy-fs.json

Run 01a0f0f5-61a0-7a0b-bd28-b5e2dda86112 · 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